2016-11-04 08:47:59 -05:00
|
|
|
#!/bin/bash
|
|
|
|
|
2017-02-16 09:00:42 -06:00
|
|
|
# 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.
|
|
|
|
|
2016-11-04 08:47:59 -05:00
|
|
|
INPUT_DATA_PATH="$1"
|
|
|
|
RESULT_PATH="$2"
|
|
|
|
BINPATH="$3"
|
|
|
|
FILENAME="$4"
|
|
|
|
ABS_TOL="$5"
|
|
|
|
REL_TOL="$6"
|
2018-09-07 07:37:34 -05:00
|
|
|
COMPARE_ECL_COMMAND="$7"
|
|
|
|
OPM_PACK_COMMAND="$8"
|
|
|
|
PARALLEL="${9}"
|
|
|
|
EXE_NAME="${10}"
|
|
|
|
shift 10
|
2016-11-04 08:47:59 -05:00
|
|
|
TEST_ARGS="$@"
|
|
|
|
|
2020-03-09 05:19:50 -05:00
|
|
|
BASE_NAME=${FILENAME}_RESTART.DATA
|
2018-08-04 00:56:45 -05:00
|
|
|
|
2016-11-04 08:47:59 -05:00
|
|
|
rm -Rf ${RESULT_PATH}
|
|
|
|
mkdir -p ${RESULT_PATH}
|
|
|
|
cd ${RESULT_PATH}
|
2018-01-04 06:48:43 -06:00
|
|
|
if test $PARALLEL -eq 1
|
|
|
|
then
|
|
|
|
CMD_PREFIX="mpirun -np 4 "
|
|
|
|
else
|
|
|
|
CMD_PREFIX=""
|
|
|
|
fi
|
2020-03-09 05:19:50 -05:00
|
|
|
${CMD_PREFIX} ${BINPATH}/${EXE_NAME} ${INPUT_DATA_PATH}/${FILENAME} --enable-adaptive-time-stepping=false --output-dir=${RESULT_PATH} ${TEST_ARGS}
|
2018-06-21 05:14:17 -05:00
|
|
|
|
2017-02-02 07:58:23 -06:00
|
|
|
test $? -eq 0 || exit 1
|
2018-08-04 00:56:45 -05:00
|
|
|
|
2020-03-09 05:19:50 -05:00
|
|
|
${OPM_PACK_COMMAND} -o ${BASE_NAME} ${INPUT_DATA_PATH}/${FILENAME}_RESTART.DATA
|
2018-06-21 05:14:17 -05:00
|
|
|
|
2020-03-09 05:19:50 -05:00
|
|
|
${CMD_PREFIX} ${BINPATH}/${EXE_NAME} ${BASE_NAME} --enable-adaptive-time-stepping=false --output-dir=${RESULT_PATH} ${TEST_ARGS}
|
2017-02-02 07:58:23 -06:00
|
|
|
test $? -eq 0 || exit 1
|
2016-11-04 08:47:59 -05:00
|
|
|
|
2017-02-02 07:58:23 -06:00
|
|
|
ecode=0
|
2017-03-10 07:44:48 -06:00
|
|
|
echo "=== Executing comparison for summary file ==="
|
2018-09-07 07:37:34 -05:00
|
|
|
${COMPARE_ECL_COMMAND} -R -t SMRY ${RESULT_PATH}/${FILENAME} ${RESULT_PATH}/${FILENAME}_RESTART ${ABS_TOL} ${REL_TOL}
|
2017-02-02 07:58:23 -06:00
|
|
|
if [ $? -ne 0 ]
|
|
|
|
then
|
|
|
|
ecode=1
|
2018-09-07 07:37:34 -05:00
|
|
|
${COMPARE_ECL_COMMAND} -a -R -t SMRY ${RESULT_PATH}/${FILENAME} ${RESULT_PATH}/${FILENAME}_RESTART ${ABS_TOL} ${REL_TOL}
|
2017-02-02 07:58:23 -06:00
|
|
|
fi
|
2016-11-04 08:47:59 -05:00
|
|
|
|
2017-03-10 07:44:48 -06:00
|
|
|
echo "=== Executing comparison for restart file ==="
|
2019-05-09 00:55:05 -05:00
|
|
|
${COMPARE_ECL_COMMAND} -l -t UNRST ${RESULT_PATH}/${FILENAME} ${RESULT_PATH}/${FILENAME}_RESTART ${ABS_TOL} ${REL_TOL}
|
2017-02-16 09:00:42 -06:00
|
|
|
if [ $? -ne 0 ]
|
|
|
|
then
|
|
|
|
ecode=1
|
2019-05-09 00:55:05 -05:00
|
|
|
${COMPARE_ECL_COMMAND} -a -l -t UNRST ${RESULT_PATH}/${FILENAME} ${RESULT_PATH}/${FILENAME}_RESTART ${ABS_TOL} ${REL_TOL}
|
2017-02-16 09:00:42 -06:00
|
|
|
fi
|
2017-02-02 07:58:23 -06:00
|
|
|
|
|
|
|
exit $ecode
|