@@ -6,13 +6,15 @@ function(mpi_test names use_runner)
6
6
7
7
foreach (name IN LISTS names )
8
8
9
- add_executable (test_${name} test_${name}.f90 )
10
- target_link_libraries (test_${name} PRIVATE h5fortran::h5fortran )
9
+ set (tname "${name} _mpi" )
10
+
11
+ add_executable (test_${tname} test_${name}.f90 )
12
+ target_link_libraries (test_${tname} PRIVATE h5fortran::h5fortran )
11
13
12
14
if (use_runner )
13
- set (cmd test_runner -exe $< TARGET_FILE:test_${name } > -mpiexec ${MPIEXEC_EXECUTABLE} -lx 1000 )
15
+ set (cmd test_runner -exe $< TARGET_FILE:test_${tname } > -mpiexec ${MPIEXEC_EXECUTABLE} -lx 1000 )
14
16
else ()
15
- set (cmd ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} $< TARGET_FILE:test_${name } > )
17
+ set (cmd ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} $< TARGET_FILE:test_${tname } > )
16
18
# these tests could also be -n 2 instead of max_numprocs.
17
19
# Just trying to keep aware of possible problems vs. MPI worker count.
18
20
endif ()
@@ -21,15 +23,10 @@ if(${name} STREQUAL "string_read")
21
23
list (APPEND cmd ${string_file} )
22
24
endif ()
23
25
24
- add_test (NAME ${name } COMMAND ${cmd} )
26
+ add_test (NAME ${tname } COMMAND ${cmd} )
25
27
26
28
endforeach ()
27
29
28
- set_tests_properties (${names} PROPERTIES
29
- RESOURCE_LOCK cpu_mpi
30
- LABELS mpi
31
- )
32
-
33
30
endfunction (mpi_test )
34
31
35
32
# --- test files
@@ -51,24 +48,24 @@ endif()
51
48
52
49
# --- MPI tests
53
50
54
- set (mpi_tests array_mpi attributes_mpi cast_mpi destructor_mpi exist_mpi
55
- fill_mpi groups_mpi layout shape
51
+ set (mpi_tests array attributes cast destructor exist
52
+ fill groups layout shape
56
53
string string_read write
57
54
)
58
55
59
56
mpi_test ("${mpi_tests} " false )
60
57
61
- set (runner_tests deflate_write_mpi deflate_props_mpi deflate_read_mpi )
58
+ set (runner_tests deflate_write deflate_props deflate_read )
62
59
63
60
mpi_test ("${runner_tests} " true )
64
61
65
62
# --- test dependencies
66
63
67
- set_tests_properties (write PROPERTIES
64
+ set_tests_properties (write_mpi PROPERTIES
68
65
FIXTURES_SETUP test_files
69
66
)
70
67
71
- set_tests_properties (layout shape PROPERTIES
68
+ set_tests_properties (layout_mpi shape_mpi PROPERTIES
72
69
FIXTURES_REQUIRED test_files
73
70
REQUIRED_FILES "${CMAKE_CURRENT_BINARY_DIR} /test_write.h5;${CMAKE_CURRENT_BINARY_DIR} /test_layout.h5"
74
71
)
@@ -89,30 +86,17 @@ EXECUTABLE ${CMAKE_CTEST_COMMAND}
89
86
)
90
87
endif ()
91
88
92
- # --- Python h5py
93
- find_package (Python COMPONENTS Interpreter )
94
- if (NOT DEFINED h5py_ok )
95
- execute_process (COMMAND ${Python_EXECUTABLE} -c "import h5py"
96
- RESULT_VARIABLE h5py_code
97
- )
98
- if (h5py_code EQUAL 0 )
99
- set (h5py_ok true CACHE BOOL "h5py OK" )
100
- else ()
101
- set (h5py_ok false CACHE BOOL "h5py not OK" )
102
- endif ()
103
- endif ()
104
-
105
- set_tests_properties (string_read PROPERTIES
106
- FIXTURES_REQUIRED h5str
89
+ set_tests_properties (string_read_mpi PROPERTIES
90
+ FIXTURES_REQUIRED h5str_mpi
107
91
DISABLED $< NOT:$< BOOL:${h5py_ok} > >
108
92
)
109
93
110
- add_test (NAME PythonString
94
+ add_test (NAME PythonString_mpi
111
95
COMMAND ${Python_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR} /test_string.py ${string_file}
112
96
)
113
97
114
- set_tests_properties (PythonString PROPERTIES
115
- FIXTURES_SETUP h5str
98
+ set_tests_properties (PythonString_mpi PROPERTIES
99
+ FIXTURES_SETUP h5str_mpi
116
100
DISABLED $< NOT:$< BOOL:${h5py_ok} > >
117
101
)
118
102
@@ -123,6 +107,7 @@ get_property(test_names DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY TESTS)
123
107
set_tests_properties (${test_names} PROPERTIES
124
108
TIMEOUT 30
125
109
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
110
+ RESOURCE_LOCK cpu_mpi
126
111
)
127
112
128
113
# --- Windows shared DLLs
0 commit comments