Repository navigation
global_evaluate: send an uncontained point only to the ranks whose cell box holds it - #1290
Conversation
…nts just outside Coverage asked for in the parallel review desk's review of #1258. These pass on development too: the change that follows is not meant to alter any answer. Underworld development team with AI support from Claude Code
…ll box holds it The hand-over of #1258 gathered every rank's uncontained points to every rank, so each rank's work followed the global count of such points and grew with the rank count; points just outside the domain were in that set on every call. Now each rank's cell bounding box is gathered (2 x cdim numbers per rank), each point goes only to the ranks whose box (widened by 1e-8 of the domain extent) holds it, and the claims come back by a second all-to-all. A rank whose cell contains a point has it inside its box, so the lowest containing rank is the same as before. 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)) 120aff9, np 1 to 4: ready to merge on green from this review. Every answer I compared matches development bit for bit, except in one constructed case on a domain 1e-6 model units across (finding 1). The hand-over now tests far fewer points, and the cost falls as the PR says. np 8 and 12 will follow in a separate comment. How it was run
ResultsAnswers: PR against developmentEach rank asks its own permutation of the same point sets, saves its answers in the set's order, and the saved arrays are compared bit for bit between the two builds.
Hand-over load: points each rank testsI wrapped
Each cell gives the largest per-rank count, with the sum over ranks in brackets.
CostEach figure is the time for
Collective safetyFrom the code:
Tested with no hang, on all four boxes and the three curved meshes:
Neighbouring tests (PR build)
Findings
What was run and not run
Logs kept by the reviewer. Underworld development team with AI support from Claude Code |
…takes that cell's value Fails at np 2 and 4 on 120aff9 (up to 0.14 off); passes on development. Underworld development team with AI support from Claude Code
…-wall slab 1e-8 of the extent fell below the cell-wall containment test's absolute rounding slab (a few times 1e-14) on domains under about 5e-6 across, so a point a quad cell contained was not routed to its rank. The widening is now max(1e-8 * extent, 1e-12). The docstring says what the box holds on a 2-manifold. Underworld development team with AI support from Claude Code
…aluate-neighbour-exchange
|
The parallel review desk's two points, at ee9e711 (fix e9b4366, test 0eafbe0, then development merged):
Runs on the rebuilt head: the #1178 file 8 passed on every rank at np 1, 2, 3 and 4; 12 parallel files that call global_evaluate at np 2, 64 passed and 2 skipped on both ranks; coverage OK (517 files). Underworld development team with AI support from Claude Code |
What changed and why
UNFILED 25, from the parallel review desk's review of #1258 (its low finding 2, and the optional finding 3).
#1258 made
global_evaluateanswer each point from a rank whose cell contains it: after the evaluation swarm's migration, each rank's points that none of its own cells contains were gathered to every rank (allgather), every rank tested all of them for exact containment, and each point went to the lowest rank that contains it. So each rank's work followed the global count of such points and grew with the rank count, and points just outside the domain (contained by no rank) were in that set on every call.Now, in
_hand_points_to_containing_rank(function/_function.pyx):Why this is exact. Mesh coordinates are of degree 1 (#978), so a cell lies inside the box of its vertices, and a rank whose cell contains a point has the point inside its box. The boxes are widened by 1e-8 of the domain's extent, more than the containment test's rounding allowance (a barycentric coordinate down to -1e-12, or 1e-10 of a cell on non-simplex meshes), so a point that a cell accepts to rounding is asked about too. The widening only adds ranks to ask; the decision is still each rank's own exact containment test, and the tie-break (lowest containing rank) is unchanged.
Collectives. Every rank, including one with no cells or no points, reaches the box gather, both all-to-all exchanges, the reductions and the migration; they are guarded only by reduced counts. The previous count
allgatheris now oneallreduce.What a user's run sees: the same answers, bit for bit, at less cost where many points are not contained by the rank holding them.
Answers unchanged
A probe asks
global_evaluatefor eight point sets on each rank and saves each rank's answers: random and near-vertex points (1e-8 off) on #1123's sheared 3-D box; random, near-vertex (1e-9 off), just-outside (1e-6) and per-rank-different points on a 2-D box; points on the triangle with a rank that holds no cells; and zero points on every rank. Against development at np 2, 3 and 4: 72 of 72 rank-by-rank answer arrays are bit-identical.Tests
Three cases added to
tests/parallel/test_1178_global_evaluate_seam_ownership_parallel.py(level 2, tier B), as the review asked:test_a_rank_with_no_cells_takes_part_and_every_point_is_exact(the empty-rank triangle fixture; exact linear field to 1e-12);test_every_rank_asking_for_no_points_returns_nothing;test_points_just_outside_keep_the_face_tolerance_answer_on_every_rank(1e-6 outside; the clamped answer within a few times |grad f| times the distance, 3.0e-6 measured, and every rank's answer identical).They pass on development too: this change is not meant to alter any answer, so they pin behaviour rather than fail first.
Cost
global_evaluateof a P1 field, slowest rank, best of three; 2-D box cell 1/64, 3-D box cell 1/12 (the review's meshes); "tested" is the number of points a rank tests for containment in the hand-over (before: every rank tests the whole gathered set). Before = #1258's code; after = this branch. np 4:Points just outside lie in no rank's box, so they are no longer sent anywhere. Random points differ within run-to-run noise. The rest of #1258's overhead is the first containment walk of every held point (the review's finding 1), which this does not change.
Not measured: np 8 and np 12. Those runs were not made within this session's core allowance on a shared machine. Before, the tested set per rank was the global count, so it grew with the rank count; after, it is the points within a rank's box, which does not. The table's "tested" column is where that shows, and it would be the thing to confirm at np 8 and 12.
Review fold-in
The parallel review desk found the 1e-8 × extent widening narrower than the cell-wall containment test's absolute rounding slab (a few times 1e-14) on domains under about 5e-6 across: on a quad box 1e-6 across, points a cell contained to rounding were not routed to that cell's rank, and came back up to 0.12 off. The widening now has a floor of 1e-12, ten times the largest distance that test accepts. New test
test_points_just_outside_a_tiny_box_are_answered_by_the_cell_that_contains_them: fails at np 2 and 4 before the floor, passes on development and on this head (np 1 to 4). The docstring also says what the box holds on a 2-manifold.What was run
On a 96-thread Linux workstation (single system image, Intel Xeon Gold 6240R, MPICH):
test_1178file, serial and np 2, 3, 4scripts/check_test_coverage.pyNot run
np 5 and above; the full suite; macOS; manifold or curved-coordinate meshes (the box argument rests on degree-1 coordinates, which every mesh has today, #978).
Underworld development team with AI support from Claude Code