Repository navigation
SC26 SCC: Parallelize the cell loops inside each IB patch's gang - #2097
Draft
aliencaocao wants to merge 1 commit into
Draft
aliencaocao wants to merge 1 commit into
aliencaocao wants to merge 1 commit into
Conversation
Lines of Code
|
|
Claude Code Review Head SHA: 483ce11 Files changed:
Findings:
|
This branch has not been deployed
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.
Parallelize the cell loops inside each IB patch's gang
Problem
Currently,
s_apply_ib_patches_ib_parallelismhadpatch_idas its only parallel loop. For cases with few immersed bodies whose bounding boxes cover many cells, they leave the GPU nearly idle, because the code uses one thread per patch and every cell of every box is being processed serially by that thread.What this does
The bounding-box cell loops (k, j, i in 3D; j, i in 2D) become a collapsed vector loop inside each patch's gang.
grid_cell_parallelism(the default for static patches) already parallelizes the cell loops and is untouched.Measurements
Benchmark: https://github.com/MFlowCode/MFC/blob/master/examples/2D_mibm_particle_cloud/case.py
(
many_ib_patch_parallelism=T), scaled to 7000x7000 on 1xH200.Validation
On NVHPC 26.9 with OpenACC, taking the saved files on the 20th step and comparing against
master:ib_state_20.dat): 74/400 words differ by one ULP due to floating-point ordering, rest bit-identical.On AMD OpenMP and CPU this code change is a no-op. On NVHPC OpenMP, it just add a
!$omp loop bind(thread)which is also a no-op compared to no directive (current).Contribution Policy
All contributions are expected to demonstrate:
If these expectations are not met, we would prefer to implement the changes ourselves rather than spend time reviewing low-effort submissions.
Acknowledgment
This PR is cherry-picked from #2093 and is contributed by Nanyang Technological University Team Supernova for SC26 Student Cluster Competition.