From: Christian Heinrich Date: Mon, 11 Apr 2016 15:32:09 +0000 (+0200) Subject: [SMPI] Introduce smpi/trace-call-location cfg-switch X-Git-Tag: v3_14~1202^2~6 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/6890b9250584b746be6cf8c444237c8811e499b0 [SMPI] Introduce smpi/trace-call-location cfg-switch This switch enables/disables call locations for MPI calls in traces. --- diff --git a/src/instr/instr_paje_header.cpp b/src/instr/instr_paje_header.cpp index 90514aa007..f135044bc4 100644 --- a/src/instr/instr_paje_header.cpp +++ b/src/instr/instr_paje_header.cpp @@ -5,6 +5,7 @@ * under the terms of the license (GNU LGPL) which comes with this package. */ #include "src/instr/instr_private.h" +#include "simgrid/sg_config.h" XBT_LOG_NEW_DEFAULT_SUBCATEGORY(instr_paje_header, instr, "Paje tracing event system (header)"); @@ -163,7 +164,7 @@ static void TRACE_header_PajePushState (int basic, int size) fprintf(tracing_file, "%% Container string\n"); fprintf(tracing_file, "%% Value string\n"); if (size) fprintf(tracing_file, "%% Size int\n"); - if (false) { + if (xbt_cfg_get_boolean("smpi/trace-call-location")) { fprintf(tracing_file, "%% Filename string\n"); fprintf(tracing_file, "%% Linenumber int\n"); } diff --git a/src/instr/instr_paje_trace.cpp b/src/instr/instr_paje_trace.cpp index 10a9c65da4..d106f33719 100644 --- a/src/instr/instr_paje_trace.cpp +++ b/src/instr/instr_paje_trace.cpp @@ -8,6 +8,7 @@ #include "xbt/virtu.h" /* sg_cmdline */ #include #include /** std::setprecision **/ +#include "simgrid/sg_config.h" XBT_LOG_NEW_DEFAULT_SUBCATEGORY(instr_paje_trace, instr_trace, "tracing event system"); @@ -223,7 +224,7 @@ void print_pajeSetState(paje_event_t event) { print_default_pajeState_row(event); stream << " " << static_cast(event->data)->value->id; - if (true) { // If (sg_config("tracing/caller_location")) + if (xbt_cfg_get_boolean("smpi/trace-call-location")) { stream << " \"" << static_cast(event->data)->filename << "\" " << static_cast(event->data)->linenumber; } @@ -246,7 +247,7 @@ void print_pajePushState(paje_event_t event) { } } - if (true) { // If (sg_config("tracing/caller_location")) + if (xbt_cfg_get_boolean("smpi/trace-call-location")) { stream << " \"" << static_cast(event->data)->filename << "\" " << static_cast(event->data)->linenumber; } diff --git a/src/simgrid/sg_config.cpp b/src/simgrid/sg_config.cpp index 67da0de999..6e478f6348 100644 --- a/src/simgrid/sg_config.cpp +++ b/src/simgrid/sg_config.cpp @@ -573,6 +573,8 @@ void sg_config_init(int *argc, char **argv) xbt_cfg_register_alias("smpi/async-small-thresh","smpi/async_small_thresh"); xbt_cfg_register_alias("smpi/async-small-thresh","smpi/async_small_thres"); + xbt_cfg_register_boolean("smpi/trace-call-location", "no", NULL, "Should filename and linenumber of MPI calls be traced?"); + xbt_cfg_register_int("smpi/send-is-detached-thresh", 65536, NULL, "Threshold of message size where MPI_Send stops behaving like MPI_Isend and becomes MPI_Ssend"); xbt_cfg_register_alias("smpi/send-is-detached-thresh","smpi/send_is_detached_thresh");