X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/ee0065a64fccf2b975b69537eed87ea499c72dfb..b8df87e176f27b25534f27d7e240defa32ca35bc:/include/simgrid/smpi/replay.hpp diff --git a/include/simgrid/smpi/replay.hpp b/include/simgrid/smpi/replay.hpp index 1b3152a7a6..46f5d86fb2 100644 --- a/include/simgrid/smpi/replay.hpp +++ b/include/simgrid/smpi/replay.hpp @@ -1,34 +1,35 @@ -/* Copyright (c) 2009-2018. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2009-2019. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ #ifndef SMPI_REPLAY_HPP_ #define SMPI_REPLAY_HPP_ +#include "src/smpi/include/smpi_actor.hpp" + #include -#include #include #include #include #include -#define CHECK_ACTION_PARAMS(action, mandatory, optional) \ -{ \ - 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), \ - ss.str().c_str()); \ - } \ -} +#define CHECK_ACTION_PARAMS(action, mandatory, optional) \ + { \ + if (action.size() < static_cast(mandatory + 2)) { \ + std::stringstream ss; \ + ss << __func__ << " replay failed.\n" \ + << action.size() << " items were given on the line. First two should be process_id and action. " \ + << "This action needs after them " << mandatory << " mandatory arguments, and accepts " << optional \ + << " optional ones. \n" \ + << "The full line that was given is:\n "; \ + for (const auto& elem : action) { \ + ss << elem << " "; \ + } \ + ss << "\nPlease contact the Simgrid team if support is needed"; \ + throw std::invalid_argument(ss.str()); \ + } \ + } XBT_PRIVATE void* smpi_get_tmp_sendbuffer(int size); XBT_PRIVATE void* smpi_get_tmp_recvbuffer(int size); @@ -91,8 +92,6 @@ public: int root = 0; MPI_Datatype datatype1 = MPI_DEFAULT_TYPE; MPI_Datatype datatype2 = MPI_DEFAULT_TYPE; - - virtual void parse(simgrid::xbt::ReplayAction& action, std::string name) = 0; }; class BcastArgParser : public CollCommParser { @@ -166,13 +165,13 @@ public: /** * Base class for all ReplayActions. * Note that this class actually implements the behavior of each action - * while the parsing of the replay arguments is done in the @ActionArgParser class. + * while the parsing of the replay arguments is done in the @ref ActionArgParser class. * In other words: The logic goes here, the setup is done by the ActionArgParser. */ template class ReplayAction { protected: const std::string name; - const int my_proc_id; + const aid_t my_proc_id; T args; public: @@ -283,7 +282,7 @@ public: class AllToAllAction : public ReplayAction { public: - explicit AllToAllAction() : ReplayAction("allToAll") {} + explicit AllToAllAction() : ReplayAction("alltoall") {} void kernel(simgrid::xbt::ReplayAction& action) override; }; @@ -313,13 +312,13 @@ public: class ReduceScatterAction : public ReplayAction { public: - explicit ReduceScatterAction() : ReplayAction("reduceScatter") {} + explicit ReduceScatterAction() : ReplayAction("reducescatter") {} void kernel(simgrid::xbt::ReplayAction& action) override; }; class AllToAllVAction : public ReplayAction { public: - explicit AllToAllVAction() : ReplayAction("allToAllV") {} + explicit AllToAllVAction() : ReplayAction("alltoallv") {} void kernel(simgrid::xbt::ReplayAction& action) override; }; }