Repository navigation
feat: Morton placement, a faster regrid transfer, and the quadtree benchmark - #72
Merged
Merged
Conversation
…d tags from 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
placement="morton":regridplaces the patches on the ranks along a Morton curve (morton_ranks). All refined levels share one curve, keyed by the lower corner in cells of the finest level, so a patch and the patches over it tend to share a rank. The curve is cut into runs of about equal cells, counting the cells each rank already holds (the base level). The keys come fromcunumpy'smorton_encode. A patch added by hand withadd_patchgoes where"balanced"would put it.transferlooks up old patches through the bin index of the halo schedules instead of comparing every pair. It also drops copies that a later copy overwrites entirely: for node fields, an old patch with the same box makes the copies from its neighbours redundant. It skips the interpolation from below for patches that copies cover fully. Results are bit-identical (the last copy of a point still wins). On a mesh of 386 blocks of 8 cells, the serial regrid went from 866 to 277 ms per step.benchmarks/quadtree: a particle-in-cell cycle following a moving beam (tag, regrid, migrate, deposit, solver setup, solve, halos, gather), each step a scope-profiler region. It compares clusters with quadtree blocks of 8, 16 and 32 cells, serially and on 4 ranks with both placements (RESULTS.md).Findings (in
RESULTS.md):Checklist
pre-commit runandpytestpass (723 passed locally; the quadtree tests also undermpirun -n 2/3/4)docs/, tutorials orREADME.qmd) are updated where the behaviour changedfeat:,fix:,docs:, ...)