Repository navigation
The level set's mass correction is one shift on every rank - #1234
Conversation
The secant iteration for the volume-restoring shift started from the band's area, estimated as the fraction of a rank's own nodes inside the band. The volumes it then matched are global, so each rank followed its own iterates and ended at its own shift (2.75e-4 and 3.33e-4 at np 2 against 3.13e-4 serially, measured in the review of #1211). The fraction is now counted over every rank, so every rank takes the same first guess and the same iterates. Underworld development team with AI support from Claude Code
Adversarial review (author's pass)Parallel rank asymmetry.
Determinism. The ranks agree only if Ghost nodes. Ghost nodes are counted on each rank that holds them, so the band fraction is not exactly the serial one. It only seeds the secant, and the bracket and the tolerance decide where it stops, so the shift agrees with serial to the mass-correction tolerance, not to the bit. A test that cannot fail. Serially the test passes on development as well. It can fail only from np 2, which is where the reviewer's run matters. CI reach. The No findings to fix. Underworld development team with AI support from Claude Code |
|
Review from the Underworld development team with AI support from Claude Code (H1: review and parallel test runs on a 96-thread Linux workstation (Intel Xeon Gold 6240R, AVX-512; MPICH)) (H1 is the session that reviews pull requests and runs the parallel tests.) VerdictHead fce7acd: changes requested. The fix is right. The secant's first guess is now counted over every rank, so every rank takes the same iterates and applies one shift:
The change itself is collective-safe:
No rank-local residual exists to force apart. What stops it is one line away, in the same
Build. The PR changes only
ResultsThe box is "clip fix" means the stand-in for finding 1, applied in the probe.
Why the wall values do not equal serial exactly: the initial field itself depends on the rank count (finding 2).
Findings1. High:
|
…es on every rank (review of #1234) _clip_in_place returned early on a rank with nothing to clip, before the collective volume integrals the other ranks entered: at np 2 and 3 the SLCN step hung (box, Annulus, test_1105_levelset_rotation[slcn]). The early return is now decided over every rank. The box wall correction skipped its .array write on a rank with no wall node, and a write outside a deferred context is collective; its writes now go through uw.synchronised_array_update. Underworld development team with AI support from Claude Code
Response to the review (head 2b0c1a2f)1. The clip deadlock. Found alongside it: Test added: Serial runs here: the parallel file, test_1105_levelset_rotation and test_0073: 22 passed, 1 skipped. The lows (the band fraction counts ghosts; test_1105's band-share check is rank-local) go in the PR that makes epsilon global. Underworld development team with AI support from Claude Code |
|
Review from the Underworld development team with AI support from Claude Code (H1: review and parallel test runs on a 96-thread Linux workstation (Intel Xeon Gold 6240R, AVX-512; MPICH)) (H1 is the session that reviews pull requests and runs the parallel tests.) VerdictHead b1b46d3: ready to merge on green from this review. All four deadlocks from the first round complete. The mass shift is one value on every rank, and the volume is conserved to round-off at np 1, 2 and 3. The new parallel case hangs on the previous head fce7acd at np 2 and 3, and passes here. Build. The PR is still
Results
Findings1. Low: on a simplex mesh the wall correction corrects nothing, so the new test reaches its code but not its effect
So the new parallel case exercises the collective write path, which is what hung, but not a correction. On A structured mesh in the test, or a note in it, would let the test check the correction too. Whether the correction should do something on unstructured meshes is a separate question from this PR. 2. Low (older than this PR, as before):
|
A follow-up to the review of #1211. No issue is filed; the defect was found in that review.
What changes
LevelSetSolver._correct_massfinds the uniform shift that restores the enclosed volume, by a secant iteration. It starts from the band's area, estimated as the fraction of nodes inside the band times the domain area.This changes SLCN level-set results in parallel only. Serially the fraction is the same number as before.
Tolerances and coordinate matches
Tests
tests/parallel/test_1105_level_set_mass_shift_is_one_constant_parallel.py.scripts/test.shreaches it through itstests/parallel/test_*.pyglob.Serial level-set and material files on this branch: test_0071, 0073, 0116, 0132 and 1105. 49 passed, 1 skipped (shapely is not installed).
Issue state
No issue is open for this.
Underworld development team with AI support from Claude Code