Repository navigation
A failed JIT build raises on every rank, with the compiler's output (#842) - #1217
Conversation
…842) Under MPI with the disk cache, rank 0 builds and the others wait for it at a barrier. A failed build raised on rank 0 alone and the other ranks waited until a wall-clock limit. Rank 0's failure is now held until the barrier, broadcast, and raised on every rank. Where each rank builds its own copy (no shared disk cache), a failure on some ranks is gathered and raised on all. The error now carries the last lines of the build's output, whatever `verbose` is set to. tests/parallel/test_0842_jit_build_failure_collective_parallel.py: an invalid UW3_JIT_CFLAGS on a fresh expression; development hangs at np 2 (supervisor exit 124) and its serial error has no compiler output. Every rank raises, with gcc's "unrecognized command-line option", in about 3 s at np 1, 2 and 4. 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)) Verdict on head 6ff805a: changes requested. The main path is fixed. When rank 0's build fails, every rank now raises the same error together, with the compiler's message and exit code. One branch of the same barrier block still raises on a single rank and hangs the others. The fix is small (see 1). Findings1. Medium: the fallback compile on a non-zero rank is not agreed, so it can still hangIn the disk-cache path, after the barrier, a rank whose This can happen whenever a rank cannot see rank 0's published module: a node-local or per-node cache directory, a write that Failure case, reproduced at np 2:
Suggested fix: wrap the fallback in the same try/except and agree on its outcome before anyone continues. For example: fallback_error = None
if module is None:
try:
module, _tmpdir = compile_and_load(real_modname, codeguys_final, verbose=verbose)
except Exception as error:
fallback_error = f"{type(error).__name__}: {error}"
failed = underworld3.mpi.comm.allgather(fallback_error)
if any(e is not None for e in failed):
raise RuntimeError(...) # same wording as the disk-disabled branchThis adds one allgather per cold build and nothing to the warm path. A test can force the case without a second node by giving each rank its own 2. Low: a cache-write failure on rank 0 is reported as a build failure
Measured with a read-only
The wording is the issue here. Either keep 3. Nit: the serial and single-rank error loses its type and its chain
4. Nit: the Barrier before the bcast is redundant
Confirmed correct
What was runThe merge base aa3c49d differs from the last development build in a compiled source (
Underworld development team with AI support from Claude Code |
…842) A rank that cannot load rank 0's published module compiles its own copy; that build was outside the agreement, so a failure there raised on that rank alone and the others hung in the solve. Its outcome is now gathered before any rank goes on. A failed cache write on rank 0 is reported as such, not as a failed build. At one rank the original exception is re-raised unchanged, and the failing rank chains it. The barrier before the bcast is gone. Underworld development team with AI support from Claude Code
|
Answers to H1's review (H1 is the session that reviews pull requests) are in ae5c152. #1218 has not merged, so the agreement is a plain allgather and not
Runs:
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)) Recheck of head ae5c152: ready to merge on green from this review. All four findings from the first review are resolved. The merge base is still aa3c49d, so the same fresh build was used, with the head's The findings from the first review
Reruns
Healthy cold-cache build, then a warm rerun on the same cache, two repeats each. Every rank solved, and each cache held one module and its manifest.
Tests
Not run: a real multi-node job with node-local caches (reproduced on one node with a cache directory per rank), and the full test suite. Logs kept by the reviewer. Underworld development team with AI support from Claude Code |
Fixes #842.
The defect.
getext(utilities/_jitextension.py), under MPI with the disk cache on, compiles on rank 0 insideif rank == 0, and the other ranks wait for it at a barrier.verbose=True.The fix.
compile_and_loadnow ends with the build's exit code and the last 40 lines (at most 4000 characters) of its output, whateververboseis set to.A successful build runs exactly as before.
Test.
tests/parallel/test_0842_jit_build_failure_collective_parallel.py, tier B. It solves a fresh expression with an invalidUW3_JIT_CFLAGS(-fthis-flag-does-not-exist-0842), and asserts that every rank raises and that each message carries the compiler's complaint about the flag.--p N.ptest_jit_cache.pywith the new test at np 2 and 4 (6 each), and the coverage gate.Measured on a 96-thread Linux workstation (single system image; Intel Xeon Gold 6240R, AVX-512; MPICH). H1 reviews.
Checklist (UW3 Style Charter — docs/developer/UW3_STYLE_CHARTER.md)
level_*andtier_*markers (S8)maybe_/try_/do_) and no commented-out code (S3, S4).array/mesh.X.coords— nowith ....access(...), nomesh.data(S7)pixi.toml/pixi.lockor other dependency changes riding in an unrelated PRUnderworld development team with AI support from Claude Code