Skip to content

Add ParallelForOMP#4595

Merged
WeiqunZhang merged 3 commits intoAMReX-Codes:developmentfrom
WeiqunZhang:parallelfor_omp
Aug 8, 2025
Merged

Add ParallelForOMP#4595
WeiqunZhang merged 3 commits intoAMReX-Codes:developmentfrom
WeiqunZhang:parallelfor_omp

Conversation

@WeiqunZhang
Copy link
Copy Markdown
Member

ParallelFor does not do any OMP threading, because we do coarse-grained OMP threading at the MFIter level with tiling. But there are cases we use ParallelFor outside MFIter and they could benefit from OMP threading. Thus, we add new ParallelForOMP functions in this PR. Note that OMP threading is used only for CPU builds with OMP, otherwise the new ParallelForOMP functions are equivalent to ParallelFor functions.

@WeiqunZhang
Copy link
Copy Markdown
Member Author

If needed, we can extend this to support BoxND.

ParallelFor does not do any OMP threading, because we do coarse-grained OMP
threading at the MFIter level with tiling. But there are cases we use
ParallelFor outside MFIter and they could benefit from OMP threading. Thus,
we add new ParallelForOMP functions in this PR. Note that OMP threading is
used only for CPU builds with OMP, otherwise the new ParallelForOMP
functions are equivalent to ParallelFor functions.
@WeiqunZhang WeiqunZhang requested a review from atmyers August 7, 2025 21:12
@WeiqunZhang WeiqunZhang marked this pull request as ready for review August 8, 2025 00:07
Co-authored-by: Andrew Myers <[email protected]>
@WeiqunZhang WeiqunZhang merged commit 8cfb8b6 into AMReX-Codes:development Aug 8, 2025
75 checks passed
@WeiqunZhang WeiqunZhang deleted the parallelfor_omp branch August 8, 2025 19:13
WeiqunZhang added a commit to WeiqunZhang/amrex that referenced this pull request Aug 11, 2025
GCC does have allow omp collapse on loops marked with ivdep.
WeiqunZhang added a commit that referenced this pull request Aug 11, 2025
GCC does not allow omp collapse on loops marked with ivdep.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants