Building and running tests¶
OpenPFC ships a Catch2-based suite under tests/, built as the openpfc-tests executable. This page complements the one-line OpenPFC_BUILD_TESTS entry in build_options.md.
Enable / disable¶
CMake option |
Default |
Effect |
|---|---|---|
|
ON |
|
|
OFF |
Adds slow benchmarks from |
Defined in cmake/BuildOptions.cmake.
Quick commands¶
From your build directory after a successful configure:
cmake --build . -j"$(nproc)"
ctest --output-on-failure
To run the Catch2 executable directly (faster iteration):
./openpfc-tests # or build/openpfc-tests depending on generator
./openpfc-tests '~[MPI]' # same filter as the default CTest target below
What CTest registers¶
CTest name |
What it runs |
|---|---|
|
|
|
Only if |
|
If |
|
Same, for 4 ranks. |
MPI CTest targets are optional because many laptops and CI runners cannot launch multi-rank jobs reliably. Options in tests/CMakeLists.txt:
OpenPFC_RUN_MPI_SUITES— master switch formpi_*tests.OpenPFC_MPI_TEST_REGISTER_HIGH_RANK_ALWAYS— register 3- and 4-rank tests even when the configure host reports few CPUs (e.g. configure on a login node, run tests on a compute node).OpenPFC_MPI_TEST_MAX_WORLD_SIZE— cap registered MPI world sizes (useful on CI).
VTK writer tests and other targets may add_test separately under tests/unit/frontend/io/ — use ctest -N to list everything after configure.
Application tests¶
When OpenPFC_BUILD_APPS=ON, some apps register extra CTest entries (e.g. tungsten / aluminum checks). Those live next to each app’s CMakeLists.txt.
Minimal new-test walkthrough: tutorials/add_catch2_test.md.
See also¶
CONTRIBUTING.md— changelog and review expectationsbuild_options.md— all CMake switchesINSTALL.md— Catch2 / MPI / toolchain prerequisitestroubleshooting.md— configure and link failures
What runs in CI vs on clusters (audit 11 / PN)¶
Check |
GitHub Actions CI |
Cluster (tohtori / LUMI) |
|---|---|---|
CPU unit + integration ( |
yes (gcc-11/13, Debug/Release) |
yes |
MPI suites |
2 ranks only |
2/3/4 ranks ( |
|
yes ( |
|
CUDA/HIP compile (no GPU) |
best-effort |
|
CUDA/HIP run (parity, VTK, IC residency) |
not possible (no GPU) |
tohtori (CUDA), LUMI (HIP) |
Golden trajectories / performance baselines |
no |
yes (see |
The authoritative GPU compile check today is scripts/build.sh --with-cuda --no-test
(and --with-rocm) on a machine with the toolchain; the GPU-run checks
(test_tungsten_cpu_vs_cuda, test_tungsten_app_gpu_ic, etc.) must be run on a
GPU node. See tests/baselines/BASELINES.md for the scientific/performance
baselines and which comparisons are bitwise vs tolerance-based.