Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[SMPI] Introduce smpi/trace-call-location cfg-switch
authorChristian Heinrich <franz-christian.heinrich@inria.fr>
Mon, 11 Apr 2016 15:32:09 +0000 (17:32 +0200)
committerChristian Heinrich <franz-christian.heinrich@inria.fr>
Thu, 19 May 2016 14:37:23 +0000 (16:37 +0200)
This switch enables/disables call locations for MPI calls in
traces.

src/instr/instr_paje_header.cpp
src/instr/instr_paje_trace.cpp
src/simgrid/sg_config.cpp

index 90514aa..f135044 100644 (file)
@@ -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");
   }
index 10a9c65..d106f33 100644 (file)
@@ -8,6 +8,7 @@
 #include "xbt/virtu.h" /* sg_cmdline */
 #include <sstream>
 #include <iomanip> /** 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<setState_t>(event);
   stream << " " << static_cast<setState_t>(event->data)->value->id;
 
-  if (true) { // If (sg_config("tracing/caller_location"))
+  if (xbt_cfg_get_boolean("smpi/trace-call-location")) {
     stream << " \"" << static_cast<setState_t>(event->data)->filename
            << "\" " << static_cast<setState_t>(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<pushState_t>(event->data)->filename
            << "\" " << static_cast<pushState_t>(event->data)->linenumber;
   }
index 67da0de..6e478f6 100644 (file)
@@ -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");