From 438c80685105522e7ff4eb0820566520778b5386 Mon Sep 17 00:00:00 2001 From: Christian Heinrich Date: Wed, 17 Jan 2018 19:11:43 +0100 Subject: [PATCH] [SMPI] (LAST PATCH) Fix SMPI replay & smpi-replay tesh This patch is the last and SMPI should build and run correctly. --- examples/smpi/replay/replay.tesh | 6 +++--- src/instr/instr_paje_events.cpp | 3 ++- src/smpi/internals/smpi_replay.cpp | 7 +++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/smpi/replay/replay.tesh b/examples/smpi/replay/replay.tesh index 5c702a0f34..e2ca2453cc 100644 --- a/examples/smpi/replay/replay.tesh +++ b/examples/smpi/replay/replay.tesh @@ -150,11 +150,11 @@ $ tail -n +3 ./simgrid.trace > 0 1 0 MPI > 2 2 1 MPI_STATE > 4 3 0 1 1 MPI_LINK -> 6 0 1 1 0 "rank-0" +> 6 0 1 1 0 "rank-1" > 5 4 2 computing "0 1 1" > 5 5 2 smpi_replay_run_init "0 1 0" -> 6 0 2 1 0 "rank-1" -> 6 0 3 1 0 "rank-2" +> 6 0 2 1 0 "rank-2" +> 6 0 3 1 0 "rank-3" > 12 0 2 1 5 > 13 0 2 1 > 12 0 2 2 5 diff --git a/src/instr/instr_paje_events.cpp b/src/instr/instr_paje_events.cpp index 29b7e34e50..9719ce57d9 100644 --- a/src/instr/instr_paje_events.cpp +++ b/src/instr/instr_paje_events.cpp @@ -156,7 +156,8 @@ void StateEvent::print() if (getContainer()->getName().find("rank-") != 0) stream << getContainer()->getName() << " " << extra_->print(); else - stream << getContainer()->getName().erase(0, 5) << " " << extra_->print(); + /* Subtract -1 because this is the process id and we transform it to the rank id */ + stream << stoi(getContainer()->getName().erase(0, 5)) - 1 << " " << extra_->print(); fprintf(tracing_files.at(getContainer()), "%s\n", stream.str().c_str()); } else { diff --git a/src/smpi/internals/smpi_replay.cpp b/src/smpi/internals/smpi_replay.cpp index 421cc29a17..c59a810d60 100644 --- a/src/smpi/internals/smpi_replay.cpp +++ b/src/smpi/internals/smpi_replay.cpp @@ -220,7 +220,7 @@ static void action_send(const char *const *action) MPI_CURRENT_TYPE= MPI_DEFAULT_TYPE; int rank = smpi_process()->index(); - int dst_traced = MPI_COMM_WORLD->group()->rank(to); + int dst_traced = MPI_COMM_WORLD->group()->actor(to)->getPid(); TRACE_smpi_comm_in(rank, __FUNCTION__, new simgrid::instr::Pt2PtTIData("send", to, size, encode_datatype(MPI_CURRENT_TYPE))); @@ -247,7 +247,7 @@ static void action_Isend(const char *const *action) MPI_CURRENT_TYPE= MPI_DEFAULT_TYPE; int rank = smpi_process()->index(); - int dst_traced = MPI_COMM_WORLD->group()->rank(to); + int dst_traced = MPI_COMM_WORLD->group()->actor(to)->getPid(); TRACE_smpi_comm_in(rank, __FUNCTION__, new simgrid::instr::Pt2PtTIData("Isend", to, size, encode_datatype(MPI_CURRENT_TYPE))); if (not TRACE_smpi_view_internals()) @@ -275,7 +275,7 @@ static void action_recv(const char *const *action) { MPI_CURRENT_TYPE= MPI_DEFAULT_TYPE; int rank = smpi_process()->index(); - int src_traced = MPI_COMM_WORLD->group()->rank(from); + int src_traced = MPI_COMM_WORLD->group()->actor(from)->getPid(); TRACE_smpi_comm_in(rank, __FUNCTION__, new simgrid::instr::Pt2PtTIData("recv", from, size, encode_datatype(MPI_CURRENT_TYPE))); @@ -309,7 +309,6 @@ static void action_Irecv(const char *const *action) MPI_CURRENT_TYPE= MPI_DEFAULT_TYPE; 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", from, size, encode_datatype(MPI_CURRENT_TYPE))); MPI_Status status; -- 2.20.1