1 if(enable_smpi AND enable_smpi_MPICH3_testsuite)
3 set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
5 set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
6 set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff")
9 include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi")
10 include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../include/")
12 add_executable(allgather2 allgather2.c)
13 add_executable(allgather3 allgather3.c)
14 add_executable(allgather_struct allgather_struct.c)
15 add_executable(allgatherv2 allgatherv2.c)
16 add_executable(allgatherv3 allgatherv3.c)
17 if(HAVE_PRIVATIZATION)
18 add_executable(allgatherv4 allgatherv4.c)
20 add_executable(allgatherv4 allgatherv4_manual.c)
22 add_executable(allred2 allred2.c)
23 add_executable(allred3 allred3.c)
24 add_executable(allred4 allred4.c)
25 add_executable(allred5 allred5.c)
26 add_executable(allred6 allred6.c)
27 if(HAVE_PRIVATIZATION)
28 add_executable(allred allred.c)
30 add_executable(allred allred_manual.c)
32 add_executable(allredmany allredmany.c)
33 add_executable(alltoall1 alltoall1.c)
34 add_executable(alltoallv0 alltoallv0.c)
35 add_executable(alltoallv alltoallv.c)
36 # add_executable(alltoallw1 alltoallw1.c)
37 # add_executable(alltoallw2 alltoallw2.c)
38 # add_executable(alltoallw_zeros alltoallw_zeros.c)
39 add_executable(bcast_full bcast.c)
40 add_executable(bcast_min_datatypes bcast.c)
41 add_executable(bcast_comm_world bcast.c)
42 add_executable(bcasttest bcasttest.c)
43 add_executable(bcastzerotype bcastzerotype.c)
44 add_executable(coll10 coll10.c)
45 add_executable(coll11 coll11.c)
46 add_executable(coll12 coll12.c)
47 add_executable(coll13 coll13.c)
48 add_executable(coll2 coll2.c)
49 add_executable(coll3 coll3.c)
50 add_executable(coll4 coll4.c)
51 add_executable(coll5 coll5.c)
52 add_executable(coll6 coll6.c)
53 add_executable(coll7 coll7.c)
54 add_executable(coll8 coll8.c)
55 add_executable(coll9 coll9.c)
56 add_executable(exscan2 exscan2.c)
57 add_executable(exscan exscan.c)
58 add_executable(gather2 gather2.c)
59 add_executable(gather_big gather_big.c)
60 add_executable(gather gather.c)
61 # add_executable(iallred iallred.c)
62 # add_executable(ibarrier ibarrier.c)
63 # add_executable(icallgather icallgather.c)
64 # add_executable(icallgatherv icallgatherv.c)
65 # add_executable(icallreduce icallreduce.c)
66 # add_executable(icalltoall icalltoall.c)
67 # add_executable(icalltoallv icalltoallv.c)
68 # add_executable(icalltoallw icalltoallw.c)
69 # add_executable(icbarrier icbarrier.c)
70 # add_executable(icbcast icbcast.c)
71 # add_executable(icgather icgather.c)
72 # add_executable(icgatherv icgatherv.c)
73 # add_executable(icreduce icreduce.c)
74 # add_executable(icscatter icscatter.c)
75 # add_executable(icscatterv icscatterv.c)
76 add_executable(longuser longuser.c)
77 # add_executable(nonblocking2 nonblocking2.c)
78 # add_executable(nonblocking3 nonblocking3.c)
79 # add_executable(nonblocking nonblocking.c)
80 # add_executable(opband opband.c)
81 # add_executable(opbor opbor.c)
82 # add_executable(opbxor opbxor.c)
83 add_executable(op_commutative op_commutative.c)
84 # add_executable(opland opland.c)
85 # add_executable(oplor oplor.c)
86 # add_executable(oplxor oplxor.c)
87 # add_executable(opmax opmax.c)
88 # add_executable(opmaxloc opmaxloc.c)
89 # add_executable(opmin opmin.c)
90 # add_executable(opminloc opminloc.c)
91 # add_executable(opprod opprod.c)
92 # add_executable(opsum opsum.c)
93 add_executable(red3 red3.c)
94 add_executable(red4 red4.c)
95 add_executable(redscat2 redscat2.c)
96 add_executable(redscat3 redscat3.c)
97 add_executable(redscatbkinter redscatbkinter.c)
98 add_executable(redscatblk3 redscatblk3.c)
99 add_executable(red_scat_block2 red_scat_block2.c)
100 add_executable(red_scat_block red_scat_block.c)
101 add_executable(redscat redscat.c)
102 # add_executable(redscatinter redscatinter.c)
103 add_executable(reduce_mpich reduce.c)
104 add_executable(reduce_local reduce_local.c)
105 add_executable(scantst scantst.c)
106 add_executable(scatter2 scatter2.c)
107 add_executable(scatter3 scatter3.c)
108 add_executable(scattern scattern.c)
109 add_executable(scatterv scatterv.c)
110 # add_executable(uoplong uoplong.c)
112 target_link_libraries(allgather2 simgrid mtest_c)
113 target_link_libraries(allgather3 simgrid mtest_c)
114 target_link_libraries(allgather_struct simgrid mtest_c)
115 target_link_libraries(allgatherv2 simgrid mtest_c)
116 target_link_libraries(allgatherv3 simgrid mtest_c)
117 target_link_libraries(allgatherv4 simgrid mtest_c)
118 target_link_libraries(allred2 simgrid mtest_c)
119 target_link_libraries(allred3 simgrid mtest_c)
120 target_link_libraries(allred4 simgrid mtest_c)
121 target_link_libraries(allred5 simgrid mtest_c)
122 target_link_libraries(allred6 simgrid mtest_c)
123 target_link_libraries(allred simgrid mtest_c)
124 target_link_libraries(allredmany simgrid mtest_c)
125 target_link_libraries(alltoall1 simgrid mtest_c)
126 target_link_libraries(alltoallv0 simgrid mtest_c)
127 target_link_libraries(alltoallv simgrid mtest_c)
128 # target_link_libraries(alltoallw1 simgrid mtest_c)
129 # target_link_libraries(alltoallw2 simgrid mtest_c)
130 # target_link_libraries(alltoallw_zeros simgrid mtest_c)
131 target_link_libraries(bcast_full simgrid mtest_c)
132 target_link_libraries(bcast_min_datatypes simgrid mtest_c)
133 target_link_libraries(bcast_comm_world simgrid mtest_c)
134 target_link_libraries(bcasttest simgrid mtest_c)
135 target_link_libraries(bcastzerotype simgrid mtest_c)
136 target_link_libraries(coll10 simgrid mtest_c)
137 target_link_libraries(coll11 simgrid mtest_c)
138 target_link_libraries(coll12 simgrid mtest_c)
139 target_link_libraries(coll13 simgrid mtest_c)
140 target_link_libraries(coll2 simgrid mtest_c)
141 target_link_libraries(coll3 simgrid mtest_c)
142 target_link_libraries(coll4 simgrid mtest_c)
143 target_link_libraries(coll5 simgrid mtest_c)
144 target_link_libraries(coll6 simgrid mtest_c)
145 target_link_libraries(coll7 simgrid mtest_c)
146 target_link_libraries(coll8 simgrid mtest_c)
147 target_link_libraries(coll9 simgrid mtest_c)
148 target_link_libraries(exscan2 simgrid mtest_c)
149 target_link_libraries(exscan simgrid mtest_c)
150 target_link_libraries(gather2 simgrid mtest_c)
151 target_link_libraries(gather_big simgrid mtest_c)
152 target_link_libraries(gather simgrid mtest_c)
153 # target_link_libraries(iallred simgrid mtest_c)
154 # target_link_libraries(ibarrier simgrid mtest_c)
155 # target_link_libraries(icallgather simgrid mtest_c)
156 # target_link_libraries(icallgatherv simgrid mtest_c)
157 # target_link_libraries(icallreduce simgrid mtest_c)
158 # target_link_libraries(icalltoall simgrid mtest_c)
159 # target_link_libraries(icalltoallv simgrid mtest_c)
160 # target_link_libraries(icalltoallw simgrid mtest_c)
161 # target_link_libraries(icbarrier simgrid mtest_c)
162 # target_link_libraries(icbcast simgrid mtest_c)
163 # target_link_libraries(icgather simgrid mtest_c)
164 # target_link_libraries(icgatherv simgrid mtest_c)
165 # target_link_libraries(icreduce simgrid mtest_c)
166 # target_link_libraries(icscatter simgrid mtest_c)
167 # target_link_libraries(icscatterv simgrid mtest_c)
168 target_link_libraries(longuser simgrid mtest_c)
169 # target_link_libraries(nonblocking2 simgrid mtest_c)
170 # target_link_libraries(nonblocking3 simgrid mtest_c)
171 # target_link_libraries(nonblocking simgrid mtest_c)
172 # target_link_libraries(opband simgrid mtest_c)
173 # target_link_libraries(opbor simgrid mtest_c)
174 # target_link_libraries(opbxor simgrid mtest_c)
175 target_link_libraries(op_commutative simgrid mtest_c)
176 # target_link_libraries(opland simgrid mtest_c)
177 # target_link_libraries(oplor simgrid mtest_c)
178 # target_link_libraries(oplxor simgrid mtest_c)
179 # target_link_libraries(opmax simgrid mtest_c)
180 # target_link_libraries(opmaxloc simgrid mtest_c)
181 # target_link_libraries(opmin simgrid mtest_c)
182 # target_link_libraries(opminloc simgrid mtest_c)
183 # target_link_libraries(opprod simgrid mtest_c)
184 # target_link_libraries(opsum simgrid mtest_c)
185 target_link_libraries(red3 simgrid mtest_c)
186 target_link_libraries(red4 simgrid mtest_c)
187 target_link_libraries(redscat2 simgrid mtest_c)
188 target_link_libraries(redscat3 simgrid mtest_c)
189 target_link_libraries(redscatbkinter simgrid mtest_c)
190 target_link_libraries(redscatblk3 simgrid mtest_c)
191 target_link_libraries(red_scat_block2 simgrid mtest_c)
192 target_link_libraries(red_scat_block simgrid mtest_c)
193 target_link_libraries(redscat simgrid mtest_c)
194 # target_link_libraries(redscatinter simgrid mtest_c)
195 target_link_libraries(reduce_mpich simgrid mtest_c)
196 target_link_libraries(reduce_local simgrid mtest_c)
197 target_link_libraries(scantst simgrid mtest_c)
198 target_link_libraries(scatter2 simgrid mtest_c)
199 target_link_libraries(scatter3 simgrid mtest_c)
200 target_link_libraries(scattern simgrid mtest_c)
201 target_link_libraries(scatterv simgrid mtest_c)
202 # target_link_libraries(uoplong simgrid mtest_c)
204 set_target_properties(allred PROPERTIES COMPILE_FLAGS "-O0" LINK_FLAGS "-O0")
205 set_target_properties(bcast_min_datatypes PROPERTIES COMPILE_FLAGS "-DBCAST_MIN_DATATYPES_ONLY" LINK_FLAGS "-DBCAST_MIN_DATATYPES_ONLY")
206 set_target_properties(bcast_comm_world PROPERTIES COMPILE_FLAGS "-DBCAST_COMM_WORLD_ONLY" LINK_FLAGS "-DBCAST_COMM_WORLD_ONLY")
208 # These tests take 5 to 15 seconds to run, so we don't want to run them several times.
209 # But at the same time, we'd like to check if they work for all factories and all privatization algorithm
210 # Thus the current matrix
212 MACRO(ADD_MPICH3_COLL SELECTOR FACTORY PRIVATIZATION)
213 set(NAME "test-smpi-mpich3-coll-${SELECTOR}")
214 set(ARGS "-execarg=--cfg=smpi/coll-selector:${SELECTOR}" ${ARGN})
215 if(NOT "${PRIVATIZATION}" STREQUAL "" AND HAVE_PRIVATIZATION)
216 set(NAME "${NAME}-${PRIVATIZATION}")
217 set(ARGS ${ARGS} "-execarg=--cfg=smpi/privatization:${PRIVATIZATION}")
219 string(TOUPPER "HAVE_${FACTORY}_CONTEXTS" HAVE_FACTORY)
220 if(NOT "${FACTORY}" STREQUAL "" AND ${HAVE_FACTORY})
221 set(NAME "${NAME}-${FACTORY}")
222 set(ARGS ${ARGS} "-execarg=--cfg=contexts/factory:${FACTORY}")
224 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=${TESH_WRAPPER}" -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/coll -tests=testlist ${ARGS})
225 SET_TESTS_PROPERTIES(${NAME} PROPERTIES PASS_REGULAR_EXPRESSION "tests passed!")
228 # Test default selector; default factory; default privatization
229 ADD_MPICH3_COLL(default "" "")
231 # Test OMPI selector: thread factory, dlopen privatization
232 ADD_MPICH3_COLL(ompi "thread" "dlopen" -execarg=--cfg=smpi/bcast:binomial_tree)
234 # Test MPICH selector: boost factory, dlopen privatization
235 ADD_MPICH3_COLL(mpich "boost" "dlopen")
237 # Test MVAPICH2 selector: ucontext factory, mmap privatization
238 ADD_MPICH3_COLL(mvapich2 "ucontext" "mmap")
240 # Test IMPI selector: raw factory, mmap privatization
241 ADD_MPICH3_COLL(impi "raw" "mmap")
245 set(examples_src ${examples_src}
246 ${CMAKE_CURRENT_SOURCE_DIR}/allgather2.c
247 ${CMAKE_CURRENT_SOURCE_DIR}/allgather_struct.c
248 ${CMAKE_CURRENT_SOURCE_DIR}/allgather3.c
249 ${CMAKE_CURRENT_SOURCE_DIR}/allgatherv2.c
250 ${CMAKE_CURRENT_SOURCE_DIR}/allgatherv3.c
251 ${CMAKE_CURRENT_SOURCE_DIR}/allgatherv4.c
252 ${CMAKE_CURRENT_SOURCE_DIR}/allgatherv4_manual.c
253 ${CMAKE_CURRENT_SOURCE_DIR}/allred2.c
254 ${CMAKE_CURRENT_SOURCE_DIR}/allred3.c
255 ${CMAKE_CURRENT_SOURCE_DIR}/allred4.c
256 ${CMAKE_CURRENT_SOURCE_DIR}/allred5.c
257 ${CMAKE_CURRENT_SOURCE_DIR}/allred6.c
258 ${CMAKE_CURRENT_SOURCE_DIR}/allred.c
259 ${CMAKE_CURRENT_SOURCE_DIR}/allred_manual.c
260 ${CMAKE_CURRENT_SOURCE_DIR}/allredmany.c
261 ${CMAKE_CURRENT_SOURCE_DIR}/alltoall1.c
262 ${CMAKE_CURRENT_SOURCE_DIR}/alltoallv0.c
263 ${CMAKE_CURRENT_SOURCE_DIR}/alltoallv.c
264 ${CMAKE_CURRENT_SOURCE_DIR}/alltoallw1.c
265 ${CMAKE_CURRENT_SOURCE_DIR}/alltoallw2.c
266 ${CMAKE_CURRENT_SOURCE_DIR}/alltoallw_zeros.c
267 ${CMAKE_CURRENT_SOURCE_DIR}/bcast.c
268 ${CMAKE_CURRENT_SOURCE_DIR}/bcasttest.c
269 ${CMAKE_CURRENT_SOURCE_DIR}/bcastzerotype.c
270 ${CMAKE_CURRENT_SOURCE_DIR}/coll10.c
271 ${CMAKE_CURRENT_SOURCE_DIR}/coll11.c
272 ${CMAKE_CURRENT_SOURCE_DIR}/coll12.c
273 ${CMAKE_CURRENT_SOURCE_DIR}/coll13.c
274 ${CMAKE_CURRENT_SOURCE_DIR}/coll2.c
275 ${CMAKE_CURRENT_SOURCE_DIR}/coll3.c
276 ${CMAKE_CURRENT_SOURCE_DIR}/coll4.c
277 ${CMAKE_CURRENT_SOURCE_DIR}/coll5.c
278 ${CMAKE_CURRENT_SOURCE_DIR}/coll6.c
279 ${CMAKE_CURRENT_SOURCE_DIR}/coll7.c
280 ${CMAKE_CURRENT_SOURCE_DIR}/coll8.c
281 ${CMAKE_CURRENT_SOURCE_DIR}/coll9.c
282 ${CMAKE_CURRENT_SOURCE_DIR}/exscan2.c
283 ${CMAKE_CURRENT_SOURCE_DIR}/exscan.c
284 ${CMAKE_CURRENT_SOURCE_DIR}/gather2.c
285 ${CMAKE_CURRENT_SOURCE_DIR}/gather_big.c
286 ${CMAKE_CURRENT_SOURCE_DIR}/gather.c
287 ${CMAKE_CURRENT_SOURCE_DIR}/iallred.c
288 ${CMAKE_CURRENT_SOURCE_DIR}/ibarrier.c
289 ${CMAKE_CURRENT_SOURCE_DIR}/icallgather.c
290 ${CMAKE_CURRENT_SOURCE_DIR}/icallgatherv.c
291 ${CMAKE_CURRENT_SOURCE_DIR}/icallreduce.c
292 ${CMAKE_CURRENT_SOURCE_DIR}/icalltoall.c
293 ${CMAKE_CURRENT_SOURCE_DIR}/icalltoallv.c
294 ${CMAKE_CURRENT_SOURCE_DIR}/icalltoallw.c
295 ${CMAKE_CURRENT_SOURCE_DIR}/icbarrier.c
296 ${CMAKE_CURRENT_SOURCE_DIR}/icbcast.c
297 ${CMAKE_CURRENT_SOURCE_DIR}/icgather.c
298 ${CMAKE_CURRENT_SOURCE_DIR}/icgatherv.c
299 ${CMAKE_CURRENT_SOURCE_DIR}/icreduce.c
300 ${CMAKE_CURRENT_SOURCE_DIR}/icscatter.c
301 ${CMAKE_CURRENT_SOURCE_DIR}/icscatterv.c
302 ${CMAKE_CURRENT_SOURCE_DIR}/longuser.c
303 ${CMAKE_CURRENT_SOURCE_DIR}/nonblocking2.c
304 ${CMAKE_CURRENT_SOURCE_DIR}/nonblocking3.c
305 ${CMAKE_CURRENT_SOURCE_DIR}/nonblocking.c
306 ${CMAKE_CURRENT_SOURCE_DIR}/opband.c
307 ${CMAKE_CURRENT_SOURCE_DIR}/opbor.c
308 ${CMAKE_CURRENT_SOURCE_DIR}/opbxor.c
309 ${CMAKE_CURRENT_SOURCE_DIR}/op_commutative.c
310 ${CMAKE_CURRENT_SOURCE_DIR}/opland.c
311 ${CMAKE_CURRENT_SOURCE_DIR}/oplor.c
312 ${CMAKE_CURRENT_SOURCE_DIR}/oplxor.c
313 ${CMAKE_CURRENT_SOURCE_DIR}/opmax.c
314 ${CMAKE_CURRENT_SOURCE_DIR}/opmaxloc.c
315 ${CMAKE_CURRENT_SOURCE_DIR}/opmin.c
316 ${CMAKE_CURRENT_SOURCE_DIR}/opminloc.c
317 ${CMAKE_CURRENT_SOURCE_DIR}/opprod.c
318 ${CMAKE_CURRENT_SOURCE_DIR}/opsum.c
319 ${CMAKE_CURRENT_SOURCE_DIR}/red3.c
320 ${CMAKE_CURRENT_SOURCE_DIR}/red4.c
321 ${CMAKE_CURRENT_SOURCE_DIR}/redscat2.c
322 ${CMAKE_CURRENT_SOURCE_DIR}/redscat3.c
323 ${CMAKE_CURRENT_SOURCE_DIR}/redscatbkinter.c
324 ${CMAKE_CURRENT_SOURCE_DIR}/redscatblk3.c
325 ${CMAKE_CURRENT_SOURCE_DIR}/red_scat_block2.c
326 ${CMAKE_CURRENT_SOURCE_DIR}/red_scat_block.c
327 ${CMAKE_CURRENT_SOURCE_DIR}/redscat.c
328 ${CMAKE_CURRENT_SOURCE_DIR}/redscatinter.c
329 ${CMAKE_CURRENT_SOURCE_DIR}/reduce.c
330 ${CMAKE_CURRENT_SOURCE_DIR}/reduce_local.c
331 ${CMAKE_CURRENT_SOURCE_DIR}/scantst.c
332 ${CMAKE_CURRENT_SOURCE_DIR}/scatter2.c
333 ${CMAKE_CURRENT_SOURCE_DIR}/scatter3.c
334 ${CMAKE_CURRENT_SOURCE_DIR}/scattern.c
335 ${CMAKE_CURRENT_SOURCE_DIR}/scatterv.c
336 ${CMAKE_CURRENT_SOURCE_DIR}/uoplong.c
338 set(txt_files ${txt_files} ${CMAKE_CURRENT_SOURCE_DIR}/testlist PARENT_SCOPE)