FFTW: Always initialize FFTW for users when OMP is on#4861
Merged
ax3l merged 7 commits intoAMReX-Codes:developmentfrom Jan 5, 2026
Merged
FFTW: Always initialize FFTW for users when OMP is on#4861ax3l merged 7 commits intoAMReX-Codes:developmentfrom
ax3l merged 7 commits intoAMReX-Codes:developmentfrom
Conversation
ax3l
requested changes
Jan 2, 2026
Member
ax3l
left a comment
There was a problem hiding this comment.
Thank you! This looks great, but I have a few questions about:
- external init/finalize
- small update to third-party requirements (CMake)
- macro guards w/o FFT option enabled
Probably all quick to resolve next week :)
Co-authored-by: Axel Huebl <[email protected]>
ax3l
reviewed
Jan 5, 2026
| LIBRARIES += -Wl,-rpath,$(FFTW_HOME)/lib | ||
| endif | ||
| ifeq ($(USE_OMP),TRUE) | ||
| LIBRARIES += -lfftw3f_omp -lfftw3_omp |
Member
There was a problem hiding this comment.
If you like to 100% mirror the CMake logic:
Suggested change
| LIBRARIES += -lfftw3f_omp -lfftw3_omp | |
| DEFINES += -DAMREX_FFTW_OMP=1 | |
| LIBRARIES += -lfftw3f_omp -lfftw3_omp |
ax3l
reviewed
Jan 5, 2026
It's a define, keep to style.
ax3l
approved these changes
Jan 5, 2026
Member
ax3l
left a comment
There was a problem hiding this comment.
LGTM, a small minor suggestion for a simpler/explicitly controlled FFTW w/ OpenMP macro.
ax3l
reviewed
Jan 5, 2026
ax3l
reviewed
Jan 5, 2026
ax3l
approved these changes
Jan 5, 2026
ankithadas
pushed a commit
to ankithadas/amrex
that referenced
this pull request
Jan 7, 2026
Close AMReX-Codes#4856 Co-authored-by: Axel Huebl <[email protected]>
Member
|
@WeiqunZhang I just realized if I pass Will PR in #4941 |
9 tasks
ax3l
added a commit
that referenced
this pull request
Feb 12, 2026
## Summary In some corner cases, we sometimes work around broken FFTW installs: for some (temporary) reason we cannot have any threading in FFTW, neither with OpenMP nor threads. In those cases, when we still want to thread the rest of AMReX with OpenMP, we can set our AMReX transitive FFTW OpenMP requirements explicitly off, e.g., via CMake `-DAMReX_FFTW_IGNORE_OMP=ON`. But this is not yet implemented consistently and since #4861 exposes undefined FFTW symbols when used. This enables this work-around. - [x] macro - [x] CMake - [x] GNUmake - [x] `AMReX_Config.H` ## Additional background #4861 (comment) ## Checklist The proposed changes: - [x] fix a bug or incorrect behavior in AMReX - [ ] add new capabilities to AMReX - [ ] changes answers in the test suite to more than roundoff level - [ ] are likely to significantly affect the results of downstream AMReX users - [ ] include documentation in the code and/or rst files, if appropriate --------- Co-authored-by: Weiqun Zhang <[email protected]>
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.
Close #4856