Repository navigation
feat: reuse the halo geometry of kept patches, and Morton cuts weighted by cost - #73
Merged
Merged
Conversation
…d tags from marker counts.
…ed by marker counts.
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.
Summary
HaloExchangekeeps each patch's geometry on the hierarchy as a record: its copies and interpolation weights, with its fields named by patch key(level, box, ranks). Records are kept per centering, halo width, dtype and split, andregridhands them to the new hierarchy. A patch reuses its record when it has the same box and ranks and the same patches within reach of its halo (same level) and of its interpolation (level below). Otherwise the geometry is found again as before. The halos are bit-identical to a fresh build; a test checks this for node and cell fields, serially and under MPI.regrid(..., placement="morton", cost=...)takes a per-cell cost per level, in units of one cell. A patch's weight is its cells plus the cost of its leaf cells (box_costs), and the base level's cost counts as each rank's starting load.morton_ranks(..., weights=...)cuts the curve by these weights.marker_countsgives the markers per cell of every level, summed over the ranks;marker_tagsnow uses it.rebalance(cost). It places the patches of a hierarchy again along the weighted Morton curve and moves the fields. The base level stays where it is; the markers follow withmigrate.benchmarks/quadtreecomparesmorton, markersunder MPI and reports the marker imbalance.RESULTS.mdhas the new runs. The "Quadtree patches" tutorial shows the cuts with and without the markers.Findings (
RESULTS.md)mpiarray.CopyPlanof each exchange is now the largest part, about 100 of 250 ms at 386 patches.Checklist
pre-commit runandpytestpass (728 passed locally; the quadtree tests also undermpirun -n 2/3/4)docs/, tutorials orREADME.qmd) are updated where the behaviour changedfeat:,fix:,docs:, ...)