-
Notifications
You must be signed in to change notification settings - Fork 52
253 lines (226 loc) · 8.76 KB
/
build-and-test-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
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
name: Build and Test (Linux)
on:
push:
branches:
- main
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-and-test-linux:
strategy:
fail-fast: false
matrix:
include: # Pairwise testing (from allpairspy)
- compiler: gcc
mpi: mpich
math-libs: aocl
build-shared: static
with-64bit-int: int64
with-openmp: openmp
with-solver: strumpack
with-eigensolver: arpack
- compiler: clang
mpi: mpich
math-libs: aocl
build-shared: shared
with-64bit-int: int64
with-openmp: serial
with-solver: superlu
with-eigensolver: arpack
- compiler: gcc
mpi: openmpi
math-libs: openblas
build-shared: shared
with-64bit-int: int32
with-openmp: openmp
with-solver: strumpack
with-eigensolver: slepc
- compiler: intel
mpi: intelmpi
math-libs: intelmkl
build-shared: static
with-64bit-int: int64
with-openmp: openmp
with-solver: superlu
with-eigensolver: slepc
- compiler: intel
mpi: intelmpi
math-libs: intelmkl
build-shared: static
with-64bit-int: int32
with-openmp: serial
with-solver: strumpack
with-eigensolver: arpack
- compiler: intel
mpi: intelmpi
math-libs: intelmkl
build-shared: shared
with-64bit-int: int32
with-openmp: openmp
with-solver: strumpack
with-eigensolver: slepc
- compiler: gcc
mpi: openmpi
math-libs: aocl
build-shared: static
with-64bit-int: int32
with-openmp: serial
with-solver: strumpack
with-eigensolver: slepc
- compiler: clang
mpi: mpich
math-libs: aocl
build-shared: static
with-64bit-int: int32
with-openmp: serial
with-solver: superlu
with-eigensolver: slepc
runs-on: palace_ubuntu-latest_16-core
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Configure Open MPI
if: matrix.mpi == 'openmpi'
run: |
sudo apt-get install -y openmpi-bin libopenmpi-dev
- name: Configure MPICH
if: matrix.mpi == 'mpich'
run: |
sudo apt-get install -y mpich libmpich-dev
- name: Configure Intel MPI
if: matrix.mpi == 'intelmpi'
uses: mpi4py/setup-mpi@v1
with:
mpi: ${{ matrix.mpi }}
- name: Configure Clang compiler
if: matrix.compiler == 'clang'
run: |
sudo apt-get install -y clang lld
- name: Configure Intel oneAPI compiler
if: matrix.compiler == 'intel'
run: |
sudo apt-get install -y intel-oneapi-compiler-dpcpp-cpp \
intel-oneapi-compiler-fortran
- name: Install math libraries (OpenBLAS)
if: matrix.math-libs == 'openblas'
run: |
if [[ "${{ matrix.with-openmp }}" == 'openmp' ]]; then
sudo apt-get install -y libopenblas-openmp-dev
else
sudo apt-get install -y libopenblas-serial-dev
fi
- name: Install math libraries (Intel oneAPI MKL)
if: matrix.math-libs == 'intelmkl'
run: |
sudo apt-get install -y intel-oneapi-mkl intel-oneapi-mkl-devel
- name: Install math libraries (AOCL)
if: matrix.math-libs == 'aocl'
run: |
wget https://download.amd.com/developer/eula/aocl/aocl-4-1/aocl-linux-gcc-4.1.0_1_amd64.deb
sudo apt-get install -y ./aocl-linux-gcc-4.1.0_1_amd64.deb
rm aocl-linux-gcc-*.deb
- name: Build Palace
env:
CMAKE_BUILD_TYPE: Release
NUM_PROC_BUILD_MAX: '32'
run: |
# Configure environment
if [[ "${{ matrix.compiler }}" == 'intel' ]] || \
[[ "${{ matrix.mpi }}" == 'intelmpi' ]] || \
[[ "${{ matrix.math-libs }}" == 'intelmkl' ]]; then
source /opt/intel/oneapi/setvars.sh # Sets PATH, MKLROOT
if [[ "${{ matrix.compiler }}" == 'intel' ]]; then
export CC=icx
export CXX=icpx
export FC=ifx
fi
elif [[ "${{ matrix.compiler }}" == 'clang' ]]; then
export CC=clang
export CXX=clang++
export FC=gfortran-12
export LDFLAGS='-fuse-ld=lld'
elif [[ "${{ matrix.compiler }}" == 'gcc' ]]; then
export CC=gcc-12
export CXX=g++-12
export FC=gfortran-12
fi
if [[ "${{ matrix.math-libs }}" == 'aocl' ]]; then
export AOCLROOT=/opt/AMD/aocl/aocl-linux-gcc-4.1.0/gcc
export LD_LIBRARY_PATH=$AOCLROOT/lib:$LD_LIBRARY_PATH
fi
export NUM_PROC_BUILD=$(nproc 2> /dev/null || sysctl -n hw.ncpu)
if [[ "$NUM_PROC_BUILD" -gt "$NUM_PROC_BUILD_MAX" ]]; then
NUM_PROC_BUILD=$NUM_PROC_BUILD_MAX
fi
[[ "${{ matrix.build-shared }}" == 'shared' ]] && BUILD_SHARED='ON' || BUILD_SHARED='OFF'
[[ "${{ matrix.with-64bit-int }}" == 'int64' ]] && WITH_INT64='ON' || WITH_INT64='OFF'
[[ "${{ matrix.with-openmp }}" == 'openmp' ]] && WITH_OPENMP='ON' || WITH_OPENMP='OFF'
[[ "${{ matrix.with-solver }}" == 'superlu' ]] && WITH_SUPERLU='ON' || WITH_SUPERLU='OFF'
[[ "${{ matrix.with-solver }}" == 'strumpack' ]] && WITH_STRUMPACK='ON' || WITH_STRUMPACK='OFF'
[[ "${{ matrix.with-solver }}" == 'mumps' ]] && WITH_MUMPS='ON' || WITH_MUMPS='OFF'
[[ "${{ matrix.with-eigensolver }}" == 'slepc' ]] && WITH_SLEPC='ON' || WITH_SLEPC='OFF'
[[ "${{ matrix.with-eigensolver }}" == 'arpack' ]] && WITH_ARPACK='ON' || WITH_ARPACK='OFF'
# Build and install (with unit tests)
mkdir palace-build && cd palace-build
cmake .. \
-DCMAKE_INSTALL_PREFIX=$(pwd)/../palace-install \
-DBUILD_SHARED_LIBS=$BUILD_SHARED \
-DPALACE_WITH_64BIT_INT=$WITH_INT64 \
-DPALACE_WITH_OPENMP=$WITH_OPENMP \
-DPALACE_WITH_SUPERLU=$WITH_SUPERLU \
-DPALACE_WITH_STRUMPACK=$WITH_STRUMPACK \
-DPALACE_WITH_MUMPS=$WITH_MUMPS \
-DPALACE_WITH_SLEPC=$WITH_SLEPC \
-DPALACE_WITH_ARPACK=$WITH_ARPACK
make -j$NUM_PROC_BUILD palace-tests
- name: Run unit tests
env:
NUM_PROC_TEST_MAX: '2'
run: |
# Configure environment
if [[ "${{ matrix.compiler }}" == 'intel' ]] || \
[[ "${{ matrix.mpi }}" == 'intelmpi' ]] || \
[[ "${{ matrix.math-libs }}" == 'intelmkl' ]]; then
source /opt/intel/oneapi/setvars.sh # Sets PATH, MKLROOT
fi
if [[ "${{ matrix.with-openmp }}" == 'true' ]]; then
export OMP_NUM_THREADS=2
else
export OMP_NUM_THREADS=1
fi
export LD_LIBRARY_PATH=$(pwd)/palace-install/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$(pwd)/palace-install/lib64:$LD_LIBRARY_PATH
cd $(pwd)/palace-build/palace-build/test/unit
# Run tests
mpirun -np $NUM_PROC_TEST_MAX ./unit-tests --skip-benchmarks
- name: Run regression tests for examples/
env:
NUM_PROC_TEST_MAX: '8'
run: |
# Configure environment
if [[ "${{ matrix.compiler }}" == 'intel' ]] || \
[[ "${{ matrix.mpi }}" == 'intelmpi' ]] || \
[[ "${{ matrix.math-libs }}" == 'intelmkl' ]]; then
source /opt/intel/oneapi/setvars.sh # Sets PATH, MKLROOT
fi
if [[ "${{ matrix.math-libs }}" == 'aocl' ]]; then
export AOCLROOT=/opt/AMD/aocl/aocl-linux-gcc-4.1.0/gcc
export LD_LIBRARY_PATH=$AOCLROOT/lib:$LD_LIBRARY_PATH
fi
export NUM_PROC_TEST=$(nproc 2> /dev/null || sysctl -n hw.ncpu)
if [[ "$NUM_PROC_TEST" -gt "$NUM_PROC_TEST_MAX" ]]; then
NUM_PROC_TEST=$NUM_PROC_TEST_MAX
fi
if [[ "${{ matrix.with-openmp }}" == 'true' ]]; then
NUM_PROC_TEST=$(( NUM_PROC_TEST / 2 ))
export OMP_NUM_THREADS=2
else
export OMP_NUM_THREADS=1
fi
export PATH=$(pwd)/palace-install/bin:$PATH
# Run tests
julia --project=test/examples -e 'using Pkg; Pkg.instantiate()'
julia --project=test/examples --color=yes test/examples/runtests.jl