2019-05-15 14:07:07 +02:00
|
|
|
#!/bin/bash
|
2018-11-08 13:56:15 +01:00
|
|
|
|
|
|
|
|
# author: Ole Schuett
|
|
|
|
|
|
2021-02-17 17:02:43 +01:00
|
|
|
if (($# != 2)); then
|
|
|
|
|
echo "Usage: test_regtest.sh <ARCH> <VERSION>"
|
|
|
|
|
exit 1
|
2018-11-08 13:56:15 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
ARCH=$1
|
|
|
|
|
VERSION=$2
|
|
|
|
|
|
|
|
|
|
# shellcheck disable=SC1091
|
|
|
|
|
source /opt/cp2k-toolchain/install/setup
|
|
|
|
|
|
2019-06-27 20:14:01 +02:00
|
|
|
# Make OpenMPI happy.
|
2021-02-17 17:02:43 +01:00
|
|
|
if command -v ompi_info &> /dev/null; then
|
2021-10-28 13:47:07 +02:00
|
|
|
TESTOPTS="--mpiexec='mpiexec --bind-to none --allow-run-as-root' ${TESTOPTS}"
|
2021-02-17 17:02:43 +01:00
|
|
|
export OMPI_MCA_plm_rsh_agent=/bin/false
|
2019-06-27 20:14:01 +02:00
|
|
|
fi
|
|
|
|
|
|
2020-11-23 12:14:25 +01:00
|
|
|
# Switch to stable DBCSR version if requested.
|
2021-02-17 17:02:43 +01:00
|
|
|
if [ -n "${USE_STABLE_DBCSR}" ]; then
|
|
|
|
|
echo "Switching to stable DBCSR version..."
|
|
|
|
|
if ! git -C cp2k/exts/dbcsr checkout v2.1.0-rc16; then
|
|
|
|
|
echo -e "\nSummary: Could not checkout stable DBCSR version."
|
|
|
|
|
echo -e "Status: FAILED\n"
|
|
|
|
|
exit 0
|
|
|
|
|
fi
|
|
|
|
|
ln -fs python3 /usr/bin/python # DBCSR v2.1.0-rc16 needs the python binary.
|
2020-11-23 12:14:25 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# Compile cp2k.
|
2020-03-12 00:05:44 +01:00
|
|
|
echo -en "\nCompiling cp2k... "
|
2020-07-10 15:12:23 +02:00
|
|
|
cd /workspace/cp2k || exit 1
|
2021-02-17 17:02:43 +01:00
|
|
|
if make -j ARCH="${ARCH}" VERSION="${VERSION}" &> make.out; then
|
|
|
|
|
echo "done."
|
2020-03-12 00:05:44 +01:00
|
|
|
else
|
2021-02-17 17:02:43 +01:00
|
|
|
echo -e "failed.\n\n"
|
|
|
|
|
tail -n 100 make.out
|
|
|
|
|
echo -e "\nSummary: Compilation failed."
|
|
|
|
|
echo -e "Status: FAILED\n"
|
|
|
|
|
exit 0
|
2020-03-12 00:05:44 +01:00
|
|
|
fi
|
|
|
|
|
|
2020-11-23 12:14:25 +01:00
|
|
|
# Check benchmark files for input errors.
|
2021-02-17 17:02:43 +01:00
|
|
|
if [[ "${ARCH}" == "local" ]]; then
|
|
|
|
|
echo -en "\nChecking benchmarks... "
|
|
|
|
|
if ! ./tools/regtesting/check_inputs.py "./exe/${ARCH}/cp2k.${VERSION}" "./benchmarks/"; then
|
|
|
|
|
echo -e "\nSummary: Some benchmark inputs could not be parsed."
|
|
|
|
|
echo -e "Status: FAILED\n"
|
|
|
|
|
exit 0
|
|
|
|
|
fi
|
2020-03-12 00:05:44 +01:00
|
|
|
fi
|
|
|
|
|
|
2021-05-21 12:20:42 +02:00
|
|
|
# Improve code coverage on COSMA.
|
|
|
|
|
export COSMA_DIM_THRESHOLD=0
|
|
|
|
|
|
2020-11-23 12:14:25 +01:00
|
|
|
# Run regtests.
|
2020-03-12 00:05:44 +01:00
|
|
|
echo -e "\n========== Running Regtests =========="
|
2021-10-27 11:08:03 +02:00
|
|
|
make ARCH="${ARCH}" VERSION="${VERSION}" TESTOPTS="${TESTOPTS}" test
|
2018-11-08 13:56:15 +01:00
|
|
|
|
2019-05-15 14:07:07 +02:00
|
|
|
exit 0 # Prevent CI from overwriting do_regtest's summary message.
|
2020-03-12 00:05:44 +01:00
|
|
|
|
2018-11-08 13:56:15 +01:00
|
|
|
#EOF
|