-
Notifications
You must be signed in to change notification settings - Fork 33
228 lines (199 loc) · 7.67 KB
/
check_gnu.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
name: GNU Fortran
# Controls when the action will run.
on:
push:
branches:
- develop
workflow_call:
inputs:
json-fortran-version:
description: "The version of the JSON-Fortran library to use."
type: string
required: false
default: "8.3.0"
pfunit-version:
description: "The version of the pFUnit library to use."
type: string
required: false
default: "v4.4.2"
jobs:
GNU:
runs-on: ${{matrix.os}}
strategy:
fail-fast: false
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
echo "nproc=$(nproc)" >> $GITHUB_OUTPUT
echo "os-version=$(lsb_release -ds | tr " " -)" >> $GITHUB_OUTPUT
- 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
echo "nproc=$(sysctl -n hw.ncpu)" >> $GITHUB_OUTPUT
echo "os-version=$(sw_vers -productName)-$(sw_vers -productVersion)" >> $GITHUB_OUTPUT
name: ${{ matrix.os }} - ${{ matrix.compiler }} - ${{ matrix.backend }} - ${{ matrix.precision }}
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 }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Setup env.
id: setup-env
run: ${{ matrix.setup-env }}
- name: Setup dependencies
id: setup-deps
env:
PFUNIT_VERSION: ${{ inputs.pfunit-version }}
JSON_FORTRAN_VERSION: ${{ inputs.json-fortran-version }}
run: |
if [ -z "$PFUNIT_VERSION" ]; then PFUNIT_VERSION="v4.4.2"; fi
if [ -z "$JSON_FORTRAN_VERSION" ]; then JSON_FORTRAN_VERSION="8.3.0"; fi
echo "pfunit-version=$PFUNIT_VERSION" >> $GITHUB_OUTPUT
echo "json-fortran-version=$JSON_FORTRAN_VERSION" >> $GITHUB_OUTPUT
- name: Get pFunit
id: get-pfunit
if: matrix.backend == 'cpu'
uses: ./.github/actions/setup_pfunit
with:
version: ${{ steps.setup-deps.outputs.pfunit-version }}
os: ${{ steps.setup-env.outputs.os-version }}
compiler: ${{ matrix.compiler }}
- name: Get json-fortran
id: get-json-fortran
uses: ./.github/actions/setup_json-fortran
with:
version: ${{ steps.setup-deps.outputs.json-fortran-version }}
os: ${{ steps.setup-env.outputs.os-version }}
compiler: ${{ matrix.compiler }}
- name: Add JSON-Fortran to environment
env:
JSON_FORTRAN_DIR: ${{ steps.get-json-fortran.outputs.install-dir }}
run: |
echo "PKG_CONFIG_PATH=${PKG_CONFIG_PATH}:$JSON_FORTRAN_DIR/lib/pkgconfig/" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$JSON_FORTRAN_DIR/lib/" >> $GITHUB_ENV
- name: Build (CPU backend)
if: matrix.backend == 'cpu'
env:
PFUNIT_DIR: ${{ steps.get-pfunit.outputs.install-dir }}
run: |
./regen.sh
./configure FC=${FC} FCFLAGS="-O2 -pedantic -std=f2008 -w" --with-pfunit=$PFUNIT_DIR --enable-real=${RP}
make -j${{ steps.setup-env.outputs.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 -w" --enable-real=${RP} --with-cuda=/usr
make -j${{ steps.setup-env.outputs.nproc }}
- name: Build (HIP backend)
if: matrix.backend == 'HIP'
run: |
# Following the instructions from https://rocm.docs.amd.com/projects/install-on-linux/en/latest/install/quick-start.html
wget -r -np -nd -A 'amdgpu*.deb' https://repo.radeon.com/amdgpu-install/latest/ubuntu/focal/
sudo apt install ./amdgpu-install_*.deb
sudo apt-get update && sudo apt-get install -y amdgpu-dkms rocm-dev
# Lets not hardcode the version
ROCM_DIR=$(ls -d /opt/rocm-*)
./regen.sh
./configure FC=${FC} FCFLAGS="-O2 -pedantic -std=f2008 -w" HIP_HIPCC_FLAGS="-O2 -fPIE" --enable-real=${RP} --with-hip=$ROCM_DIR
make -j ${{ steps.setup-env.outputs.nproc }}
- name: Build (OpenCL backend)
if: matrix.backend == 'opencl'
run: |
./regen.sh
./configure FC=${FC} FCFLAGS="-O2 -pedantic -std=f2008 -w" --enable-real=${RP} --with-opencl
make -j ${{ steps.setup-env.outputs.nproc }}
- name: Regression test FP32
if: matrix.backend == 'cpu' && matrix.precision == 'sp'
run: |
cd tests/regression/cylinder
./test_easy.sh 1 sp
cd ../..
- name: Regression test FP64
if: matrix.backend == 'cpu' && matrix.precision == 'dp'
run: |
cd tests/regression/cylinder
./test.sh 1 dp
cd ../..
- name: Check
if: matrix.backend == 'cpu'
run: |
make -j ${{ steps.setup-env.outputs.nproc }} check > tests/test-suite.log
- name: Archive test report
if: matrix.backend == 'cpu' && failure()
uses: actions/upload-artifact@v4
with:
name: Test report - ${{ matrix.os }} - ${{ matrix.compiler }} - ${{ matrix.backend }} - ${{ matrix.precision }}
path: tests/unit/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 ${{ steps.setup-env.outputs.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 ${{ steps.setup-env.outputs.nproc }}
- name: Dist (HIP backend)
if: matrix.backend == 'hip'
run: |
make dist
mkdir releng
tar xf neko-*.tar.gz -C releng
cd releng/neko-*
ROCM_DIR=$(ls -d /opt/rocm-*)
./configure FC=${FC} FCFLAGS="-fPIE" --enable-real=${RP} HIP_HIPCC_FLAGS="-O2 -fPIE" --with-hip=$ROCM_DIR
make -j ${{ steps.setup-env.outputs.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 ${{ steps.setup-env.outputs.nproc }}