User Tools

Site Tools


dev:regtesting

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
dev:regtesting [2021/06/02 13:14] tmuellerdev:regtesting [2023/10/19 14:03] (current) – 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/regtesting/do_regtest | do_regtest]] script. +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 23: Line 23:
 ==== Step 0: make based testing ==== ==== Step 0: make based testing ====
  
-  * If you are able to build and run cp2k on the local machine the easiest way is to start the regtesting by running ''make ARCH=... VERSION=... test''. The options listed in Step 2 can also be specified with ''make'' via ''TESTOPTS+=<options>'', e.g. ''TESTOPTS+="-mpiranks 4 -ompthreads 4"'' requires 4 MPI ranks and 4 OpenMP threads for each MPI rank.+  * If you are able to build and run cp2k on the local machine the easiest way is to start the regtesting by running ''make ARCH=... VERSION=... test''. The options listed in Step 2 can also be specified with ''make'' via ''TESTOPTS=<options>'', e.g. ''TESTOPTS+="--mpiranks 4 --ompthreads 4"'' requires 4 MPI ranks and 4 OpenMP threads for each MPI rank.
   * Be careful about the value of ''-j'' parameter you will use; running too many tests in parallel can cause tests to fail due to lack of system and/or GPU memory.   * Be careful about the value of ''-j'' parameter you will use; running too many tests in parallel can cause tests to fail due to lack of system and/or GPU memory.
   * If this fails (e.g. on batch systems), continue with Step 1 else go to interpretation.   * If this fails (e.g. on batch systems), continue with Step 1 else go to interpretation.
Line 34: Line 34:
 ==== Step 2: Running ==== ==== Step 2: Running ====
 <code> <code>
-tools/regtesting/do_regtest --help +tests/do_regtest.py -h 
-Usage: do_regtest [OPTION+usage: do_regtest.py [-h] [--mpiranks MPIRANKS] [--ompthreads OMPTHREADS
-Run the CP2K regression test suite +                     [--maxtasks MAXTASKS] [--num_gpus NUM_GPUS] 
-Example: do_regtest -c my_regtest.conf+                     [--timeout TIMEOUT] [--maxerrors MAXERRORS] 
 +                     [--mpiexec MPIEXEC] [--smoketest] [--valgrind] 
 +                     [--keepalive] [--flagslow] [--debug] 
 +                     [--restrictdir RESTRICTDIR] [--skipdir SKIPDIR] 
 +                     [--workbasedir WORKBASEDIR] arch version
  
-General: +Runs CP2K regression test suite.
-  -h, -help, --help         print this help screen. +
-  -c, -config FILE          read any of the following configuration switches from FILE. +
-  -cp2kdir PATH             location of cp2k source tree relative to current working directory. +
-  -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
-  -version VERSION          VERSION passed to make. Default: sopt. +  arch 
-  -arch ARCH                ARCH passed to make. Default: Linux-x86-64-gfortran. +  version
-  -quick                    rebuild if needed, but without realclean. Default: off. +
-  -nobuild                  do not build cp2k, rely on user's build. Default: off.+
  
-Runtime+options
-  -mpiranks NRANKS          number of mpi-ranks. Default: 2 for parallel versions, 1 for serial. +  -h, --help            show this help message and exit 
-  -ompthreads NTHREADS      number of OpenMP threads. Default: 2 for smp versions otherwise 1. +  --mpiranks MPIRANKS 
-  -maxtasks NPROCS          total number of processor to use. Default: `nproc`. +  --ompthreads OMPTHREADS 
-  -maxbuildtasks NPROCS     total number of processor to use for compilation. Default taken from -maxtasks. +  --maxtasks MAXTASKS 
-  -jobmaxtime SECONDS       maximum execution time of a single test. Default 600. +  --num_gpus NUM_GPUS 
-  -farming                  test via a single farming run (only for parallel cp2k). +  --timeout TIMEOUT 
- +  --maxerrors MAXERRORS 
-Testing: +  --mpiexec MPIEXEC 
-  -noreset                  do not reset the reference outputs. Default: off. +  --smoketest           Runs only the first test of each directory
-  -shard ISHARD NSHARDS     do sharding: Divide the test dirs into NSHARD subsets and only run the ISHARD-th set. +  --valgrind            Runs tests under Valgrind memcheckBest used together with --keepalive
-  -skiptest                 do not run test, only build. Default: off+  --keepalive           Use a persistent cp2k-shell process to reduce startup time
-  -skipunittest             do not run unit tests. Default: off+  --flagslow            Flag slow tests in the final summary and status report
-  -skipdir TESTDIR          do not run tests in TESTDIR. This switch can repeated+  --debug 
-  -restrictdir TESTDIR      run only tests in TESTDIR. This switch can repeated+  --restrictdir RESTRICTDIR 
-  -retest                   run only tests in directories, which had failing tests in previous run. +  --skipdir SKIPDIR 
- +  --workbasedir WORKBASEDIR
-Exit codes: +
-    0   clean exit with testing +
-    3   problem with realclean +
-    4   build errors +
-    5   problem with retest option no TEST directory with latest test results found +
-      problem with retest option no error summary exists in the last TEST directory +
-      reference directory is locked +
-    8   ctrl-C (SIGINT) and various other signals trapped +
- +
-For more information visit: <http://cp2k.org/dev:regtesting>+
 </code> </code>
  
Line 266: Line 253:
 CP2K_VERSION="psmp" CP2K_VERSION="psmp"
 </code> </code>
 +
 +**Note**: if the ''%%tools/regtesting%%'' is not in that minimal directory tree as shown above you may get an error about the ''%%timings.py%%'' not found and there will be no timings. If you need those you should link/copy the regtesting scripts into ''%%tools/regtest%%'' of that minimal directory tree, at which you point you can leave the ''%%CP2K_REGTEST_SCRIPT_DIR%%'' variable undefined again.
dev/regtesting.1622639652.txt.gz · Last modified: 2021/06/02 13:14 by tmueller