dev:regtesting
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
dev:regtesting [2020/04/06 17:59] – make can also use options listed in do_regtest xinwu | dev:regtesting [2023/10/19 13:57] – Update flags krack | ||
---|---|---|---|
Line 11: | Line 11: | ||
===== How does it work? ===== | ===== How does it work? ===== | ||
- | The regression test suite is run using the [[src>tools/ | + | The regression test suite is run using the [[src>tests/do_regtest.py | do_regtest]] script. |
It performs the following tasks: | It performs the following tasks: | ||
* performs a realclean build of the source | * performs a realclean build of the source | ||
Line 34: | Line 34: | ||
==== Step 2: Running ==== | ==== Step 2: Running ==== | ||
< | < | ||
- | $ tools/ | + | $ tests/do_regtest.py -h |
- | Usage: do_regtest [OPTION] | + | usage: do_regtest.py [-h] [--mpiranks MPIRANKS] [--ompthreads OMPTHREADS] [--maxtasks MAXTASKS] [--num_gpus NUM_GPUS] [--timeout TIMEOUT] [--maxerrors MAXERRORS] [--mpiexec MPIEXEC] |
- | Run the CP2K regression test suite | + | [--smoketest] [--valgrind] [--keepalive] [--flagslow] [--debug] [--restrictdir RESTRICTDIR] [--skipdir SKIPDIR] [--workbasedir WORKBASEDIR] |
- | Example: do_regtest | + | arch version |
- | General: | + | Runs CP2K regression test suite. |
- | -h, -help, --help | + | |
- | -c, -config FILE read any of the following configuration switches from FILE. | + | |
- | -cp2kdir PATH | + | |
- | -dirout PATH root path of output folder (default: current working directory). | + | |
- | -mpiexec EXE name of the executable to run mpi-ranks. Default: mpiexec. | + | |
- | Build: | + | positional arguments: |
- | | + | arch |
- | -arch ARCH ARCH passed to make. Default: Linux-x86-64-gfortran. | + | |
- | | + | |
- | -nobuild | + | |
- | Runtime: | + | options: |
- | -mpiranks NRANKS | + | -h, --help show this help message and exit |
- | -ompthreads NTHREADS | + | --mpiranks MPIRANKS |
- | -maxtasks NPROCS | + | --ompthreads OMPTHREADS |
- | -maxbuildtasks NPROCS | + | --maxtasks |
- | -jobmaxtime SECONDS | + | --num_gpus NUM_GPUS |
- | -farming | + | --timeout TIMEOUT |
- | + | --maxerrors MAXERRORS | |
- | Testing: | + | --mpiexec MPIEXEC |
- | -noreset | + | --smoketest |
- | -shard ISHARD NSHARDS | + | --valgrind |
- | -skiptest | + | --keepalive |
- | -skipunittest | + | --flagslow |
- | -skipdir TESTDIR | + | --debug |
- | -restrictdir TESTDIR | + | --restrictdir RESTRICTDIR |
- | -retest | + | --skipdir SKIPDIR |
- | + | --workbasedir WORKBASEDIR | |
- | Exit codes: | + | |
- | 0 clean exit with testing | + | |
- | 3 | + | |
- | 4 build errors | + | |
- | 5 | + | |
- | | + | |
- | | + | |
- | 8 ctrl-C (SIGINT) and various other signals trapped | + | |
- | + | ||
- | For more information visit: < | + | |
</ | </ | ||
Line 102: | Line 85: | ||
| '' | | '' | ||
+ | ===== Run with sbatch ===== | ||
+ | |||
+ | The '' | ||
+ | |||
+ | What you need: | ||
+ | |||
+ | * '' | ||
+ | * a CP2K source tree with a built CP2K | ||
+ | |||
+ | ==== Instructions ==== | ||
+ | |||
+ | The way the regtest script works is that it goes through all the directories (for example '' | ||
+ | |||
+ | Also, '' | ||
+ | |||
+ | Append the following to your '' | ||
+ | |||
+ | <code bash> | ||
+ | CP2K_BASE_DIR="/ | ||
+ | CP2K_TEST_DIR=" | ||
+ | # CP2K_REGTEST_SCRIPT_DIR="" | ||
+ | |||
+ | CP2K_ARCH=" | ||
+ | CP2K_VERSION=" | ||
+ | |||
+ | # the following is the default, adjust if you want to run single tests with more than 2 ranks/tasks | ||
+ | NTASKS_SINGLE_TEST=2 | ||
+ | NNODES_SINGLE_TEST=1 | ||
+ | SRUN_CMD=" | ||
+ | |||
+ | # the following should be sufficiently generic: | ||
+ | |||
+ | mkdir -p " | ||
+ | cd " | ||
+ | |||
+ | cp2k_rel_dir=$(realpath --relative-to=" | ||
+ | # srun does not like `-np`, override the complete command instead: | ||
+ | export cp2k_run_prefix=" | ||
+ | |||
+ | " | ||
+ | -arch " | ||
+ | -version " | ||
+ | -nobuild \ | ||
+ | -mpiranks ${NTASKS_SINGLE_TEST} \ | ||
+ | -ompthreads ${OMP_NUM_THREADS} \ | ||
+ | -maxtasks ${SLURM_NTASKS} \ | ||
+ | -cp2kdir " | ||
+ | |& tee " | ||
+ | |||
+ | # the above will output both to the slurm-*.out as well as a log file, | ||
+ | # if you want only the log file replace the `|& tee` with a `>& | ||
+ | |||
+ | # More options: | ||
+ | # -farming | ||
+ | # -retest | ||
+ | </ | ||
+ | |||
+ | A complete '' | ||
+ | |||
+ | <code bash> | ||
+ | #!/bin/bash -l | ||
+ | #SBATCH --time=01: | ||
+ | #SBATCH --nodes=4 | ||
+ | #SBATCH --ntasks-per-node=128 | ||
+ | #SBATCH --cpus-per-task=2 | ||
+ | #SBATCH --ntasks-per-core=1 | ||
+ | |||
+ | # More SBATCH options: | ||
+ | # If you need 512GB memory nodes (otherwise only 256GB guaranteed): | ||
+ | # #SBATCH --mem=497G | ||
+ | # To run on the debug queue (max 10 nodes, 30 min): | ||
+ | # # | ||
+ | |||
+ | set -o errexit | ||
+ | set -o nounset | ||
+ | set -o pipefail | ||
+ | |||
+ | export MPICH_OFI_STARTUP_CONNECT=1 | ||
+ | export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK} | ||
+ | export OMP_PROC_BIND=close | ||
+ | export OMP_PLACES=cores | ||
+ | |||
+ | source " | ||
+ | |||
+ | module load cpeGNU | ||
+ | module load \ | ||
+ | cray-fftw \ | ||
+ | ELPA/ | ||
+ | libxsmm/ | ||
+ | libxc/5.1.3 \ | ||
+ | Libint-CP2K/ | ||
+ | gcc/10.2.0 | ||
+ | |||
+ | # Let the user see the currently loaded modules in the slurm log for completeness: | ||
+ | module list | ||
+ | |||
+ | CP2K_BASE_DIR="/ | ||
+ | CP2K_TEST_DIR=" | ||
+ | |||
+ | CP2K_ARCH=" | ||
+ | CP2K_VERSION=" | ||
+ | |||
+ | NTASKS_SINGLE_TEST=2 | ||
+ | NNODES_SINGLE_TEST=1 | ||
+ | SRUN_CMD=" | ||
+ | |||
+ | # to run tests across nodes (to check for communication effects), use: | ||
+ | # NNODES_SINGLE_TEST=4 | ||
+ | # SRUN_CMD=" | ||
+ | |||
+ | # the following should be sufficiently generic: | ||
+ | |||
+ | mkdir -p " | ||
+ | cd " | ||
+ | |||
+ | cp2k_rel_dir=$(realpath --relative-to=" | ||
+ | # srun does not like `-np`, override the complete command instead: | ||
+ | export cp2k_run_prefix=" | ||
+ | |||
+ | " | ||
+ | -arch " | ||
+ | -version " | ||
+ | -nobuild \ | ||
+ | -mpiranks ${NTASKS_SINGLE_TEST} \ | ||
+ | -ompthreads ${OMP_NUM_THREADS} \ | ||
+ | -maxtasks ${SLURM_NTASKS} \ | ||
+ | -cp2kdir " | ||
+ | | ||
+ | </ | ||
+ | |||
+ | ==== Test parallelization via Farming ==== | ||
+ | |||
+ | Since the startup time of '' | ||
+ | |||
+ | Simply add the option '' | ||
+ | |||
+ | ==== Minimal directory setup ==== | ||
+ | |||
+ | If you want to test a precompiled executable there is a minimal directory layout you have to reproduce to run the regtest: | ||
+ | |||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | |||
+ | An example if your HPC center uses EasyBuild to provide the CP2K package: | ||
+ | |||
+ | < | ||
+ | cp2k-prebuilt | ||
+ | ├── data -> / | ||
+ | ├── exe | ||
+ | │ └── prebuilt -> / | ||
+ | └── tests | ||
+ | </ | ||
+ | |||
+ | and then update the variables as follows: | ||
+ | |||
+ | <code bash> | ||
+ | CP2K_BASE_DIR="/ | ||
+ | CP2K_TEST_DIR=" | ||
+ | CP2K_REGTEST_SCRIPT_DIR="/ | ||
+ | |||
+ | CP2K_ARCH=" | ||
+ | CP2K_VERSION=" | ||
+ | </ | ||
+ | **Note**: if the '' |
dev/regtesting.txt · Last modified: 2023/10/19 14:03 by krack