-
Notifications
You must be signed in to change notification settings - Fork 47
222 lines (194 loc) · 6.39 KB
/
testing-linux.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
---
name: Testing on Linux
on:
push:
branches:
- 'develop'
pull_request:
jobs:
##################################################################################
# Run pre-commit
##################################################################################
pre-commit:
runs-on: ubuntu-latest
container:
image: ghcr.io/cp2k/dbcsr-build-env-ubuntu-22.04:develop
steps:
- uses: actions/checkout@v4
- name: Run pre-commit
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
pre-commit run --all-files || ( git status --short ; git diff ; exit 1 )
##################################################################################
# Build and test on linux, no accelerator
##################################################################################
build-and-test:
runs-on: ubuntu-latest
container:
image: ghcr.io/cp2k/dbcsr-build-env-ubuntu-22.04:develop
strategy:
matrix:
use_mpi: [MPI=ON, MPI=OFF]
use_openmp: [OPENMP=ON, OPENMP=OFF]
use_smm: [SMM=blas, SMM=libxsmm]
mpi_suffix: [openmpi, mpich]
exclude:
- use_mpi: MPI=OFF
mpi_suffix: mpich
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- name: Configure
run: |
mkdir -p build
cd build
cmake -G Ninja \
-DCMAKE_BUILD_TYPE=Coverage \
-DUSE_${{ matrix.use_mpi }} \
-DUSE_${{ matrix.use_openmp }} \
-DUSE_${{ matrix.use_smm }} \
-DMPI_EXECUTABLE_SUFFIX=.${{ matrix.mpi_suffix }} \
-DMPIEXEC_PREFLAGS="$([ "${{ matrix.mpi_suffix }}" = "openmpi" ] && echo "-mca btl ^openib --allow-run-as-root --oversubscribe")" \
-DLCOV_ARGS="--test-name;${{ matrix.use_mpi }}-${{ matrix.use_openmp }}-${{ matrix.use_smm }}-cpu" \
-DTEST_MPI_RANKS=auto \
..
- name: Build
run: cmake --build build -- --verbose
- name: Test
run: |
cd build
ctest --output-on-failure
- name: Generate coverage info
run: |
cmake --build build -- cov-info
mv build/coverage.info build/coverage-Linux-${{ matrix.use_mpi }}-${{ matrix.use_openmp }}-${{ matrix.use_smm }}-cpu.info
- name: Upload coverage data
uses: actions/upload-artifact@v4
with:
name: coverage-data-${{ matrix.use_mpi }}-${{ matrix.use_openmp }}-${{ matrix.use_smm }}-${{ matrix.mpi_suffix }}
path: build/coverage-*.info
- name: Upload coverage data (generated files)
uses: actions/upload-artifact@v4
if: matrix.use_mpi == 'MPI=ON' && matrix.use_openmp == 'OPENMP=ON' && matrix.use_smm == 'SMM=blas' && matrix.mpi_suffix == 'openmpi'
with:
name: coverage-data-${{ matrix.use_mpi }}-${{ matrix.use_openmp }}-${{ matrix.use_smm }}-${{ matrix.mpi_suffix }}-generated-files
path: |
build/src/dbcsr.h
build/src/tensors/dbcsr_tensor.h
##################################################################################
# Build on CUDA
##################################################################################
build-on-cuda:
runs-on: ubuntu-latest
container:
image: ghcr.io/cp2k/dbcsr-build-env-ubuntu-22.04-cuda:develop
strategy:
matrix:
use_openmp: [OPENMP=ON]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- name: Configure
run: |
mkdir -p build
cd build
cmake -G Ninja \
-DCMAKE_BUILD_TYPE=Debug \
-DUSE_${{ matrix.use_openmp }} \
-DUSE_ACCEL=cuda \
-DWITH_GPU=H100 \
-DWITH_EXAMPLES=ON \
-DWITH_CUDA_PROFILING=ON \
..
- name: Build
run: cmake --build build -- --verbose
##################################################################################
# Build on OpenCL
##################################################################################
build-on-opencl:
runs-on: ubuntu-latest
container:
image: ghcr.io/cp2k/dbcsr-build-env-ubuntu-22.04-cuda:develop
strategy:
matrix:
use_openmp: [OPENMP=ON]
use_smm: [SMM=libxsmm]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- name: Configure
run: |
mkdir -p build
cd build
cmake -G Ninja \
-DCMAKE_BUILD_TYPE=Debug \
-DUSE_${{ matrix.use_openmp }} \
-DUSE_${{ matrix.use_smm }} \
-DUSE_ACCEL=opencl \
-DWITH_EXAMPLES=ON \
..
- name: Build
run: cmake --build build -- --verbose
##################################################################################
# Build on ROCm
##################################################################################
build-on-rocm:
runs-on: ubuntu-latest
container:
image: ghcr.io/cp2k/dbcsr-build-env-rocm:develop
strategy:
matrix:
use_openmp: [OPENMP=ON]
use_g2g: [G2G=ON, G2G=OFF]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- name: Configure
run: |
mkdir -p build
cd build
cmake -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DUSE_${{ matrix.use_openmp }} \
-DUSE_ACCEL=hip \
-DWITH_GPU=Mi250 \
-DWITH_${{ matrix.use_g2g }} \
-DWITH_EXAMPLES=ON \
-DCMAKE_PREFIX_PATH=/opt/rocm \
..
- name: Build
run: cmake --build build -- --verbose
coverage:
name: Combine & check coverage.
runs-on: ubuntu-latest
needs: build-and-test
container:
image: ghcr.io/cp2k/dbcsr-build-env-ubuntu-22.04:develop
steps:
- uses: actions/checkout@v4
- name: Download coverage data
uses: actions/[email protected]
with:
pattern: coverage-data-*
merge-multiple: true
- name: Combine coverage
run: |
mkdir -p build/src
mv dbcsr.h tensors build/src/
echo *.info | xargs printf -- '-a %s\n' | xargs lcov -o merged.info
genhtml merged.info -o htmlcov
lcov --summary merged.info
- name: Upload merged HTML report
uses: actions/upload-artifact@v4
with:
name: html-report
path: htmlcov
# vim: set ts=2 sw=2 tw=0 :