added: parallel serialization restart test for spe1

This commit is contained in:
Arne Morten Kvarving 2023-02-09 14:46:03 +01:00
parent c50fcc5818
commit 55e3c8fe27
3 changed files with 32 additions and 7 deletions

View File

@ -168,12 +168,17 @@ endfunction()
# - This test class compares the output from a restarted parallel simulation
# to that of a non-restarted parallel simulation.
function(add_test_compare_parallel_restarted_simulation)
set(oneValueArgs CASENAME FILENAME SIMULATOR ABS_TOL REL_TOL DIR MPI_PROCS RESTART_STEP)
set(oneValueArgs CASENAME FILENAME SIMULATOR ABS_TOL REL_TOL DIR MPI_PROCS RESTART_STEP TEST_NAME)
set(multiValueArgs TEST_ARGS)
cmake_parse_arguments(PARAM "$" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
if(NOT PARAM_DIR)
set(PARAM_DIR ${PARAM_CASENAME})
endif()
if (PARAM_TEST_NAME)
set(TEST_NAME ${PARAM_TEST_NAME})
else()
set(TEST_NAME compareParallelRestartedSim_${PARAM_SIMULATOR}+${PARAM_FILENAME})
endif()
set(RESULT_PATH ${BASE_RESULT_PATH}/parallelRestart/${PARAM_SIMULATOR}+${PARAM_CASENAME})
set(DRIVER_ARGS -i ${OPM_TESTS_ROOT}/${PARAM_DIR}
-r ${RESULT_PATH}
@ -188,12 +193,11 @@ function(add_test_compare_parallel_restarted_simulation)
list(APPEND DRIVER_ARGS -n ${PARAM_MPI_PROCS})
endif()
opm_add_test(compareParallelRestartedSim_${PARAM_SIMULATOR}+${PARAM_FILENAME} NO_COMPILE
opm_add_test(${TEST_NAME} NO_COMPILE
EXE_NAME ${PARAM_SIMULATOR}
DRIVER_ARGS ${DRIVER_ARGS}
TEST_ARGS ${PARAM_TEST_ARGS})
set_tests_properties(compareParallelRestartedSim_${PARAM_SIMULATOR}+${PARAM_FILENAME}
PROPERTIES RUN_SERIAL 1)
set_tests_properties(${TEST_NAME} PROPERTIES RUN_SERIAL 1)
endfunction()

View File

@ -43,3 +43,18 @@ add_test_compare_parallel_restarted_simulation(CASENAME numerical_aquifer_3d_1aq
RESTART_STEP 3
DIR aquifer-num
TEST_ARGS --enable-tuning=true --tolerance-cnv=0.00003 --time-step-control=pid --linear-solver=cpr_trueimpes)
# Serialized restart tests
if(HDF5_FOUND)
opm_set_test_driver(${PROJECT_SOURCE_DIR}/tests/run-serialization-regressionTest.sh "")
add_test_compare_parallel_restarted_simulation(CASENAME spe1_serialized
DIR spe1
FILENAME SPE1CASE1
SIMULATOR flow
TEST_NAME compareParallelSerializedSim_flow+spe1
ABS_TOL 2e-2
REL_TOL 1e-5
RESTART_STEP 94
TEST_ARGS --tolerance-mb=1e-7
MPI_PROCS 4)
endif()

View File

@ -21,7 +21,8 @@ then
fi
OPTIND=1
while getopts "i:r:b:f:a:t:c:e:d:s:" OPT
MPI_PROCS=1
while getopts "i:r:b:f:a:t:c:e:n:d:s:" OPT
do
case "${OPT}" in
i) INPUT_DATA_PATH=${OPTARG} ;;
@ -34,22 +35,27 @@ do
d) ;;
s) RESTART_STEP=${OPTARG} ;;
e) EXE_NAME=${OPTARG} ;;
n) MPI_PROCS=${OPTARG} ;;
esac
done
shift $(($OPTIND-1))
TEST_ARGS="$@"
BASE_NAME=${FILENAME}
if test $MPI_PROCS -gt 1
then
CMD_PREFIX="mpirun -np $MPI_PROCS "
fi
rm -Rf ${RESULT_PATH}
mkdir -p ${RESULT_PATH}
cd ${RESULT_PATH}
${BINPATH}/${EXE_NAME} ${INPUT_DATA_PATH}/${FILENAME} --output-dir=${RESULT_PATH} ${TEST_ARGS} --save-step=${RESTART_STEP}
${CMD_PREFIX}${BINPATH}/${EXE_NAME} ${INPUT_DATA_PATH}/${FILENAME} --output-dir=${RESULT_PATH} ${TEST_ARGS} --save-step=${RESTART_STEP}
test $? -eq 0 || exit 1
mkdir -p ${RESULT_PATH}/restart
${BINPATH}/${EXE_NAME} ${INPUT_DATA_PATH}/${FILENAME} --output-dir=${RESULT_PATH}/restart ${TEST_ARGS} --load-step=${RESTART_STEP} --save-file=${RESULT_PATH}/${FILENAME}.OPMRST
${CMD_PREFIX}${BINPATH}/${EXE_NAME} ${INPUT_DATA_PATH}/${FILENAME} --output-dir=${RESULT_PATH}/restart ${TEST_ARGS} --load-step=${RESTART_STEP} --save-file=${RESULT_PATH}/${FILENAME}.OPMRST
test $? -eq 0 || exit 1
echo "=== Executing comparison for restart file ==="