Multi-ApplicationOnlineProfiling  2.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
MALP_Config.h File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
Include dependency graph for MALP_Config.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  TA_Conf_entry
 Define a configuration entry structure, which contain a descritpion buffer, the entry type and variables and buffers for all possible type of an entry value. More...
 

Macros

#define TA_Conf_dispatch()
 Start broadcasting for the analyzer. More...
 

Enumerations

enum  TA_Conf_key_t {
  TA_CONF_GLOBAL_HEADER, TA_CONF_THREAD_PER_TASK, TA_CONF_VERBOSITY_HEADER, TA_CONF_DISPLAY_BANNER,
  TA_CONF_DISPLAY_BB_LOAD, TA_CONF_VERBOSE_OUTPUT, TA_CONF_INSTRUMENT_HEADER, TA_CONF_INSTRUMENT_MPI,
  TA_CONF_INSTRUMENT_POSIX, TA_CONF_INSTRUMENT_MPI_OTF, TA_CONF_INSTRUMENT_POSIX_OTF, TA_CONF_INSTRUMENT_POSIX_PROFILE,
  TA_CONF_INSTRUMENT_POSIX_PROFILE_DUMP, TA_CONF_SAMPLE_ANALYSIS_HEADER, TA_CONF_SAMPLE_ANALYSIS_ENABLED, TA_CONF_OTF2_ANALYSIS_HEADER,
  TA_CONF_OTF2_ANALYSIS_ENABLED, TA_CONF_OTF2_TRACE_PATH, TA_CONF_OTF2_TRACE_NAME, TA_CONF_KEY_COUNT
}
 Enumeration of the configuration parameter keys for MALP. More...
 
enum  TA_Conf_type {
  TA_CONF_NONE, TA_CONF_INT, TA_CONF_BOOL, TA_CONF_DOUBLE,
  TA_CONF_STRING
}
 Possible types for the Analyzer configuration parameter values. More...
 

Functions

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. More...
 
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. More...
 
int TA_Conf_update (char *key_name, char *val)
 Update the value for a configuration option with control of the value name. More...
 
void TA_Conf_init_default ()
 Initialisation of the Trace_Collector with default options. More...
 
void TA_Conf_init_from_env ()
 Initialisation of config from environment. More...
 
void TA_Conf_dump (char *dest)
 Save the Analyzer_ configuration in the destination file in argument. More...
 
void TA_Conf_load (char *source)
 Load and use a file to set the Analyzer configuration. More...
 
static int TA_Conf_get_key_int (TA_Conf_key_t key)
 Get a configuration parameter value of type int. More...
 
static int TA_Conf_get_key_bool (TA_Conf_key_t key)
 Get a configuration parameter value of type bool. More...
 
static double TA_Conf_get_key_double (TA_Conf_key_t key)
 Get a configuration parameter value of type double. More...
 
static char * TA_Conf_get_key_string (TA_Conf_key_t key)
 Get a configuration parameter value of type string. More...
 

Variables

static const char *const TA_Conf_key_lablel [TA_CONF_KEY_COUNT]
 
struct TA_Conf_entry TA_Conf_entries [TA_CONF_KEY_COUNT]
 

Macro Definition Documentation

void TA_Conf_dispatch ( )
Value:
do{int ___ret = PMPI_Bcast( (char*)TA_Conf_entries,\
sizeof(struct TA_Conf_entry) * TA_CONF_KEY_COUNT,\
MPI_CHAR, 0, VMPI_Get_partition_comm());\
if( ___ret != MPI_SUCCESS ) {\
printf("Failled to dispatch configuration \n");\
abort();\
}}while(0)
static MPI_Comm VMPI_Get_partition_comm()
Returns current partition's communicator.
Definition: VMPI.h:175
struct TA_Conf_entry TA_Conf_entries[TA_CONF_KEY_COUNT]
Definition: MALP_Config.c:25
Define a configuration entry structure, which contain a descritpion buffer, the entry type and variab...
Definition: MALP_Config.h:123

Start broadcasting for the analyzer.

Start the exchange between the communication channel (MPI_COMM_WORLD) and the analyzer list of parameters ( TA_Conf_entries - list of TA_Conf_entry ).

Definition at line 297 of file MALP_Config.h.

Enumeration Type Documentation

Enumeration of the configuration parameter keys for MALP.

