File: test_regtest_cmake.sh

package info (click to toggle)
cp2k 2025.2-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 372,052 kB
  • sloc: fortran: 963,262; ansic: 64,495; f90: 21,676; python: 14,419; sh: 11,382; xml: 2,173; makefile: 953; pascal: 845; perl: 492; cpp: 345; lisp: 297; csh: 16
file content (59 lines) | stat: -rwxr-xr-x 1,534 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/bash

# author: Ole Schuett

if (($# != 2)); then
  echo "Usage: test_regtest_cmake.sh <PROFILE> <VERSION>"
  exit 1
fi

PROFILE=$1
VERSION=$2

ulimit -c 0 # Disable core dumps as they can take a very long time to write.

# 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

# Compile CP2K.
./build_cp2k_cmake.sh "${PROFILE}" "${VERSION}" || exit 0

# Fake installation of data files.
mkdir -p ./share/cp2k
ln -s ../../data ./share/cp2k/data

# 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

# 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

# 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

# Run regtests.
echo -e "\n========== Running Regtests =========="
set -x
# shellcheck disable=SC2086
./tests/do_regtest.py ./build/bin/ ${VERSION} ${TESTOPTS}

exit 0 # Prevent CI from overwriting do_regtest's summary message.

#EOF