added: serialization restart test for spe1

This commit is contained in:
Arne Morten Kvarving 2023-02-09 14:46:03 +01:00
parent a60b7e50ca
commit eb00299373
2 changed files with 77 additions and 0 deletions

View File

@ -84,3 +84,17 @@ add_test_compare_restarted_simulation(CASENAME spe1
REL_TOL ${rel_tol_restart}
RESTART_STEP 6
TEST_ARGS --sched-restart=false)
# Serialized restart tests
if(HDF5_FOUND)
opm_set_test_driver(${PROJECT_SOURCE_DIR}/tests/run-serialization-regressionTest.sh "")
add_test_compare_restarted_simulation(CASENAME spe1_serialized
DIR spe1
FILENAME SPE1CASE1
SIMULATOR flow
TEST_NAME compareSerializedSim_flow+spe1
ABS_TOL 2e-2
REL_TOL 1e-5
RESTART_STEP 94
TEST_ARGS --tolerance-mb=1e-7)
endif()

View File

@ -0,0 +1,63 @@
#!/bin/bash
# This runs a simulator from start to end, then a restarted
# run of the simulator, before comparing the output from the two runs.
# This is meant to track regressions in the restart support.
if test $# -eq 0
then
echo -e "Usage:\t$0 <options> -- [additional simulator options]"
echo -e "\tMandatory options:"
echo -e "\t\t -i <path> Path to read deck from"
echo -e "\t\t -r <path> Path to store results in"
echo -e "\t\t -b <path> Path to simulator binary"
echo -e "\t\t -f <filename> Deck file name"
echo -e "\t\t -a <tol> Absolute tolerance in comparison"
echo -e "\t\t -t <tol> Relative tolerance in comparison"
echo -e "\t\t -c <path> Path to comparison tool"
echo -e "\t\t -e <filename> Simulator binary to use"
echo -e "\t\t -s <step> Step to do restart testing from"
exit 1
fi
OPTIND=1
while getopts "i:r:b:f:a:t:c:e:d:s:" OPT
do
case "${OPT}" in
i) INPUT_DATA_PATH=${OPTARG} ;;
r) RESULT_PATH=${OPTARG} ;;
b) BINPATH=${OPTARG} ;;
f) FILENAME=${OPTARG} ;;
a) ABS_TOL=${OPTARG} ;;
t) REL_TOL=${OPTARG} ;;
c) COMPARE_ECL_COMMAND=${OPTARG} ;;
d) ;;
s) RESTART_STEP=${OPTARG} ;;
e) EXE_NAME=${OPTARG} ;;
esac
done
shift $(($OPTIND-1))
TEST_ARGS="$@"
BASE_NAME=${FILENAME}
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}
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
test $? -eq 0 || exit 1
echo "=== Executing comparison for restart file ==="
${COMPARE_ECL_COMMAND} -l -t UNRST ${RESULT_PATH}/${FILENAME} ${RESULT_PATH}/restart/${FILENAME} ${ABS_TOL} ${REL_TOL}
if [ $? -ne 0 ]
then
ecode=1
${COMPARE_ECL_COMMAND} -a -l -t UNRST ${RESULT_PATH}/${FILENAME} ${RESULT_PATH}/restart/${FILENAME} ${ABS_TOL} ${REL_TOL}
fi
exit $ecode