add mpi testing to github actions #242
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CMake test matrix | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
build: | |
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
compiler: [g++, clang++] | |
kokkos: [on, off] | |
mempool: [on, off] | |
mpi: [on, off] | |
exclude: | |
- kokkos: off | |
mempool: on | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
path: omega_h | |
- uses: actions/checkout@v4 | |
if: ${{ matrix.kokkos == 'on' }} | |
with: | |
repository: kokkos/kokkos | |
path: kokkos | |
- name: install mpich | |
if: ${{ matrix.mpi == 'on' }} | |
run: | | |
sudo apt update | |
sudo apt install mpich | |
- name: set mpi compiler wrapper | |
if: ${{ matrix.mpi == 'on' }} | |
run: | | |
echo "CXX=mpicxx" >> "$GITHUB_ENV" | |
echo "MPICH_CXX=${{matrix.compiler.CXX}}" >> "$GITHUB_ENV" | |
- name: set base compiler | |
if: ${{ matrix.mpi == 'off' }} | |
run: | | |
echo "CXX=${{matrix.compiler.CXX}}" >> "$GITHUB_ENV" | |
- name: Configure Kokkos | |
if: ${{ matrix.kokkos == 'on' }} | |
shell: bash | |
working-directory: ${{github.workspace}}/kokkos | |
run: cmake . | |
-Bbuild | |
-DCMAKE_CXX_COMPILER=${{ matrix.compiler }} | |
-DCMAKE_INSTALL_PREFIX=build/install | |
- name: Build Kokkos | |
if: ${{ matrix.kokkos == 'on' }} | |
shell: bash | |
run: cmake --build $GITHUB_WORKSPACE/kokkos/build --target install | |
- name: check env | |
run: | |
printf 'CXX = %s\n' "$CXX" | |
- name: Configure CMake | |
shell: bash | |
working-directory: ${{github.workspace}}/omega_h | |
run: cmake . | |
-Bbuild | |
-DCMAKE_CXX_COMPILER=${CXX} | |
-DCMAKE_VERBOSE_MAKEFILE=on | |
-DOmega_h_USE_MPI=${{ matrix.mpi }} | |
-DOmega_h_USE_Kokkos=${{ matrix.kokkos }} | |
-DKokkos_PREFIX=$GITHUB_WORKSPACE/kokkos/build/install | |
-DBUILD_TESTING=ON | |
-DBUILD_SHARED_LIBS=OFF | |
-DENABLE_CTEST_MEMPOOL=${{ matrix.mempool }} | |
- name: Build | |
working-directory: ${{github.workspace}}/omega_h/build | |
shell: bash | |
run: cmake --build . -j2 | |
- name: Test | |
working-directory: ${{github.workspace}}/omega_h/build | |
shell: bash | |
run: ctest | |
- name: Print | |
if: always() | |
run: cat ${{github.workspace}}/omega_h/build/Testing/Temporary/LastTest.log |