- add_executable(allgather2 allgather2.c ../util/mtest.c)
- add_executable(allgather3 allgather3.c ../util/mtest.c)
- add_executable(allgatherv2 allgatherv2.c ../util/mtest.c)
- add_executable(allgatherv3 allgatherv3.c ../util/mtest.c)
- add_executable(allgatherv4 allgatherv4.c ../util/mtest.c)
- add_executable(allred2 allred2.c ../util/mtest.c)
- add_executable(allred3 allred3.c ../util/mtest.c)
- add_executable(allred4 allred4.c ../util/mtest.c)
- add_executable(allred5 allred5.c ../util/mtest.c)
- add_executable(allred6 allred6.c ../util/mtest.c)
-# add_executable(allred allred.c ../util/mtest.c)
- add_executable(allredmany allredmany.c ../util/mtest.c)
- add_executable(alltoall1 alltoall1.c ../util/mtest.c)
- add_executable(alltoallv0 alltoallv0.c ../util/mtest.c)
- add_executable(alltoallv alltoallv.c ../util/mtest.c)
- add_executable(alltoallw1 alltoallw1.c ../util/mtest.c)
- add_executable(alltoallw2 alltoallw2.c ../util/mtest.c)
- add_executable(alltoallw_zeros alltoallw_zeros.c ../util/mtest.c)
- add_executable(bcast2 bcast2.c ../util/mtest.c)
- add_executable(bcast3 bcast3.c ../util/mtest.c)
- add_executable(bcasttest bcasttest.c ../util/mtest.c)
- add_executable(bcastzerotype bcastzerotype.c ../util/mtest.c)
- add_executable(coll10 coll10.c ../util/mtest.c)
- add_executable(coll11 coll11.c ../util/mtest.c)
- add_executable(coll12 coll12.c ../util/mtest.c)
- add_executable(coll13 coll13.c ../util/mtest.c)
- add_executable(coll2 coll2.c ../util/mtest.c)
- add_executable(coll3 coll3.c ../util/mtest.c)
- add_executable(coll4 coll4.c ../util/mtest.c)
- add_executable(coll5 coll5.c ../util/mtest.c)
- add_executable(coll6 coll6.c ../util/mtest.c)
- add_executable(coll7 coll7.c ../util/mtest.c)
- add_executable(coll8 coll8.c ../util/mtest.c)
- add_executable(coll9 coll9.c ../util/mtest.c)
- add_executable(exscan2 exscan2.c ../util/mtest.c)
- add_executable(exscan exscan.c ../util/mtest.c)
- add_executable(gather2 gather2.c ../util/mtest.c)
- add_executable(gather2_save gather2_save.c ../util/mtest.c)
- add_executable(gather gather.c ../util/mtest.c)
- add_executable(iallred iallred.c ../util/mtest.c)
- add_executable(ibarrier ibarrier.c ../util/mtest.c)
- add_executable(icallgather icallgather.c ../util/mtest.c)
- add_executable(icallgatherv icallgatherv.c ../util/mtest.c)
- add_executable(icallreduce icallreduce.c ../util/mtest.c)
- add_executable(icalltoall icalltoall.c ../util/mtest.c)
- add_executable(icalltoallv icalltoallv.c ../util/mtest.c)
- add_executable(icalltoallw icalltoallw.c ../util/mtest.c)
- add_executable(icbarrier icbarrier.c ../util/mtest.c)
- add_executable(icbcast icbcast.c ../util/mtest.c)
- add_executable(icgather icgather.c ../util/mtest.c)
- add_executable(icgatherv icgatherv.c ../util/mtest.c)
- add_executable(icreduce icreduce.c ../util/mtest.c)
- add_executable(icscatter icscatter.c ../util/mtest.c)
- add_executable(icscatterv icscatterv.c ../util/mtest.c)
- add_executable(longuser longuser.c ../util/mtest.c)
- add_executable(nonblocking2 nonblocking2.c ../util/mtest.c)
- add_executable(nonblocking3 nonblocking3.c ../util/mtest.c)
- add_executable(nonblocking nonblocking.c ../util/mtest.c)
- add_executable(opband opband.c ../util/mtest.c)
- add_executable(opbor opbor.c ../util/mtest.c)
- add_executable(opbxor opbxor.c ../util/mtest.c)
- add_executable(op_commutative op_commutative.c ../util/mtest.c)
- add_executable(opland opland.c ../util/mtest.c)
- add_executable(oplor oplor.c ../util/mtest.c)
- add_executable(oplxor oplxor.c ../util/mtest.c)
- add_executable(opmax opmax.c ../util/mtest.c)
- add_executable(opmaxloc opmaxloc.c ../util/mtest.c)
- add_executable(opmin opmin.c ../util/mtest.c)
- add_executable(opminloc opminloc.c ../util/mtest.c)
- add_executable(opprod opprod.c ../util/mtest.c)
- add_executable(opsum opsum.c ../util/mtest.c)
- add_executable(red3 red3.c ../util/mtest.c)
- add_executable(red4 red4.c ../util/mtest.c)
- add_executable(redscat2 redscat2.c ../util/mtest.c)
- add_executable(redscat3 redscat3.c ../util/mtest.c)
- add_executable(redscatbkinter redscatbkinter.c ../util/mtest.c)
- add_executable(redscatblk3 redscatblk3.c ../util/mtest.c)
- add_executable(red_scat_block2 red_scat_block2.c ../util/mtest.c)
- add_executable(red_scat_block red_scat_block.c ../util/mtest.c)
- add_executable(redscat redscat.c ../util/mtest.c)
- add_executable(redscatinter redscatinter.c ../util/mtest.c)
- add_executable(reduce_mpich reduce.c ../util/mtest.c)
- add_executable(reduce_local reduce_local.c ../util/mtest.c)
- add_executable(scantst scantst.c ../util/mtest.c)
- add_executable(scatter2 scatter2.c ../util/mtest.c)
- add_executable(scatter3 scatter3.c ../util/mtest.c)
- add_executable(scattern scattern.c ../util/mtest.c)
- add_executable(scatterv scatterv.c ../util/mtest.c)
- add_executable(uoplong uoplong.c ../util/mtest.c)
+ foreach(test allgather2 allgather3 allgather_struct allgatherv2 allgatherv3
+ allred2 allred3 allred4 allred5 allred6 allredmany alltoall1
+ alltoallv0 alltoallv alltoallw1 alltoallw2 alltoallw_zeros
+ bcasttest bcastzerotype coll2 coll3 coll4 coll5 coll6 coll7 coll8
+ coll9 coll10 coll11 coll12 coll13 exscan exscan2 gather gather2 gatherv
+ gather_big ibarrier longuser nonblocking nonblocking2 nonblocking3 iallred
+ # icallgather icallgatherv icallreduce
+ # icalltoall icalltoallv icalltoallw icbarrier icbcast
+ # icgather icgatherv icreduce icscatter icscatterv
+ opband opbor opbxor opland oplor oplxor opmax opmaxloc
+ opmin opminloc opprod opsum
+ op_commutative red3 red4 redscat2 redscat3 redscatbkinter redscatblk3
+ redscat red_scat_block red_scat_block2 allgatherv4 allred
+ # redscatinter
+ reduce_local scantst scatter2 scatter3 scattern scatterv
+ uoplong
+ )
+ add_executable(${test} EXCLUDE_FROM_ALL ${test}.c)
+ add_dependencies(tests ${test})
+ target_link_libraries(${test} simgrid mtest_c)
+ endforeach()
+
+ set_target_properties(allred PROPERTIES COMPILE_FLAGS "-O0" LINK_FLAGS "-O0")
+
+ foreach(test bcast_full bcast_min_datatypes bcast_comm_world)
+ add_executable(${test} EXCLUDE_FROM_ALL bcast.c)
+ add_dependencies(tests ${test})
+ target_link_libraries(${test} simgrid mtest_c)
+ endforeach()
+ set_target_properties(bcast_min_datatypes PROPERTIES COMPILE_FLAGS "-DBCAST_MIN_DATATYPES_ONLY" LINK_FLAGS "-DBCAST_MIN_DATATYPES_ONLY")
+ set_target_properties(bcast_comm_world PROPERTIES COMPILE_FLAGS "-DBCAST_COMM_WORLD_ONLY" LINK_FLAGS "-DBCAST_COMM_WORLD_ONLY")
+
+ add_executable(reduce_mpich EXCLUDE_FROM_ALL reduce.c)
+ add_dependencies(tests reduce_mpich)
+ target_link_libraries(reduce_mpich simgrid mtest_c)
+
+ # These tests take 5 to 15 seconds to run, so we don't want to run them several times.
+ # But at the same time, we'd like to check if they work for all factories and all privatization algorithm
+ # Thus the current matrix
+
+ MACRO(ADD_MPICH3_COLL SELECTOR FACTORY PRIVATIZATION)
+ set(NAME "test-smpi-mpich3-coll-${SELECTOR}")
+ set(ARGS "-execarg=--cfg=smpi/coll-selector:${SELECTOR}" ${ARGN})
+ if(NOT "${PRIVATIZATION}" STREQUAL "" AND HAVE_PRIVATIZATION)
+ set(NAME "${NAME}-${PRIVATIZATION}")
+ set(ARGS ${ARGS} "-execarg=--cfg=smpi/privatization:${PRIVATIZATION}")
+ endif()
+ string(TOUPPER "HAVE_${FACTORY}_CONTEXTS" HAVE_FACTORY)
+ if(NOT "${FACTORY}" STREQUAL "" AND ${HAVE_FACTORY})
+ set(NAME "${NAME}-${FACTORY}")
+ set(ARGS ${ARGS} "-execarg=--cfg=contexts/factory:${FACTORY}")
+ endif()
+ ADD_TEST(${NAME} ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/coll ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests "-wrapper=${VALGRIND_WRAPPER}" -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/coll -tests=testlist ${ARGS})
+ SET_TESTS_PROPERTIES(${NAME} PROPERTIES PASS_REGULAR_EXPRESSION "tests passed!")
+ ENDMACRO()
+
+ # Test default selector; default factory; default privatization
+ ADD_MPICH3_COLL(default "" "")
+
+ # Test OMPI selector: thread factory, dlopen privatization
+ ADD_MPICH3_COLL(ompi "thread" "dlopen" -execarg=--cfg=smpi/bcast:binomial_tree)
+
+ # Test MPICH selector: boost factory, dlopen privatization
+ ADD_MPICH3_COLL(mpich "boost" "dlopen")
+
+ # Test MVAPICH2 selector: ucontext factory, mmap privatization
+ ADD_MPICH3_COLL(mvapich2 "ucontext" "mmap")