Skip to content

Merge pull request #600 from danieljprice/set-binary-fixes #1740

Merge pull request #600 from danieljprice/set-binary-fixes

Merge pull request #600 from danieljprice/set-binary-fixes #1740

Workflow file for this run

name: mpi
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
test:
strategy:
fail-fast: false
matrix:
debug:
- no
- yes
openmp:
- no
- yes
ntasks:
- 1
- 2
input: # [SETUP, phantom_tests]
- ['test', '']
- ['testkd', '']
- ['testdust', 'dust']
- ['testgr', 'gr']
- ['testgrav', 'gravity ptmass']
- ['testgrowth', 'dustgrowth']
- ['testnimhd', 'nimhd']
- ['test2', '']
- ['testcyl', '']
name: |
MPI test (SETUP=${{ matrix.input[0] }},
targets=${{ matrix.input[1] }},
DEBUG=${{ matrix.debug }},
OPENMP=${{ matrix.openmp }},
ntasks=${{ matrix.ntasks }})
runs-on: ubuntu-latest
env:
OMP_STACKSIZE: 512M
OMP_NUM_THREADS: 2
steps:
- name: Install gfortran and openMPI
run: |
sudo apt-get --yes update
sudo apt-get --yes install gfortran openmpi-bin openmpi-common libopenmpi-dev
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
- name: Compile with MPI
run: make SETUP=${{ matrix.input[0] }} MPI=yes DEBUG=${{ matrix.debug }} OPENMP=${{ matrix.openmp }} phantomtest
env:
SYSTEM: gfortran
- name: Test with MPI
run: mpirun --allow-run-as-root -np ${{ matrix.ntasks }} --oversubscribe ./bin/phantomtest ${{ matrix.input[1] }}
# Gather results into a dummy job that will fail if the previous job fails
gather_results:
if: always()
needs:
- test
# This name matches the branch protection requirement
name: mpi
runs-on: ubuntu-latest
steps:
- name: Check all tests
run: |
if [[ "${{ needs.test.result }}" == "success" ]]; then
echo "All tests succeeded"
else
echo "At least one test failed"
exit 1
fi