From: Frederic Suter Date: Sat, 5 Mar 2016 19:59:10 +0000 (+0100) Subject: separate dsend and pingpong X-Git-Tag: v3_13~544 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/b0ab0c5a91c78404c76b02acf058c7a762934c74 separate dsend and pingpong --- diff --git a/.gitignore b/.gitignore index 4d73089b92..a726a58594 100644 --- a/.gitignore +++ b/.gitignore @@ -989,8 +989,8 @@ teshsuite/smpi/mpich-test/pt2pt/waitall3 teshsuite/smpi/mpich-test/pt2pt/waitall4 teshsuite/smpi/mpich-test/pt2pt/waitany teshsuite/smpi/mpich-test/*/*.stdo -teshsuite/smpi/pingpong/dsend -teshsuite/smpi/pingpong/pingpong +teshsuite/smpi/pt2pt-dsend/pt2pt-dsend +teshsuite/smpi/pt2pt-pingpong/pt2pt-pingpong teshsuite/smpi/reduce_coll teshsuite/smpi/reduce/reduce teshsuite/smpi/reduce/reduce_coll diff --git a/teshsuite/smpi/CMakeLists.txt b/teshsuite/smpi/CMakeLists.txt index 2aac6d1c99..1230f7837c 100644 --- a/teshsuite/smpi/CMakeLists.txt +++ b/teshsuite/smpi/CMakeLists.txt @@ -7,7 +7,7 @@ if(enable_smpi) include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi") foreach(x coll-allgather coll-allgatherv coll-alltoallv coll-barrier coll-bcast coll-gather coll-scatter - type-hvector type-indexed type-struct type-vector) + pt2pt-dsend pt2pt-pingpong type-hvector type-indexed type-struct type-vector) add_executable (${x} ${x}/${x}.c) target_link_libraries(${x} simgrid) set_target_properties(${x} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${x}) @@ -52,8 +52,13 @@ if(enable_smpi) endforeach() endif() +# Extra pt2pt pingpong test: broken usage ti-tracing +ADD_TESH_FACTORIES(tesh-smpi-broken "thread" --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/pt2pt-pingpong --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/pt2pt-pingpong broken_hostfiles.tesh) +ADD_TESH(tesh-smpi-replay-ti-tracing --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/pt2pt-pingpong --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/pt2pt-pingpong TI_output.tesh) +set(teshsuite_src ${teshsuite_src} PARENT_SCOPE) +set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/pt2pt-pingpong/broken_hostfiles.tesh + ${CMAKE_CURRENT_SOURCE_DIR}/pt2pt-pingpong/TI_output.tesh PARENT_SCOPE) set(bin_files ${bin_files} ${CMAKE_CURRENT_SOURCE_DIR}/hostfile - ${CMAKE_CURRENT_SOURCE_DIR}/hostfile_coll PARENT_SCOPE) -set(teshsuite_src ${teshsuite_src} PARENT_SCOPE) -set(tesh_files ${tesh_files} PARENT_SCOPE) + ${CMAKE_CURRENT_SOURCE_DIR}/hostfile_coll + ${CMAKE_CURRENT_SOURCE_DIR}/hostfile_empty PARENT_SCOPE) diff --git a/teshsuite/smpi/pingpong/empty-hostfile.txt b/teshsuite/smpi/hostfile_empty similarity index 100% rename from teshsuite/smpi/pingpong/empty-hostfile.txt rename to teshsuite/smpi/hostfile_empty diff --git a/teshsuite/smpi/pingpong/CMakeLists.txt b/teshsuite/smpi/pingpong/CMakeLists.txt deleted file mode 100644 index f4d90cb332..0000000000 --- a/teshsuite/smpi/pingpong/CMakeLists.txt +++ /dev/null @@ -1,29 +0,0 @@ -if(enable_smpi) - if(WIN32) - set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h") - else() - set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc") - endif() - include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi") - - add_executable (pingpong pingpong.c) - target_link_libraries(pingpong simgrid) - add_executable (dsend dsend.c) - target_link_libraries(dsend simgrid) -endif() - -set(tesh_files - ${tesh_files} - ${CMAKE_CURRENT_SOURCE_DIR}/pt2pt.tesh - ${CMAKE_CURRENT_SOURCE_DIR}/TI_output.tesh - ${CMAKE_CURRENT_SOURCE_DIR}/broken_hostfiles.tesh - PARENT_SCOPE) -set(examples_src - ${examples_src} - ${CMAKE_CURRENT_SOURCE_DIR}/dsend.c - ${CMAKE_CURRENT_SOURCE_DIR}/pingpong.c - PARENT_SCOPE) -set(txt_files - ${txt_files} - ${CMAKE_CURRENT_SOURCE_DIR}/empty-hostfile.txt - PARENT_SCOPE) diff --git a/teshsuite/smpi/pingpong/broken_hostfiles.tesh b/teshsuite/smpi/pingpong/broken_hostfiles.tesh deleted file mode 100644 index 6e78e3483b..0000000000 --- a/teshsuite/smpi/pingpong/broken_hostfiles.tesh +++ /dev/null @@ -1,8 +0,0 @@ -! setenv LD_LIBRARY_PATH=../../lib -! expect return 1 -$ ${bindir:=.}/../../../bin/smpirun -hostfile empty-hostfile.txt -platform ../../../examples/platforms/small_platform.xml -np 4 ${bindir:=.}/pingpong -q --log=smpi_kernel.thres:warning -> [smpirun] ** error: the hostfile 'empty-hostfile.txt' is empty. Aborting. - -! expect return 1 -$ ${bindir:=.}/../../../bin/smpirun -hostfile hostfile-does-not-exist.txt -platform ../../../examples/platforms/small_platform.xml -np 4 ${bindir:=.}/pingpong -q --log=smpi_kernel.thres:warning -> [smpirun] ** error: the file 'hostfile-does-not-exist.txt' does not exist. Aborting. diff --git a/teshsuite/smpi/pingpong/dsend.c b/teshsuite/smpi/pt2pt-dsend/pt2pt-dsend.c similarity index 96% rename from teshsuite/smpi/pingpong/dsend.c rename to teshsuite/smpi/pt2pt-dsend/pt2pt-dsend.c index 30d63893cc..4a1f8b9845 100644 --- a/teshsuite/smpi/pingpong/dsend.c +++ b/teshsuite/smpi/pt2pt-dsend/pt2pt-dsend.c @@ -14,15 +14,13 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(dsend,"the dsend test"); int main(int argc, char *argv[]) { int rank; int data=11; - MPI_Init(&argc, &argv); MPI_Comm_rank(MPI_COMM_WORLD, &rank); - + if (rank==1) { data=22; MPI_Send(&data,1,MPI_INT,(rank+1)%2,666,MPI_COMM_WORLD); -// smpi_sleep(1000); } else { MPI_Recv(&data,1,MPI_INT,MPI_ANY_SOURCE,666,MPI_COMM_WORLD,NULL); if (data !=22) { diff --git a/teshsuite/smpi/pt2pt-dsend/pt2pt-dsend.tesh b/teshsuite/smpi/pt2pt-dsend/pt2pt-dsend.tesh new file mode 100644 index 0000000000..dc6d06e02c --- /dev/null +++ b/teshsuite/smpi/pt2pt-dsend/pt2pt-dsend.tesh @@ -0,0 +1,11 @@ +p Test dsend +! setenv LD_LIBRARY_PATH=../../lib +! output sort +$ ${bindir:=.}/../../../bin/smpirun -map -hostfile ../hostfile -platform ../../../examples/platforms/small_platform.xml -np 2 ${bindir:=.}/pt2pt-dsend -q --log=smpi_kernel.thres:warning +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'surf/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:(2) 0.000000] [dsend/INFO] rank 1: data exchanged +> [Tremblay:0:(1) 0.002945] [dsend/INFO] rank 0: data exchanged +> [rank 0] -> Tremblay +> [rank 1] -> Jupiter diff --git a/teshsuite/smpi/pingpong/TI_output.tesh b/teshsuite/smpi/pt2pt-pingpong/TI_output.tesh similarity index 98% rename from teshsuite/smpi/pingpong/TI_output.tesh rename to teshsuite/smpi/pt2pt-pingpong/TI_output.tesh index 9f68f66a38..0182d9e2c5 100644 --- a/teshsuite/smpi/pingpong/TI_output.tesh +++ b/teshsuite/smpi/pt2pt-pingpong/TI_output.tesh @@ -5,7 +5,7 @@ p Test output of time independent tracing p generate a trace with pingpong, and replay itself, then check that output trace of the second run is the same as in the first (once sorted) ! setenv LD_LIBRARY_PATH=../../lib ! output sort -$ ${bindir:=.}/../../../bin/smpirun -trace-ti --cfg=tracing/filename:out_in_ti.txt --cfg=smpi/cpu_threshold:-1 -map -hostfile ../hostfile -platform ../../../examples/platforms/small_platform.xml -np 4 ${bindir:=.}/pingpong -q --log=smpi_kernel.thres:warning +$ ${bindir:=.}/../../../bin/smpirun -trace-ti --cfg=tracing/filename:out_in_ti.txt --cfg=smpi/cpu_threshold:-1 -map -hostfile ../hostfile -platform ../../../examples/platforms/small_platform.xml -np 4 ${bindir:=.}/pt2pt-pingpong -q --log=smpi_kernel.thres:warning > *** Ping-pong test (MPI_Send/MPI_Recv) *** > == pivot=0 : pingpong [0] <--> [1] > == pivot=1 : pingpong [1] <--> [2] @@ -108,12 +108,10 @@ $ rm -rf ./out_in_ti.txt_files $ rm out_ti.txt $ rm out_in_ti.txt - - p Same test, but only using one output file for all processes p generate a trace with pingpong, and replay itself, then check that output trace of the second run is the same as in the first (once sorted) ! output sort -$ ${bindir:=.}/../../../bin/smpirun -trace-ti --cfg=tracing/filename:out_in_ti.txt --cfg=tracing/smpi/format/ti_one_file:yes -map -hostfile ../hostfile -platform ../../../examples/platforms/small_platform.xml -np 4 ${bindir:=.}/pingpong -q --log=smpi_kernel.thres:warning +$ ${bindir:=.}/../../../bin/smpirun -trace-ti --cfg=tracing/filename:out_in_ti.txt --cfg=tracing/smpi/format/ti_one_file:yes -map -hostfile ../hostfile -platform ../../../examples/platforms/small_platform.xml -np 4 ${bindir:=.}/pt2pt-pingpong -q --log=smpi_kernel.thres:warning > *** Ping-pong test (MPI_Send/MPI_Recv) *** > == pivot=0 : pingpong [0] <--> [1] > == pivot=1 : pingpong [1] <--> [2] @@ -165,12 +163,7 @@ $ ${bindir:=.}/../../../bin/smpirun -ext smpi_replay --log=replay.:critical -tra > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/smpi/format/ti_one_file' to 'yes' > [Jupiter:1:(2) 0.016798] [smpi_replay/INFO] Simulation time 0.016798 - - $ rm -rf ./out_ti.txt_files $ rm -rf ./out_in_ti.txt_files $ rm out_ti.txt $ rm out_in_ti.txt - - - diff --git a/teshsuite/smpi/pt2pt-pingpong/broken_hostfiles.tesh b/teshsuite/smpi/pt2pt-pingpong/broken_hostfiles.tesh new file mode 100644 index 0000000000..6a2e3021a5 --- /dev/null +++ b/teshsuite/smpi/pt2pt-pingpong/broken_hostfiles.tesh @@ -0,0 +1,8 @@ +! setenv LD_LIBRARY_PATH=../../lib +! expect return 1 +$ ${bindir:=.}/../../../bin/smpirun -hostfile ../hostfile_empty -platform ../../../examples/platforms/small_platform.xml -np 4 ${bindir:=.}/pt2pt-pingpong -q --log=smpi_kernel.thres:warning +> [smpirun] ** error: the hostfile '../hostfile_empty' is empty. Aborting. + +! expect return 1 +$ ${bindir:=.}/../../../bin/smpirun -hostfile hostfile-does-not-exist.txt -platform ../../../examples/platforms/small_platform.xml -np 4 ${bindir:=.}/pt2pt-pingpong -q --log=smpi_kernel.thres:warning +> [smpirun] ** error: the file 'hostfile-does-not-exist.txt' does not exist. Aborting. diff --git a/teshsuite/smpi/pingpong/pingpong.c b/teshsuite/smpi/pt2pt-pingpong/pt2pt-pingpong.c similarity index 89% rename from teshsuite/smpi/pingpong/pingpong.c rename to teshsuite/smpi/pt2pt-pingpong/pt2pt-pingpong.c index 7adb6aea1f..62afcde78a 100644 --- a/teshsuite/smpi/pingpong/pingpong.c +++ b/teshsuite/smpi/pt2pt-pingpong/pt2pt-pingpong.c @@ -12,8 +12,7 @@ int main(int argc, char *argv[]) { const int tag1 = 42, tag2 = 43; /* Message tag */ - int rank; - int size; + int rank, size; int msg = 99; int err; int pivot; @@ -37,33 +36,26 @@ int main(int argc, char *argv[]) /* start pingpong tests between several pairs */ for (pivot = 0; pivot < size - 1; pivot++) { - if (pivot == rank) { - printf("\n== pivot=%d : pingpong [%d] <--> [%d]\n", pivot, pivot, - pivot + 1); + printf("\n== pivot=%d : pingpong [%d] <--> [%d]\n", pivot, pivot, pivot + 1); int dst = rank + 1; - printf("[%d] About to send 1st message '%d' to process [%d]\n", - rank, msg, dst); + printf("[%d] About to send 1st message '%d' to process [%d]\n", rank, msg, dst); MPI_Send(&msg, 1, MPI_INT, dst, tag1, MPI_COMM_WORLD); MPI_Recv(&msg, 1, MPI_INT, dst, tag2, MPI_COMM_WORLD, &status); /* Receive a message */ - printf("[%d] Received reply message '%d' from process [%d]\n", rank, - msg, dst); - + printf("[%d] Received reply message '%d' from process [%d]\n", rank, msg, dst); } if ((pivot + 1) == rank) { int src = rank - 1; MPI_Recv(&msg, 1, MPI_INT, src, tag1, MPI_COMM_WORLD, &status); /* Receive a message */ - printf("[%d] Received 1st message '%d' from process [%d]\n", rank, - msg, src); + printf("[%d] Received 1st message '%d' from process [%d]\n", rank, msg, src); msg++; printf("[%d] increment message's value to '%d'\n", rank, msg); - printf("[%d] About to send back message '%d' to process [%d]\n", - rank, msg, src); + printf("[%d] About to send back message '%d' to process [%d]\n", rank, msg, src); MPI_Send(&msg, 1, MPI_INT, src, tag2, MPI_COMM_WORLD); } } - MPI_Finalize(); /* Terminate MPI */ + MPI_Finalize(); return 0; } diff --git a/teshsuite/smpi/pingpong/pt2pt.tesh b/teshsuite/smpi/pt2pt-pingpong/pt2pt-pingpong.tesh similarity index 66% rename from teshsuite/smpi/pingpong/pt2pt.tesh rename to teshsuite/smpi/pt2pt-pingpong/pt2pt-pingpong.tesh index 068916b50e..58d1ff26be 100644 --- a/teshsuite/smpi/pingpong/pt2pt.tesh +++ b/teshsuite/smpi/pt2pt-pingpong/pt2pt-pingpong.tesh @@ -1,20 +1,7 @@ -p Test dsend -! setenv LD_LIBRARY_PATH=../../lib -! output sort -$ ${bindir:=.}/../../../bin/smpirun -map -hostfile ../hostfile -platform ../../../examples/platforms/small_platform.xml -np 2 ${bindir:=.}/dsend -q --log=smpi_kernel.thres:warning -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'surf/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:(2) 0.000000] [dsend/INFO] rank 1: data exchanged -> [Tremblay:0:(1) 0.002945] [dsend/INFO] rank 0: data exchanged -> [rank 0] -> Tremblay -> [rank 1] -> Jupiter - - p Test pingpong ! setenv LD_LIBRARY_PATH=../../lib ! output sort -$ ${bindir:=.}/../../../bin/smpirun -map -hostfile ../hostfile -platform ../../../examples/platforms/small_platform.xml -np 4 ${bindir:=.}/pingpong -q --log=smpi_kernel.thres:warning +$ ${bindir:=.}/../../../bin/smpirun -map -hostfile ../hostfile -platform ../../../examples/platforms/small_platform.xml -np 4 ${bindir:=.}/pt2pt-pingpong -q --log=smpi_kernel.thres:warning > *** Ping-pong test (MPI_Send/MPI_Recv) *** > == pivot=0 : pingpong [0] <--> [1] > == pivot=1 : pingpong [1] <--> [2] @@ -41,4 +28,3 @@ $ ${bindir:=.}/../../../bin/smpirun -map -hostfile ../hostfile -platform ../../. > [rank 1] -> Jupiter > [rank 2] -> Fafard > [rank 3] -> Ginette - diff --git a/tools/cmake/DefinePackages.cmake b/tools/cmake/DefinePackages.cmake index 84a695fadb..800f58b9f7 100644 --- a/tools/cmake/DefinePackages.cmake +++ b/tools/cmake/DefinePackages.cmake @@ -1052,7 +1052,6 @@ set(CMAKEFILES_TXT teshsuite/smpi/allreduce/CMakeLists.txt teshsuite/smpi/alltoall/CMakeLists.txt teshsuite/smpi/compute/CMakeLists.txt - teshsuite/smpi/pingpong/CMakeLists.txt teshsuite/smpi/reduce/CMakeLists.txt teshsuite/smpi/shared/CMakeLists.txt teshsuite/smpi/isp/umpire/CMakeLists.txt diff --git a/tools/cmake/Tests.cmake b/tools/cmake/Tests.cmake index 0f16924d07..ad403671c2 100644 --- a/tools/cmake/Tests.cmake +++ b/tools/cmake/Tests.cmake @@ -298,12 +298,8 @@ IF(NOT enable_memcheck) IF(enable_smpi) # BEGIN TESH TESTS # smpi examples - ADD_TESH_FACTORIES(tesh-smpi-pt2pt "thread;ucontext;raw;boost" --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/pingpong --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/pingpong pt2pt.tesh) ADD_TESH_FACTORIES(tesh-smpi-reduce "thread;ucontext;raw;boost" --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/reduce --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/reduce reduce.tesh) ADD_TESH_FACTORIES(tesh-smpi-compute "thread;ucontext;raw;boost" --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/compute --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/compute compute.tesh) - # smpi broken usage - ADD_TESH_FACTORIES(tesh-smpi-broken "thread" --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/pingpong --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/pingpong broken_hostfiles.tesh) - ADD_TESH(tesh-smpi-replay-ti-tracing --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/pingpong --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/pingpong TI_output.tesh) FOREACH (ALLREDUCE_COLL default lr rab1 rab2 rab_rdb rdb smp_binomial smp_binomial_pipeline smp_rdb smp_rsag smp_rsag_lr smp_rsag_rab redbcast ompi mpich ompi_ring_segmented mvapich2 mvapich2_rs mvapich2_two_level impi)