From 9f8d811451ee11bbb7dcfa82a30486f3aec5e6ca Mon Sep 17 00:00:00 2001 From: Augustin Degomme Date: Tue, 21 Oct 2014 14:21:15 +0200 Subject: [PATCH] Apply patch suggested by fabien Chaix. This avoids issues with reqq being deleted in replay waitall This also removes the MPI barrier in replay finalize, which was not needed anymore --- examples/smpi/replay/smpi_replay.tesh | 19 ++++++++++--------- .../smpi/replay_multiple/replay_multiple.tesh | 4 ++-- src/smpi/smpi_replay.c | 15 +++++++++++---- 3 files changed, 23 insertions(+), 15 deletions(-) diff --git a/examples/smpi/replay/smpi_replay.tesh b/examples/smpi/replay/smpi_replay.tesh index 1f5bc8065a..bb086c016c 100644 --- a/examples/smpi/replay/smpi_replay.tesh +++ b/examples/smpi/replay/smpi_replay.tesh @@ -209,17 +209,18 @@ $ tail -n +3 ./simgrid.trace > 12 13.138198 2 3 7 > 5 8 2 smpi_replay_finalize "0 1 0" > 13 14.286929 2 2 +> 12 14.286929 2 2 8 > 13 18.250974 2 1 +> 12 18.250974 2 1 8 > 13 19.691622 2 3 -> 12 19.695603 2 1 8 -> 12 19.698548 2 2 8 -> 12 19.699584 2 3 8 -> 13 19.699584 2 3 -> 7 19.699584 1 3 -> 13 19.699584 2 1 -> 7 19.699584 1 1 -> 13 19.699584 2 2 -> 7 19.699584 1 2 +> 12 19.691622 2 3 8 +> 13 19.691622 2 3 +> 7 19.691622 1 3 +> 13 19.691622 2 2 +> 7 19.691622 1 2 +> 13 19.691622 2 1 +> 7 19.691622 1 1 + diff --git a/examples/smpi/replay_multiple/replay_multiple.tesh b/examples/smpi/replay_multiple/replay_multiple.tesh index 0d68e08742..37ec2e47bd 100644 --- a/examples/smpi/replay_multiple/replay_multiple.tesh +++ b/examples/smpi/replay_multiple/replay_multiple.tesh @@ -7,7 +7,7 @@ $ ./replay_multiple description_file ${srcdir:=.}/../../platforms/small_platform > [0.000000] [msg_test/INFO] Initializing instance 1 of size 32 > [0.000000] [msg_test/INFO] Initializing instance 2 of size 32 > [0.000000] [smpi_kernel/INFO] You did not set the power of the host running the simulation. The timings will certainly not be accurate. Use the option "--cfg=smpi/running_power:" to set its value.Check http://simgrid.org/simgrid/latest/doc/options.html#options_smpi_bench for more information. -> [Fafard:2:(53) 1140967.830052] [smpi_replay/INFO] Simulation time 1123895.291050 -> [1140967.964219] [msg_test/INFO] Simulation time 1.14097e+06 +> [Fafard:2:(53) 1140967.830052] [smpi_replay/INFO] Simulation time 1123895.291051 +> [1140967.830052] [msg_test/INFO] Simulation time 1.14097e+06 $ rm -f deployment.xml diff --git a/src/smpi/smpi_replay.c b/src/smpi/smpi_replay.c index 2f6bebbfb5..a8ffb170c1 100644 --- a/src/smpi/smpi_replay.c +++ b/src/smpi/smpi_replay.c @@ -483,7 +483,9 @@ static void action_waitall(const char *const *action){ xbt_dynar_free(&recvs); #endif - xbt_dynar_free_container(&(reqq[smpi_process_index()])); + int freedrank=smpi_process_index(); + xbt_dynar_free_container(&(reqq[freedrank])); + reqq[freedrank]=xbt_dynar_new(sizeof(MPI_Request),&xbt_free_ref); } log_timed_action (action, clock); } @@ -1059,12 +1061,16 @@ int smpi_replay_finalize(){ active_processes--; } - xbt_dynar_free_container(&(reqq[smpi_process_index()])); - if(!active_processes){ /* Last process alive speaking */ /* end the simulated timer */ sim_time = smpi_process_simulated_elapsed(); + } + + + xbt_dynar_free_container(&(reqq[smpi_process_index()])); + + if(!active_processes){ XBT_INFO("Simulation time %f", sim_time); _xbt_replay_action_exit(); xbt_free(sendbuffer); @@ -1072,7 +1078,8 @@ int smpi_replay_finalize(){ xbt_free(reqq); reqq = NULL; } - mpi_coll_barrier_fun(MPI_COMM_WORLD); + + #ifdef HAVE_TRACING int rank = smpi_process_index(); instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1); -- 2.20.1