Skip to content

feat(mr): predict and take details with the boundary-clamped prediction stencil #2118

feat(mr): predict and take details with the boundary-clamped prediction stencil

feat(mr): predict and take details with the boundary-clamped prediction stencil #2118

Workflow file for this run

name: samurai CI
on: [pull_request]
# This section cancels previous runs for the same PR
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
# GitHub-hosted runners on Azure sometimes expose a "mana" RDMA/InfiniBand NIC whose UCX
# driver randomly fails to initialize (UCX ERROR ... mana_0 ... failed: Operation not supported),
# which aborts MPI_Init (used by PETSc even for single-rank runs) and kills the process with
# exit code 143. Restricting UCX to shared-memory/TCP transports avoids probing that NIC.
env:
UCX_TLS: self,sm,tcp
jobs:
#
# Check samurai with pre-commit
#
#########################################################
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: pre-commit/action@v3.0.0
#
# Check samurai with cppcheck
#
#########################################################
cppcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Mamba and samurai env installation
uses: mamba-org/setup-micromamba@v1
with:
environment-file: conda/environment.yml
environment-name: samurai-env
cache-environment: true
- name: cppcheck installation
shell: bash -el {0}
run: |
conda install -y cppcheck=2.12 python=3.12 cxx-compiler
- name: Configure
shell: bash -el {0}
run: |
cmake . -Bbuild -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_BUILD_TYPE=Debug -DBUILD_DEMOS=ON
- name: Run cppcheck on samurai
shell: bash -el {0}
run: |
cppcheck --enable=all -q --project=./build/compile_commands.json --suppressions-list=.cppcheck --inline-suppr 2> cppcheck_err.txt
- name: Check for errors
run: |
if [[ -s cppcheck_err.txt ]];
then
cat cppcheck_err.txt
exit -1
fi
#
# Check linux build with mamba environment
#
#########################################################
linux-mamba:
needs: [pre-commit, cppcheck]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- cpp-version: gcc-11
compiler: "gcc"
package: "gcc-11 g++-11"
cc: "gcc-11"
cxx: "g++-11"
- cpp-version: gcc-12
compiler: "gcc"
package: "gcc-12 g++-12"
cc: "gcc-12"
cxx: "g++-12"
- cpp-version: gcc-13
compiler: "gcc"
package: "gcc-13 g++-13"
cc: "gcc-13"
cxx: "g++-13"
# - cpp-version: gcc-14
# os: ubuntu-latest
# compiler: "gcc"
# package: "gcc-14 g++-14"
# cc: "gcc-14"
# cxx: "g++-14"
- cpp-version: clang-16
compiler: "clang"
package: "clang-16"
cc: "clang-16"
cxx: "clang++-16"
- cpp-version: clang-17
compiler: "clang"
package: "clang-17"
cc: "clang-17"
cxx: "clang++-17"
- cpp-version: clang-18
compiler: "clang"
package: "clang-18"
cc: "clang-18"
cxx: "clang++-18"
- cpp-version: clang-19
compiler: "clang"
package: "clang-19"
cc: "clang-19"
cxx: "clang++-19"
steps:
- uses: actions/checkout@v4
- name: Cache
uses: actions/cache@v4
with:
path: |
~/.cache/ccache
# Rotating key: each run saves a fresh entry, restore-keys falls
# back to the most recent cache for this compiler. A static key
# would restore but never re-save, freezing the cache forever.
key: ccache-linux-${{ matrix.cpp-version }}-${{ github.run_id }}
restore-keys: |
ccache-linux-${{ matrix.cpp-version }}-
- name: Compiler and dev tools installation
run: |
sudo apt update
sudo apt install ${{ matrix.package }} ccache
- name: ccache setup
run: |
ccache --max-size=2G
ccache --zero-stats
# - name: Information about ccache
# run: |
# ccache -s -v
- name: Mamba and samurai env installation
uses: mamba-org/setup-micromamba@v1
with:
environment-file: conda/environment.yml
environment-name: samurai-env
cache-environment: true
cache-environment-key: ${{ runner.os }}-${{ matrix.cpp-version }}-${{ hashFiles('conda/environment.yml') }}
# - name: Conda update
# shell: bash -l {0}
# run: |
# conda update --all
- name: Petsc installation
shell: bash -l {0}
run: |
conda install -y petsc pkg-config
- name: Conda informations
shell: bash -l {0}
run: |
conda info
conda list
- name: Configure
shell: bash -l {0}
run: |
export LDFLAGS="${LDFLAGS} -L$CONDA_PREFIX/lib"
CC=${{ matrix.cc }} CXX=${{ matrix.cxx }} cmake \
. \
-Bbuild \
-GNinja \
-DCMAKE_BUILD_TYPE=Release \
-DWITH_PETSC=ON \
-DBUILD_DEMOS=ON \
-DBUILD_TESTS=ON
- name: Build
shell: bash -l {0}
run: |
cmake --build build --target all --parallel 4
# if [[ "${{ matrix.compiler }}" == "gcc" ]]; then
# cmake --build build --target all --parallel 1 # Limit parallelism with gcc to avoid memory issues
# else
# cmake --build build --target all --parallel 2
# fi
- name: ccache statistics
if: always()
run: ccache --show-stats --verbose
- name: Test with googletest
shell: bash -l {0}
run: |
export LD_LIBRARY_PATH="$CONDA_PREFIX/lib:$LD_LIBRARY_PATH"
cd build
./tests/test_samurai_lib
./tests/test_fv_operators_petsc
- name: Generate ParaView reader reference files
shell: bash -l {0}
run: |
export LD_LIBRARY_PATH="$CONDA_PREFIX/lib:$LD_LIBRARY_PATH"
mkdir -p tests/reference/paraview
./build/tests/generate_paraview_reference tests/reference/paraview
- name: Generate yt reader reference files
shell: bash -l {0}
run: |
export LD_LIBRARY_PATH="$CONDA_PREFIX/lib:$LD_LIBRARY_PATH"
mkdir -p tests/reference/yt
./build/tests/generate_yt_reference tests/reference/yt
- name: Test with pytest
shell: bash -l {0}
run: |
export LD_LIBRARY_PATH="$CONDA_PREFIX/lib:$LD_LIBRARY_PATH"
cd tests
# The following options are set to have a deterministic Petsc behaviour on Linux.
# The problem occurs on the diff. heated cavity demo. It seems to come from the use of the non-linear solver with QR to solve the Jacobian systems.
# The result is not deterministic accross runs. Something seems to be multithreaded in Petsc or in one of its dependencies.
# The strange part is that the diff. heated cavity is the only demo that fails.
# Hint: it's the only demo with a non-linear block solver.
export OMP_NUM_THREADS=1
export OMP_DYNAMIC=FALSE
export OMP_MAX_ACTIVE_LEVELS=1
export MKL_NUM_THREADS=1
export OPENBLAS_NUM_THREADS=1
export VECLIB_MAXIMUM_THREADS=1
export SCOTCH_DETERMINISTIC=1
pytest -v -s --h5diff
#
# Check linux build with mamba environment
#
#########################################################
linux-mpi-mamba:
needs: [pre-commit, cppcheck]
runs-on: self-hosted
steps:
- uses: actions/checkout@v4
- name: Mamba and samurai env installation
uses: mamba-org/setup-micromamba@v2
with:
environment-file: conda/mpi-environment.yml
download-micromamba: false
micromamba-binary-path: /home/ubuntu/.local/bin/micromamba
# environment-name: samurai-env
# generate-run-shell: true
# post-cleanup: environment
- name: Petsc installation
shell: micromamba-shell {0}
run: |
micromamba install -y petsc pkg-config cxx-compiler ccache
# Self-hosted runner: ccache dir persists on disk across runs,
# so no actions/cache step is needed here.
ccache --max-size=5G
- name: Micromamba informations
shell: micromamba-shell {0}
run: |
micromamba info
micromamba list
- name: Configure
shell: micromamba-shell {0}
run: |
cmake \
. \
-Bbuild \
-DCMAKE_BUILD_TYPE=Release \
-DWITH_MPI=ON \
-DWITH_PETSC=ON \
-DBUILD_DEMOS=ON \
-DBUILD_TESTS=ON \
-DSAMURAI_WITH_PARMETIS=ON
- name: Build
shell: micromamba-shell {0}
run: |
cmake --build build --target finite-volume-advection-2d
cmake --build build --target finite-volume-burgers
cmake --build build --target finite-volume-heat
cmake --build build --target finite-volume-lid-driven-cavity
cmake --build build --target finite-volume-burgers-os-2d-mpi
cmake --build build --target generate_paraview_reference
cmake --build build --target generate_yt_reference
- name: MPI test finite-volume-advection-2d
shell: micromamba-shell {0}
run: |
cd build
set -e # Stop on first failure
mpiexec -n 1 ./demos/FiniteVolume/finite-volume-advection-2d --Tf 0.05 --nfiles 20
mpiexec -n 2 ./demos/FiniteVolume/finite-volume-advection-2d --Tf 0.05 --nfiles 20
mpiexec -n 3 ./demos/FiniteVolume/finite-volume-advection-2d --Tf 0.05 --nfiles 20
mpiexec -n 4 ./demos/FiniteVolume/finite-volume-advection-2d --Tf 0.05 --nfiles 20
mpiexec -n 9 ./demos/FiniteVolume/finite-volume-advection-2d --Tf 0.05 --nfiles 20
ls
python ../python/compare.py FV_advection_2d_pred_0_size_1_ite_ FV_advection_2d_pred_0_size_2_ite_ --start 1 --end 19
python ../python/compare.py FV_advection_2d_pred_0_size_1_ite_ FV_advection_2d_pred_0_size_3_ite_ --start 1 --end 19
python ../python/compare.py FV_advection_2d_pred_0_size_1_ite_ FV_advection_2d_pred_0_size_4_ite_ --start 1 --end 19
python ../python/compare.py FV_advection_2d_pred_0_size_1_ite_ FV_advection_2d_pred_0_size_9_ite_ --start 1 --end 19
python ../python/compare.py FV_advection_2d_pred_1_size_1_ite_ FV_advection_2d_pred_1_size_2_ite_ --start 1 --end 19
python ../python/compare.py FV_advection_2d_pred_1_size_1_ite_ FV_advection_2d_pred_1_size_3_ite_ --start 1 --end 19
python ../python/compare.py FV_advection_2d_pred_1_size_1_ite_ FV_advection_2d_pred_1_size_4_ite_ --start 1 --end 19
python ../python/compare.py FV_advection_2d_pred_1_size_1_ite_ FV_advection_2d_pred_1_size_9_ite_ --start 1 --end 19
rm *.h5 *.xdmf
mpiexec -n 1 ./demos/FiniteVolume/finite-volume-advection-2d --Tf 0.05 --nfiles 20 --load-balancing-at 10
mpiexec -n 2 ./demos/FiniteVolume/finite-volume-advection-2d --Tf 0.05 --nfiles 20 --load-balancing-at 10
mpiexec -n 3 ./demos/FiniteVolume/finite-volume-advection-2d --Tf 0.05 --nfiles 20 --load-balancing-at 10
mpiexec -n 4 ./demos/FiniteVolume/finite-volume-advection-2d --Tf 0.05 --nfiles 20 --load-balancing-at 10
ls
python ../python/compare.py FV_advection_2d_pred_0_size_1_ite_ FV_advection_2d_pred_0_size_2_ite_ --start 1 --end 19
python ../python/compare.py FV_advection_2d_pred_0_size_1_ite_ FV_advection_2d_pred_0_size_3_ite_ --start 1 --end 19
python ../python/compare.py FV_advection_2d_pred_0_size_1_ite_ FV_advection_2d_pred_0_size_4_ite_ --start 1 --end 19
python ../python/compare.py FV_advection_2d_pred_1_size_1_ite_ FV_advection_2d_pred_1_size_2_ite_ --start 1 --end 19
python ../python/compare.py FV_advection_2d_pred_1_size_1_ite_ FV_advection_2d_pred_1_size_3_ite_ --start 1 --end 19
python ../python/compare.py FV_advection_2d_pred_1_size_1_ite_ FV_advection_2d_pred_1_size_4_ite_ --start 1 --end 19
- name: MPI test finite-volume-burgers
shell: micromamba-shell {0}
run: |
cd build
set -e # Stop on first failure
mpiexec -n 1 ./demos/FiniteVolume/finite-volume-burgers --Tf 0.1 --nfiles 20 --min-level 6 --max-level 8
mpiexec -n 2 ./demos/FiniteVolume/finite-volume-burgers --Tf 0.1 --nfiles 20 --min-level 6 --max-level 8
mpiexec -n 3 ./demos/FiniteVolume/finite-volume-burgers --Tf 0.1 --nfiles 20 --min-level 6 --max-level 8
mpiexec -n 4 ./demos/FiniteVolume/finite-volume-burgers --Tf 0.1 --nfiles 20 --min-level 6 --max-level 8
mpiexec -n 6 ./demos/FiniteVolume/finite-volume-burgers --Tf 0.1 --nfiles 20 --min-level 6 --max-level 8
ls
python ../python/compare.py burgers_2D_size_1_ite_ burgers_2D_size_2_ite_ --start 1 --end 19
python ../python/compare.py burgers_2D_size_1_ite_ burgers_2D_size_3_ite_ --start 1 --end 19
python ../python/compare.py burgers_2D_size_1_ite_ burgers_2D_size_4_ite_ --start 1 --end 19
python ../python/compare.py burgers_2D_size_1_ite_ burgers_2D_size_6_ite_ --start 1 --end 19
rm *.h5 *.xdmf
mpiexec -n 1 ./demos/FiniteVolume/finite-volume-burgers --Tf 0.1 --nfiles 20 --min-level 6 --max-level 8 --load-balancing-at 10
mpiexec -n 2 ./demos/FiniteVolume/finite-volume-burgers --Tf 0.1 --nfiles 20 --min-level 6 --max-level 8 --load-balancing-at 10
mpiexec -n 3 ./demos/FiniteVolume/finite-volume-burgers --Tf 0.1 --nfiles 20 --min-level 6 --max-level 8 --load-balancing-at 10
mpiexec -n 4 ./demos/FiniteVolume/finite-volume-burgers --Tf 0.1 --nfiles 20 --min-level 6 --max-level 8 --load-balancing-at 10
mpiexec -n 6 ./demos/FiniteVolume/finite-volume-burgers --Tf 0.1 --nfiles 20 --min-level 6 --max-level 8 --load-balancing-at 10
ls
python ../python/compare.py burgers_2D_size_1_ite_ burgers_2D_size_2_ite_ --start 1 --end 19
python ../python/compare.py burgers_2D_size_1_ite_ burgers_2D_size_3_ite_ --start 1 --end 19
python ../python/compare.py burgers_2D_size_1_ite_ burgers_2D_size_4_ite_ --start 1 --end 19
python ../python/compare.py burgers_2D_size_1_ite_ burgers_2D_size_6_ite_ --start 1 --end 19
- name: MPI test finite-volume-heat
env:
# HPC libraries (MPICH, MUMPS, ScaLAPACK...) frequently leak tcache-incompatible blocks: they use custom allocators,
# mixed Fortran/C/C++ memory ownership, aligned allocations, and unusual free patterns.
# They often free blocks that do not satisfy tcache alignment constraints.
# glibc normally tolerates it, except when tcache reuses the block across executions.
# This can cause a crash when multiple runs are launched in the same CI job.
# Here, the 3-rank test crashes at the beginning with the error "malloc(): unaligned tcache chunk detected".
# So we disable tcache.
GLIBC_TUNABLES: "glibc.malloc.tcache_count=0"
shell: micromamba-shell {0}
run: |
cd build
set -e # Stop on first failure
# MUMPS doesn't have a deterministic behaviour. For instance, the MUMPS conda package is compiled with OpenMP, so we set the number of threads to 1 to have deterministic output.
# It also depends on other libraries (Scotch, ...) that we also need to set configure.
export OMP_NUM_THREADS=1
export OMP_DYNAMIC=FALSE
export OMP_MAX_ACTIVE_LEVELS=1
export MKL_NUM_THREADS=1
export OPENBLAS_NUM_THREADS=1
export VECLIB_MAXIMUM_THREADS=1
export SCOTCH_DETERMINISTIC=1
mpiexec -n 1 ./demos/FiniteVolume/finite-volume-heat --init-sol crenel -pc_type lu -pc_factor_mat_solver_type mumps -mat_ordering_type amd --Tf 0.1 --min-level 3 --max-level 8
mpiexec -n 2 ./demos/FiniteVolume/finite-volume-heat --init-sol crenel -pc_type lu -pc_factor_mat_solver_type mumps -mat_ordering_type amd --Tf 0.1 --min-level 3 --max-level 8
mpiexec -n 3 ./demos/FiniteVolume/finite-volume-heat --init-sol crenel -pc_type lu -pc_factor_mat_solver_type mumps -mat_ordering_type amd --Tf 0.1 --min-level 3 --max-level 8
mpiexec -n 1 ./demos/FiniteVolume/finite-volume-heat --init-sol crenel -pc_type lu -pc_factor_mat_solver_type mumps -mat_ordering_type amd --Tf 0.1 --min-level 3 --max-level 8 --load-balancing-at 10
mpiexec -n 2 ./demos/FiniteVolume/finite-volume-heat --init-sol crenel -pc_type lu -pc_factor_mat_solver_type mumps -mat_ordering_type amd --Tf 0.1 --min-level 3 --max-level 8 --load-balancing-at 10
# Add this test when the problem of ghost owners is fixed. For this test, multuple ranks own the same ghost cell, which is not supported by the current implementation of the ghost cells.
# mpiexec -n 3 ./demos/FiniteVolume/finite-volume-heat --init-sol crenel -pc_type lu -pc_factor_mat_solver_type mumps -mat_ordering_type amd --Tf 0.1 --min-level 3 --max-level 8 --load-balancing-at 10
ls
python ../python/compare.py heat_2D_size_1_ite_ heat_2D_size_2_ite_ --start 1 --end 9 --tol 1e-3 # Loose tolerance needed due to the known bugs in the mesh? Try with a stricter tol when the bugs are fixed.
# We don't compare the results with 3 ranks because the number of cells might be different.
rm -f heat_2D*
- name: MPI test finite-volume-lid-driven-cavity
shell: micromamba-shell {0}
run: |
cd build
set -e # Stop on first failure
# MUMPS doesn't have a deterministic behaviour. For instance, the MUMPS conda package is compiled with OpenMP, so we set the number of threads to 1 to have deterministic output.
# It also depends on other libraries (Scotch, ...) that we also need to set configure.
export OMP_NUM_THREADS=1
export OMP_DYNAMIC=FALSE
export OMP_MAX_ACTIVE_LEVELS=1
export MKL_NUM_THREADS=1
export OPENBLAS_NUM_THREADS=1
export VECLIB_MAXIMUM_THREADS=1
export SCOTCH_DETERMINISTIC=1
mpiexec -n 1 ./demos/FiniteVolume/finite-volume-lid-driven-cavity -pc_type lu -pc_factor_mat_solver_type mumps -mat_ordering_type amd --filename ldc_ink_size_1 --Tf 0.1 --nfiles 1 --min-level 8 --max-level 8
mpiexec -n 2 ./demos/FiniteVolume/finite-volume-lid-driven-cavity -pc_type lu -pc_factor_mat_solver_type mumps -mat_ordering_type amd --filename ldc_ink_size_2 --Tf 0.1 --nfiles 1 --min-level 8 --max-level 8
ls
python ../python/compare.py ldc_ink_size_1 ldc_ink_size_2 --tol 1e-11
- name: MPI test burgers OSMP 2D (weak scaling)
shell: micromamba-shell {0}
run: |
cd build
set -e # Stop on first failure
mpiexec -n 2 ./demos/FiniteVolume/finite-volume-burgers-os-2d-mpi --npx=2 --npy=1 --min-level=0 --max-level=8 --Tf=6 --nfiles 1
mpiexec -n 2 ./demos/FiniteVolume/finite-volume-burgers-os-2d-mpi --npx=1 --npy=2 --min-level=0 --max-level=8 --Tf=6 --nfiles 1
mpiexec -n 4 ./demos/FiniteVolume/finite-volume-burgers-os-2d-mpi --npx=2 --npy=2 --min-level=0 --max-level=8 --Tf=6 --nfiles 1
mpiexec -n 8 ./demos/FiniteVolume/finite-volume-burgers-os-2d-mpi --npx=4 --npy=2 --min-level=0 --max-level=8 --Tf=6 --nfiles 1
mpiexec -n 8 ./demos/FiniteVolume/finite-volume-burgers-os-2d-mpi --npx=2 --npy=4 --min-level=0 --max-level=8 --Tf=6 --nfiles 1
mpiexec -n 9 ./demos/FiniteVolume/finite-volume-burgers-os-2d-mpi --npx=3 --npy=3 --min-level=0 --max-level=8 --Tf=6 --nfiles 1
- name: Build load balancing diffusion
shell: micromamba-shell {0}
run: |
cmake --build build --target test_lb_diffusion
- name: Build load balancing tests and demos
shell: micromamba-shell {0}
run: |
cmake --build build --target \
test_lb_migration test_lb_metrics test_lb_sfc test_lb_diffusion \
test_lb_graph test_lb_metis test_lb_ghosts test_lb_flux \
test_lb_sfc_tube mpi-load-balancing-2d mpi-load-balancing-3d
- name: MPI load balancing unit tests (ctest, 2/3/4 procs)
shell: micromamba-shell {0}
env:
FI_PROVIDER: tcp
OMP_NUM_THREADS: "1"
run: |
ctest --test-dir build -R "test_lb" --output-on-failure
- name: Load balancing strategy comparison (pytest)
shell: micromamba-shell {0}
run: |
cd tests
SAMURAI_MPI_BUILD_DIR="${GITHUB_WORKSPACE}/build" python -m pytest test_load_balancing.py -v
- name: Build ghost-update robustness test and case dumper
shell: micromamba-shell {0}
run: |
cmake --build build --target test_ghost_update_parallel mpi-ghost-cases
- name: MPI ghost-update robustness tests (ctest, 2/3/4 procs)
shell: micromamba-shell {0}
env:
FI_PROVIDER: tcp
OMP_NUM_THREADS: "1"
run: |
ctest --test-dir build -R "test_ghost_update_parallel" --output-on-failure
- name: Ghost-update case catalog and visualisation (pytest)
shell: micromamba-shell {0}
env:
FI_PROVIDER: tcp
OMP_NUM_THREADS: "1"
run: |
cd tests
SAMURAI_MPI_BUILD_DIR="${GITHUB_WORKSPACE}/build" python -m pytest test_ghost_cases.py --mpl -v
- name: Generate ParaView reader reference files
shell: micromamba-shell {0}
run: |
mkdir -p tests/reference/paraview
mpiexec -n 1 ./build/tests/generate_paraview_reference tests/reference/paraview
mpiexec -n 2 ./build/tests/generate_paraview_reference tests/reference/paraview --mpi
- name: ParaView reader tests (pytest)
shell: micromamba-shell {0}
run: |
cd tests
pytest test_paraview_reader.py -v
- name: Generate yt reader reference files
shell: micromamba-shell {0}
run: |
mkdir -p tests/reference/yt
mpiexec -n 1 ./build/tests/generate_yt_reference tests/reference/yt
mpiexec -n 2 ./build/tests/generate_yt_reference tests/reference/yt --mpi
- name: yt reader tests (pytest)
shell: micromamba-shell {0}
run: |
cd tests
pytest test_yt_reader.py -v
- name: ccache statistics
shell: micromamba-shell {0}
if: always()
run: ccache --show-stats --verbose
macos-mamba:
needs: [pre-commit, cppcheck]
runs-on: macos-26
steps:
- uses: actions/checkout@v4
- name: Cache
uses: actions/cache@v4
with:
path: |
~/Library/Caches/ccache
key: ccache-macos-${{ github.run_id }}
restore-keys: |
ccache-macos-
- name: Mamba and samurai env installation
uses: mamba-org/setup-micromamba@v1
with:
environment-file: conda/environment.yml
environment-name: samurai-env
cache-environment: true
- name: Petsc installation
shell: bash -l {0}
run: |
micromamba install -y petsc mpich pkg-config
- name: Install cxx compiler
shell: bash -l {0}
run: |
micromamba install -y cxx-compiler ccache
ccache --max-size=2G
ccache --zero-stats
- name: micromamba informations
shell: bash -l {0}
run: |
micromamba info
micromamba list
- name: Configure
shell: bash -l {0}
run: |
cmake \
. \
-Bbuild \
-GNinja \
-DCMAKE_BUILD_TYPE=Release \
-DWITH_PETSC=ON \
-DBUILD_DEMOS=ON \
-DBUILD_TESTS=ON
- name: Build
shell: bash -l {0}
run: |
cmake --build ./build --config Release --parallel 3
- name: ccache statistics
shell: bash -l {0}
if: always()
run: ccache --show-stats --verbose
- name: Generate ParaView reader reference files
shell: bash -l {0}
run: |
mkdir -p tests/reference/paraview
./build/tests/generate_paraview_reference tests/reference/paraview
- name: Generate yt reader reference files
shell: bash -l {0}
run: |
mkdir -p tests/reference/yt
./build/tests/generate_yt_reference tests/reference/yt
- name: Run tests
shell: bash -l {0}
run: |
./build/tests/test_samurai_lib
./build/tests/test_fv_operators_petsc
cd tests; pytest -v -s --h5diff
#
# CHECK_NAN
#
#########################################################
linux-mamba-check-nan:
needs: [pre-commit, cppcheck]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Cache
uses: actions/cache@v4
with:
path: |
~/.cache/ccache
key: ccache-linux-mamba-check-nan-${{ github.run_id }}
restore-keys: |
ccache-linux-mamba-check-nan-
- name: Mamba and samurai env installation
uses: mamba-org/setup-micromamba@v2
with:
environment-file: conda/environment.yml
environment-name: samurai-env
cache-environment: true
cache-environment-key: ${{ runner.os }}-${{ hashFiles('conda/environment.yml') }}
- name: Petsc installation
shell: bash -l {0}
run: |
conda install -y petsc pkg-config cxx-compiler ccache
ccache --max-size=2G
ccache --zero-stats
- name: Conda informations
shell: bash -l {0}
run: |
conda info
conda list
- name: Configure
shell: bash -l {0}
run: |
cmake \
. \
-Bbuild \
-GNinja \
-DCMAKE_BUILD_TYPE=Debug \
-DSAMURAI_CHECK_NAN=ON \
-DWITH_PETSC=ON \
-DBUILD_DEMOS=ON
- name: Build
shell: bash -l {0}
run: |
cmake --build build --target finite-volume-burgers
cmake --build build --target finite-volume-lid-driven-cavity
- name: ccache statistics
shell: bash -l {0}
if: always()
run: ccache --show-stats --verbose
- name: test finite-volume-burgers
shell: bash -l {0}
run: |
cd build
set -e # Stop on first failure
./demos/FiniteVolume/finite-volume-burgers --min-level 2 --max-level 6
- name: test finite-volume-lid-driven-cavity
shell: bash -l {0}
run: |
cd build
set -e # Stop on first failure
./demos/FiniteVolume/finite-volume-lid-driven-cavity --min-level 3 --max-level 6
#
# MPI with CHECK_NAN
#
#########################################################
linux-mamba-check-nan-mpi:
needs: [pre-commit, cppcheck]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Cache
uses: actions/cache@v4
with:
path: |
~/.cache/ccache
key: ccache-linux-mamba-check-nan-mpi-${{ github.run_id }}
restore-keys: |
ccache-linux-mamba-check-nan-mpi-
- name: Mamba and samurai env installation
uses: mamba-org/setup-micromamba@v2
with:
environment-file: conda/mpi-environment.yml
environment-name: samurai-env
cache-environment: true
cache-environment-key: ${{ runner.os }}-${{ hashFiles('conda/mpi-environment.yml') }}
- name: Petsc installation
shell: bash -l {0}
run: |
conda install -y petsc pkg-config cxx-compiler ccache
ccache --max-size=2G
ccache --zero-stats
- name: Conda informations
shell: bash -l {0}
run: |
conda info
conda list
- name: Configure
shell: bash -l {0}
run: |
cmake \
. \
-Bbuild \
-GNinja \
-DWITH_MPI=ON \
-DCMAKE_BUILD_TYPE=Debug \
-DSAMURAI_CHECK_NAN=ON \
-DBUILD_DEMOS=ON
- name: Build
shell: bash -l {0}
run: |
cmake --build build --target finite-volume-advection-2d
cmake --build build --target finite-volume-burgers
- name: ccache statistics
shell: bash -l {0}
if: always()
run: ccache --show-stats --verbose
- name: test finite-volume-advection-2d
shell: bash -l {0}
run: |
cd build
set -e # Stop on first failure
mpiexec -n 1 ./demos/FiniteVolume/finite-volume-advection-2d --Tf 0.05 --nfiles 1
mpiexec -n 2 ./demos/FiniteVolume/finite-volume-advection-2d --Tf 0.05 --nfiles 1 --min-level 5
mpiexec -n 2 ./demos/FiniteVolume/finite-volume-advection-2d --Tf 0.05 --nfiles 1 --min-level 5 --load-balancing-at 10
# This test is failing with 3 processes due to a bug in the exchange of subdomain corners when load_balancing is activated
mpiexec -n 3 ./demos/FiniteVolume/finite-volume-advection-2d --Tf 0.05 --nfiles 1 --min-level 5
mpiexec -n 3 ./demos/FiniteVolume/finite-volume-advection-2d --Tf 0.05 --nfiles 1 --min-level 5 --load-balancing-at 10
- name: test finite-volume-burgers
shell: bash -l {0}
run: |
cd build
set -e # Stop on first failure
mpiexec -n 1 ./demos/FiniteVolume/finite-volume-burgers --Tf 0.1 --nfiles 1 --max-level 8
mpiexec -n 2 ./demos/FiniteVolume/finite-volume-burgers --Tf 0.1 --nfiles 1 --max-level 8
# This test is failing with 3 processes due to a bug in the exchange of subdomain corners
# mpiexec -n 3 ./demos/FiniteVolume/finite-volume-burgers --Tf 0.1 --nfiles 1 --max-level 8
#
# Compile snippets in documentation
#
#########################################################
compile_snippets:
needs: [pre-commit, cppcheck]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Cache
uses: actions/cache@v4
with:
path: |
~/.cache/ccache
key: ccache-compile-snippets-${{ github.run_id }}
restore-keys: |
ccache-compile-snippets-
- name: Mamba and samurai env installation
uses: mamba-org/setup-micromamba@v2
with:
environment-file: conda/environment.yml
environment-name: samurai-env
cache-environment: true
cache-environment-key: ${{ runner.os }}-${{ hashFiles('conda/environment.yml') }}
- name: Compiler installation
shell: bash -l {0}
run: |
micromamba install -y cxx-compiler ccache
ccache --max-size=2G
ccache --zero-stats
- name: Configure
shell: bash -l {0}
run: |
cmake \
. \
-Bbuild \
-DBUILD_SNIPPETS=ON
- name: Build snippets
shell: bash -l {0}
run: |
cmake --build build --target all --parallel 4
- name: ccache statistics
shell: bash -l {0}
if: always()
run: ccache --show-stats --verbose
#
# Build and run the benchmark suite (smoke test: catches build breaks and
# runtime crashes/exceptions, not a performance check -- shared CI runners
# give no timing guarantee). Excludes bench_load_balancing, which is
# MPI-only and not built here.
#
#########################################################
benchmarks:
needs: [pre-commit, cppcheck]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Cache
uses: actions/cache@v4
with:
path: |
~/.cache/ccache
key: ccache-benchmarks-${{ github.run_id }}
restore-keys: |
ccache-benchmarks-
- name: Mamba and samurai env installation
uses: mamba-org/setup-micromamba@v2
with:
environment-file: conda/environment.yml
environment-name: samurai-env
cache-environment: true
cache-environment-key: ${{ runner.os }}-${{ hashFiles('conda/environment.yml') }}
- name: Compiler installation
shell: bash -l {0}
run: |
micromamba install -y cxx-compiler ccache
ccache --max-size=2G
ccache --zero-stats
- name: Configure
shell: bash -l {0}
run: |
cmake \
. \
-Bbuild \
-GNinja \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_BENCHMARKS=ON
- name: Build
shell: bash -l {0}
run: |
cmake --build build --target all --parallel 4
- name: ccache statistics
shell: bash -l {0}
if: always()
run: ccache --show-stats --verbose
- name: Run benchmarks
shell: bash -l {0}
run: |
set -e
for exe in build/benchmark/bench_*; do
echo "=== $exe ==="
"$exe" --benchmark_min_time=0.01s
done