|
YAC 3.20.0
Yet Another Coupler
|
#include <stdlib.h>#include <stdio.h>#include <errno.h>#include <limits.h>#include <string.h>#include "utils_core.h"#include "yac_mpi_internal.h"
Go to the source code of this file.
Functions | |
| char const * | yac_name_type_pair_get_name (struct yac_name_type_pair const *pairs, size_t count, int type) |
| int | yac_name_type_pair_get_type (struct yac_name_type_pair const *pairs, size_t count, char const *name) |
| char * | yac_string_dup (char const *string) |
| DEF_NAME_TYPE_PAIRS (bool_table, DEF_NAME_TYPE_PAIR(false, 0), DEF_NAME_TYPE_PAIR(true, 1), DEF_NAME_TYPE_PAIR(FALSE, 0), DEF_NAME_TYPE_PAIR(TRUE, 1), DEF_NAME_TYPE_PAIR(no, 0), DEF_NAME_TYPE_PAIR(yes, 1), DEF_NAME_TYPE_PAIR(NO, 0), DEF_NAME_TYPE_PAIR(YES, 1), DEF_NAME_TYPE_PAIR(off, 0), DEF_NAME_TYPE_PAIR(on, 1), DEF_NAME_TYPE_PAIR(OFF, 0), DEF_NAME_TYPE_PAIR(ON, 1), DEF_NAME_TYPE_PAIR(0, 0), DEF_NAME_TYPE_PAIR(1, 1)) | |
| int | yac_getenv_int (const char *name, int default_value, int threshold, MPI_Comm comm) |
| char * | yac_getenv_str (const char *name, const char *default_value, MPI_Comm comm) |
| DEF_NAME_TYPE_PAIRS | ( | bool_table | , |
| DEF_NAME_TYPE_PAIR(false, 0) | , | ||
| DEF_NAME_TYPE_PAIR(true, 1) | , | ||
| DEF_NAME_TYPE_PAIR(FALSE, 0) | , | ||
| DEF_NAME_TYPE_PAIR(TRUE, 1) | , | ||
| DEF_NAME_TYPE_PAIR(no, 0) | , | ||
| DEF_NAME_TYPE_PAIR(yes, 1) | , | ||
| DEF_NAME_TYPE_PAIR(NO, 0) | , | ||
| DEF_NAME_TYPE_PAIR(YES, 1) | , | ||
| DEF_NAME_TYPE_PAIR(off, 0) | , | ||
| DEF_NAME_TYPE_PAIR(on, 1) | , | ||
| DEF_NAME_TYPE_PAIR(OFF, 0) | , | ||
| DEF_NAME_TYPE_PAIR(ON, 1) | , | ||
| DEF_NAME_TYPE_PAIR(0, 0) | , | ||
| DEF_NAME_TYPE_PAIR(1, 1) | ) |
| int yac_getenv_int | ( | const char * | name, |
| int | default_value, | ||
| int | threshold, | ||
| MPI_Comm | comm ) |
Get the value of an environment variable as an integer. If the environment variable is not set, or if its value is below the provided threshold, the provided default value will be returned. The environment variable is only queried on rank 0 of the provided communicator, and the result is broadcast to all ranks.
| [in] | name | Name of the environment variable |
| [in] | default_value | Default value to return if the environment variable is not set or below threshold |
| [in] | threshold | Minimum accepted value for the environment variable |
| [in] | comm | Communicator used for rank-0 evaluation and broadcasting |
Definition at line 89 of file utils_core.c.

| char * yac_getenv_str | ( | const char * | name, |
| const char * | default_value, | ||
| MPI_Comm | comm ) |
Get the value of an environment variable as a string. If the environment variable is not set or is an empty string, the provided default value will be returned. The environment variable is only queried on rank 0 of the provided communicator, and the result is broadcast to all ranks.
| [in] | name | Name of the environment variable |
| [in] | default_value | Default value to return if the environment variable is not set or empty (may be NULL) |
| [in] | comm | Communicator used for rank-0 evaluation and broadcasting |
Definition at line 125 of file utils_core.c.

| char * yac_string_dup | ( | char const * | string | ) |
duplicate a string by allocating new memory and copying the content of the original string into it. If a NULL value is provided, NULL will be returned.
| [in] | string | string to duplicate |
Definition at line 33 of file utils_core.c.
