From 9121f87db72ee514f1ecc706cf7c314b1d3f8a9e Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Fri, 28 Jul 2017 13:06:54 +0200 Subject: [PATCH] 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. --- examples/smpi/replay/replay.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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; -- 2.20.1