2016-11-23 03:59:48 -06:00
|
|
|
#!/bin/bash
|
|
|
|
|
2017-02-16 09:00:42 -06:00
|
|
|
# This performs a serial and a parallel for a simulator,
|
|
|
|
# then compares the summary and restart files from the two runs.
|
|
|
|
# Meant to track regression in parallel simulators.
|
|
|
|
|
2016-11-23 03:59:48 -06: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"
|
|
|
|
EXE_NAME="${8}"
|
|
|
|
shift 8
|
2016-11-23 03:59:48 -06:00
|
|
|
TEST_ARGS="$@"
|
|
|
|
|
|
|
|
rm -Rf ${RESULT_PATH}
|
|
|
|
mkdir -p ${RESULT_PATH}
|
|
|
|
cd ${RESULT_PATH}
|
2018-11-14 07:51:39 -06:00
|
|
|
${BINPATH}/${EXE_NAME} ${TEST_ARGS}.DATA --enable-opm-rst-file=true --linear-solver-reduction=1e-7 --tolerance-cnv=5e-6 --tolerance-mb=1e-8 --output-dir=${RESULT_PATH}
|
2018-06-21 05:14:17 -05:00
|
|
|
|
2017-02-02 07:58:23 -06:00
|
|
|
test $? -eq 0 || exit 1
|
2016-11-23 03:59:48 -06:00
|
|
|
mkdir mpi
|
|
|
|
cd mpi
|
2018-11-14 07:51:39 -06:00
|
|
|
mpirun -np 4 ${BINPATH}/${EXE_NAME} ${TEST_ARGS}.DATA --enable-opm-rst-file=true --linear-solver-reduction=1e-7 --tolerance-cnv=5e-6 --tolerance-mb=1e-8 --output-dir=${RESULT_PATH}/mpi
|
2017-02-02 07:58:23 -06:00
|
|
|
test $? -eq 0 || exit 1
|
2016-11-23 03:59:48 -06:00
|
|
|
cd ..
|
|
|
|
|
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} -t SMRY -R ${RESULT_PATH}/${FILENAME} ${RESULT_PATH}/mpi/${FILENAME} ${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} -t SMRY -a -R ${RESULT_PATH}/${FILENAME} ${RESULT_PATH}/mpi/${FILENAME} ${ABS_TOL} ${REL_TOL}
|
2017-02-02 07:58:23 -06:00
|
|
|
fi
|
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}/mpi/${FILENAME} ${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}/mpi/${FILENAME} ${ABS_TOL} ${REL_TOL}
|
2017-02-16 09:00:42 -06:00
|
|
|
fi
|
2017-02-02 07:58:23 -06:00
|
|
|
|
|
|
|
exit $ecode
|