Skip to content

Commit 4678ba0

Browse files
committed
Enhance Github CI workflow
1 parent bba9eed commit 4678ba0

File tree

3 files changed

+49
-224
lines changed

3 files changed

+49
-224
lines changed

.github/workflows/ci.yml

Lines changed: 46 additions & 221 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Continuous Integration
1+
name: 'Test Suite'
22

33
on:
44
push:
@@ -10,62 +10,50 @@ on:
1010
- 'mfc.sh'
1111
- 'golden.txt'
1212
- 'CMakeLists.txt'
13+
- 'requirements.txt'
1314

1415
pull_request:
1516

1617
workflow_dispatch:
1718

1819
jobs:
1920
github:
20-
name: (GitHub) Test Suite
21+
name: Github
2122
strategy:
2223
matrix:
23-
include:
24-
- os: ubuntu-latest
25-
debug: --no-debug
26-
intel: false
27-
- os: ubuntu-latest
28-
debug: --debug
29-
intel: false
30-
# - os: ubuntu-latest
31-
# debug: --no-debug
32-
# intel: true
33-
# intel-command: source /opt/intel/oneapi/setvars.sh
34-
# - os: ubuntu-latest
35-
# debug: --debug
36-
# intel: true
37-
# intel-command: source /opt/intel/oneapi/setvars.sh
38-
- os: macos-latest
39-
debug: --no-debug
40-
gcc: 11
41-
- os: macos-latest
42-
debug: --debug
43-
gcc: 11
24+
os: ['ubuntu', 'macos']
25+
mpi: ['mpi', 'no-mpi']
26+
debug: ['debug', 'no-debug']
27+
intel: [false]
4428
fail-fast: false
4529
continue-on-error: true
46-
runs-on: ${{ matrix.os }}
30+
runs-on: ${{ matrix.os }}-latest
4731
steps:
4832
- name: Clone
4933
uses: actions/checkout@v3
5034

5135
- name: Setup MacOS
52-
if: matrix.os == 'macos-latest'
36+
if: matrix.os == 'macos'
5337
run: |
54-
echo "OMPI_FC=gfortran-${{ matrix.gcc }}" >> $GITHUB_ENV
55-
echo "OMPI_CXX=g++-${{ matrix.gcc }}" >> $GITHUB_ENV
56-
echo "OMPI_MPICC=gcc-${{ matrix.gcc }}" >> $GITHUB_ENV
57-
echo "CC=gcc-${{ matrix.gcc }}" >> $GITHUB_ENV
58-
echo "CXX=g++-${{ matrix.gcc }}" >> $GITHUB_ENV
59-
echo "FC=gfortran-${{ matrix.gcc }}" >> $GITHUB_ENV
60-
brew install wget make python make cmake coreutils gcc@${{ matrix.gcc }}
61-
HOMEBREW_MAKE_JOBS=$(nproc) brew install --cc=gcc-${{ matrix.gcc }} --verbose --build-from-source open-mpi
38+
echo "CC=gcc-13" >> $GITHUB_ENV
39+
echo "CXX=g++-13" >> $GITHUB_ENV
40+
echo "FC=gfortran-13" >> $GITHUB_ENV
41+
brew install wget make python make cmake coreutils gcc@13
42+
43+
- name: (MacOS) Build OpenMPI
44+
if: matrix.os == 'macos' && matrix.mpi == 'mpi'
45+
run: |
46+
echo "OMPI_FC=gfortran-13" >> $GITHUB_ENV
47+
echo "OMPI_CXX=g++-13" >> $GITHUB_ENV
48+
echo "OMPI_MPICC=gcc-13" >> $GITHUB_ENV
49+
HOMEBREW_MAKE_JOBS=$(nproc) brew install --cc=gcc-13 --verbose --build-from-source open-mpi
6250
6351
- name: Setup Ubuntu
64-
if: matrix.os == 'ubuntu-latest' && matrix.intel == false
52+
if: matrix.os == 'ubuntu' && matrix.intel == false
6553
run: sudo apt install tar wget make cmake gcc g++ python3 python3-dev "openmpi-*" libopenmpi-dev
6654

6755
- name: Setup Ubuntu (Intel)
68-
if: matrix.os == 'ubuntu-latest' && matrix.intel == true
56+
if: matrix.os == 'ubuntu' && matrix.intel == true
6957
run: |
7058
sudo apt install tar wget make cmake python3 python3-dev
7159
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
@@ -84,211 +72,48 @@ jobs:
8472
echo "MPI_HOME=/opt/intel/oneapi/mpi/2021.7.1/" >> $GITHUB_ENV
8573
8674
- name: Build
87-
run: |
88-
${{ matrix.intel-command }}
89-
/bin/bash mfc.sh build -j $(nproc) ${{ matrix.debug }}
75+
run: /bin/bash mfc.sh build -j $(nproc) --${{ matrix.debug }} --${{ matrix.mpi }}
9076

