Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
separate dsend and pingpong
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Sat, 5 Mar 2016 19:59:10 +0000 (20:59 +0100)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Sat, 5 Mar 2016 19:59:10 +0000 (20:59 +0100)
13 files changed:
.gitignore
teshsuite/smpi/CMakeLists.txt
teshsuite/smpi/hostfile_empty [moved from teshsuite/smpi/pingpong/empty-hostfile.txt with 100% similarity]
teshsuite/smpi/pingpong/CMakeLists.txt [deleted file]
teshsuite/smpi/pingpong/broken_hostfiles.tesh [deleted file]
teshsuite/smpi/pt2pt-dsend/pt2pt-dsend.c [moved from teshsuite/smpi/pingpong/dsend.c with 96% similarity]
teshsuite/smpi/pt2pt-dsend/pt2pt-dsend.tesh [new file with mode: 0644]
teshsuite/smpi/pt2pt-pingpong/TI_output.tesh [moved from teshsuite/smpi/pingpong/TI_output.tesh with 98% similarity]
teshsuite/smpi/pt2pt-pingpong/broken_hostfiles.tesh [new file with mode: 0644]
teshsuite/smpi/pt2pt-pingpong/pt2pt-pingpong.c [moved from teshsuite/smpi/pingpong/pingpong.c with 89% similarity]
teshsuite/smpi/pt2pt-pingpong/pt2pt-pingpong.tesh [moved from teshsuite/smpi/pingpong/pt2pt.tesh with 66% similarity]
tools/cmake/DefinePackages.cmake
tools/cmake/Tests.cmake

index 4d73089..a726a58 100644 (file)
@@ -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
index 2aac6d1..1230f78 100644 (file)
@@ -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/CMakeLists.txt b/teshsuite/smpi/pingpong/CMakeLists.txt
deleted file mode 100644 (file)
index f4d90cb..0000000
+++ /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 (file)
index 6e78e34..0000000
+++ /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.
similarity index 96%
rename from teshsuite/smpi/pingpong/dsend.c
rename to teshsuite/smpi/pt2pt-dsend/pt2pt-dsend.c
index 30d6389..4a1f8b9 100644 (file)
@@ -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 (file)
index 0000000..dc6d06e
--- /dev/null
@@ -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
similarity index 98%
rename from teshsuite/smpi/pingpong/TI_output.tesh
rename to teshsuite/smpi/pt2pt-pingpong/TI_output.tesh
index 9f68f66..0182d9e 100644 (file)
@@ -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 (file)
index 0000000..6a2e302
--- /dev/null
@@ -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.
similarity index 89%
rename from teshsuite/smpi/pingpong/pingpong.c
rename to teshsuite/smpi/pt2pt-pingpong/pt2pt-pingpong.c
index 7adb6ae..62afcde 100644 (file)
@@ -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;
 }
similarity index 66%
rename from teshsuite/smpi/pingpong/pt2pt.tesh
rename to teshsuite/smpi/pt2pt-pingpong/pt2pt-pingpong.tesh
index 068916b..58d1ff2 100644 (file)
@@ -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
-
index 84a695f..800f58b 100644 (file)
@@ -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
index 0f16924..ad40367 100644 (file)
@@ -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)