diff --git a/.azure-pipelines.yml b/.azure-pipelines.yml index 337974119b0..1f963097f37 100644 --- a/.azure-pipelines.yml +++ b/.azure-pipelines.yml @@ -147,7 +147,11 @@ jobs: df -h # configure export AMReX_CMAKE_FLAGS="-DAMReX_ASSERTIONS=ON -DAMReX_TESTING=ON" - cmake -S . -B build ${AMReX_CMAKE_FLAGS} ${WARPX_CMAKE_FLAGS} -DWarpX_TEST_CLEANUP=ON + cmake -S . -B build \ + ${AMReX_CMAKE_FLAGS} \ + ${WARPX_CMAKE_FLAGS} \ + -DWarpX_TEST_CLEANUP=ON \ + -DWarpX_TEST_FPETRAP=ON # build cmake --build build -j 2 # run tests (exclude pytest.AMReX when running Python tests) diff --git a/CMakeLists.txt b/CMakeLists.txt index 905c93494a4..8d5cc60b46f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -93,6 +93,10 @@ option(WarpX_QED_TOOLS "Build external tool to generate QED lookup tables (r option(WarpX_TEST_CLEANUP "Clean up CI test directories" OFF) mark_as_advanced(WarpX_TEST_CLEANUP) +# Advanced option to run CI tests with FPE-trapping runtime parameters +option(WarpX_TEST_FPETRAP "Run CI tests with FPE-trapping runtime parameters" OFF) +mark_as_advanced(WarpX_TEST_FPETRAP) + set(WarpX_DIMS_VALUES 1 2 3 RZ) set(WarpX_DIMS 3 CACHE STRING "Simulation dimensionality <1;2;3;RZ>") list(REMOVE_DUPLICATES WarpX_DIMS) diff --git a/Examples/CMakeLists.txt b/Examples/CMakeLists.txt index 75494a6e97e..4e366febc06 100644 --- a/Examples/CMakeLists.txt +++ b/Examples/CMakeLists.txt @@ -117,7 +117,7 @@ function(add_warpx_test ) # set Python executable - set(THIS_Python_EXE) + set(THIS_Python_EXE) # FIXME unsetting a variable can expose a cache variable that was previously hidden if(python) set(THIS_Python_EXE ${Python_EXECUTABLE}) endif() @@ -138,18 +138,24 @@ function(add_warpx_test # FIXME Use helper function to handle Windows exceptions set_property(TEST ${name}.run APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${PYTHONPATH}:${CMAKE_PYTHON_OUTPUT_DIRECTORY}") else() + # TODO Use these for Python tests too set(runtime_params "amrex.abort_on_unused_inputs = 1" - "amrex.fpe_trap_invalid = 1" - "amrex.fpe_trap_overflow = 1" - "amrex.fpe_trap_zero = 1" "amrex.throw_exception = 1" "warpx.always_warn_immediately = 1" - # FIXME should come before input file - #"warpx.abort_on_warning_threshold = low" "warpx.do_dynamic_scheduling = 0" "warpx.serialize_initial_conditions = 1" + # FIXME should go before input file + #"warpx.abort_on_warning_threshold = low" ) + set(runtime_params_fpetrap "") + if(WarpX_TEST_FPETRAP) + set(runtime_params_fpetrap + "amrex.fpe_trap_invalid = 1" + "amrex.fpe_trap_overflow = 1" + "amrex.fpe_trap_zero = 1" + ) + endif() add_test( NAME ${name}.run COMMAND @@ -157,6 +163,7 @@ function(add_warpx_test $ ${INPUTS_FILE} ${runtime_params} + ${runtime_params_fpetrap} ${INPUTS_ARGS} WORKING_DIRECTORY ${THIS_WORKING_DIR} ) @@ -165,7 +172,7 @@ function(add_warpx_test # run all tests with 1 OpenMP thread by default set_property(TEST ${name}.run APPEND PROPERTY ENVIRONMENT "OMP_NUM_THREADS=1") - set(THIS_Python_SCRIPT_EXE) + set(THIS_Python_SCRIPT_EXE) # FIXME unsetting a variable can expose a cache variable that was previously hidden if(python OR WIN32) set(THIS_Python_SCRIPT_EXE ${Python_EXECUTABLE}) endif()