cp2k/tools/docker/scripts/test_regtest.sh

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

66 lines
1.7 KiB
Bash
Raw Permalink Normal View History

#!/bin/bash
2018-11-08 13:56:15 +01:00
# author: Ole Schuett
2021-02-17 17:02:43 +01:00
if (($# != 2)); then
2025-12-27 16:33:41 +01:00
echo "Usage: test_regtest.sh <PROFILE> <VERSION>"
2021-02-17 17:02:43 +01:00
exit 1
2018-11-08 13:56:15 +01:00
fi
2025-12-27 16:33:41 +01:00
PROFILE=$1
2018-11-08 13:56:15 +01:00
VERSION=$2
ulimit -c 0 # Disable core dumps as they can take a very long time to write.
2022-04-29 10:53:57 +02:00
# Check available shared memory - needed for MPI inter-process communication.
SHM_AVAIL=$(df --output=avail -m /dev/shm | tail -1)
if ((SHM_AVAIL < 1024)); then
echo "ERROR: Not enough shared memory. If you're running docker use --shm-size=1g."
exit 1
fi
# Load Spack or Toolchain environment.
if [[ "${PROFILE}" =~ ^spack ]]; then
eval "$(spack env activate myenv --sh)"
elif [[ "${PROFILE}" =~ ^toolchain ]]; then
# shellcheck disable=SC1091
source /opt/cp2k-toolchain/install/setup
fi
2025-12-27 16:33:41 +01:00
# Extend stack size only for Intel compilers.
if "./build/bin/cp2k.${VERSION}" --version | grep -q "compiler: Intel"; then
ulimit -s unlimited # breaks address sanitizer
export OMP_STACKSIZE=64m
fi
# Improve code coverage on COSMA.
export COSMA_DIM_THRESHOLD=0
2018-11-08 13:56:15 +01:00
2019-06-27 20:14:01 +02:00
# Make OpenMPI happy.
export OMPI_MCA_plm_rsh_agent=/bin/false
export OMPI_ALLOW_RUN_AS_ROOT=1
export OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1
export OMPI_MCA_mpi_yield_when_idle=1
export OMPI_MCA_btl=self,sm
export OMPI_MCA_pml=ob1
2019-06-27 20:14:01 +02:00
# Use keepalive mode for GPU tests.
if [[ "${PROFILE}" == *cuda* ]] || [[ "${PROFILE}" == *hip* ]]; then
TESTOPTS="--keepalive ${TESTOPTS}"
fi
# Flag slow tests in debug runs.
if [[ "${PROFILE}" == "toolchain" ]] && [[ "${VERSION}" == *dbg* ]]; then
TESTOPTS="--flagslow ${TESTOPTS}"
fi
# Run regtests.
2020-03-12 00:05:44 +01:00
echo -e "\n========== Running Regtests =========="
2025-12-27 16:33:41 +01:00
set -x
# shellcheck disable=SC2086
./tests/do_regtest.py ./build/bin/ ${VERSION} ${TESTOPTS}
2018-11-08 13:56:15 +01: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