Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[SMPI] (SECOND PATCH) Fix destinations/origins for tracing *TIData objects
[simgrid.git] / src / smpi / internals / smpi_replay.cpp
index 8e02386..421cc29 100644 (file)
@@ -87,6 +87,8 @@ static double parse_double(const char *string)
   return value;
 }
 
+
+//TODO: this logic should be moved inside the datatype class, to support all predefined types and get rid of is_replayable.
 static MPI_Datatype decode_datatype(const char *const action)
 {
   switch(atoi(action)) {
@@ -221,7 +223,7 @@ static void action_send(const char *const *action)
   int dst_traced = MPI_COMM_WORLD->group()->rank(to);
 
   TRACE_smpi_comm_in(rank, __FUNCTION__,
-                     new simgrid::instr::Pt2PtTIData("send", dst_traced, size, encode_datatype(MPI_CURRENT_TYPE)));
+                     new simgrid::instr::Pt2PtTIData("send", to, size, encode_datatype(MPI_CURRENT_TYPE)));
   if (not TRACE_smpi_view_internals())
     TRACE_smpi_send(rank, rank, dst_traced, 0, size*MPI_CURRENT_TYPE->size());
 
@@ -247,7 +249,7 @@ static void action_Isend(const char *const *action)
   int rank = smpi_process()->index();
   int dst_traced = MPI_COMM_WORLD->group()->rank(to);
   TRACE_smpi_comm_in(rank, __FUNCTION__,
-                     new simgrid::instr::Pt2PtTIData("Isend", dst_traced, size, encode_datatype(MPI_CURRENT_TYPE)));
+                     new simgrid::instr::Pt2PtTIData("Isend", to, size, encode_datatype(MPI_CURRENT_TYPE)));
   if (not TRACE_smpi_view_internals())
     TRACE_smpi_send(rank, rank, dst_traced, 0, size*MPI_CURRENT_TYPE->size());
 
@@ -276,7 +278,7 @@ static void action_recv(const char *const *action) {
   int src_traced = MPI_COMM_WORLD->group()->rank(from);
 
   TRACE_smpi_comm_in(rank, __FUNCTION__,
-                     new simgrid::instr::Pt2PtTIData("recv", src_traced, size, encode_datatype(MPI_CURRENT_TYPE)));
+                     new simgrid::instr::Pt2PtTIData("recv", from, size, encode_datatype(MPI_CURRENT_TYPE)));
 
   //unknown size from the receiver point of view
   if (size <= 0.0) {
@@ -309,7 +311,7 @@ static void action_Irecv(const char *const *action)
   int rank = smpi_process()->index();
   int src_traced = MPI_COMM_WORLD->group()->rank(from);
   TRACE_smpi_comm_in(rank, __FUNCTION__,
-                     new simgrid::instr::Pt2PtTIData("Irecv", src_traced, size, encode_datatype(MPI_CURRENT_TYPE)));
+                     new simgrid::instr::Pt2PtTIData("Irecv", from, size, encode_datatype(MPI_CURRENT_TYPE)));
   MPI_Status status;
   //unknow size from the receiver pov
   if (size <= 0.0) {
@@ -441,7 +443,7 @@ static void action_bcast(const char *const *action)
 
   int rank = smpi_process()->index();
   TRACE_smpi_comm_in(rank, __FUNCTION__,
-                     new simgrid::instr::CollTIData("bcast", MPI_COMM_WORLD->group()->index(root), -1.0, size, -1,
+                     new simgrid::instr::CollTIData("bcast", MPI_COMM_WORLD->group()->actor(root)->getPid(), -1.0, size, -1,
                                                     encode_datatype(MPI_CURRENT_TYPE), ""));
 
   void *sendbuf = smpi_get_tmp_sendbuffer(size* MPI_CURRENT_TYPE->size());
@@ -469,7 +471,7 @@ static void action_reduce(const char *const *action)
 
   int rank = smpi_process()->index();
   TRACE_smpi_comm_in(rank, __FUNCTION__,
-                     new simgrid::instr::CollTIData("reduce", MPI_COMM_WORLD->group()->index(root), comp_size,
+                     new simgrid::instr::CollTIData("reduce", MPI_COMM_WORLD->group()->actor(root)->getPid(), comp_size,
                                                     comm_size, -1, encode_datatype(MPI_CURRENT_TYPE), ""));
 
   void *recvbuf = smpi_get_tmp_sendbuffer(comm_size* MPI_CURRENT_TYPE->size());