Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add (too?) simple test for privatization.
authordegomme <augustin.degomme@unibas.ch>
Wed, 3 May 2017 08:14:34 +0000 (10:14 +0200)
committerdegomme <augustin.degomme@unibas.ch>
Wed, 3 May 2017 08:14:34 +0000 (10:14 +0200)
Tests mmap if present, and dlopen every time (it should work on all systems)

teshsuite/smpi/CMakeLists.txt
teshsuite/smpi/privatization/privatization.c [new file with mode: 0644]
teshsuite/smpi/privatization/privatization.tesh [new file with mode: 0644]
teshsuite/smpi/privatization/privatization_dlopen.tesh [new file with mode: 0644]

index 8ebe1cb..ed2a264 100644 (file)
@@ -8,7 +8,7 @@ if(enable_smpi)
   include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi")
   foreach(x coll-allgather coll-allgatherv coll-allreduce coll-alltoall coll-alltoallv coll-barrier coll-bcast 
             coll-gather coll-reduce coll-reduce-scatter coll-scatter macro-sample pt2pt-dsend pt2pt-pingpong 
   include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi")
   foreach(x coll-allgather coll-allgatherv coll-allreduce coll-alltoall coll-alltoallv coll-barrier coll-bcast 
             coll-gather coll-reduce coll-reduce-scatter coll-scatter macro-sample pt2pt-dsend pt2pt-pingpong 
-            type-hvector type-indexed type-struct type-vector bug-17132 timers )
+            type-hvector type-indexed type-struct type-vector bug-17132 timers privatization )
     add_executable       (${x}  ${x}/${x}.c)
     target_link_libraries(${x}  simgrid)
     set_target_properties(${x}  PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${x})
     add_executable       (${x}  ${x}/${x}.c)
     target_link_libraries(${x}  simgrid)
     set_target_properties(${x}  PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${x})
@@ -34,7 +34,8 @@ set(tesh_files    ${tesh_files}     ${CMAKE_CURRENT_SOURCE_DIR}/coll-allreduce/c
                                     ${CMAKE_CURRENT_SOURCE_DIR}/coll-allreduce/coll-allreduce-automatic.tesh
                                     ${CMAKE_CURRENT_SOURCE_DIR}/coll-alltoall/clusters.tesh
                                     ${CMAKE_CURRENT_SOURCE_DIR}/pt2pt-pingpong/broken_hostfiles.tesh
                                     ${CMAKE_CURRENT_SOURCE_DIR}/coll-allreduce/coll-allreduce-automatic.tesh
                                     ${CMAKE_CURRENT_SOURCE_DIR}/coll-alltoall/clusters.tesh
                                     ${CMAKE_CURRENT_SOURCE_DIR}/pt2pt-pingpong/broken_hostfiles.tesh
-                                    ${CMAKE_CURRENT_SOURCE_DIR}/pt2pt-pingpong/TI_output.tesh              PARENT_SCOPE)
+                                    ${CMAKE_CURRENT_SOURCE_DIR}/pt2pt-pingpong/TI_output.tesh              
+                                    ${CMAKE_CURRENT_SOURCE_DIR}/privatization/privatization_dlopen.tesh                             PARENT_SCOPE)
 set(bin_files       ${bin_files}    ${CMAKE_CURRENT_SOURCE_DIR}/hostfile
                                     ${CMAKE_CURRENT_SOURCE_DIR}/hostfile_cluster
                                     ${CMAKE_CURRENT_SOURCE_DIR}/hostfile_coll
 set(bin_files       ${bin_files}    ${CMAKE_CURRENT_SOURCE_DIR}/hostfile
                                     ${CMAKE_CURRENT_SOURCE_DIR}/hostfile_cluster
                                     ${CMAKE_CURRENT_SOURCE_DIR}/hostfile_coll
@@ -116,4 +117,12 @@ if(enable_smpi)
   # 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)
   # 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)
+
+  # Simple privatization tests
+  if(HAVE_PRIVATIZATION)
+    ADD_TESH_FACTORIES(tesh-smpi-privatization-mmap  "thread;ucontext;raw;boost"   --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/privatization --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/privatization privatization.tesh)
+  endif()
+
+    ADD_TESH_FACTORIES(tesh-smpi-privatization-dlopen  "thread;ucontext;raw;boost"   --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/privatization --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/privatization privatization_dlopen.tesh)
+
 endif()
 endif()
diff --git a/teshsuite/smpi/privatization/privatization.c b/teshsuite/smpi/privatization/privatization.c
new file mode 100644 (file)
index 0000000..07c2b8f
--- /dev/null
@@ -0,0 +1,27 @@
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <mpi.h>
+
+
+static int myvalue = 0;
+
+int main(int argc, char **argv)
+{
+    int me;
+
+    MPI_Init(&argc, &argv);
+
+    MPI_Comm_rank(MPI_COMM_WORLD, &me);
+
+    MPI_Barrier(MPI_COMM_WORLD);
+
+    myvalue = me;
+
+    MPI_Barrier(MPI_COMM_WORLD);
+
+    if(myvalue!=me)
+      printf("Privatization error - %d != %d\n", myvalue, me);
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/privatization/privatization.tesh b/teshsuite/smpi/privatization/privatization.tesh
new file mode 100644 (file)
index 0000000..83215a6
--- /dev/null
@@ -0,0 +1,5 @@
+p Test privatization
+! setenv LD_LIBRARY_PATH=../../lib
+! timeout 5
+$ ${bindir:=.}/../../../smpi_script/bin/smpirun -hostfile ../hostfile -platform ../../../examples/platforms/small_platform.xml -np 32 ${bindir:=.}/privatization --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning --cfg=smpi/privatization:1
+> You requested to use 32 processes, but there is only 5 processes in your hostfile...
diff --git a/teshsuite/smpi/privatization/privatization_dlopen.tesh b/teshsuite/smpi/privatization/privatization_dlopen.tesh
new file mode 100644 (file)
index 0000000..6d8f954
--- /dev/null
@@ -0,0 +1,5 @@
+p Test privatization with dlopen
+! setenv LD_LIBRARY_PATH=../../lib
+! timeout 5
+$ ${bindir:=.}/../../../smpi_script/bin/smpirun -hostfile ../hostfile -platform ../../../examples/platforms/small_platform.xml -np 32 ${bindir:=.}/privatization --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning --cfg=smpi/privatization:dlopen
+> You requested to use 32 processes, but there is only 5 processes in your hostfile...