From: degomme Date: Wed, 3 May 2017 08:14:34 +0000 (+0200) Subject: Add (too?) simple test for privatization. X-Git-Tag: v3.16~274^2~74 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/ef935e2af394f46f25314d9f841644fac7a4a715 Add (too?) simple test for privatization. Tests mmap if present, and dlopen every time (it should work on all systems) --- diff --git a/teshsuite/smpi/CMakeLists.txt b/teshsuite/smpi/CMakeLists.txt index 8ebe1cbf20..ed2a264a43 100644 --- a/teshsuite/smpi/CMakeLists.txt +++ b/teshsuite/smpi/CMakeLists.txt @@ -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 - 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}) @@ -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}/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 @@ -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) + + # 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() diff --git a/teshsuite/smpi/privatization/privatization.c b/teshsuite/smpi/privatization/privatization.c new file mode 100644 index 0000000000..07c2b8fa95 --- /dev/null +++ b/teshsuite/smpi/privatization/privatization.c @@ -0,0 +1,27 @@ + +#include +#include +#include + + +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 index 0000000000..83215a63c4 --- /dev/null +++ b/teshsuite/smpi/privatization/privatization.tesh @@ -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 index 0000000000..6d8f954e44 --- /dev/null +++ b/teshsuite/smpi/privatization/privatization_dlopen.tesh @@ -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...