Recover non-finite values in parallel global evaluation - #602
Conversation
Include located-but-nonfinite interpolation results in global_evaluate's parallel best-claim fallback. This prevents finite SLCN midpoint coordinates from receiving NaN velocities when a rank-local interpolation reports a false located status.\n\nAdd a focused regression for fallback index selection. Validate with the two-rank migration suite and an eight-rank Zhong A1 cellsize=1/16 step that previously diverged with DIVERGED_FNORM_NAN.
|
@lmoresi Could you please review the parallel We observed cases where interpolation returned a non-finite value even though the point-location mask reported the point as located. The existing fallback therefore did not run, and a single This PR sends those non-finite located results through the existing globally nearest-rank RBF recovery path. Could you please check whether:
The focused two-rank MPI regression file passes ( |
Adversarial reviewReviewed at the PR head against 1. The recovery substitutes an RBF extrapolation for a failed interpolation, 2. The root cause is not diagnosed, and recovering from it removes the 3. The test pins the index selection, not the recovery. 4. One stray NaN now costs the whole ladder, on every rank. Checked and cleared.
Underworld development team with AI support from Claude Code |
|
Finding 2 is now #604, so the condition survives this PR landing rather than being closed out with it. It also records the clue the fix contains: the replacement value comes from The suggested first step there is the one that would also answer finding 1: have the recovery count what it repaired and report it once per call. That keeps this PR's behaviour exactly and turns a silent substitution into something observable. |
Summary
Root cause
global_evaluate_nd()previously entered its parallel recovery path only for points marked extrapolated byreturn_mask. A failed interpolation can occasionally returnNaNwhile retaining a located flag, so the value bypassed recovery. In Semi-Lagrangian Crank-Nicolson midpoint tracing, one such value makes the departure coordinate and transported history non-finite.Implementation
The new
_global_fallback_indices()helper selects the union of extrapolated points and points with any non-finite result component. These points use the existing globally nearest-rank RBF fallback. The collective structure and finite-value behavior are unchanged.Validation
./uw buildmpirun -n 2 python -m pytest --with-mpi tests/parallel/test_0760_swarm_cache_migration.py -q: 4 passed per rank in 3.69 sThis focused change was extracted from the mantle-convection benchmark branch before that branch is reset to current upstream development.