91-
- name: Test Suite (Debug)
92-
if: matrix.debug == '--debug'
93-
run: |
94-
${{ matrix.intel-command }}
95-
/bin/bash mfc.sh test -j $(nproc) --debug
96-
97-
- name: Test Suite (No Debug)
98-
if: matrix.debug == '--no-debug'
99-
run: |
100-
${{ matrix.intel-command }}
101-
/bin/bash mfc.sh test -j $(nproc) -a
102-
77+
- name: Test
78+
run: /bin/bash mfc.sh test -j $(nproc) $(if [ "${{ matrix.mpi }}" == "mpi" ]; then echo "--test-all"; fi)
10379

104-
self-cpu-release:
105-
name: Test CPU release - nvhpc
106-
runs-on:
107-
group: phoenix
108-
labels: self-hosted
109-
if: github.repository == 'MFlowCode/MFC'
110-
continue-on-error: true
80+
docker:
81+
name: Github | Docker
82+
runs-on: ubuntu-latest
11183
steps:
112-
- name: Clone
113-
uses: actions/checkout@v3
84+
- name: Clone
85+
uses: actions/checkout@v3
11486

115-
- name: Build
116-
run: |
117-
. ./mfc.sh load -c p -m g
118-
./mfc.sh build -j 2
87+
- name: Test
88+
run: sudo ./mfc.sh docker ./mfc.sh test -j $(nproc) -a
11989

120-
- name: Test
121-
run: |
122-
. ./mfc.sh load -c p -m g
123-
mv misc/run-phoenix-release-cpu.sh ./
124-
sbatch run-phoenix-release-cpu.sh
125-
126-
- name: Print
127-
if: always()
128-
run: |
129-
cat test.out
130-
131-
self-gpu-release:
132-
name: Test GPU release - nvhpc
133-
runs-on:
134-
group: phoenix
135-
labels: self-hosted
90+
self:
91+
name: Georgia Tech | Phoenix (NVHPC)
13692
if: github.repository == 'MFlowCode/MFC'
13793
continue-on-error: true
94+
strategy:
95+
matrix:
96+
device: ['cpu', 'gpu']
97+
runs-on:
98+
group: phoenix
99+
labels: self-hosted
138100
steps:
139101
- name: Clone
140102
uses: actions/checkout@v3
141103

