Merge pull request #3740 from atgeirr/make-split-comm-test-runtime-optional

Replace DEMONSTRATE_RUN_WITH_NONWORLD_COMM macro with runtime bool.
This commit is contained in:
Markus Blatt
2021-12-20 12:46:49 +01:00
committed by GitHub
3 changed files with 154 additions and 17 deletions

View File

@@ -196,6 +196,48 @@ function(add_test_compare_parallel_restarted_simulation)
PROPERTIES RUN_SERIAL 1)
endfunction()
###########################################################################
# TEST: add_test_split_comm
###########################################################################
# Input:
# - casename: basename (no extension)
#
# Details:
# - This test class compares the output from a parallel simulation
# to that of a parallel simulation running with a custom communicator.
function(add_test_split_comm)
set(oneValueArgs CASENAME FILENAME SIMULATOR ABS_TOL REL_TOL DIR)
set(multiValueArgs TEST_ARGS)
cmake_parse_arguments(PARAM "$" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
if(NOT PARAM_DIR)
set(PARAM_DIR ${PARAM_CASENAME})
endif()
set(RESULT_PATH ${BASE_RESULT_PATH}/parallelSplitComm/${PARAM_SIMULATOR}+${PARAM_CASENAME})
set(DRIVER_ARGS -i ${OPM_TESTS_ROOT}/${PARAM_DIR}
-r ${RESULT_PATH}
-b ${PROJECT_BINARY_DIR}/bin
-f ${PARAM_FILENAME}
-a ${PARAM_ABS_TOL}
-t ${PARAM_REL_TOL}
-c ${COMPARE_ECL_COMMAND})
if(PARAM_MPI_PROCS)
list(APPEND DRIVER_ARGS -n ${PARAM_MPI_PROCS})
endif()
opm_add_test(compareParallelSplitComm_${PARAM_SIMULATOR}+${PARAM_FILENAME} NO_COMPILE
EXE_NAME ${PARAM_SIMULATOR}
DRIVER_ARGS ${DRIVER_ARGS}
TEST_ARGS ${PARAM_TEST_ARGS})
set_tests_properties(compareParallelSplitComm_${PARAM_SIMULATOR}+${PARAM_FILENAME}
PROPERTIES RUN_SERIAL 1)
endfunction()
###########################################################################
if(NOT TARGET test-suite)
add_custom_target(test-suite)
endif()
@@ -1196,6 +1238,15 @@ if(MPI_FOUND)
DIR aquifer-num
TEST_ARGS --enable-tuning=true --tolerance-cnv=0.00003 --time-step-control=pid --linsolver=cpr)
# Single test to verify that we treat custom communicators correctly.
opm_set_test_driver(${PROJECT_SOURCE_DIR}/tests/run-split-comm-test.sh "")
add_test_split_comm(CASENAME spe1
FILENAME SPE1CASE2
SIMULATOR flow
ABS_TOL 0.0
REL_TOL 0.0)
opm_set_test_driver(${PROJECT_SOURCE_DIR}/tests/run-parallel-regressionTest.sh "")
# Different tolerances for these tests