34 printf(
"Bad entry key \n");
40 strncpy( entry->
desc, desc, 499);
49 printf(
"Wrong default config given \n");
59 printf(
"this options awaits a value\n");
63 snprintf(entry->
c_value, 200,
"%s", value);
67 printf(
"Given entry ( %s ) is not numeric\n", value );
71 switch ( entry->
type ) {
82 printf(
"Unknown type \n");
143 printf(
"Warning env option for %s (%s) misformated \n", (
char *)
TA_Conf_key_lablel[i], key);
156 "#############################################\n"
158 "# GLOBAL CONFIGURATION #\n"
160 "##############################################\n",
164 "Number of concurent worker threads per task (0 for core count)",
169 "##############################################\n"
171 "# ANALYZER VERBOSITY #\n"
173 "##############################################\n",
177 "Display MALP banner at program startup",
181 "Display blackboard's load to diagnose heavy load (useful for C++)",
185 "Activates debug messages during report generation",
191 "##############################################\n"
193 "# INSTRUMENTATION #\n"
195 "##############################################\n",
199 "Enable MPI calls instrumentation",
203 "Enable POSIX calls instrumentation",
207 "Activate to send MPI calls to the OTF trace",
211 "Activate to send POSIX calls to the OTF trace",
215 "Generate a complete posix profile (including untracked streams)",
219 "Dump a posix profile at program termination (Works for non MPI programs)",
224 "#############################################\n"
226 "# SAMPLE ANALYSIS #\n"
228 "##############################################\n",
232 "Enable Sample Analysis (TEST MODULE ONLY)",
237 "#############################################\n"
239 "# OTF2 ANALYSIS #\n"
241 "##############################################\n",
245 "Enable OTF2 Analysis",
249 "Path to otf2 trace",
253 "Name of otf2 trace file",
264 FILE *conf = fopen( dest,
"w" );
267 printf(
"Failed to open config file for write (%s)\n", dest);
287 FILE *file = fopen( source ,
"r" );
302 while ( fgets( linebuff, 500, file) ) {
304 linebuff[strlen(linebuff) - 1] =
'\0';
307 if ( (ret =sscanf( linebuff,
"%s %1000[^\n]s", name_buff, val_buff)) == 2 ) {
309 printf(
"Warning @ line %d : %s \n", line_count, linebuff);
315 if ( (sscanf( linebuff,
"%s", name_buff) == 1 ) ) {
317 printf(
"Warning @ line %d : %s \n", line_count, linebuff);
325 perror(
"Error parsing line");
static const char *const TA_Conf_key_lablel[TA_CONF_KEY_COUNT]
TA_Conf_type
Possible types for the Analyzer configuration parameter values.
void TA_Conf_load(char *source)
Load and use a file to set the Analyzer configuration.
void TA_Conf_dump(char *dest)
Save the Analyzer_ configuration in the destination file in argument.
TA_Conf_type type
Type of a configuration parameter value.
int TA_Conf_entry_update(struct TA_Conf_entry *entry, char *value)
Update the value for a configuration parameter after control of the value's content and type...
void TA_Conf_init_default()
Initialisation of the Trace_Collector with default options.
void TA_Conf_entry_init(TA_Conf_key_t key, char *desc, TA_Conf_type type, char *value)
Initialisation of the Analyzer configuration parameter's type, description and value.
struct TA_Conf_entry TA_Conf_entries[TA_CONF_KEY_COUNT]
char desc[500]
Descriptor of a configuration parameter.
void TA_Conf_init_from_env()
Initialisation of config from environment.
static int MALP_Trace_line_begins_with_sharp(char *line)
Checks if the first not space char of a string is a #.
Define a configuration entry structure, which contain a descritpion buffer, the entry type and variab...
static int TA_Conf_get_key_index(char *key_name)
Return the index of a key name in list of Analyser configuration keys ( TA_Conf_key_t ) ...
static int MALP_Trace_is_numeric(char *number)
Checks if a string contains a numerical element.
int i_value
integer variable for the configuration parameter value
char c_value[1000]
char* buffer for the configuration parameter value
static int MALP_Trace_fast_strcmp(char *haystack, char *needle)
Fast string comparison.
TA_Conf_key_t
Enumeration of the configuration parameter keys for MALP.
int TA_Conf_update(char *key_name, char *val)
Update the value for a configuration option with control of the value name.
float d_value
float variable for the configuration parameter value