From: Augustin Degomme Date: Thu, 3 Oct 2019 12:57:12 +0000 (+0200) Subject: Have trace-call-location work with filenames and not full paths. X-Git-Tag: v3.24~49 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/c1ce9e4bb468297fd4e37e777a37d4abf1d72ae3 Have trace-call-location work with filenames and not full paths. It's much easier this way to use adjustment files, and name collisions in a given code are not common. If it's still needed, previous behaviour can be restored using "smpi/trace-call-use-absolute-path" option --- diff --git a/src/simgrid/sg_config.cpp b/src/simgrid/sg_config.cpp index 2acb020ae2..e736195faf 100644 --- a/src/simgrid/sg_config.cpp +++ b/src/simgrid/sg_config.cpp @@ -406,7 +406,8 @@ void sg_config_init(int *argc, char **argv) simgrid::config::declare_flag("smpi/trace-call-location", "Should filename and linenumber of MPI calls be traced?", false); - + simgrid::config::declare_flag("smpi/trace-call-use-absolute-path", + "Should filenames for trace-call tracing be absolute or not?", false); simgrid::config::declare_flag( "smpi/send-is-detached-thresh", "Threshold of message size where MPI_Send stops behaving like MPI_Isend and becomes MPI_Ssend", 65536); diff --git a/src/smpi/internals/smpi_bench.cpp b/src/smpi/internals/smpi_bench.cpp index 20e22c73fd..84fbe20aa8 100644 --- a/src/smpi/internals/smpi_bench.cpp +++ b/src/smpi/internals/smpi_bench.cpp @@ -12,6 +12,7 @@ #include "src/internal_config.h" #include "src/mc/mc_replay.hpp" #include "xbt/config.hpp" +#include "xbt/file.hpp" #include "src/smpi/include/smpi_actor.hpp" #include @@ -470,8 +471,11 @@ void smpi_trace_set_call_location(const char* file, const int line) loc->previous_filename = loc->filename; loc->previous_linenumber = loc->linenumber; - loc->filename = file; - loc->linenumber = line; + if(not simgrid::config::get_value("smpi/trace-call-use-absolute-path")) + loc->filename = simgrid::xbt::Path(file).get_base_name(); + else + loc->filename = file; + loc->linenumber = line; } /** Required for Fortran bindings */