Newer
Older
#ifndef CONFIGURATION_H
#define CONFIGURATION_H
#include <stdio.h>
enum verbosity_level_enum
{
OFF = 0,
INFO = 1,
DEBUG = 2,
TRACE = 3
};
enum transmission_mode_enum
{
SPARSE_COLLECTIVE = 0,
POINT_TO_POINT = 1,
PERSISTENT_REQUEST = 2
};
enum communication_computation_mode_enum
{
NO_OVERLAP = 0,
OVERLAP = 4
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
};
#define FILE_BASENAME_SZ 1024
#define FILE_EXT ".wi"
#define FILE_EXT_LEN (sizeof(FILE_EXT)-1)
#define FILE_NAME_SZ (FILE_BASENAME_SZ + FILE_EXT_LEN)
typedef struct
{
int verbosity_level;
int transmission_mode;
int communication_computation_mode;
int nprocs[2];
int n_iterations;
long n_generations_per_iteration;
char file_basename[FILE_BASENAME_SZ];
} conf_t;
// Meta-information for MPI-Datatype creation (see mpitypes.c)
#define CONF_T_N_INT_MEMBERS 6
#define CONF_T_FIRST_INT_MEMBER verbosity_level
#define CONF_T_N_LONG_MEMBERS 2
#define CONF_T_FIRST_LONG_MEMBER n_generations_per_iteration
#define CONF_T_N_CHAR_MEMBERS FILE_BASENAME_SZ
#define CONF_T_FIRST_CHAR_MEMBER file_basename[0]
void conf_init_default(conf_t *c);
void conf_init_from_args(conf_t *c, int argc, char* argv[]);
void conf_print(const conf_t *c, FILE *file);
int info_enabled(const conf_t *c);
int warn_enabled(const conf_t *c);
int debug_enabled(const conf_t *c);
int trace_enabled(const conf_t *c);
#endif