From d7acbd4087c3b0a61d6e7e44b0a4db5b40772a71 Mon Sep 17 00:00:00 2001 From: Christian Heinrich Date: Fri, 30 Mar 2018 11:15:29 +0200 Subject: [PATCH] [SMPI] Replay: Make error message more verbose --- src/smpi/internals/smpi_replay.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/smpi/internals/smpi_replay.cpp b/src/smpi/internals/smpi_replay.cpp index 1aca704338..2d03b91272 100644 --- a/src/smpi/internals/smpi_replay.cpp +++ b/src/smpi/internals/smpi_replay.cpp @@ -16,6 +16,7 @@ #include #include #include +#include #include using simgrid::s4u::Actor; @@ -28,12 +29,18 @@ 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) -- 2.20.1