-
Notifications
You must be signed in to change notification settings - Fork 32
433 lines (426 loc) · 17.5 KB
/
main.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
name: CI
# Controls when the action will run.
on:
pull_request:
branches: [master]
workflow_dispatch:
jobs:
linting:
name: "Flint"
runs-on: ubuntu-20.04
steps:
- name: Setup env.
run: |
sudo apt-get update && sudo apt-get install -yq python3-dev python3-pip python3-tk
pip install nobvisual==0.2.0 flinter==0.4.0
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Lint
run: |
flint score src/ -d 10 -r flinter_rc.yml | tee flint.txt
score=$(awk '$1==0{print $3}' flint.txt)
if (( $(echo "$score < 8.02" |bc -l) )) ; then
exit 1
fi
- name: Archive linter report
uses: actions/upload-artifact@v4
with:
name: flint-report
path: flint.txt
retention-days: 5
GNU:
needs: linting
runs-on: ${{matrix.os}}
strategy:
fail-fast: true
matrix:
os: [ubuntu-20.04, macos-13]
compiler: [gfortran-10, gfortran-11, gfortran-12]
backend: [cpu, cuda, hip, opencl]
precision: [sp, dp]
exclude:
- os: ubuntu-20.04
compiler: gfortran-11
- os: ubuntu-20.04
compiler: gfortran-12
- os: ubuntu-20.04
backend: opencl
- os: macos-13
compiler: gfortran-10
- os: macos-13
backend: cuda
- os: macos-13
backend: hip
include:
- os: ubuntu-20.04
setup-env: |
sudo apt-get update && sudo apt-get install -y openmpi-bin libopenmpi-dev autoconf automake autotools-dev libopenblas-dev make git m4 python3 cmake-curses-gui
- os: macos-13
setup-env: export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 && brew install openmpi && brew install automake && brew install gcc@11 && brew install gcc@12
env:
FC: ${{ matrix.compiler }}
OMPI_FC: ${{ matrix.compiler }}
OMPI_ALLOW_RUN_AS_ROOT: 1
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1
OMPI_MCA_btl_vader_single_copy_mechanism: none
RP: ${{ matrix.precision }}
name: ${{ matrix.os }} / ${{ matrix.compiler }} / ${{ matrix.backend }} / ${{ matrix.precision }}
steps:
- name: Setup env.
run: ${{ matrix.setup-env }}
- name: Cache pFUnit
id: cache-pfunit
uses: actions/cache@v4
with:
path: ~/pkg/pfunit
key: pfunit-${{ runner.os }}-${{ matrix.os }}-${{ matrix.compiler }}
- name: Build pFUnit
if: ${{ (steps.cache-pfunit.outputs.cache-hit != 'true') && (matrix.backend == 'cpu') }}
run: |
git clone --depth 1 https://github.com/Goddard-Fortran-Ecosystem/pFUnit.git -b v4.4.2
cd pFUnit
cat >> pfunit_error_stop.patch << _ACEOF
diff --git a/src/funit/FUnit.F90 b/src/funit/FUnit.F90
index 7df7b65..4f7dbf5 100644
--- a/src/funit/FUnit.F90
+++ b/src/funit/FUnit.F90
@@ -168,7 +168,7 @@ contains
#if defined(PGI)
call exit(-1)
#else
- stop '*** Encountered 1 or more failures/errors during testing. ***'
+ error stop '*** Encountered 1 or more failures/errors during testing. ***'
#endif
end if
_ACEOF
git apply pfunit_error_stop.patch && mkdir b && cd b
cmake -DCMAKE_INSTALL_PREFIX=${HOME}/pkg/pfunit ..
make -j$(nproc) && make install && cd ../../
- name: Cache json-fortran
id: cache-json-fortran
uses: actions/cache@v4
with:
path: ~/pkg/json-fortran
key: json-fortran-${{ runner.os }}-${{ matrix.os }}-${{ matrix.compiler }}
- name: Install json-fortran
if: ${{ (steps.cache-json-fortran.outputs.cache-hit != 'true') }}
run: |
git clone --depth 1 https://github.com/ExtremeFLOW/json-fortran/
cd json-fortran
mkdir build && cd build
cmake -DCMAKE_INSTALL_PREFIX=${HOME}/pkg/json-fortran -DUSE_GNU_INSTALL_CONVENTION=ON ..
make -j$(nproc) && make install && cd ../../
rm -f ${HOME}/pkg/json-fortran/lib/*.dylib
- name: Setup json-fortran
run: |
echo "PKG_CONFIG_PATH=${PKG_CONFIG_PATH}:${HOME}/pkg/json-fortran/lib/pkgconfig/" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${HOME}/pkg/json-fortran/lib/" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Build (CPU backend)
if: matrix.backend == 'cpu'
run: |
echo $PKG_CONFIG_PATH
./regen.sh
./configure FC=${FC} FCFLAGS="-O2 -pedantic -std=f2008" --with-pfunit=${HOME}/pkg/pfunit/PFUNIT-4.4 --enable-real=${RP}
make -j$(nproc)
- name: Build (CUDA backend)
if: matrix.backend == 'cuda'
run: |
sudo apt-get install -y nvidia-cuda-toolkit
./regen.sh
./configure FC=${FC} FCFLAGS="-O2 -pedantic -std=f2008" --enable-real=${RP} --with-cuda=/usr
make -j$(nproc)
- name: Build (HIP backend)
if: matrix.backend == 'HIP'
run: |
wget -q -O - https://repo.radeon.com/rocm/rocm.gpg.key | sudo apt-key add -
echo 'deb [arch=amd64] https://repo.radeon.com/rocm/apt/debian/ ubuntu main' | sudo tee /etc/apt/sources.list.d/rocm.list
sudo apt-get update && sudo apt-get install -y rocm-dev
./regen.sh
./configure FC=${FC} FCFLAGS="-O2 -pedantic -std=f2008" HIP_HIPCC_FLAGS="-O2 -fPIE" --enable-real=${RP} --with-hip=/opt/rocm-6.1.2
make -j$(nproc)
- name: Build (OpenCL backend)
if: matrix.backend == 'opencl'
run: |
./regen.sh
./configure FC=${FC} FCFLAGS="-O2 -pedantic -std=f2008" --enable-real=${RP} --with-opencl
make -j$(nproc)
- name: Check
if: matrix.backend == 'cpu'
run: |
ls ${HOME}/pkg/json-fortran/lib/
make -j$(nproc) check
- name: Archive test report
if: matrix.backend == 'cpu' && failure()
uses: actions/upload-artifact@v2
with:
name: Test report_${{ matrix.os }}_${{ matrix.compiler }}
path: tests/test-suite.log
retention-days: 2
- name: Dist (CPU backend)
if: matrix.backend == 'cpu'
run: |
make dist
mkdir releng
tar xf neko-*.tar.gz -C releng
cd releng/neko-*
./configure FC=${FC} --enable-real=${RP}
make -j $(nproc)
- name: Dist (CUDA backend)
if: matrix.backend == 'cuda'
run: |
make dist
mkdir releng
tar xf neko-*.tar.gz -C releng
cd releng/neko-*
./configure FC=${FC} --enable-real=${RP} --with-cuda=/usr
make -j $(nproc)
- name: Dist (HIP backend)
if: matrix.backend == 'hip'
run: |
make dist
mkdir releng
tar xf neko-*.tar.gz -C releng
cd releng/neko-*
./configure FC=${FC} FCFLAGS="-fPIE" --enable-real=${RP} HIP_HIPCC_FLAGS="-O2 -fPIE" --with-hip=/opt/rocm-6.1.2
make -j $(nproc)
- name: Dist (OpenCL backend)
if: matrix.backend == 'opencl'
run: |
make dist
mkdir releng
tar xf neko-*.tar.gz -C releng
cd releng/neko-*
./configure FC=${FC} --enable-real=${RP} --with-opencl
make -j $(nproc)
Intel:
needs: linting
runs-on: ${{matrix.os}}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04]
compiler: [ifort, ifx]
precision: [sp, dp]
backend: [cpu]
include:
- os: ubuntu-20.04
setup-env: |
wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null && echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list && sudo apt-get update -y && sudo apt install -y --no-install-recommends intel-oneapi-compiler-fortran intel-oneapi-mpi intel-oneapi-mpi-devel intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic
source /opt/intel/oneapi/setvars.sh
sudo apt install -y autoconf automake autotools-dev libopenblas-dev make git m4 python3 ca-certificates cmake
INTEL_PATH=$(find /opt/intel/oneapi/compiler/ -name "${FC}" -type f | xargs dirname)
export PATH=$INTEL_PATH:${PATH}
printenv >> $GITHUB_ENV
env:
CC: icc
FC: ${{ matrix.compiler }}
RP: ${{ matrix.precision }}
name: ${{ matrix.os }} / ${{ matrix.compiler }} / ${{ matrix.backend }} / ${{ matrix.precision }}
steps:
- name: Setup env.
run: ${{ matrix.setup-env }}
- name: Cache json-fortran
id: cache-json-fortran
uses: actions/cache@v4
with:
path: ~/pkg/json-fortran
key: json-fortran-${{ runner.os }}-${{ matrix.os }}-${{ matrix.compiler }}
- name: Install json-fortran
if: ${{ (steps.cache-json-fortran.outputs.cache-hit != 'true') }}
run: |
git clone --depth 1 https://github.com/ExtremeFLOW/json-fortran/
cd json-fortran
mkdir build && cd build
env FC=${FC} cmake -DCMAKE_INSTALL_PREFIX=${HOME}/pkg/json-fortran -DUSE_GNU_INSTALL_CONVENTION=ON ..
make -j$(nproc) && make install && cd ../../
cat ${HOME}/pkg/json-fortran/lib/pkgconfig/json-fortran.pc
- name: Setup json-fortran
run: |
echo "PKG_CONFIG_PATH=${PKG_CONFIG_PATH}:${HOME}/pkg/json-fortran/lib/pkgconfig/" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${HOME}/pkg/json-fortran/lib/" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Build
run: |
echo $PKG_CONFIG_PATH
./regen.sh
./configure FC=${FC} CC=${CC} MPIFC"=mpiifort -fc=${FC}" --enable-real=${RP}
make FCFLAGS="-O2 -stand f08 -warn errors `pkg-config --cflags json-fortran`" -j$(nproc)
NVIDIA:
needs: linting
runs-on: ${{matrix.os}}
strategy:
fail-fast: true
matrix:
os: [ubuntu-20.04]
compiler: [nvfortran]
backend: [cpu, cuda]
precision: [dp]
include:
- os: ubuntu-20.04
setup-env: sudo apt-get update && sudo apt-get install -y autoconf automake autotools-dev make git m4 libopenblas-dev && curl https://developer.download.nvidia.com/hpc-sdk/ubuntu/DEB-GPG-KEY-NVIDIA-HPC-SDK | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-hpcsdk-archive-keyring.gpg && echo 'deb [signed-by=/usr/share/keyrings/nvidia-hpcsdk-archive-keyring.gpg] https://developer.download.nvidia.com/hpc-sdk/ubuntu/amd64 /' | sudo tee /etc/apt/sources.list.d/nvhpc.list && sudo apt-get update -y && sudo apt-get install -y nvhpc-24-3 && NVARCH=`uname -s`_`uname -m`; export NVARCH && NVCOMPILERS=/opt/nvidia/hpc_sdk; export NVCOMPILERS && PATH=$NVCOMPILERS/$NVARCH/24.3/compilers/bin:$PATH; export PATH && export PATH=$NVCOMPILERS/$NVARCH/24.3/comm_libs/mpi/bin:$PATH && printenv >> $GITHUB_ENV
env:
CC: gcc
FC: ${{ matrix.compiler }}
OMPI_FC: ${{ matrix.compiler }}
OMPI_CC: gcc
OMPI_ALLOW_RUN_AS_ROOT: 1
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1
OMPI_MCA_btl_vader_single_copy_mechanism: none
RP: ${{ matrix.precision }}
name: ${{ matrix.os }} / ${{ matrix.compiler }} / ${{ matrix.backend }} / ${{ matrix.precision }}
steps:
- name: Setup env.
run: ${{ matrix.setup-env }}
- name: Cache json-fortran
id: cache-json-fortran
uses: actions/cache@v4
with:
path: ~/pkg/json-fortran
key: json-fortran-${{ runner.os }}-${{ matrix.os }}-${{ matrix.compiler }}
- name: Install json-fortran
if: ${{ (steps.cache-json-fortran.outputs.cache-hit != 'true') }}
run: |
git clone --depth 1 https://github.com/ExtremeFLOW/json-fortran/
cd json-fortran
mkdir build && cd build
cmake -DCMAKE_INSTALL_PREFIX=${HOME}/pkg/json-fortran -DUSE_GNU_INSTALL_CONVENTION=ON ..
make -j$(nproc) && make install && cd ../../
cat ${HOME}/pkg/json-fortran/lib/pkgconfig/json-fortran.pc
- name: Setup json-fortran
run: |
echo "PKG_CONFIG_PATH=${PKG_CONFIG_PATH}:${HOME}/pkg/json-fortran/lib/pkgconfig/" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${HOME}/pkg/json-fortran/lib/" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Build (CPU backend)
if: matrix.backend == 'cpu'
run: |
git apply patches/nvhpc_bge.patch
./regen.sh
./configure FC=${FC} FCFLAGS="-O3" --enable-real=${RP}
make
- name: Build (CUDA backend)
if: matrix.backend == 'cuda'
run: |
git apply patches/nvhpc_bge.patch
./regen.sh
./configure FC=${FC} FCFLAGS="-O3" --enable-real=${RP} --with-cuda=/opt/nvidia/hpc_sdk/Linux_x86_64/24.3/cuda/
make
- name: Dist (CPU backend)
if: matrix.backend == 'cpu'
run: |
git stash
make dist
mkdir releng
tar xf neko-*.tar.gz -C releng
cd releng/neko-*
patch -u src/common/signal.f90 -i patches/nvhpc_bge.patch
./configure FC=${FC} FCFLAGS="-O3" --enable-real=${RP}
make -j $(nproc)
- name: Dist (CUDA backend)
if: matrix.backend == 'cuda'
run: |
git stash
make dist
mkdir releng
tar xf neko-*.tar.gz -C releng
cd releng/neko-*
patch -u src/common/signal.f90 -i patches/nvhpc_bge.patch
./configure FC=${FC} FCFLAGS="-O3" --enable-real=${RP} --with-cuda=/opt/nvidia/hpc_sdk/Linux_x86_64/24.3/cuda/
make -j $(nproc)
ReFrame:
needs: GNU
runs-on: ubuntu-20.04
strategy:
fail-fast: true
matrix:
precision: [sp, dp]
compiler: [gfortran-10]
env:
FC: ${{ matrix.compiler }}
OMPI_FC: ${{ matrix.compiler}}
OMPI_ALLOW_RUN_AS_ROOT: 1
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1
OMPI_MCA_btl_vader_single_copy_mechanism: none
RP: ${{ matrix.precision }}
name: ReFrame / ${{ matrix.compiler}} / ${{ matrix.precision }}
steps:
- name: Setup env.
run: |
sudo apt-get update && sudo apt-get install -y openmpi-bin libopenmpi-dev autoconf automake autotools-dev libopenblas-dev make git m4 python3
pip install reframe-hpc
- name: Cache json-fortran
id: cache-json-fortran
uses: actions/cache@v4
with:
path: ~/pkg/json-fortran
key: json-fortran-${{ runner.os }}-${{ matrix.os }}-${{ matrix.compiler }}
- name: Install json-fortran
if: ${{ (steps.cache-json-fortran.outputs.cache-hit != 'true') }}
run: |
git clone --depth 1 https://github.com/ExtremeFLOW/json-fortran/
cd json-fortran
mkdir build && cd build
cmake -DCMAKE_INSTALL_PREFIX=${HOME}/pkg/json-fortran -DUSE_GNU_INSTALL_CONVENTION=ON ..
make -j$(nproc) && make install && cd ../../
cat ${HOME}/pkg/json-fortran/lib/pkgconfig/json-fortran.pc
- name: Setup json-fortran
run: |
echo "PKG_CONFIG_PATH=${PKG_CONFIG_PATH}:${HOME}/pkg/json-fortran/lib/pkgconfig/" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${HOME}/pkg/json-fortran/lib/" >> $GITHUB_ENV
- name: Topology
run: |
reframe --detect-host-topology
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Regression tests
run: |
./regen.sh
cd reframe
env NEKO_REAL=${RP} NEKO_SCHEME=pnpn reframe -v -C settings.py -c checks.py -n MiniHemi -n MiniTgv8 -n MiniRB -r --performance-report --system github-actions:cpu
documentation:
needs: [Intel, GNU, NVIDIA, ReFrame]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup env.
run: |
sudo apt-get update && sudo apt-get install -y git openmpi-bin libopenmpi-dev autoconf automake autotools-dev libopenblas-dev make git m4 python3 doxygen fonts-freefont-ttf graphviz
git clone https://github.com/ExtremeFLOW/doxygen-awesome-css doc/doxygen-awesome-css
git clone --depth 1 https://github.com/ExtremeFLOW/json-fortran/
cd json-fortran
mkdir build && cd build
cmake -DCMAKE_INSTALL_PREFIX=${HOME}/pkg/json-fortran -DUSE_GNU_INSTALL_CONVENTION=ON ..
make -j$(nproc) && make install && cd ../../
echo "PKG_CONFIG_PATH=${PKG_CONFIG_PATH}:${HOME}/pkg/json-fortran/lib/pkgconfig/" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${HOME}/pkg/json-fortran/lib/" >> $GITHUB_ENV
- name: Doxygen
run: |
./regen.sh
./configure FC=${FC}
make html
# Deploy the HTML documentation to GitHub Pages
- name: GH Pages Deployment
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./doc/html/
allow_empty_commit: false
force_orphan: false
publish_branch: gh-pages
destination_dir: docs/release
keep_files: false
enable_jekyll: true