From a9b0436a2cbb60596670309f9e80229bccbfd05c Mon Sep 17 00:00:00 2001 From: George Markomanolis Date: Fri, 8 Feb 2013 14:02:24 +0200 Subject: [PATCH 1/1] Fixing a possible bug, I should use parse_double() instead of atoi() if I want to handle values like 5e8. Adding examples for MPI_Alltoallv, MPI_Alltoall, MPI_Bcast/MPI_Reduce with various datatypes and MPI_Waitall. --- examples/smpi/replay/actions_alltoall.txt | 12 +++++++++ examples/smpi/replay/actions_alltoallv.txt | 12 +++++++++ .../replay/actions_bcast_reduce_datatypes.txt | 27 +++++++++++++++++++ examples/smpi/replay/actions_waitall.txt | 19 +++++++++++++ src/smpi/smpi_replay.c | 11 ++++---- 5 files changed, 75 insertions(+), 6 deletions(-) create mode 100644 examples/smpi/replay/actions_alltoall.txt create mode 100644 examples/smpi/replay/actions_alltoallv.txt create mode 100644 examples/smpi/replay/actions_bcast_reduce_datatypes.txt create mode 100644 examples/smpi/replay/actions_waitall.txt diff --git a/examples/smpi/replay/actions_alltoall.txt b/examples/smpi/replay/actions_alltoall.txt new file mode 100644 index 0000000000..7660765e18 --- /dev/null +++ b/examples/smpi/replay/actions_alltoall.txt @@ -0,0 +1,12 @@ +0 init +1 init +2 init + +0 allToAll 500 500 +1 allToAll 500 500 +2 allToAll 500 500 + + +0 finalize +1 finalize +2 finalize diff --git a/examples/smpi/replay/actions_alltoallv.txt b/examples/smpi/replay/actions_alltoallv.txt new file mode 100644 index 0000000000..cd4f95c3ae --- /dev/null +++ b/examples/smpi/replay/actions_alltoallv.txt @@ -0,0 +1,12 @@ +0 init +1 init +2 init + +0 allToAllV 100 1 40 30 1 20 150 1000 1 80 100 1 20 110 +1 allToAllV 1000 80 1 40 1 100 160 1000 40 1 30 10 70 140 +2 allToAllV 1000 100 30 1 1 120 150 1000 30 40 1 1 50 60 + + +0 finalize +1 finalize +2 finalize diff --git a/examples/smpi/replay/actions_bcast_reduce_datatypes.txt b/examples/smpi/replay/actions_bcast_reduce_datatypes.txt new file mode 100644 index 0000000000..69545b7fdf --- /dev/null +++ b/examples/smpi/replay/actions_bcast_reduce_datatypes.txt @@ -0,0 +1,27 @@ +0 init 1 +1 init 1 +2 init 1 + +0 bcast 5e8 1 0 +1 bcast 5e8 1 0 +2 bcast 5e8 1 0 + +0 compute 5e8 +1 compute 2e8 +2 compute 5e8 + +0 bcast 5e8 0 3 +1 bcast 5e8 0 3 +2 bcast 5e8 0 3 + +0 compute 5e8 +1 compute 2e8 +2 compute 5e8 + +0 reduce 5e8 5e8 0 4 +1 reduce 5e8 5e8 0 4 +2 reduce 5e8 5e8 0 4 + +0 finalize +1 finalize +2 finalize diff --git a/examples/smpi/replay/actions_waitall.txt b/examples/smpi/replay/actions_waitall.txt new file mode 100644 index 0000000000..d7e3799dcd --- /dev/null +++ b/examples/smpi/replay/actions_waitall.txt @@ -0,0 +1,19 @@ +0 init +1 init +2 init + +0 Irecv 1 2000 +1 Isend 0 2000 +2 Irecv 1 3000 + +0 Irecv 2 3000 +1 Isend 2 3000 +2 Isend 0 3000 + +0 waitAll +1 waitAll +2 waitAll + +0 finalize +1 finalize +2 finalize diff --git a/src/smpi/smpi_replay.c b/src/smpi/smpi_replay.c index 23c57ce0d3..d7990bf2ab 100644 --- a/src/smpi/smpi_replay.c +++ b/src/smpi/smpi_replay.c @@ -487,8 +487,8 @@ static void action_allReduce(const char *const *action) { static void action_allToAll(const char *const *action) { double clock = smpi_process_simulated_elapsed(); int comm_size = smpi_comm_size(MPI_COMM_WORLD); - int send_size = atoi(action[2]); - int recv_size = atoi(action[3]); + int send_size = parse_double(action[2]); + int recv_size = parse_double(action[3]); void *send = xbt_new0(int, send_size*comm_size); void *recv = xbt_new0(int, send_size*comm_size); @@ -505,8 +505,7 @@ static void action_allToAll(const char *const *action) { smpi_coll_tuned_alltoall_bruck(send, send_size, MPI_CURRENT_TYPE, recv, recv_size, MPI_CURRENT_TYPE, MPI_COMM_WORLD); - } else if (send_size < 3000) { - + } else if (send_size < 3000) { smpi_coll_tuned_alltoall_basic_linear(send, send_size, MPI_CURRENT_TYPE, recv, recv_size, MPI_CURRENT_TYPE, MPI_COMM_WORLD); @@ -552,8 +551,8 @@ static void action_allToAllv(const char *const *action) { int *senddisps = xbt_new0(int, comm_size); int *recvdisps = xbt_new0(int, comm_size); - send_buf_size=atoi(action[2]); - recv_buf_size=atoi(action[3+2*comm_size]); + send_buf_size=parse_double(action[2]); + recv_buf_size=parse_double(action[3+2*comm_size]); int *sendbuf = xbt_new0(int, send_buf_size); int *recvbuf = xbt_new0(int, recv_buf_size); -- 2.20.1