Skip to content

Add sanitize_openmpi_env fixture #1026

Add sanitize_openmpi_env fixture

Add sanitize_openmpi_env fixture #1026

Workflow file for this run

name: Tests
on:
push:
pull_request:
schedule:
# run sunday moring
- cron: '30 6 * * 0'
defaults:
run:
shell: bash
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
standard_tests:
timeout-minutes: 60
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
env:
BOUT_TEST_TIMEOUT: "6m"
PETSC_DIR: /usr/lib/petscdir/petsc3.12/x86_64-linux-gnu-real
PETSC_ARCH: ""
SLEPC_DIR: /usr/lib/slepcdir/slepc3.12/x86_64-linux-gnu-real/
SLEPC_ARCH: ""
OMP_NUM_THREADS: ${{ matrix.config.omp_num_threads }}
PYTHONPATH: ${{ github.workspace }}/tools/pylib
OMPI_MCA_rmaps_base_oversubscribe: yes
PRTE_MCA_rmaps_default_mapping_policy: ":oversubscribe"
MPIRUN: mpiexec -np
BOUT_TEST_DOWNLOAD_FLAGS: --retry-on-http-error=502,503,504 --tries 3
strategy:
fail-fast: true
matrix:
# Need this to be able to exclude the coverage job
is_master_or_next:
- ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/next' || github.base_ref == 'master' || github.base_ref == 'next' }}
is_cron:
- ${{ github.event_name == 'cron' }}
config:
- name: "PETSc unreleased, ADIOS2, 3D metrics"
os: ubuntu-24.04
cmake_options: "-DBUILD_SHARED_LIBS=ON
-DBOUT_ENABLE_METRIC_3D=ON
-DBOUT_ENABLE_OPENMP=ON
-DBOUT_USE_PETSC=ON
-DBOUT_USE_SLEPC=ON
-DBOUT_USE_SUNDIALS=ON
-DBOUT_USE_HYPRE=OFF
-DBOUT_USE_ADIOS2=ON
-DBOUT_ENABLE_PYTHON=ON
-DADIOS2_ROOT=/home/runner/local
-DSUNDIALS_ROOT=/home/runner/local
-DPETSC_DIR=/home/runner/local/petsc
-DSLEPC_DIR=/home/runner/local/slepc"
build_petsc: -petsc-main
build_petsc_branch: main
build_adios2: true
on_cron: true
- name: "Default options, Ubuntu 22.04"
os: ubuntu-22.04
cmake_options: ""
on_cron: false
- name: "Optimised, static"
os: ubuntu-latest
cmake_options: "-DCHECK=0
-DBUILD_SHARED_LIBS=OFF
-DCMAKE_CXX_FLAGS=-Ofast
-DBOUT_ENABLE_SIGNAL=OFF
-DBOUT_ENABLE_TRACK=OFF
-DBOUT_ENABLE_BACKTRACE=OFF
-DBOUT_USE_PETSC=ON
-DBOUT_USE_SLEPC=ON
-DBOUT_USE_SUNDIALS=ON
-DBOUT_USE_HYPRE=ON
-DSUNDIALS_ROOT=/home/runner/local"
on_cron: false
- name: "Debug, shared"
os: ubuntu-latest
cmake_options: "-DCHECK=4
-DCMAKE_BUILD_TYPE=Debug
-DBOUT_ENABLE_SIGNAL=ON
-DBOUT_ENABLE_TRACK=ON
-DBOUT_USE_PETSC=ON
-DBOUT_USE_SLEPC=ON
-DBOUT_USE_SUNDIALS=ON
-DBOUT_USE_HYPRE=ON
-DSUNDIALS_ROOT=/home/runner/local"
on_cron: false
- name: "Shared, release"
os: ubuntu-latest
cmake_options: "-DBUILD_SHARED_LIBS=ON
-DBOUT_ENABLE_OPENMP=ON
-DCMAKE_BUILD_TYPE=Release
-DBOUT_USE_PETSC=ON
-DBOUT_USE_SLEPC=ON
-DBOUT_USE_SUNDIALS=ON
-DBOUT_USE_HYPRE=ON
-DBOUT_BUILD_DOCS=OFF
-DSUNDIALS_ROOT=/home/runner/local"
omp_num_threads: 2
on_cron: false
- name: "Shared, OpenMP, 3D metrics"
os: ubuntu-latest
cmake_options: "-DBUILD_SHARED_LIBS=ON
-DBOUT_ENABLE_METRIC_3D=ON
-DBOUT_ENABLE_OPENMP=ON
-DBOUT_USE_PETSC=ON
-DBOUT_USE_SLEPC=ON
-DBOUT_USE_SUNDIALS=ON
-DBOUT_USE_HYPRE=OFF
-DBOUT_ENABLE_PYTHON=ON
-DSUNDIALS_ROOT=/home/runner/local"
omp_num_threads: 2
on_cron: false
exclude:
- is_cron: true
config:
on_cron: false
steps:
- name: Job information
run: |
echo Build: ${{ matrix.config.name }}, ${{ matrix.config.os }}
echo CMake options: ${{ matrix.config.cmake_options }}
- name: Install dependencies
run: |
sudo apt update
sudo apt install -y \
libfftw3-dev \
libnetcdf-dev \
libnetcdf-c++4-dev \
netcdf-bin \
lcov \
openmpi-bin \
libopenmpi-dev \
petsc-dev \
slepc-dev \
liblapack-dev \
libparpack2-dev \
libhypre-dev
- uses: actions/checkout@v6
with:
submodules: true
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- uses: actions/setup-python@v6
with:
python-version: '3.x'
- name: Setup virtual environment with uv
run: |
# uv sync automatically creates a .venv and installs the groups
uv sync --no-dev --group pytest --inexact
# Install the core requirements into the same venv
uv pip install -r requirements.txt
# Put the venv in the PATH
echo "$GITHUB_WORKSPACE/.venv/bin" >> $GITHUB_PATH
# Force CMake to recognize the virtual environment
echo "VIRTUAL_ENV=$GITHUB_WORKSPACE/.venv" >> $GITHUB_ENV
- name: Cache Zenodo test data
uses: actions/cache@v5
with:
path: build/tests/integrated/test-fci-mpi/grid.fci.nc
# If we update the test, invalidate the cache
key: zenodo-data-${{ hashFiles('tests/integrated/test-fci-mpi/CMakeLists.txt') }}
- name: Cache SUNDIALS build
uses: actions/cache@v5
with:
path: /home/runner/local
key: bout-sundials-${{ matrix.config.os }}${{ matrix.config.build_petsc }}
- name: Build SUNDIALS
run: ./.build_sundials_for_ci.sh
- name: Build PETSc
run: BUILD_PETSC=${{ matrix.config.build_petsc }} ./.build_petsc_for_ci.sh ${{ matrix.config.build_petsc_branch }}
- name: Build ADIOS2
run: BUILD_ADIOS2=${{ matrix.config.build_adios2 }} ./.build_adios2_for_ci.sh
- name: Build BOUT++
run: |
UNIT_ONLY=${{ matrix.config.unit_only }} ./.ci_with_cmake.sh ${{ matrix.config.cmake_options }} \
-DPython3_EXECUTABLE=$GITHUB_WORKSPACE/.venv/bin/python
Fedora:
# This is its own job as it doesn't use most of the steps of the
# standard_tests
timeout-minutes: 120
runs-on: ubuntu-latest
env:
BOUT_TEST_DOWNLOAD_FLAGS: --retry-on-http-error=502,503,504 --tries 3
steps:
- uses: actions/checkout@v6
with:
submodules: true
- name: Cache Zenodo test data
uses: actions/cache@v5
with:
path: build/tests/integrated/test-fci-mpi/grid.fci.nc
# If we update the test, invalidate the cache
key: zenodo-data-${{ hashFiles('tests/integrated/test-fci-mpi/CMakeLists.txt') }}
- name: Build Fedora
run: ./.ci_fedora.sh setup openmpi
shell: bash
env:
TRAVIS_BUILD_DIR: ${{ github.workspace }}