PhantomNR #1395
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: mpi | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
test: | |
strategy: | |
fail-fast: false | |
matrix: | |
debug: | |
- no | |
- yes | |
openmp: | |
- no | |
- yes | |
ntasks: | |
- 1 | |
- 4 | |
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: 4 | |
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@v3 | |
- 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 |