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.
|
|
|
|
|
2021-10-13 03:47:23 -05:00
|
|
|
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"
|
2021-11-27 05:47:17 -06:00
|
|
|
echo -e "\t\t -d <path> Path to restart deck tool"
|
2021-10-13 03:47:23 -05:00
|
|
|
echo -e "\t\t -e <filename> Simulator binary to use"
|
2021-11-27 05:47:17 -06:00
|
|
|
echo -e "\t\t -s <step> Step to do restart testing from"
|
2021-10-13 03:47:23 -05:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
OPTIND=1
|
2021-11-30 02:41:08 -06:00
|
|
|
while getopts "i:r:b:f:a:t:c:e:d:s:" OPT
|
2021-10-13 03:47:23 -05:00
|
|
|
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} ;;
|
2021-11-27 05:47:17 -06:00
|
|
|
d) RST_DECK_COMMAND=${OPTARG} ;;
|
|
|
|
s) RESTART_STEP=${OPTARG} ;;
|
2021-10-13 03:47:23 -05:00
|
|
|
e) EXE_NAME=${OPTARG} ;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
shift $(($OPTIND-1))
|
2016-11-04 08:47:59 -05:00
|
|
|
TEST_ARGS="$@"
|
|
|
|
|
2021-11-27 05:47:17 -06:00
|
|
|
BASE_NAME=${FILENAME}_RESTART
|
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}
|
2020-06-08 03:27:08 -05:00
|
|
|
${BINPATH}/${EXE_NAME} ${INPUT_DATA_PATH}/${FILENAME} --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
|
|
|
|
2024-07-08 08:55:41 -05:00
|
|
|
${RST_DECK_COMMAND} -m inline -s ${INPUT_DATA_PATH}/${FILENAME}.DATA ${FILENAME}.UNRST:${RESTART_STEP} ${BASE_NAME}.DATA
|
2018-06-21 05:14:17 -05:00
|
|
|
|
2020-06-08 03:27:08 -05:00
|
|
|
${BINPATH}/${EXE_NAME} ${BASE_NAME} --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
|