Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[SMPI/INSTR] Trace MPI_Wait() calls correctly
authorChristian Heinrich <franz-christian.heinrich@inria.fr>
Thu, 14 Jun 2018 15:22:10 +0000 (17:22 +0200)
committerChristian Heinrich <franz-christian.heinrich@inria.fr>
Thu, 21 Jun 2018 09:55:40 +0000 (11:55 +0200)
We need to identify the request we want to wait for when
replaying with TI-traces; so we need to trace additional information
that we use for exactly that.

src/instr/instr_private.hpp
src/smpi/bindings/smpi_pmpi_request.cpp
src/smpi/internals/smpi_replay.cpp

index be709da..46ac112 100644 (file)
@@ -196,6 +196,29 @@ public:
   }
   std::string display_size() override { return std::to_string(send_size > 0 ? send_size : recv_size); }
 };
+
+/**
+ * If we want to wait for a request of asynchronous communication, we need to be able
+ * to identify this request. We do this by searching for a request identified by (src, dest, tag).
+ */
+class WaitTIData : public TIData {
+  int src;
+  int dest;
+  int tag;
+
+public:
+  explicit WaitTIData(int src, int dest, int tag) : TIData("wait"), src(src), dest(dest), tag(tag){};
+
+  std::string print() override
+  {
+    std::stringstream stream;
+    stream << getName() << " " << src << " " << dest << " " << tag;
+
+    return stream.str();
+  }
+
+  std::string display_size() override { return ""; }
+};
 }
 }
 
index e1a2e34..f8e4612 100644 (file)
@@ -670,7 +670,8 @@ int PMPI_Wait(MPI_Request * request, MPI_Status * status)
     int my_proc_id = (*request)->comm() != MPI_COMM_NULL
                          ? simgrid::s4u::this_actor::get_pid()
                          : -1; // TODO: cheinrich: Check if this correct or if it should be MPI_UNDEFINED
-    TRACE_smpi_comm_in(my_proc_id, __func__, new simgrid::instr::NoOpTIData("wait"));
+    TRACE_smpi_comm_in(my_proc_id, __func__,
+                       new simgrid::instr::WaitTIData((*request)->src(), (*request)->dst(), (*request)->tag()));
 
     simgrid::smpi::Request::wait(request, status);
     retval = MPI_SUCCESS;
index 671ed7c..2c5c920 100644 (file)
@@ -424,7 +424,7 @@ void WaitAction::kernel(simgrid::xbt::ReplayAction& action)
   // MPI_REQUEST_NULL by Request::wait!
   bool is_wait_for_receive = (request->flags() & MPI_REQ_RECV);
   // TODO: Here we take the rank while we normally take the process id (look for my_proc_id)
-  TRACE_smpi_comm_in(rank, __func__, new simgrid::instr::NoOpTIData("wait"));
+  TRACE_smpi_comm_in(rank, __func__, new simgrid::instr::WaitTIData(args.src, args.dst, args.tag));
 
   MPI_Status status;
   Request::wait(&request, &status);