X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/1a64ca4c11a1eb7ba2ecd102f877ac571486a034..2e454138b3ecf02eed16a102c94f112bed8285d7:/examples/smpi/CMakeLists.txt diff --git a/examples/smpi/CMakeLists.txt b/examples/smpi/CMakeLists.txt index 0e8feaa292..7c46e06c26 100644 --- a/examples/smpi/CMakeLists.txt +++ b/examples/smpi/CMakeLists.txt @@ -1,3 +1,32 @@ +# These tests are cpp (by default, we assume C code) +set(_replay_sources ${CMAKE_CURRENT_SOURCE_DIR}/replay/replay.cpp) +set(_ampi_test_sources ${CMAKE_CURRENT_SOURCE_DIR}/ampi_test/ampi_test.cpp) + +# These tests are only used when MC is actived +set(MC_tests bugged1 bugged2 bugged1_liveness only_send_deterministic mutual_exclusion non_termination1 + non_termination2 non_termination3 non_termination4 sendsend) +foreach(x ${MC_tests}) + if(NOT SIMGRID_HAVE_MC) + set(_${x}_disable 1) + endif() + set(_${x}_sources ${CMAKE_CURRENT_SOURCE_DIR}/mc/${x}.c) + set(_${x}_outdir ${CMAKE_CURRENT_BINARY_DIR}/mc) +endforeach() + +# Compute the default for all configurations, and add all source files to the archive +foreach(x ampi_test trace trace_simple trace_call_location energy gemm simple-execute replay ${MC_tests}) + if(NOT DEFINED _${x}_sources) + set(_${x}_sources ${CMAKE_CURRENT_SOURCE_DIR}/${x}/${x}.c) + endif() + if(NOT DEFINED _${x}_outdir) + set(_${x}_outdir ${CMAKE_CURRENT_BINARY_DIR}/${x}) + endif() + + set(examples_src ${examples_src} ${_${x}_sources}) +endforeach() +set(examples_src ${examples_src} PARENT_SCOPE) + +# Compile the binaries, but only when everything is activated if(enable_smpi) set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc") set(CMAKE_CXX_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicxx") @@ -5,40 +34,27 @@ if(enable_smpi) file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/mc/") - foreach(x replay ampi_test trace trace_simple trace_call_location energy gemm) - add_executable (smpi_${x} EXCLUDE_FROM_ALL ${CMAKE_CURRENT_SOURCE_DIR}/${x}/${x}) - target_link_libraries(smpi_${x} simgrid) - set_target_properties(smpi_${x} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${x}) - add_dependencies(tests smpi_${x}) - endforeach() - - set_target_properties(smpi_trace_call_location PROPERTIES COMPILE_FLAGS "-trace-call-location") + foreach(x ampi_test trace trace_simple trace_call_location energy gemm simple-execute replay ${MC_tests}) - foreach(x bugged1 bugged2 bugged1_liveness only_send_deterministic mutual_exclusion non_termination1 - non_termination2 non_termination3 non_termination4 sendsend) - if(SIMGRID_HAVE_MC) - add_executable (smpi_${x} EXCLUDE_FROM_ALL ${CMAKE_CURRENT_SOURCE_DIR}/mc/${x}.c) + if(NOT DEFINED _${x}_disable) + add_executable (smpi_${x} EXCLUDE_FROM_ALL ${_${x}_sources}) target_link_libraries(smpi_${x} simgrid) - set_target_properties(smpi_${x} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/mc) + set_target_properties(smpi_${x} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${_${x}_outdir}) add_dependencies(tests smpi_${x}) endif() endforeach() + + set_target_properties(smpi_trace_call_location PROPERTIES COMPILE_FLAGS "-trace-call-location") endif() -foreach(x ampi_test replay) - set(examples_src ${examples_src} ${CMAKE_CURRENT_SOURCE_DIR}/${x}/${x}.cpp) -endforeach() -foreach(x trace trace_simple trace_call_location energy gemm) - set(examples_src ${examples_src} ${CMAKE_CURRENT_SOURCE_DIR}/${x}/${x}.c) -endforeach() -foreach(x bugged1 bugged2 bugged1_liveness only_send_deterministic mutual_exclusion non_termination1 - non_termination2 non_termination3 non_termination4 sendsend) - set(examples_src ${examples_src} ${CMAKE_CURRENT_SOURCE_DIR}/mc/${x}.c) -endforeach() +unset(_${x}_sources) +unset(_${x}_disable) +unset(_${x}_outdir) -set(examples_src ${examples_src} PARENT_SCOPE) set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/energy/energy.tesh ${CMAKE_CURRENT_SOURCE_DIR}/trace/trace.tesh + ${CMAKE_CURRENT_SOURCE_DIR}/simple-execute/simple-execute.tesh + ${CMAKE_CURRENT_SOURCE_DIR}/simple-execute/simple-execute-cpp-platf.tesh ${CMAKE_CURRENT_SOURCE_DIR}/gemm/gemm.tesh ${CMAKE_CURRENT_SOURCE_DIR}/trace_simple/trace_simple.tesh ${CMAKE_CURRENT_SOURCE_DIR}/trace_call_location/trace_call_location.tesh @@ -54,7 +70,8 @@ set(bin_files ${bin_files} ${CMAKE_CURRENT_SOURCE_DIR}/hostfile ${CMAKE_CURRENT_SOURCE_DIR}/mc/hostfile_bugged2 ${CMAKE_CURRENT_SOURCE_DIR}/mc/hostfile_only_send_deterministic ${CMAKE_CURRENT_SOURCE_DIR}/mc/hostfile_mutual_exclusion - ${CMAKE_CURRENT_SOURCE_DIR}/mc/hostfile_non_termination PARENT_SCOPE) + ${CMAKE_CURRENT_SOURCE_DIR}/mc/hostfile_non_termination + ${CMAKE_CURRENT_SOURCE_DIR}/simple-execute/hostfile_griffon PARENT_SCOPE) set(txt_files ${txt_files} ${CMAKE_CURRENT_SOURCE_DIR}/replay/actions0.txt ${CMAKE_CURRENT_SOURCE_DIR}/replay/actions1.txt ${CMAKE_CURRENT_SOURCE_DIR}/replay/actions_allreduce.txt @@ -74,11 +91,16 @@ set(txt_files ${txt_files} ${CMAKE_CURRENT_SOURCE_DIR}/replay/actions0.t if(enable_smpi) # MC is currently broken with threads (deadlock => timeout) if(SIMGRID_HAVE_MC) + add_dependencies(tests-mc smpimain) + add_dependencies(tests-mc smpi_only_send_deterministic) ADD_TESH(smpi-mc-only-send-determinism --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi/mc --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --cd ${CMAKE_BINARY_DIR}/examples/smpi/mc ${CMAKE_HOME_DIRECTORY}/examples/smpi/mc/only_send_deterministic.tesh) + add_dependencies(tests-mc smpi_sendsend) ADD_TESH_FACTORIES(smpi-mc-sendsend "^thread" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi/mc --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --cd ${CMAKE_BINARY_DIR}/examples/smpi/mc ${CMAKE_HOME_DIRECTORY}/examples/smpi/mc/sendsend.tesh) endif() ADD_TESH(smpi-tracing --setenv bindir=${CMAKE_BINARY_DIR}/examples/smpi/trace --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi/trace --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --cd ${CMAKE_BINARY_DIR}/examples/smpi/trace ${CMAKE_HOME_DIRECTORY}/examples/smpi/trace/trace.tesh) + ADD_TESH(smpi-simple-execute --setenv bindir=${CMAKE_BINARY_DIR}/examples/smpi/simple-execute --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi/simple-execute --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --cd ${CMAKE_BINARY_DIR}/examples/smpi/simple-execute ${CMAKE_HOME_DIRECTORY}/examples/smpi/simple-execute/simple-execute.tesh) + ADD_TESH(smpi-simple-execute-cpp-platf --setenv bindir=${CMAKE_BINARY_DIR}/examples/smpi/simple-execute --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi/simple-execute --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --setenv libdir=${CMAKE_BINARY_DIR}/lib --cd ${CMAKE_BINARY_DIR}/examples/smpi/simple-execute ${CMAKE_HOME_DIRECTORY}/examples/smpi/simple-execute/simple-execute-cpp-platf.tesh) ADD_TESH(smpi-tracing-simple --setenv bindir=${CMAKE_BINARY_DIR}/examples/smpi/trace_simple --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi/trace_simple --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --cd ${CMAKE_BINARY_DIR}/examples/smpi/trace_simple ${CMAKE_HOME_DIRECTORY}/examples/smpi/trace_simple/trace_simple.tesh) ADD_TESH(smpi-tracing-call-location --setenv bindir=${CMAKE_BINARY_DIR}/examples/smpi/trace_call_location --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --cd ${CMAKE_BINARY_DIR}/examples/smpi/trace_call_location ${CMAKE_HOME_DIRECTORY}/examples/smpi/trace_call_location/trace_call_location.tesh) ADD_TESH(smpi-replay --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --cd ${CMAKE_BINARY_DIR}/examples/smpi ${CMAKE_HOME_DIRECTORY}/examples/smpi/replay/replay.tesh)