Enumerator
TA_CONF_GLOBAL_HEADER 
TA_CONF_THREAD_PER_TASK 
TA_CONF_VERBOSITY_HEADER 
TA_CONF_DISPLAY_BANNER 
TA_CONF_DISPLAY_BB_LOAD 
TA_CONF_VERBOSE_OUTPUT 
TA_CONF_INSTRUMENT_HEADER 
TA_CONF_INSTRUMENT_MPI 
TA_CONF_INSTRUMENT_POSIX 
TA_CONF_INSTRUMENT_MPI_OTF 
TA_CONF_INSTRUMENT_POSIX_OTF 
TA_CONF_INSTRUMENT_POSIX_PROFILE 
TA_CONF_INSTRUMENT_POSIX_PROFILE_DUMP 
TA_CONF_SAMPLE_ANALYSIS_HEADER 
TA_CONF_SAMPLE_ANALYSIS_ENABLED 
TA_CONF_OTF2_ANALYSIS_HEADER 
TA_CONF_OTF2_ANALYSIS_ENABLED 
TA_CONF_OTF2_TRACE_PATH 
TA_CONF_OTF2_TRACE_NAME 
TA_CONF_KEY_COUNT 

Definition at line 32 of file MALP_Config.h.

Possible types for the Analyzer configuration parameter values.

Enumerator
TA_CONF_NONE 

No defined type.

TA_CONF_INT 

Integer.

TA_CONF_BOOL 

Boolean.

TA_CONF_DOUBLE 

Double.

TA_CONF_STRING 

String.

Definition at line 110 of file MALP_Config.h.

Function Documentation

void TA_Conf_dump ( char *  dest)

Save the Analyzer_ configuration in the destination file in argument.

Parameters
destConfiguration file destination

Definition at line 262 of file MALP_Config.c.

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.

Parameters
keyConfiguration parameter key
descConfiguration parameter description.
typeConfiguration parameter value's type
valuenew value for the configuration parameter
Returns
the modification status (0: key not found or update failure, 1: success )

Definition at line 30 of file MALP_Config.c.

Here is the call graph for this function:

Here is the caller graph for this function:

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.

(see TA_Conf_update for control on the key name)

Parameters
entryKey of the configuration parameter to modify
valuenew value for the configuration parameter (should be a numerical value)
Returns
the modification status (0: value of wrong type, 1: success )

Definition at line 56 of file MALP_Config.c.

Here is the call graph for this function:

Here is the caller graph for this function:

static int TA_Conf_get_key_bool ( TA_Conf_key_t  key)
inlinestatic

Get a configuration parameter value of type bool.

Get a configuration parameter value of type bool corresponding to a parameter key, nothing otherwise

Parameters
key
Returns
the value of the parameter if it's a boolean value

Definition at line 233 of file MALP_Config.h.

static double TA_Conf_get_key_double ( TA_Conf_key_t  key)
inlinestatic

Get a configuration parameter value of type double.

Get a configuration parameter value of type double corresponding to a parameter key, nothing otherwise

Parameters
key
Returns
the value of the parameter if it's a double

Definition at line 258 of file MALP_Config.h.

static int TA_Conf_get_key_int ( TA_Conf_key_t  key)
inlinestatic

Get a configuration parameter value of type int.

Get a configuration parameter value of type int if there's one corresponding to a parameter key, nothing otherwise

Parameters
key
Returns
the value of the parameter if it's an integer

Definition at line 210 of file MALP_Config.h.

static char* TA_Conf_get_key_string ( TA_Conf_key_t  key)
inlinestatic

Get a configuration parameter value of type string.

Get a configuration parameter value of type string corresponding to a parameter key, nothing otherwise

Parameters
key
Returns
the value of the parameter if it's a string

Definition at line 281 of file MALP_Config.h.

void TA_Conf_init_default ( )

Initialisation of the Trace_Collector with default options.

Definition at line 152 of file MALP_Config.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void TA_Conf_init_from_env ( )

Initialisation of config from environment.

Definition at line 131 of file MALP_Config.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void TA_Conf_load ( char *  source)

Load and use a file to set the Analyzer configuration.

Parameters
sourceConfiguration file source

Definition at line 285 of file MALP_Config.c.

Here is the call graph for this function:

Here is the caller graph for this function:

int TA_Conf_update ( char *  key_name,
char *  val 
)

Update the value for a configuration option with control of the value name.

Parameters
key_nameKey of the Analyzer configuration parameter to modify
valnew value for the corresponding configuration parameter (should be a numerical value)
Returns
modification status (0: key not found or update failure, 1: success )

Definition at line 116 of file MALP_Config.c.

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

struct TA_Conf_entry TA_Conf_entries[TA_CONF_KEY_COUNT]

Definition at line 25 of file MALP_Config.c.

const char* const TA_Conf_key_lablel[TA_CONF_KEY_COUNT]
static

Definition at line 71 of file MALP_Config.h.