From 856abfd0c6dd192c4d9ae7947d69b16097be5dcb Mon Sep 17 00:00:00 2001 From: Christian Heinrich Date: Mon, 9 Feb 2015 14:45:10 +0100 Subject: [PATCH] Prevent warning message 'config elem ... registered twice' Currently, Lua platform files require the MSG module to be initialised. Hence, when SMPI and Lua platform files are used at the same time, MSG and SMPI will be completely initialised, resulting in multiple calls to TRACE_global_init which sets up the config params. This commit simply adds a flag to that function so that the config elems are registered only once. --- src/instr/instr_config.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/instr/instr_config.c b/src/instr/instr_config.c index 395a9151d8..2c0ff84194 100644 --- a/src/instr/instr_config.c +++ b/src/instr/instr_config.c @@ -360,6 +360,10 @@ char *TRACE_get_viva_cat_conf (void) void TRACE_global_init(int *argc, char **argv) { + static int is_initialised = 0; + if (is_initialised) return; + + is_initialised = 1; /* name of the tracefile */ xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_FILENAME, "Trace file created by the instrumented SimGrid.", @@ -484,7 +488,7 @@ void TRACE_global_init(int *argc, char **argv) /* format -- Switch the ouput format of Tracing */ xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_FORMAT, - "(smpi only for now) Switch the ouput format of Tracing", + "(smpi only for now) Switch the output format of Tracing", xbt_cfgelm_string, 1, 1, NULL, NULL); xbt_cfg_setdefault_string(_sg_cfg_set, OPT_TRACING_FORMAT, "Paje"); -- 2.20.1