X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/1d3bb007d52c72d2f2fd5a636d4792d4e5f9427d..61c4de1ff34a325b50a86256e20e7a2de9604f45:/examples/smpi/CMakeLists.txt diff --git a/examples/smpi/CMakeLists.txt b/examples/smpi/CMakeLists.txt index 368093be63..d334fa9699 100644 --- a/examples/smpi/CMakeLists.txt +++ b/examples/smpi/CMakeLists.txt @@ -1,54 +1,79 @@ -cmake_minimum_required(VERSION 2.6) - -set(CMAKE_C_COMPILER "${PROJECT_DIRECTORY}/src/smpi/smpicc") - -set(EXECUTABLE_OUTPUT_PATH "${PROJECT_DIRECTORY}/examples/smpi/") -set(flags "-Dmain=smpi_simulated_main") -set(INCLUDES_bis "-I${PROJECT_DIRECTORY}/include/smpi") - -add_definitions (${INCLUDES_bis} ${flags}) - -add_executable(alltoall2 alltoall2.c ) -add_executable(alltoall_basic alltoall_basic.c) -add_executable(alltoallv alltoallv.c) -add_executable(allreduce allreduce.c) -add_executable(bcast bcast.c) -add_executable(bcbench bcbench.c) -add_executable(compute compute.c) -add_executable(compute2 compute2.c) -add_executable(compute3 compute3.c) -add_executable(first mvmul.c) -add_executable(pingpong pingpong.c) -add_executable(second second.c) -add_executable(scatter scatter.c) -add_executable(reduce reduce.c) -add_executable(ring_c ring_c.c) -add_executable(split split.c) -add_executable(mvmul mvmul.c) -add_executable(smpi_sendrecv sendrecv.c) - -target_link_libraries(alltoall2 m simgrid smpi -fprofile-arcs) -target_link_libraries(alltoall_basic m simgrid smpi -fprofile-arcs) -target_link_libraries(alltoallv m simgrid smpi -fprofile-arcs) -target_link_libraries(allreduce m simgrid smpi -fprofile-arcs) -target_link_libraries(bcast m simgrid smpi -fprofile-arcs) -target_link_libraries(bcbench m simgrid smpi -fprofile-arcs) -target_link_libraries(compute m simgrid smpi -fprofile-arcs) -target_link_libraries(compute2 m simgrid smpi -fprofile-arcs) -target_link_libraries(compute3 m simgrid smpi -fprofile-arcs) -target_link_libraries(first m simgrid smpi -fprofile-arcs) -target_link_libraries(pingpong m simgrid smpi -fprofile-arcs) -target_link_libraries(second m simgrid smpi -fprofile-arcs) -target_link_libraries(scatter m simgrid smpi -fprofile-arcs) -target_link_libraries(reduce m simgrid smpi -fprofile-arcs) -target_link_libraries(ring_c m simgrid smpi -fprofile-arcs) -target_link_libraries(split m simgrid smpi -fprofile-arcs) -target_link_libraries(mvmul m simgrid smpi -fprofile-arcs) -target_link_libraries(smpi_sendrecv m simgrid smpi -fprofile-arcs) - -add_custom_command(TARGET smpi_sendrecv -POST_BUILD -COMMAND "cp" -ARGS ./smpi_sendrecv ./sendrecv -WORKING_DIRECTORY "${PROJECT_DIRECTORY}/examples/smpi" -) +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") + include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi") + + file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/mc/") + + foreach(x replay ampi trace trace_simple trace_call_location energy) + add_executable (smpi_${x} ${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}) + endforeach() + + set_target_properties(smpi_trace_call_location PROPERTIES COMPILE_FLAGS "-trace-call-location") + + foreach(x bugged1 bugged2 bugged1_liveness only_send_deterministic mutual_exclusion non_termination1 + non_termination2 non_termination3 non_termination4) + if(SIMGRID_HAVE_MC) + add_executable (smpi_${x} ${CMAKE_CURRENT_SOURCE_DIR}/mc/${x}.c) + target_link_libraries(smpi_${x} simgrid) + set_target_properties(smpi_${x} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/mc) + endif() + endforeach() +endif() + +foreach(x replay) + set(examples_src ${examples_src} ${CMAKE_CURRENT_SOURCE_DIR}/${x}/${x}.cpp) +endforeach() +foreach(x trace trace_simple trace_call_location energy) + 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) + set(examples_src ${examples_src} ${CMAKE_CURRENT_SOURCE_DIR}/mc/${x}.c) +endforeach() + +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}/trace_simple/trace_simple.tesh + ${CMAKE_CURRENT_SOURCE_DIR}/trace_call_location/trace_call_location.tesh + ${CMAKE_CURRENT_SOURCE_DIR}/replay/replay.tesh PARENT_SCOPE) +set(bin_files ${bin_files} ${CMAKE_CURRENT_SOURCE_DIR}/hostfile + ${CMAKE_CURRENT_SOURCE_DIR}/energy/hostfile + ${CMAKE_CURRENT_SOURCE_DIR}/mc/promela_bugged1_liveness + ${CMAKE_CURRENT_SOURCE_DIR}/mc/hostfile_bugged1_liveness + ${CMAKE_CURRENT_SOURCE_DIR}/mc/hostfile_bugged1 + ${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) +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 + ${CMAKE_CURRENT_SOURCE_DIR}/replay/actions_allgatherv.txt + ${CMAKE_CURRENT_SOURCE_DIR}/replay/actions_alltoall.txt + ${CMAKE_CURRENT_SOURCE_DIR}/replay/actions_alltoallv.txt + ${CMAKE_CURRENT_SOURCE_DIR}/replay/actions_barrier.txt + ${CMAKE_CURRENT_SOURCE_DIR}/replay/actions_bcast.txt + ${CMAKE_CURRENT_SOURCE_DIR}/replay/actions_bcast_reduce_datatypes.txt + ${CMAKE_CURRENT_SOURCE_DIR}/replay/actions_gather.txt + ${CMAKE_CURRENT_SOURCE_DIR}/replay/actions_reducescatter.txt + ${CMAKE_CURRENT_SOURCE_DIR}/replay/actions_waitall.txt + ${CMAKE_CURRENT_SOURCE_DIR}/replay/actions_with_isend.txt + ${CMAKE_CURRENT_SOURCE_DIR}/replay/split_traces PARENT_SCOPE) + +if(enable_smpi) + if(SIMGRID_HAVE_MC) + 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) + 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-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) + ADD_TESH_FACTORIES(smpi-energy "thread;ucontext;raw;boost" --setenv bindir=${CMAKE_BINARY_DIR}/examples/smpi/energy --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi/energy --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --setenv bindir=${CMAKE_BINARY_DIR}/bin --cd ${CMAKE_BINARY_DIR}/examples/smpi/energy ${CMAKE_HOME_DIRECTORY}/examples/smpi/energy/energy.tesh) + + ADD_TESH(smpi-ampi --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/ampi/ampi.tesh) +endif()