-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathCMakeLists.txt
185 lines (159 loc) · 8.49 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
#=========================================================================================
# (C) (or copyright) 2020-2024. Triad National Security, LLC. All rights reserved.
#
# This program was produced under U.S. Government contract 89233218CNA000001 for Los
# Alamos National Laboratory (LANL), which is operated by Triad National Security, LLC
# for the U.S. Department of Energy/National Nuclear Security Administration. All rights
# in the program are reserved by Triad National Security, LLC, and the U.S. Department
# of Energy/National Nuclear Security Administration. The Government is granted for
# itself and others acting on its behalf a nonexclusive, paid-up, irrevocable worldwide
# license in this material to reproduce, prepare derivative works, distribute copies to
# the public, perform publicly and display publicly, and to permit others to do so.
#=========================================================================================
# Adding regression tests
#
# To add additional regression tests to ctest, four things must be added to
# this file:
#
# 1. there must exist within the regression/test_suites directory a folder associated with the test
# * For the calculate_pi example the folder is called 'calculate_pi', This
# folder must be added to the cmake variable TEST_DIRS as shown below.
#
# 2. the correct arguments to pass to the 'run_test.py' script must be specified
# * This arguments must be added to the CMAKE variable TEST_ARGS as shown below
#
# 3. the number of mpi processors that should be used when testing the mpi implementation
# * This argument needs to be added to the TEST_PROCS variable
#
# 4. any extra labels that need to be appended to a test
#
# NOTE: each new test must append exactly 1 item to each of the CMAKE variables
#
# Add additional regression tests to ctest below this line by calling
#
# list(APPEND TEST_DIRS name_of_folder )
# list(APPEND TEST_PROCS ${NUM_MPI_PROC_TESTING})
# list(APPEND TEST_ARGS args_to_pass_to_run_test.py )
# list(APPEND EXTRA_TEST_LABELS "my-awesome-test")
#
# Here name_of_folder should be the test folder located in parthenon/tst/regression/test_suites
# it is the parameter that is passed to run_test.py with the --test_dir argument
# Performance regression test
list(APPEND TEST_DIRS advection_performance)
list(APPEND TEST_PROCS ${NUM_MPI_PROC_TESTING})
list(APPEND TEST_ARGS "--driver ${PROJECT_BINARY_DIR}/example/advection/advection-example \
--driver_input ${CMAKE_CURRENT_SOURCE_DIR}/test_suites/advection_performance/parthinput.advection_performance \
--num_steps 4")
list(APPEND EXTRA_TEST_LABELS "perf-reg")
list(APPEND TEST_DIRS particle_leapfrog)
list(APPEND TEST_PROCS ${NUM_MPI_PROC_TESTING})
list(APPEND TEST_ARGS "--driver ${PROJECT_BINARY_DIR}/example/particle_leapfrog/particle-leapfrog \
--driver_input ${CMAKE_CURRENT_SOURCE_DIR}/test_suites/particle_leapfrog/parthinput.particle_leapfrog \
--num_steps 2")
list(APPEND EXTRA_TEST_LABELS "")
list(APPEND TEST_DIRS particle_leapfrog_outflow)
list(APPEND TEST_PROCS ${NUM_MPI_PROC_TESTING})
list(APPEND TEST_ARGS "--driver ${PROJECT_BINARY_DIR}/example/particle_leapfrog/particle-leapfrog \
--driver_input ${CMAKE_CURRENT_SOURCE_DIR}/test_suites/particle_leapfrog_outflow/parthinput.particle_leapfrog_outflow \
--num_steps 1")
list(APPEND EXTRA_TEST_LABELS "")
if (ENABLE_HDF5)
# h5py is needed for restart and hdf5 test
list(APPEND REQUIRED_PYTHON_MODULES h5py)
# Restart
list(APPEND TEST_DIRS restart)
list(APPEND TEST_PROCS ${NUM_MPI_PROC_TESTING})
list(APPEND TEST_ARGS "--driver ${PROJECT_BINARY_DIR}/example/sparse_advection/sparse_advection-example \
--driver_input ${CMAKE_CURRENT_SOURCE_DIR}/test_suites/restart/parthinput.restart \
--num_steps 4")
list(APPEND EXTRA_TEST_LABELS "")
# Restart fine
list(APPEND TEST_DIRS restart_fine)
list(APPEND TEST_PROCS ${NUM_MPI_PROC_TESTING})
list(APPEND TEST_ARGS "--driver ${PROJECT_BINARY_DIR}/example/fine_advection/fine_advection-example \
--driver_input ${CMAKE_CURRENT_SOURCE_DIR}/test_suites/restart_fine/parthinput.restart_fine \
--num_steps 2")
list(APPEND EXTRA_TEST_LABELS "")
# Calculate pi example
list(APPEND TEST_DIRS calculate_pi)
list(APPEND TEST_PROCS ${NUM_MPI_PROC_TESTING})
list(APPEND TEST_ARGS "--driver ${PROJECT_BINARY_DIR}/example/calculate_pi/pi-example \
--driver_input ${CMAKE_CURRENT_SOURCE_DIR}/test_suites/calculate_pi/parthinput.regression")
list(APPEND EXTRA_TEST_LABELS "")
# Boundary exchange example
list(APPEND TEST_DIRS boundary_exchange)
list(APPEND TEST_PROCS ${NUM_MPI_PROC_TESTING})
list(APPEND TEST_ARGS "--driver ${PROJECT_BINARY_DIR}/example/boundary_exchange/boundary-exchange-example \
--driver_input ${CMAKE_CURRENT_SOURCE_DIR}/test_suites/boundary_exchange/parthinput.boundary_exchange")
list(APPEND EXTRA_TEST_LABELS "")
# Advection test
list(APPEND TEST_DIRS advection_convergence)
list(APPEND TEST_PROCS ${NUM_MPI_PROC_TESTING})
list(APPEND TEST_ARGS "--driver ${PROJECT_BINARY_DIR}/example/advection/advection-example \
--driver_input ${CMAKE_CURRENT_SOURCE_DIR}/test_suites/advection_convergence/parthinput.advection \
--num_steps 25")
list(APPEND EXTRA_TEST_LABELS "")
list(APPEND TEST_DIRS output_hdf5)
list(APPEND TEST_PROCS ${NUM_MPI_PROC_TESTING})
list(APPEND TEST_ARGS "--driver ${PROJECT_BINARY_DIR}/example/advection/advection-example \
--driver_input ${CMAKE_CURRENT_SOURCE_DIR}/test_suites/output_hdf5/parthinput.advection \
--num_steps 4")
list(APPEND EXTRA_TEST_LABELS "")
list(APPEND TEST_DIRS advection_outflow)
list(APPEND TEST_PROCS ${NUM_MPI_PROC_TESTING})
list(APPEND TEST_ARGS "--driver ${PROJECT_BINARY_DIR}/example/advection/advection-example \
--driver_input ${CMAKE_CURRENT_SOURCE_DIR}/test_suites/advection_outflow/parthinput.advection_outflow")
list(APPEND EXTRA_TEST_LABELS "")
list(APPEND TEST_DIRS bvals)
list(APPEND TEST_PROCS ${NUM_MPI_PROC_TESTING})
list(APPEND TEST_ARGS "--driver ${PROJECT_BINARY_DIR}/example/advection/advection-example \
--driver_input ${CMAKE_CURRENT_SOURCE_DIR}/test_suites/bvals/parthinput.advection_bvals \
--num_steps 3")
list(APPEND EXTRA_TEST_LABELS "")
list(APPEND TEST_DIRS poisson)
list(APPEND TEST_PROCS ${NUM_MPI_PROC_TESTING})
list(APPEND TEST_ARGS "--driver ${PROJECT_BINARY_DIR}/example/poisson/poisson-example \
--driver_input ${CMAKE_CURRENT_SOURCE_DIR}/test_suites/poisson/parthinput.poisson")
list(APPEND EXTRA_TEST_LABELS "poisson")
list(APPEND TEST_DIRS poisson_gmg)
list(APPEND TEST_PROCS ${NUM_MPI_PROC_TESTING})
list(APPEND TEST_ARGS "--driver ${PROJECT_BINARY_DIR}/example/poisson_gmg/poisson-gmg-example \
--driver_input ${CMAKE_CURRENT_SOURCE_DIR}/test_suites/poisson_gmg/parthinput.poisson")
list(APPEND EXTRA_TEST_LABELS "poisson_gmg")
list(APPEND TEST_DIRS sparse_advection)
list(APPEND TEST_PROCS ${NUM_MPI_PROC_TESTING})
list(APPEND TEST_ARGS "--driver ${PROJECT_BINARY_DIR}/example/sparse_advection/sparse_advection-example \
--driver_input ${CMAKE_CURRENT_SOURCE_DIR}/test_suites/sparse_advection/parthinput.sparse_advection \
--num_steps 3")
list(APPEND EXTRA_TEST_LABELS "")
list(APPEND TEST_DIRS particle_tracers)
list(APPEND TEST_PROCS ${NUM_MPI_PROC_TESTING})
list(APPEND TEST_ARGS "--driver ${PROJECT_BINARY_DIR}/example/particle_tracers/particle-tracers \
--driver_input ${CMAKE_CURRENT_SOURCE_DIR}/test_suites/particle_tracers/parthinput.particle_tracers")
list(APPEND EXTRA_TEST_LABELS "")
endif()
# Any external modules that are required by python can be added to REQUIRED_PYTHON_MODULES
# list variable, before including TestSetup.cmake.
list(APPEND REQUIRED_PYTHON_MODULES numpy)
list(APPEND DESIRED_PYTHON_MODULES matplotlib)
# Include test setup functions, and check for python interpreter and modules
# setup_test_serial
# setup_test_coverage
# setup_test_parallel
# setup_test_mpi_coverage
include(${PROJECT_SOURCE_DIR}/cmake/TestSetup.cmake)
list(LENGTH TEST_DIRS len)
math(EXPR end_index "${len} - 1")
foreach( index RANGE ${end_index})
list(GET TEST_DIRS ${index} TEST_DIR)
list(GET TEST_PROCS ${index} TEST_PROC)
list(GET TEST_ARGS ${index} TEST_ARG)
list(GET EXTRA_TEST_LABELS ${index} TEST_LABELS )
if (PARTHENON_DISABLE_SPARSE)
string(APPEND TEST_ARG " --sparse_disabled")
endif()
setup_test_serial(${TEST_DIR} ${TEST_ARG} "${TEST_LABELS}")
setup_test_coverage(${TEST_DIR} ${TEST_ARG} "${TEST_LABELS}")
setup_test_parallel(${TEST_PROC} ${TEST_DIR} ${TEST_ARG} "${TEST_LABELS}")
setup_test_mpi_coverage(${TEST_PROC} ${TEST_DIR} ${TEST_ARG} "${TEST_LABELS}")
endforeach()