-
Notifications
You must be signed in to change notification settings - Fork 245
85 lines (70 loc) · 1.99 KB
/
mpi.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
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