From 2df5112b37da14d8a3af659668b82da859ccf541 Mon Sep 17 00:00:00 2001 From: Augustin Degomme Date: Tue, 9 Oct 2012 18:44:14 +0200 Subject: [PATCH] add a few tests for smpi --- buildtools/Cmake/AddTests.cmake | 21 +++++++++++---- examples/smpi/hvector.tesh | 4 +++ examples/smpi/indexed.tesh | 38 +++++++++++++++++++++++++++ examples/smpi/pingpong.c | 2 +- examples/smpi/pt2pt.tesh | 46 +++++++++++++++++++++++++++++++++ examples/smpi/struct.tesh | 12 +++++++++ 6 files changed, 117 insertions(+), 6 deletions(-) create mode 100644 examples/smpi/hvector.tesh create mode 100644 examples/smpi/indexed.tesh create mode 100644 examples/smpi/pt2pt.tesh create mode 100644 examples/smpi/struct.tesh diff --git a/buildtools/Cmake/AddTests.cmake b/buildtools/Cmake/AddTests.cmake index 091c417d0f..2cd3a5e74e 100644 --- a/buildtools/Cmake/AddTests.cmake +++ b/buildtools/Cmake/AddTests.cmake @@ -371,9 +371,9 @@ if(NOT enable_memcheck) ADD_TEST(simdag-test-simdag2 ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/simdag --cd ${CMAKE_BINARY_DIR}/examples/simdag ${CMAKE_HOME_DIRECTORY}/examples/simdag/test_simdag2.tesh) ADD_TEST(simdag-test-seq-access ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/simdag --cd ${CMAKE_BINARY_DIR}/examples/simdag ${CMAKE_HOME_DIRECTORY}/examples/simdag/test_simdag_seq_access.tesh) ADD_TEST(simdag-test-typed-tasks ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/simdag --cd ${CMAKE_BINARY_DIR}/examples/simdag ${CMAKE_HOME_DIRECTORY}/examples/simdag/test_simdag_typed_tasks.tesh) - ADD_TEST(simdag-test-fail ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/examples/simdag --cd ${CMAKE_HOME_DIRECTORY}/examples/simdag test_simdag_fail.tesh) + ADD_TEST(simdag-test-fail ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/examples/simdag --cd ${CMAKE_HOME_DIRECTORY}/examples/simdag test_simdag_fail.tesh) ADD_TEST(simdag-test-comm-throttling ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/simdag --cd ${CMAKE_BINARY_DIR}/examples/simdag ${CMAKE_HOME_DIRECTORY}/examples/simdag/test_simdag_comm_throttling.tesh) - ADD_TEST(simdag-test-dax ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/examples/simdag/dax --cd ${CMAKE_HOME_DIRECTORY}/examples/simdag/dax smalldax.tesh) + ADD_TEST(simdag-test-dax ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/examples/simdag/dax --cd ${CMAKE_HOME_DIRECTORY}/examples/simdag/dax smalldax.tesh) ADD_TEST(simdag-test-dax-cycle ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/simdag/dax --cd ${CMAKE_BINARY_DIR}/examples/simdag/dax ${CMAKE_HOME_DIRECTORY}/examples/simdag/dax/simple_dax_with_cycle.tesh) ADD_TEST(simdag-test-prop ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/simdag --cd ${CMAKE_BINARY_DIR}/examples/simdag ${CMAKE_HOME_DIRECTORY}/examples/simdag/properties/test_prop.tesh) ADD_TEST(simdag-test-minmin-scheduling ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/examples/simdag/scheduling --cd ${CMAKE_HOME_DIRECTORY}/examples/simdag/scheduling test_minmin.tesh) @@ -464,20 +464,31 @@ if(NOT enable_memcheck) ADD_TEST(smpi-bcast-thread ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:thread --cd ${CMAKE_BINARY_DIR}/examples/smpi ${CMAKE_HOME_DIRECTORY}/examples/smpi/bcast.tesh) ADD_TEST(smpi-reduce-thread ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:thread --cd ${CMAKE_BINARY_DIR}/examples/smpi ${CMAKE_HOME_DIRECTORY}/examples/smpi/reduce.tesh) ADD_TEST(smpi-vector-thread ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:thread --cd ${CMAKE_BINARY_DIR}/examples/smpi ${CMAKE_HOME_DIRECTORY}/examples/smpi/vector.tesh) + ADD_TEST(smpi-indexed-thread ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:thread --cd ${CMAKE_BINARY_DIR}/examples/smpi ${CMAKE_HOME_DIRECTORY}/examples/smpi/indexed.tesh) + ADD_TEST(smpi-struct-thread ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:thread --cd ${CMAKE_BINARY_DIR}/examples/smpi ${CMAKE_HOME_DIRECTORY}/examples/smpi/struct.tesh) + ADD_TEST(smpi-pt2pt-thread ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:thread --cd ${CMAKE_BINARY_DIR}/examples/smpi ${CMAKE_HOME_DIRECTORY}/examples/smpi/pt2pt.tesh) if(HAVE_RAWCTX) ADD_TEST(smpi-bcast-raw ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:raw --cd ${CMAKE_BINARY_DIR}/examples/smpi ${CMAKE_HOME_DIRECTORY}/examples/smpi/bcast.tesh) ADD_TEST(smpi-reduce-raw ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:raw --cd ${CMAKE_BINARY_DIR}/examples/smpi ${CMAKE_HOME_DIRECTORY}/examples/smpi/reduce.tesh) - ADD_TEST(smpi-vector-raw ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:raw --cd ${CMAKE_BINARY_DIR}/examples/smpi ${CMAKE_HOME_DIRECTORY}/examples/smpi/vector.tesh) + ADD_TEST(smpi-vector-raw ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:raw --cd ${CMAKE_BINARY_DIR}/examples/smpi ${CMAKE_HOME_DIRECTORY}/examples/smpi/vector.tesh) + ADD_TEST(smpi-indexed-raw ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:raw --cd ${CMAKE_BINARY_DIR}/examples/smpi ${CMAKE_HOME_DIRECTORY}/examples/smpi/indexed.tesh) + ADD_TEST(smpi-struct-raw ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:raw --cd ${CMAKE_BINARY_DIR}/examples/smpi ${CMAKE_HOME_DIRECTORY}/examples/smpi/struct.tesh) + ADD_TEST(smpi-pt2pt-raw ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:raw --cd ${CMAKE_BINARY_DIR}/examples/smpi ${CMAKE_HOME_DIRECTORY}/examples/smpi/pt2pt.tesh) + endif(HAVE_RAWCTX) if(CONTEXT_UCONTEXT) ADD_TEST(smpi-bcast-ucontext ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --cd ${CMAKE_BINARY_DIR}/examples/smpi ${CMAKE_HOME_DIRECTORY}/examples/smpi/bcast.tesh) ADD_TEST(smpi-reduce-ucontext ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --cd ${CMAKE_BINARY_DIR}/examples/smpi ${CMAKE_HOME_DIRECTORY}/examples/smpi/reduce.tesh) - ADD_TEST(smpi-vector-ucontex ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --cd ${CMAKE_BINARY_DIR}/examples/smpi ${CMAKE_HOME_DIRECTORY}/examples/smpi/vector.tesh) + ADD_TEST(smpi-vector-ucontex ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --cd ${CMAKE_BINARY_DIR}/examples/smpi ${CMAKE_HOME_DIRECTORY}/examples/smpi/vector.tesh) + ADD_TEST(smpi-indexed-ucontext ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --cd ${CMAKE_BINARY_DIR}/examples/smpi ${CMAKE_HOME_DIRECTORY}/examples/smpi/indexed.tesh) + ADD_TEST(smpi-struct-ucontext ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --cd ${CMAKE_BINARY_DIR}/examples/smpi ${CMAKE_HOME_DIRECTORY}/examples/smpi/struct.tesh) + ADD_TEST(smpi-pt2pt-ucontext ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --cd ${CMAKE_BINARY_DIR}/examples/smpi ${CMAKE_HOME_DIRECTORY}/examples/smpi/pt2pt.tesh) + endif(CONTEXT_UCONTEXT) if(HAVE_TRACING) ADD_TEST(smpi-tracing-ptp ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cd ${CMAKE_BINARY_DIR}/examples/smpi ${CMAKE_HOME_DIRECTORY}/examples/smpi/tracing/smpi_traced.tesh) - ADD_TEST(smpi-replay ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi --cd ${CMAKE_BINARY_DIR}/examples/smpi ${CMAKE_HOME_DIRECTORY}/examples/smpi/replay/smpi_replay.tesh) + ADD_TEST(smpi-replay ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi --cd ${CMAKE_BINARY_DIR}/examples/smpi ${CMAKE_HOME_DIRECTORY}/examples/smpi/replay/smpi_replay.tesh) endif(HAVE_TRACING) endif(enable_smpi) diff --git a/examples/smpi/hvector.tesh b/examples/smpi/hvector.tesh new file mode 100644 index 0000000000..e3399b2178 --- /dev/null +++ b/examples/smpi/hvector.tesh @@ -0,0 +1,4 @@ +p Test indexed +! setenv LD_LIBRARY_PATH=../../lib +! output sort +$ ../../bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../msg/small_platform.xml -np 2 ./indexed_test -q diff --git a/examples/smpi/indexed.tesh b/examples/smpi/indexed.tesh new file mode 100644 index 0000000000..690c08e057 --- /dev/null +++ b/examples/smpi/indexed.tesh @@ -0,0 +1,38 @@ +p Test indexed +! setenv LD_LIBRARY_PATH=../../lib +! output sort +$ ../../bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../msg/small_platform.xml -np 2 ./indexed_test -q +> [0.000000] [surf_config/INFO] Switching workstation model to compound since you changed the network and/or cpu model(s) +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-9' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' +> [rank 0] -> Tremblay +> [rank 1] -> Jupiter +> buffer[0] = 0 +> buffer[10] = 10 +> buffer[11] = 11 +> buffer[12] = 12 +> buffer[13] = 13 +> buffer[14] = 14 +> buffer[15] = 15 +> buffer[16] = 16 +> buffer[17] = 17 +> buffer[18] = -1 +> buffer[19] = -1 +> buffer[1] = 1 +> buffer[20] = -1 +> buffer[21] = -1 +> buffer[22] = -1 +> buffer[23] = -1 +> buffer[24] = 24 +> buffer[25] = 25 +> buffer[26] = 26 +> buffer[2] = 2 +> buffer[3] = 3 +> buffer[4] = 4 +> buffer[5] = 5 +> buffer[6] = -1 +> buffer[7] = -1 +> buffer[8] = -1 +> buffer[9] = 9 + diff --git a/examples/smpi/pingpong.c b/examples/smpi/pingpong.c index 871c229b9d..10dc33669f 100644 --- a/examples/smpi/pingpong.c +++ b/examples/smpi/pingpong.c @@ -48,7 +48,7 @@ int main(int argc, char *argv[]) err = MPI_Send(&msg, 1, MPI_INT, dst, tag1, MPI_COMM_WORLD); err = MPI_Recv(&msg, 1, MPI_INT, dst, tag2, MPI_COMM_WORLD, &status); /* Receive a message */ - printf("[%d] Received relpy message '%d' from process [%d] \n", rank, + printf("[%d] Received reply message '%d' from process [%d] \n", rank, msg, dst); } diff --git a/examples/smpi/pt2pt.tesh b/examples/smpi/pt2pt.tesh new file mode 100644 index 0000000000..ce70d887bc --- /dev/null +++ b/examples/smpi/pt2pt.tesh @@ -0,0 +1,46 @@ +p Test dsend +! setenv LD_LIBRARY_PATH=../../lib +! output sort +$ ../../bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../msg/small_platform.xml -np 2 ./dsend -q +> [0.000000] [surf_config/INFO] Switching workstation model to compound since you changed the network and/or cpu model(s) +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-9' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' +> [Jupiter:1:(0) 0.000000] [dsend/INFO] rank 1: data exchanged +> [Tremblay:0:(0) 0.002945] [dsend/INFO] rank 0: data exchanged +> [rank 0] -> Tremblay +> [rank 1] -> Jupiter + + +p Test pingpong +! setenv LD_LIBRARY_PATH=../../lib +! output sort +$ ../../bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../msg/small_platform.xml -np 4 ./pingpong -q +> *** Ping-pong test (MPI_Send/MPI_Recv) *** +> == pivot=0 : pingpong [0] <--> [1] +> == pivot=1 : pingpong [1] <--> [2] +> == pivot=2 : pingpong [2] <--> [3] +> [0.000000] [surf_config/INFO] Switching workstation model to compound since you changed the network and/or cpu model(s) +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-9' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' +> [0] About to send 1st message '99' to process [1] +> [0] Received reply message '100' from process [1] +> [1] About to send 1st message '100' to process [2] +> [1] About to send back message '100' to process [0] +> [1] Received 1st message '99' from process [0] +> [1] Received reply message '101' from process [2] +> [1] increment message's value to '100' +> [2] About to send 1st message '101' to process [3] +> [2] About to send back message '101' to process [1] +> [2] Received 1st message '100' from process [1] +> [2] Received reply message '102' from process [3] +> [2] increment message's value to '101' +> [3] About to send back message '102' to process [2] +> [3] Received 1st message '101' from process [2] +> [3] increment message's value to '102' +> [rank 0] -> Tremblay +> [rank 1] -> Jupiter +> [rank 2] -> Fafard +> [rank 3] -> Ginette + diff --git a/examples/smpi/struct.tesh b/examples/smpi/struct.tesh new file mode 100644 index 0000000000..0d3c6f3a0e --- /dev/null +++ b/examples/smpi/struct.tesh @@ -0,0 +1,12 @@ +p Test struct +! setenv LD_LIBRARY_PATH=../../lib +! output sort +$ ../../bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../msg/small_platform.xml -np 2 ./struct_test -q +> Process 0 got -2 (-2?) and 8.000000 (8.0?), tab (should be all 0): 0 0 0 0 0 0 +> Process 1 got -2 (-2?) and 8.000000 (8.0?), tab (should be all 0): 0 0 0 0 0 0 +> [0.000000] [surf_config/INFO] Switching workstation model to compound since you changed the network and/or cpu model(s) +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-9' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' +> [rank 0] -> Tremblay +> [rank 1] -> Jupiter -- 2.20.1