Repository navigation
Fix OpenMP pragmas - #757
Merged
Merged
Conversation
max-models
marked this pull request as draft
October 12, 2026 15:26
max-models
commented
Oct 13, 2026
max-models
left a comment
Member
Author
There was a problem hiding this comment.
Add openMP pragmas in feectools too
max-models
marked this pull request as ready for review
October 13, 2026 15:20
spossann
previously approved these changes
Oct 13, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
spossann
previously approved these changes
Oct 14, 2026
spossann
enabled auto-merge (squash)
October 14, 2026 06:46
An uninitialized out (xp.empty) containing NaN/inf stayed NaN after '*= 0.0', so test_spline_function_backends failed randomly on one MPI rank while the other rank hung in the next Allreduce (CI timeout). The test now pre-fills out with NaN to catch this deterministically. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
spossann
approved these changes
Oct 14, 2026
spossann
added a commit
that referenced
this pull request
Oct 21, 2026
Corresponding feectools PR struphy-hub/feectools#103 Fix OpenMP directives so all 128 Struphy kernel modules compile with GNU Fortran using `struphy compile --openmp`, and compile the feectools kernels with OpenMP as well. - Repair parallel regions, variable scoping, and accumulation reductions. - Give each thread its own mutable spline-evaluation workspace to prevent data races. - Force rebuilding when OpenMP settings change, and record compiler settings only after successful compilation. - Add CI compilation and numerical regression checks, plus documentation for thread counts and reduction memory requirements. ## feectools - `struphy compile --openmp` now passes `--openmp` to `psydac-accelerate`, so the feectools kernels are threaded too (previously they were always compiled serially). - The `feectools` submodule points to the `add-openmp-pragmas` branch (struphy-hub/feectools#103), which adds OpenMP pragmas to the stencil `dot`, `transpose`, `axpy` and `inner` kernels (2D/3D) and the 3D DOF kernels. - The CI OpenMP step also runs `pytest --pyargs feectools.linalg.tests.test_openmp`. - `install.rst` mentions that the feectools kernels are compiled with OpenMP, and how to run their check. ## Validation - Fresh OpenMP compilation of all 128 kernel modules. - Compiled results match serial reference loops with 1, 2, and 4 threads. - 575 tests passed, including pusher, SPH, compilation, and numerical parity tests. - `console/tests/test_compile.py` (16 tests) passes, including the new check that `--openmp` is forwarded to `psydac-accelerate`. - Ruff and whitespace checks passed. Array reductions require temporary output arrays per thread; large problems may need additional memory and larger stack limits. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Stefan Possanner <stefan.possanner@ipp.mpg.de>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Corresponding feectools PR struphy-hub/feectools#103
Fix OpenMP directives so all 128 Struphy kernel modules compile with GNU Fortran using
struphy compile --openmp, and compile the feectools kernels with OpenMP as well.feectools
struphy compile --openmpnow passes--openmptopsydac-accelerate, so the feectools kernels are threaded too (previously they were always compiled serially).feectoolssubmodule points to theadd-openmp-pragmasbranch (Add OpenMP pragmas to the stencil and DOF kernels feectools#103), which adds OpenMP pragmas to the stencildot,transpose,axpyandinnerkernels (2D/3D) and the 3D DOF kernels.pytest --pyargs feectools.linalg.tests.test_openmp.install.rstmentions that the feectools kernels are compiled with OpenMP, and how to run their check.Validation
console/tests/test_compile.py(16 tests) passes, including the new check that--openmpis forwarded topsydac-accelerate.Array reductions require temporary output arrays per thread; large problems may need additional memory and larger stack limits.
🤖 Generated with Claude Code