X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/4ff3a4cf6e03165421f65616a22be86b8f528e21..d7acbd4087c3b0a61d6e7e44b0a4db5b40772a71:/src/smpi/internals/smpi_replay.cpp diff --git a/src/smpi/internals/smpi_replay.cpp b/src/smpi/internals/smpi_replay.cpp index 40f5cdbd15..2d03b91272 100644 --- a/src/smpi/internals/smpi_replay.cpp +++ b/src/smpi/internals/smpi_replay.cpp @@ -16,25 +16,31 @@ #include #include #include +#include #include using simgrid::s4u::Actor; XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_replay,smpi,"Trace Replay with SMPI"); -static int active_processes = 0; static std::unordered_map*> reqq; static MPI_Datatype MPI_DEFAULT_TYPE; #define CHECK_ACTION_PARAMS(action, mandatory, optional) \ { \ - if (action.size() < static_cast(mandatory + 2)) \ + if (action.size() < static_cast(mandatory + 2)) { \ + std::stringstream ss; \ + for (const auto& elem : action) { \ + ss << elem << " "; \ + } \ THROWF(arg_error, 0, "%s replay failed.\n" \ "%zu items were given on the line. First two should be process_id and action. " \ "This action needs after them %lu mandatory arguments, and accepts %lu optional ones. \n" \ + "The full line that was given is:\n %s\n" \ "Please contact the Simgrid team if support is needed", \ - __func__, action.size(), static_cast(mandatory), static_cast(optional)); \ + __func__, action.size(), static_cast(mandatory), static_cast(optional), ss.str().c_str()); \ + }\ } static void log_timed_action(simgrid::xbt::ReplayAction& action, double clock) @@ -566,9 +572,6 @@ public: /* start a simulated timer */ smpi_process()->simulated_start(); - /*initialize the number of active processes */ - active_processes = smpi_process_count(); - set_reqq_self(new std::vector); } }; @@ -860,6 +863,8 @@ void smpi_replay_init(int* argc, char*** argv) /** @brief actually run the replay after initialization */ void smpi_replay_main(int* argc, char*** argv) { + static int active_processes = 0; + active_processes++; simgrid::xbt::replay_runner(*argc, *argv); /* and now, finalize everything */