Repository navigation
Keep extracted boundary names consistent across MPI ranks - #856
Conversation
Region filtering previously selected boundary enum members from rank-local strata. A coarse extracted annulus lost Upper on some ranks, causing KeyError in natural Stokes boundary registration while peers entered collectives. Union label presence over the DM communicator and create empty labels where globally retained boundaries have no local points. Preserve candidate order and exclude globally absent labels. Validation: two focused regressions pass serial and on each of two MPI ranks, including actual region extraction. No equations, coordinates, partitioning or finite-element values change. Next validate the existing int32 Gadi installation gates and rerun only the four affected coarse Poisson models.
Adversarial review1. Ordering hazard with #858 — this can hang where it used to fail. The #858 is the PR that makes those checks collective 2. The first test does not exercise the method as callers reach it. uw.discretisation.Mesh._surviving_labels(None, dm, {...})passes 3. A note for callers, not a defect here. The labels created on empty ranks What we attacked and could not break: Finding 1 is a merge-order constraint, not a code change. |
|
Thanks @lmoresi. I have explicitly recorded #858 as a merge prerequisite in the description; this PR should not merge independently. Its collective extraction guards must be present before I also clarified the test contracts: the first is a focused helper-level check of global label survival, while the second exercises the public The NULL-IS truth-value requirement is recorded for callers. No unrelated library changes were made for that non-defect finding. The updated #858 ownership/extraction suite passes in serial and on MPI2/MPI3. |
Adversarial review of #856Verdict: ready with listed changes. The library change is correct and fixes the defect. What needs changing is the test: on the old code it hangs instead of failing cleanly, and one of its assertions cannot fail. #858 has to land first. Reviewed at head 9bf307d, merge base 0dfb734. The branch is 376 commits behind development eddab70. The patch applies with a 19-line offset. CI is green, but only against the old base. Findings
Attacks that failed
#858 orderingThis PR alone: IssuesNo open issue covers this defect.
Merge conditions
Not testedThe PR's 16-rank Gadi models or anything above np 8; Open MPI (MPICH only); 3-D meshes; a solver on a surface mesh; re-extraction after a real adapt; a full build of the combinations (development plus patch and #858 plus patch ran as overlays on the built packages). Underworld development team with AI support from Claude Code |
|
Finishing this PR (H5, at Louis's and C1's direction): a superseding PR from What changed, against H1's review of 9bf307d (2026-11-06):
Results: the test file passes 5/5 at np 2, 3 and 4. The submesh files pass serially (81) and at np 2, 3 and 4 (59–61). Underworld development team with AI support from Claude Code |
…cleanly and pin the contract H1's review of 9bf307d (2026-11-06). - _surviving_labels keeps the allgathered union (the fix) and no longer creates labels: a filtered DM carries the parent's label list on every rank, and the branch never fired outside the synthetic test. - The helper test builds the reachable state (the label on every rank, points on rank 0 only), checks agreement on every rank, uses hasLabel, and destroys its DM in a finally, so a failure cannot hang the batch. - The enum is pinned exactly, for the default partition and for the region on one rank. - New: the symptom itself, a natural condition on Top for a region held by rank 0 alone, solved to u = y; and extract_surface on that region. - level, tier and mpi(min_size=2) markers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Extracting a distributed region currently builds each rank’s boundary enum from locally surviving strata. A coarse annulus mantle extraction can omit
Upperon a rank with no upper-wall points. Registering the natural Stokes boundary condition then raisesKeyError: Upperwhile other ranks enter collective solver setup.This change selects surviving boundary names over the submesh communicator and creates empty local labels for globally retained boundaries. Candidate order is preserved, and labels absent everywhere remain excluded. It changes metadata, not mesh coordinates, partitioning or equations.
Validation: two focused regressions pass serial and on both MPI ranks, including actual region extraction and an intentionally empty local label. The fresh Gadi PETSc int32 build passed 34 serial checks and 4 checks on each of 16 MPI ranks. All four affected case1/case2 Poisson models at h=1/8 and h=1/16 completed successfully on 16 ranks after the fix; the original failures are retained. No spherical models or tests are run.
Review follow-up (29 October 2026)
Merge prerequisite: #858 must land first. Do not merge this PR independently. Its collective surface-extraction guards prevent an empty rank raising before this PR's
_surviving_labelscollective. The prerequisite's review follow-up is implemented inf93cadbdand passes its complete ownership/extraction file in serial and on MPI2/MPI3.The first test is a focused helper-level test of global label survival:
_surviving_labelscurrently uses no instance state. The second test is the public caller contract (extract_regionproduces identical boundary enums on every rank); future instance-state requirements should update the focused fixture rather than weaken that caller contract.Empty PETSc index sets must be checked by truth value (
if not index_set), because a NULL IS is not necessarily PythonNone. The reviewer found no current library defect in that audit; no unrelated caller changes are included here.Underworld development team with AI support from Claude Code