142104
- name: Build
143105
run: |
144-
. ./mfc.sh load -c p -m g
145-
./mfc.sh build -j 2 --gpu
106+
. ./mfc.sh load -c p -m gpu
107+
./mfc.sh build -j 2 $(if [ '${{ matrix.device }}' == 'gpu' ]; then echo '--gpu'; fi)
146108
147109
- name: Test
148110
run: |
149-
. ./mfc.sh load -c p -m g
150-
mv misc/run-phoenix-release-gpu.sh ./
151-
sbatch run-phoenix-release-gpu.sh
111+
. ./mfc.sh load -c p -m gpu
112+
mv misc/run-phoenix-release-${{ matrix.device }}.sh ./
113+
sbatch run-phoenix-release-${{ matrix.device }}.sh
152114
153115
- name: Print
154116
if: always()
155117
run: |
156118
cat test.out
157119
158-
159-
# self-cpu:
160-
# name: (Self) Test Suite - CPU
161-
# strategy:
162-
# matrix:
163-
# include:
164-
# - os: [self-hosted, wingtip]
165-
# runs-on: ${{ matrix.os }}
166-
# if: github.repository == 'MFlowCode/MFC'
167-
# steps:
168-
# - name: Clone
169-
# uses: actions/checkout@v3
170-
171-
# - name: Setup
172-
# run: echo "test"
173-
174-
# - name: Build
175-
# run: |
176-
# module use /opt/nvidia/hpc_sdk/modulefiles/
177-
# module load nvhpc
178-
# /bin/bash mfc.sh build -j 8
179-
180-
# - name: Test Suite
181-
# run: |
182-
# module use /opt/nvidia/hpc_sdk/modulefiles/
183-
# module load nvhpc
184-
# /bin/bash mfc.sh test -j 8 -a
185-
186-
# self-cpu-debug:
187-
# name: (Self) Test Suite - CPU - debug
188-
# strategy:
189-
# matrix:
190-
# include:
191-
# - os: [self-hosted, wingtip]
192-
# runs-on: ${{ matrix.os }}
193-
# if: github.repository == 'MFlowCode/MFC'
194-
# steps:
195-
# - name: Clone
196-
# uses: actions/checkout@v3
197-
198-
# - name: Setup
199-
# run: echo "test"
200-
201-
# - name: Build
202-
# run: |
203-
# module use /opt/nvidia/hpc_sdk/modulefiles/
204-
# module load nvhpc
205-
# /bin/bash mfc.sh build -j 8 --debug
206-
207-
# - name: Test Suite
208-
# run: |
209-
# module use /opt/nvidia/hpc_sdk/modulefiles/
210-
# module load nvhpc
211-
# /bin/bash mfc.sh test -j 8 --debug
212-
213-
# self-gpu:
214-
# name: (Self) Test Suite - GPU
215-
# strategy:
216-
# matrix:
217-
# include:
218-
# - os: [self-hosted, wingtip]
219-
# runs-on: ${{ matrix.os }}
220-
# if: github.repository == 'MFlowCode/MFC'
221-
# steps:
222-
# - name: Clone
223-
# uses: actions/checkout@v3
224-
225-
# - name: Setup
226-
# run: echo "test"
227-
228-
# - name: Build
229-
# run: |
230-
# module use /opt/nvidia/hpc_sdk/modulefiles/
231-
# module load nvhpc
232-
# /bin/bash mfc.sh build -j 8 --gpu
233-
234-
# - name: Test Suite
235-
# run: |
236-
# module use /opt/nvidia/hpc_sdk/modulefiles/
237-
# module load nvhpc
238-
# /bin/bash mfc.sh test -j 8 -b mpirun --gpu -a
239-
240-
# self-gpu-debug:
241-
# name: (Self) Test Suite - GPU - debug
242-
# strategy:
243-
# matrix:
244-
# include:
245-
# - os: [self-hosted, wingtip]
246-
# runs-on: ${{ matrix.os }}
247-
# if: github.repository == 'MFlowCode/MFC'
248-
# steps:
249-
# - name: Clone
250-
# uses: actions/checkout@v3
251-
252-
# - name: Setup
253-
# run: echo "test"
254-
255-
# - name: Build
256-
# run: |
257-
# module use /opt/nvidia/hpc_sdk/modulefiles/
258-
# module load nvhpc
259-
# /bin/bash mfc.sh build -j 8 --gpu --debug
260-
261-
# - name: Test Suite
262-
# run: |
263-
# module use /opt/nvidia/hpc_sdk/modulefiles/
264-
# module load nvhpc
265-
# /bin/bash mfc.sh test -j 8 -b mpirun --gpu --debug
266-
267-
# ice-gpu:
268-
# name: (COC-ICE) Test Suite - GPU
269-
# strategy:
270-
# matrix:
271-
# include:
272-
# - os: [self-hosted, cocice]
273-
# runs-on: ${{ matrix.os }}
274-
# if: github.repository == 'MFlowCode/MFC'
275-
# steps:
276-
# - name: Clone
277-
# uses: actions/checkout@v3
278-
279-
# - name: Setup
280-
# run: echo "test"
281-
282-
# - name: Build
283-
# run: |
284-
# module purge
285-
# module load nvhpc
286-
# /usr/bin/bash mfc.sh build -j 4 --gpu
287-
288-
# - name: Test Suite
289-
# run: |
290-
# qsub -I -q coc-ice-gpu -l nodes=1:ppn=8:gpus=2:teslav100
291-
# module purge
292-
# module load nvhpc
293-
# /usr/bin/bash mfc.sh test -j 4 -b mpirun --gpu -a
294-
# exit

misc/run-phoenix-release-cpu.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@
1010

1111
cd $SLURM_SUBMIT_DIR # Change to working directory
1212
echo $(pwd)
13-
. ./mfc.sh load -c p -m g
13+
. ./mfc.sh load -c p -m gpu
1414
./mfc.sh test -j 12 -b mpirun -a

misc/run-phoenix-release-gpu.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@
1010

1111
cd $SLURM_SUBMIT_DIR # Change to working directory
1212
echo $(pwd)
13-
. ./mfc.sh load -c p -m g
14-
./mfc.sh test -j 1 -b mpirun -a --gpu
13+
. ./mfc.sh load -c p -m gpu
14+
./mfc.sh test -b mpirun -a --gpu

0 commit comments

Comments
 (0)