Fix MPI Divergent Grid Stretching#1625
Open
danieljvickers wants to merge 2 commits into
Open
Conversation
sbryngelson
approved these changes
Jul 2, 2026
Member
|
it baffles me that this was broken. surely we've done multirank grid stretching before, but the fix looks correct. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1625 +/- ##
=======================================
Coverage 60.43% 60.43%
=======================================
Files 83 83
Lines 19868 19871 +3
Branches 2956 2956
=======================================
+ Hits 12007 12010 +3
Misses 5860 5860
Partials 2001 2001 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Description
When we run grid stretching in MFC pre-processing, we first normalize the cell boundary array by the local length of the mpi rank. We then convert back later. This has the clear flaw that as we add more MPI ranks then the grid is stretched in different ways. For example, a case that runs fine in 32 ranks will suddenly break at 128 ranks because the grid was stretched more to infinity. This can also cause some frustration because the grid stretching has to be completely recomputed in order to properly strong-scale a case. When more ranks are added, it doesn't just double the resolution, it may just increase the domain size and leave the same resolution.
Both of the issues above make this clearly undesired/unintended behavior. To fix this, I added a global domain boundary in pre-processing that is used to normalize the array, instead of the local domain length. This eliminates the processor-rank-number-dependent domain stretching and makes it a little easier to set up proper grid-stretching cases.
Type of change (delete unused ones)
Testing
Ran on 1 and 1024 ranks, but obtained the same grid size.
Checklist
Check these like this
[x]to indicate which of the below applies.See the developer guide for full coding standards.
GPU changes (expand if you modified
src/simulation/)This is a CPU-only change.