Skip to content

perf: node numbering per level, accumulation owners by table, and regrid(fields=) - #75

Merged
max-models merged 16 commits into
develfrom
claude/tree-d3d-poison-maxwell-atyjic
Nov 25, 2026
Merged

max-models merged 16 commits into
develfrom
claude/tree-d3d-poison-maxwell-atyjic

Conversation

@max-models

@max-models max-models commented Nov 25, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • CompositeNodes finds the cells under finer patches from one coverage mask per level. It used to compare every patch with every patch of the next level, which is quadratic in the patches; with 386 quadtree blocks the numbering goes from 143 to 24 ms.
  • The accumulate_halos schedule takes the rank of a node's owner from a table when the owner is on one rank. Owners on several ranks still go through the loop.
  • Halo copies between two patches of a level are kept per pair of boxes on the hierarchy and handed on by regrid. in_domain is a bounds check when the domain fills its box.
  • regrid(..., fields=[...]) names the fields whose values are moved (default: all). The others are allocated on the new hierarchy and zero. A particle code that deposits the charge and solves for the potential after every regrid can skip the transfer.
  • benchmarks/quadtree regrids with fields=[] unless --move-fields is given; RESULTS.md has the runs.

Serial, median of 3, ms per step (total):

mesh devel (all fields moved) this, all fields moved this, fields=[]
clusters 241 245 225 (−7%)
clusters cut to 16 cells 496 495 430 (−13%)
quadtree, block 8 938 837 (−11%) 632 (−33%)
quadtree, block 16 474 455 (−4%) 388 (−18%)
quadtree, block 32 427 442 (within the noise) 401 (−6%)

The pair cache does not make the halos measurably faster. What is left of their schedule is the CopyPlan (~65 ms with 386 patches), the coarse-to-fine interpolation of patches whose neighbourhood changed (~35 ms) and the reuse checks (~33 ms). These numbers are in RESULTS.md.

Checklist

  • pre-commit run and pytest pass (731 passed locally; picnic's patchwork solver tests pass against this branch with fields=[])
  • New code has docstrings and tests
  • The docs (docs/, tutorials or README.qmd) are updated where the behaviour changed
  • The commit messages follow Conventional Commits (feat:, fix:, docs:, ...)

@max-models
max-models merged commit 4e34ac8 into devel Nov 25, 2026
27 checks passed
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.

1 participant