Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Unused.
[simgrid.git] / src / smpi / internals / smpi_replay.cpp
index 33c954c..9c44cde 100644 (file)
@@ -19,8 +19,6 @@
 #include <sstream>
 #include <vector>
 
-using simgrid::s4u::Actor;
-
 #include <tuple>
 // From https://stackoverflow.com/questions/7110301/generic-hash-for-tuples-in-unordered-map-unordered-set
 // This is all just to make std::unordered_map work with std::tuple. If we need this in other places,
@@ -77,7 +75,6 @@ namespace hash_tuple{
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_replay,smpi,"Trace Replay with SMPI");
 
-static std::unordered_map<int, std::vector<MPI_Request>*> reqq;
 typedef std::tuple</*sender*/ int, /* reciever */ int, /* tag */int> req_key_t;
 typedef std::unordered_map<req_key_t, MPI_Request, hash_tuple::hash<std::tuple<int,int,int>>> req_storage_t;
 
@@ -108,16 +105,6 @@ static void log_timed_action(simgrid::xbt::ReplayAction& action, double clock)
   }
 }
 
-static std::vector<MPI_Request>* get_reqq_self()
-{
-  return reqq.at(simgrid::s4u::this_actor::get_pid());
-}
-
-static void set_reqq_self(std::vector<MPI_Request> *mpi_request)
-{
-  reqq.insert({simgrid::s4u::this_actor::get_pid(), mpi_request});
-}
-
 /* Helper function */
 static double parse_double(std::string string)
 {
@@ -563,7 +550,7 @@ public:
 
 class WaitAction : public ReplayAction<WaitTestParser> {
 public:
-  WaitAction(RequestStorage& storage) : ReplayAction("Wait", storage) {}
+  explicit WaitAction(RequestStorage& storage) : ReplayAction("Wait", storage) {}
   void kernel(simgrid::xbt::ReplayAction& action) override
   {
     std::string s = boost::algorithm::join(action, " ");
@@ -666,7 +653,7 @@ public:
 
 class TestAction : public ReplayAction<WaitTestParser> {
 public:
-  TestAction(RequestStorage& storage) : ReplayAction("Test", storage) {}
+  explicit TestAction(RequestStorage& storage) : ReplayAction("Test", storage) {}
   void kernel(simgrid::xbt::ReplayAction& action) override
   {
     MPI_Request request = req_storage->find(args.src, args.dst, args.tag);
@@ -715,7 +702,7 @@ public:
 
 class WaitAllAction : public ReplayAction<ActionArgParser> {
 public:
-  WaitAllAction(RequestStorage& storage) : ReplayAction("waitAll", storage) {}
+  explicit WaitAllAction(RequestStorage& storage) : ReplayAction("waitAll", storage) {}
   void kernel(simgrid::xbt::ReplayAction& action) override
   {
     const unsigned int count_requests = req_storage->size();
@@ -732,6 +719,7 @@ public:
       }
       MPI_Status status[count_requests];
       Request::waitall(count_requests, &(reqs.data())[0], status);
+      req_storage->get_store().clear();
 
       for (auto& pair : sender_receiver) {
         TRACE_smpi_recv(pair.first, pair.second, 0);