Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
ChangeLog [ci-skip]
[simgrid.git] / examples / smpi / CMakeLists.txt
1 # These tests are cpp (by default, we assume C code)
2 set(_replay_sources    ${CMAKE_CURRENT_SOURCE_DIR}/replay/replay.cpp)
3 set(_ampi_test_sources ${CMAKE_CURRENT_SOURCE_DIR}/ampi_test/ampi_test.cpp)
4
5 # These tests are only used when MC is actived
6 set(MC_tests bugged1 bugged2 bugged1_liveness only_send_deterministic mutual_exclusion non_termination1
7              non_termination2 non_termination3 non_termination4 sendsend)
8 foreach(x ${MC_tests})
9   if(NOT SIMGRID_HAVE_MC)
10     set(_${x}_disable 1)
11   endif()
12   set(_${x}_sources ${CMAKE_CURRENT_SOURCE_DIR}/mc/${x}.c)
13   set(_${x}_outdir  ${CMAKE_CURRENT_BINARY_DIR}/mc)
14 endforeach()
15
16 # Compute the default for all configurations, and add all source files to the archive
17 foreach(x ampi_test trace trace_simple trace_call_location energy gemm simple-execute replay ${MC_tests})
18   if(NOT DEFINED _${x}_sources)
19     set(_${x}_sources ${CMAKE_CURRENT_SOURCE_DIR}/${x}/${x}.c)
20   endif()
21   if(NOT DEFINED _${x}_outdir)
22     set(_${x}_outdir  ${CMAKE_CURRENT_BINARY_DIR}/${x})
23   endif()
24
25   set(examples_src  ${examples_src}  ${_${x}_sources})
26 endforeach()
27 set(examples_src  ${examples_src}  PARENT_SCOPE)
28
29 # Compile the binaries, but only when everything is activated
30 if(enable_smpi)
31   set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
32   set(CMAKE_CXX_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicxx")
33   include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi")
34
35   file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/mc/")
36
37   foreach(x ampi_test trace trace_simple trace_call_location energy gemm simple-execute replay ${MC_tests})
38
39     if(NOT DEFINED _${x}_disable)
40       add_executable       (smpi_${x} EXCLUDE_FROM_ALL ${_${x}_sources})
41       target_link_libraries(smpi_${x} simgrid)
42       set_target_properties(smpi_${x} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${_${x}_outdir})
43       add_dependencies(tests smpi_${x})
44     endif()
45   endforeach()
46
47   set_target_properties(smpi_trace_call_location PROPERTIES COMPILE_FLAGS "-trace-call-location")
48 endif()
49
50 unset(_${x}_sources)
51 unset(_${x}_disable)
52 unset(_${x}_outdir)
53
54 set(tesh_files    ${tesh_files}    ${CMAKE_CURRENT_SOURCE_DIR}/energy/energy.tesh
55                                    ${CMAKE_CURRENT_SOURCE_DIR}/trace/trace.tesh
56                                    ${CMAKE_CURRENT_SOURCE_DIR}/simple-execute/simple-execute.tesh
57                                    ${CMAKE_CURRENT_SOURCE_DIR}/simple-execute/simple-execute-cpp-platf.tesh
58                                    ${CMAKE_CURRENT_SOURCE_DIR}/gemm/gemm.tesh
59                                    ${CMAKE_CURRENT_SOURCE_DIR}/trace_simple/trace_simple.tesh
60                                    ${CMAKE_CURRENT_SOURCE_DIR}/trace_call_location/trace_call_location.tesh
61                                    ${CMAKE_CURRENT_SOURCE_DIR}/ampi_test/ampi_test.tesh
62                                    ${CMAKE_CURRENT_SOURCE_DIR}/mc/only_send_deterministic.tesh
63                                    ${CMAKE_CURRENT_SOURCE_DIR}/mc/sendsend.tesh
64                                    ${CMAKE_CURRENT_SOURCE_DIR}/replay/replay-override-replayer.tesh
65                                    ${CMAKE_CURRENT_SOURCE_DIR}/replay/replay.tesh                          PARENT_SCOPE)
66 set(bin_files     ${bin_files}     ${CMAKE_CURRENT_SOURCE_DIR}/hostfile
67                                    ${CMAKE_CURRENT_SOURCE_DIR}/energy/hostfile
68                                    ${CMAKE_CURRENT_SOURCE_DIR}/mc/promela_bugged1_liveness
69                                    ${CMAKE_CURRENT_SOURCE_DIR}/mc/hostfile_bugged1_liveness
70                                    ${CMAKE_CURRENT_SOURCE_DIR}/mc/hostfile_bugged1
71                                    ${CMAKE_CURRENT_SOURCE_DIR}/mc/hostfile_bugged2
72                                    ${CMAKE_CURRENT_SOURCE_DIR}/mc/hostfile_only_send_deterministic
73                                    ${CMAKE_CURRENT_SOURCE_DIR}/mc/hostfile_mutual_exclusion
74                                    ${CMAKE_CURRENT_SOURCE_DIR}/mc/hostfile_non_termination
75                                    ${CMAKE_CURRENT_SOURCE_DIR}/simple-execute/hostfile_griffon             PARENT_SCOPE)
76 set(txt_files     ${txt_files}     ${CMAKE_CURRENT_SOURCE_DIR}/replay/actions0.txt
77                                    ${CMAKE_CURRENT_SOURCE_DIR}/replay/actions1.txt
78                                    ${CMAKE_CURRENT_SOURCE_DIR}/replay/actions_allreduce.txt
79                                    ${CMAKE_CURRENT_SOURCE_DIR}/replay/actions_allgatherv.txt
80                                    ${CMAKE_CURRENT_SOURCE_DIR}/replay/actions_alltoall.txt
81                                    ${CMAKE_CURRENT_SOURCE_DIR}/replay/actions_alltoallv.txt
82                                    ${CMAKE_CURRENT_SOURCE_DIR}/replay/actions_barrier.txt
83                                    ${CMAKE_CURRENT_SOURCE_DIR}/replay/actions_bcast.txt
84                                    ${CMAKE_CURRENT_SOURCE_DIR}/replay/actions_bcast_reduce_datatypes.txt
85                                    ${CMAKE_CURRENT_SOURCE_DIR}/replay/actions_gather.txt
86                                    ${CMAKE_CURRENT_SOURCE_DIR}/replay/actions_reducescatter.txt
87                                    ${CMAKE_CURRENT_SOURCE_DIR}/replay/actions_waitall.txt
88                                    ${CMAKE_CURRENT_SOURCE_DIR}/replay/actions_with_isend.txt
89                                    ${CMAKE_CURRENT_SOURCE_DIR}/replay/split_traces
90                                    ${CMAKE_CURRENT_SOURCE_DIR}/trace_call_location/adjust                  PARENT_SCOPE)
91
92 if(enable_smpi)
93   # MC is currently broken with threads (deadlock => timeout)
94   if(SIMGRID_HAVE_MC)
95     add_dependencies(tests-mc smpimain)
96     add_dependencies(tests-mc smpi_only_send_deterministic)
97     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)
98     add_dependencies(tests-mc smpi_sendsend)
99     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)
100   endif()
101
102   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)
103   if(enable_debug)
104     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)
105     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)
106   else()
107     message("-- Examples smpi-simple-execute disabled (built without debug).")
108   endif()
109   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)
110   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)
111   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)
112   ADD_TESH(smpi-replay-override-replayer --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-override-replayer.tesh)
113   ADD_TESH(smpi-gemm        --setenv bindir=${CMAKE_BINARY_DIR}/examples/smpi/gemm --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi/gemm --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --cd ${CMAKE_BINARY_DIR}/examples/smpi/gemm ${CMAKE_HOME_DIRECTORY}/examples/smpi/gemm/gemm.tesh)
114   ADD_TESH_FACTORIES(smpi-energy "*" --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)
115
116   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_test/ampi_test.tesh)
117 endif()