Skip to content

Commit d253133

Browse files
committed
Workaround OpenMP problem
1 parent 4fa8eaf commit d253133

File tree

5 files changed

+46
-32
lines changed

5 files changed

+46
-32
lines changed

.github/workflows/build-and-test-linux.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -361,14 +361,14 @@ jobs:
361361
$MPICC mpi_test.c -o mpi_test
362362
mpirun -np 2 ./mpi_test
363363
364-
- uses: julia-actions/cache@v2
365-
if: needs.filter.outputs.test == 'true'
366-
367364
- uses: julia-actions/setup-julia@v2
368365
if: needs.filter.outputs.test == 'true'
369366
with:
370367
version: '1'
371368

369+
- uses: julia-actions/cache@v2
370+
if: needs.filter.outputs.test == 'true'
371+
372372
- name: Build Palace
373373
if: needs.filter.outputs.test == 'true'
374374
env:

.github/workflows/build-and-test-macos.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,9 @@ jobs:
135135
with:
136136
version: '1'
137137

138+
- uses: julia-actions/cache@v2
139+
if: needs.filter.outputs.test == 'true'
140+
138141
- name: Configure Open MPI
139142
if: needs.filter.outputs.test == 'true' && matrix.mpi == 'openmpi'
140143
run: |

.github/workflows/docs.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,14 +117,14 @@ jobs:
117117
# If you want to use the branch-local source instead (should we always do this?)
118118
# spack -e . develop --path=$(pwd) palace@git."${{ github.head_ref || github.ref_name }}"=develop
119119

120-
- uses: julia-actions/cache@v2
121-
if: needs.filter.outputs.test == 'true'
122-
123120
- uses: julia-actions/setup-julia@v2
124121
if: needs.filter.outputs.test == 'true'
125122
with:
126123
version: '1'
127124

125+
- uses: julia-actions/cache@v2
126+
if: needs.filter.outputs.test == 'true'
127+
128128
- name: Build and deploy
129129
env:
130130
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/spack.yml

Lines changed: 33 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -84,17 +84,16 @@ jobs:
8484
# solver: +strumpack
8585
# cuda: ~cuda
8686

87-
# test-libceed gives wrong results
88-
# - arch: arm
89-
# compiler: gcc
90-
# mpi: mpich
91-
# math-libs: armpl-gcc
92-
# shared: +shared
93-
# int: +int64
94-
# openmp: +openmp
95-
# eigensolver: +arpack
96-
# solver: +strumpack
97-
# cuda: ~cuda
87+
- arch: arm
88+
compiler: gcc
89+
mpi: mpich
90+
math-libs: armpl-gcc
91+
shared: +shared
92+
int: +int64
93+
openmp: +openmp
94+
eigensolver: +arpack
95+
solver: +strumpack
96+
cuda: ~cuda
9897

9998
# Fails building libxsmm with ifx error None not found
10099
# - arch: x86
@@ -155,17 +154,16 @@ jobs:
155154
# solver: +mumps
156155
# cuda: ~cuda
157156

158-
# test-libceed gives wrong results
159-
# - arch: arm
160-
# compiler: llvm
161-
# mpi: mpich
162-
# math-libs: openblas
163-
# shared: +shared
164-
# int: ~int64
165-
# openmp: +openmp
166-
# eigensolver: +arpack
167-
# solver: +superlu-dist
168-
# cuda: ~cuda
157+
- arch: arm
158+
compiler: llvm
159+
mpi: mpich
160+
math-libs: openblas
161+
shared: +shared
162+
int: ~int64
163+
openmp: +openmp
164+
eigensolver: +arpack
165+
solver: +superlu-dist
166+
cuda: ~cuda
169167

170168
runs-on: ${{ matrix.arch == 'x86' && 'palace_ubuntu-latest_16-core' || 'ubuntu-24.04-arm' }}
171169
steps:
@@ -228,7 +226,7 @@ jobs:
228226
mpi:
229227
require: ${{ matrix.mpi }}
230228
blas:
231-
require: ${{ matrix.math-libs }}
229+
require: ${{ matrix.math-libs }} threads=openmp
232230
c:
233231
require: [${{ matrix.compiler }}]
234232
cxx:
@@ -259,9 +257,18 @@ jobs:
259257
- name: Overwrite builtin Palace package
260258
if: needs.filter.outputs.test == 'true'
261259
run: |
260+
# Bug with OpenMP and libceed
261+
# PR https://github.com/spack/spack-packages/pull/2361
262+
cd "$(spack location --repo builtin)"
263+
git remote add sbozzolo https://github.com/Sbozzolo/spack-packages.git
264+
git fetch sbozzolo libceed_openmp
265+
git reset --hard sbozzolo/libceed_openmp
266+
cd -
267+
262268
cp -r spack_repo/local/packages/palace "$(spack location --repo builtin)/packages"
263269
cp extern/patch/mfem/* "$(spack location --repo builtin)/packages/palace"
264270
271+
265272
- name: Remove Android NDK # it confuses the Intel compiler
266273
if: needs.filter.outputs.test == 'true' && matrix.compiler == 'intel-oneapi-compilers'
267274
run: sudo rm -rf /usr/local/lib/android/
@@ -350,14 +357,14 @@ jobs:
350357
palace-unit-tests --skip-benchmarks
351358
mpirun -np 2 $(which palace-unit-tests) --skip-benchmarks
352359
353-
- uses: julia-actions/cache@v2
354-
if: needs.filter.outputs.test == 'true'
355-
356360
- uses: julia-actions/setup-julia@v2
357361
if: needs.filter.outputs.test == 'true'
358362
with:
359363
version: '1'
360364

365+
- uses: julia-actions/cache@v2
366+
if: needs.filter.outputs.test == 'true'
367+
361368
- name: Run Integration Tests
362369
if: needs.filter.outputs.test == 'true'
363370
run: |

spack_repo/local/packages/palace/package.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,9 @@ class Palace(CMakePackage, CudaPackage, ROCmPackage):
150150
depends_on("hypre~cuda", when="~cuda")
151151
depends_on("hypre~rocm", when="~rocm")
152152

153+
depends_on("libceed+openmp", when="+openmp")
154+
depends_on("libceed~openmp", when="~openmp")
155+
153156
with when("@0.15:"):
154157
# +lapack means: use external lapack
155158
depends_on(
@@ -164,6 +167,7 @@ class Palace(CMakePackage, CudaPackage, ROCmPackage):
164167
depends_on("mfem+shared", when="+shared")
165168
depends_on("mfem~shared", when="~shared")
166169
depends_on("mfem+openmp", when="+openmp")
170+
depends_on("mfem+threadsafe", when="+openmp")
167171
depends_on("mfem~openmp", when="~openmp")
168172
depends_on("mfem+superlu-dist", when="+superlu-dist")
169173
depends_on("mfem~superlu-dist", when="~superlu-dist")

0 commit comments

Comments
 (0)