X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/66cf0fd85d50a36a62c860dadb22675e7ac9eb0d..f257ec7c9ab6e14b11ea63378065db42105882b5:/src/smpi/internals/smpi_replay.cpp diff --git a/src/smpi/internals/smpi_replay.cpp b/src/smpi/internals/smpi_replay.cpp index f04308348a..d55ff234b9 100644 --- a/src/smpi/internals/smpi_replay.cpp +++ b/src/smpi/internals/smpi_replay.cpp @@ -134,7 +134,10 @@ public: /* Sometimes we need to re-insert MPI_REQUEST_NULL but we still need src,dst and tag */ void addNullRequest(int src, int dst, int tag) { - store.insert({req_key_t(src, dst, tag), MPI_REQUEST_NULL}); + store.insert({req_key_t( + MPI_COMM_WORLD->group()->actor(src)->get_pid()-1, + MPI_COMM_WORLD->group()->actor(dst)->get_pid()-1, + tag), MPI_REQUEST_NULL}); } }; @@ -701,14 +704,13 @@ static std::unordered_map storage; /** @brief Only initialize the replay, don't do it for real */ void smpi_replay_init(int* argc, char*** argv) { - simgrid::smpi::Process::init(argc, argv); + if (not smpi_process()->initializing()){ + simgrid::smpi::ActorExt::init(argc, argv); + } smpi_process()->mark_as_initialized(); smpi_process()->set_replaying(true); int my_proc_id = simgrid::s4u::this_actor::get_pid(); - for (int i = 0; i < smpi_process_count(); i++) { - storage[i] = simgrid::smpi::replay::RequestStorage(); - } TRACE_smpi_init(my_proc_id); TRACE_smpi_computing_init(my_proc_id); @@ -747,9 +749,8 @@ void smpi_replay_init(int* argc, char*** argv) XBT_VERB("Delayed start for instance - Sleeping for %f flops ",value ); smpi_execute_flops(value); } else { - //UGLY: force a context switch to be sure that all MSG_processes begin initialization - XBT_DEBUG("Force context switch by smpi_execute_flops - Sleeping for 0.0 flops "); - smpi_execute_flops(0.0); + // Wait for the other actors to initialize also + simgrid::s4u::this_actor::yield(); } } @@ -758,6 +759,7 @@ void smpi_replay_main(int* argc, char*** argv) { static int active_processes = 0; active_processes++; + storage[simgrid::s4u::this_actor::get_pid()] = simgrid::smpi::replay::RequestStorage(); simgrid::xbt::replay_runner(*argc, *argv); /* and now, finalize everything */