Repository navigation
serial_reference: the spawned child keeps the user's MPI component selections (#922) - #930
Conversation
…selections serial_reference spawns each test's np=1 diagnostic with every OMPI_* variable scrubbed, which also drops OMPI_MCA_io=^ompio: on kaiju every HDF5 error 76 under load was in such a child (#922). test_1138 checks the scrub (the user's io/mtl/btl/pml selections kept, the launcher's job-identity variables dropped) and spawns a child through _run_child that reports what it received. On development the child sees OMPI_MCA_io=None. Underworld development team with AI support from Claude Code
…#922) The scrub of the spawned np=1 child dropped every OMPI_* variable, the user's MCA component selections with the launcher's job identity. A job that set OMPI_MCA_io=^ompio to keep HDF5 off OMPIO had all its reference runs on OMPIO anyway, and those runs carried every HDF5 error 76 on kaiju under load. _child_env keeps OMPI_MCA_io, OMPI_MCA_mtl, OMPI_MCA_btl and OMPI_MCA_pml, and drops everything else under the launcher prefixes; test_1138 passes and is in serial batch 4. Underworld development team with AI support from Claude Code
… scrub everywhere From the adversarial review of ae9a45c: - HIGH: keeping a framework's selection without its parameters can abort the child's MPI_Init where the parent's succeeds (measured on Open MPI 5.0.10: pml=cm with mtl=ofi and mtl_ofi_provider_include=tcp gives rc 1 under the narrow keep, rc 0 on development and in the parent). _child_env now keeps OMPI_MCA_<fw> and OMPI_MCA_<fw>_* for io and its sub-frameworks (fcoll, fs, fbtl, sharedfp), mtl, btl, pml and opal_common_ucx, and still drops every other launcher-prefixed variable; the docstring says what is still dropped (osc, coll, PMIX_MCA_*, PRTE_MCA_*, OMPI_CC). - test_0855 and test_1079 spawned children with their own copy of the old scrub, so they still ran on OMPIO under a job's io=^ompio; both call _child_env now. - test_1138's child initialises MPI and must be a singleton (size 1), and every launcher-prefixed variable it receives must be a kept framework setting, which under mpirun covers the launcher's real variables. The selections include a parameter (mtl_ofi_provider_include). Settings that are not launcher identity (OPAL_PREFIX, I_MPI_PIN, PRTE_MCA_*) are no longer listed as variables the scrub must drop. Underworld development team with AI support from Claude Code
Pre-PR adversarial reviewOne round on ae9a45c. The HIGH and both MEDIUM findings were fixed in a79d523. HIGH 1: the child kept a framework's selection but dropped its parameters, so its
MEDIUM 2: test_0855 and test_1079 spawn children with their own copy of the old scrub. Both write HDF5 under load. Fixed: both use MEDIUM 3: the test could not catch HIGH 1, and its mpirun claim had nothing behind it. Fixed: the child imports LOW 4: test 1 fails on development with an ImportError, not a behavioural assertion. Test 2 is the fail-first proof: on development the child sees LOW 5: the test's job-identity set listed settings that are not job identity ( LOW 6: the docs overstated what is kept. Fixed: Attacks that failed
Issue verdicts
Underworld development team with AI support from Claude Code |
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the changes preserving selected Open MPI settings in serial-reference child processes.
No open issues 🎉
What changed in this PR
This PR preserves selected Open MPI component settings in spawned serial-reference processes while continuing to remove launcher identity variables. It addresses the child-environment portion of #922; the library-side MPI-IO issue remains open.
Changes:
- Adds a shared environment filter that retains supported component selections and their parameters.
- Reuses the filter in mesh-smoothing and diffusion-restart subprocess tests.
- Adds regression tests for environment filtering and singleton MPI initialization, and registers them in serial batch 4.
| File | Description |
|---|---|
tests/test_1079_diffusion_disk_restart.py |
Uses the shared environment filter for restart subprocesses. |
tests/parallel/test_1138_serial_reference_child_env.py |
Tests retained settings, removed launcher variables, and singleton MPI initialization. |
tests/parallel/test_0855_mesh_smoothing_parallel.py |
Uses the shared filter for the serial reference subprocess. |
tests/parallel/serial_reference.py |
Preserves supported Open MPI settings when preparing child environments. |
scripts/test.sh |
Adds the new regression tests to serial batch 4. |
Review effort: Balanced
…-selection One conflict in scripts/test.sh, adjacent batch-4 lines (test_1133 from #928, test_1138 from this branch); both kept. Underworld development team with AI support from Claude Code
One conflict in scripts/test.sh, adjacent batch-4 lines (test_1138 from #930, test_1134 from this branch); both kept. Underworld development team with AI support from Claude Code
Shard 4 owns the whole --p N phase, and every new file under tests/parallel/ had also put its serial run in batch 4. It reached 55:32 on development (run 41564997729, #930) and was cancelled at 60 minutes on this PR, during test_1089 at np 2, which had not hung: development takes 48 s past the same point. Shards 2 and 3 took about 29 minutes. - The ten serial runs of tests/parallel files (test_1069 ... test_1139), about 6 minutes, go to shard 3. - test_05*/06*/07*, about 4 minutes, go to shard 2. --print-shards still gives [1,2,3,4], and check_test_coverage reports every file reachable. Underworld development team with AI support from Claude Code
tests/parallel/serial_reference.pyruns a test module's np 1 diagnostic in a spawned Python. It strips the launcher's variables from the child's environment, so that the child runs as a singleton and does not try to join the parent's job. It stripped everyOMPI_*variable, and with them the user's own Open MPI component selections. On kaiju, jobs setOMPI_MCA_io=^ompioto keep HDF5 off OMPIO. Under load, every HDF5 error 76 (#922) was in a spawned reference run that never saw that setting.Change
_child_envkeeps the user's selections and their parameters (OMPI_MCA_<fw>andOMPI_MCA_<fw>_*) for:opal_common_ucx.OMPI_COMM_WORLD_*,PMIX_*,PMI_*, Slurm, Hydra and the rest).pml=cmwithout its OFI provider setting aborts the child'sMPI_Init._child_env.Tests
tests/parallel/test_1138_serial_reference_child_env.py(tier B; serial batch 4 and CI's np 2 MPI phase) has two tests:OMPI_MCA_mtl_ofi_provider_include), is kept. No launcher variable is kept.OMPI_MCA_io=None.On kaiju (Open MPI 4.1.1, PETSc 3.25.0):
Refs #922. The issue stays open: its library side is untouched. That side is
_from_gmshwriting the mesh file through MPI-IO, which fails under OMPIO when many processes on a node do HDF5 I/O at once.scripts/test.shgains a line in serial batch 4 at the same place as the #919 PR and the patch summary PR.Underworld development team with AI support from Claude Code