From b3d3de7f0a303339ef0d3a6d90df58eb97e01e8c Mon Sep 17 00:00:00 2001 From: suter Date: Wed, 11 Jul 2012 16:11:42 +0200 Subject: [PATCH 1/1] add a few (totally untested) actions. --- examples/smpi/replay.c | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/examples/smpi/replay.c b/examples/smpi/replay.c index 2a8b43acc6..0c63cb7ba2 100644 --- a/examples/smpi/replay.c +++ b/examples/smpi/replay.c @@ -70,6 +70,29 @@ static void action_recv(const char *const *action) free(buffer); } +static void action_Irecv(const char *const *action) +{ + int from = atoi(action[2]); + char *buffer = (char*) malloc (1e9); + MPI_Request request; + + XBT_DEBUG("Asynchronous receive from rank%d (%s)",from, action[2]); + + MPI_Irecv(buffer, 1e9, MPI_BYTE, from, 0, MPI_COMM_WORLD, &request); + + free(buffer); +} + +static void action_wait(const char *const *action) +{ + MPI_Request request; + MPI_Status status; + + MPI_Wait(&request, &status); +} + + + int main(int argc, char *argv[]) { int i; @@ -84,8 +107,8 @@ int main(int argc, char *argv[]) xbt_replay_action_register("send", action_send); xbt_replay_action_register("Isend", action_Isend); xbt_replay_action_register("recv", action_recv); -// xbt_replay_action_register("Irecv", action_Irecv); -// xbt_replay_action_register("wait", action_wait); + xbt_replay_action_register("Irecv", action_Irecv); + xbt_replay_action_register("wait", action_wait); // xbt_replay_action_register("barrier", action_barrier); // xbt_replay_action_register("bcast", action_bcast); // xbt_replay_action_register("reduce", action_reduce); -- 2.20.1