From: Martin Quinson Date: Fri, 28 Jul 2017 11:06:54 +0000 (+0200) Subject: don't let every process do the initialization, only rank 0 X-Git-Tag: v3_17~313 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/9121f87db72ee514f1ecc706cf7c314b1d3f8a9e?hp=0c54495555dec7f8be37511e762e6120b8d80c7c don't let every process do the initialization, only rank 0 Otherwise, overriding_send will be the value assigned to previous_send, leading into a infinite call loop. --- diff --git a/examples/smpi/replay/replay.c b/examples/smpi/replay/replay.c index 078385a595..fb0e9f9577 100644 --- a/examples/smpi/replay/replay.c +++ b/examples/smpi/replay/replay.c @@ -28,9 +28,12 @@ int main(int argc, char *argv[]) { xbt_replay_action_register("blah", action_blah); /* The send action is an override, so we have to first save its previous value in a global */ - previous_send = xbt_replay_action_get("send"); - xbt_replay_action_register("send", overriding_send); - + int rank; + MPI_Comm_rank(MPI_COMM_WORLD, &rank); + if (rank == 0) { + previous_send = xbt_replay_action_get("send"); + xbt_replay_action_register("send", overriding_send); + } /* The regular run of the replayer */ smpi_replay_main(&argc, &argv); return 0;