Skip to content

test: relaunch an mpiexec that never started, for every test and for the MPI_INIT flake too - #95

Merged
cekees merged 1 commit into
mainfrom
mpi-init-retry
Oct 23, 2026
Merged

cekees merged 1 commit into
mainfrom
mpi-init-retry

Conversation

@cekees

@cekees cekees commented Oct 23, 2026

Copy link
Copy Markdown
Owner

Both Intel runs of #88 lost one test to the same Open MPI 5 launch flake: a rank's MPI_Init fails with It looks like MPI_INIT failed ... PML add procs failed --> Returned "Not found" (-13) (exit 14), once in test_pro_cli::test_superlu_is_refused_on_two_ranks_before_computing (two ranks) and once in test/multilevel/test_cube_q2.py::test_single_level_q2_quad_is_the_serial_solve[4]. The existing relaunch (test/multilevel/conftest.py, from #75) matched only the PMIx ptl_tool: problems getting address message and covered only test/multilevel, so it caught neither.

Changes:

  • The relaunch moves to test/conftest.py as an autouse fixture that wraps every subprocess.run from a test. A launch whose stderr carries either Open MPI message (nothing has run when they appear) is launched again, three attempts in all, with a pause of PROTEUS_TEST_MPI_RETRY_DELAY seconds (default 3) then twice that. Any other failure is returned unchanged, as is anything whose stderr was not captured. Five other test files launch mpiexec directly (test_pro_cli.py, test_adr_problem.py, test_archive_parallel_metadata.py, parun_exit_status/, poisson_2d/test_parallel_partitioning.py) and are now covered.
  • test/multilevel/conftest.py keeps only its rank-slot gate (test/multilevel: limit concurrent MPI ranks instead of grouping onto one xdist worker #87), layered over the root retry (it depends on that fixture by name), so a relaunch holds the same slots.
  • test/test_mpi_launch_retry.py: a fake launcher that fails a given number of times with a given message checks that both messages are relaunched, that there are three attempts at most, and that a failure of the job itself or an uncaptured stderr is not relaunched.

Checked locally (chewbacca, Open MPI 5 env): the new tests, test/multilevel/test_multigrid.py (the slot gate over the retry), and the full test/multilevel directory with -n 4 --dist loadgroup.

#88 merges this branch so its Intel leg gets the retry; once this merges, #88 is just its two scripts on main.

🤖 Generated with Claude Code

…the MPI_INIT flake too

Open MPI 5 on the macOS Intel runner fails to start a launch now and then: either PMIx
cannot find a network interface ("ptl_tool: problems getting address", exit 213) or a rank's
MPI_Init cannot reach the others ("It looks like MPI_INIT failed ... PML add procs failed",
exit 14). #88's two Intel runs each lost one test to the second message, once in
test_pro_cli (two ranks) and once in test/multilevel (four ranks). The retry that caught
the first message lived in test/multilevel/conftest.py, so it covered neither.

The retry now lives in test/conftest.py, wraps every subprocess.run from any test, and
matches both messages; nothing has run when either appears, so relaunching is safe, and
any other failure is returned as it is. The multilevel conftest keeps only its rank-slot
gate, layered over the root retry so a relaunch holds the same slots.
test_mpi_launch_retry.py drives the retry with a fake launcher that fails a given number
of times with a given message (PROTEUS_TEST_MPI_RETRY_DELAY=0 makes it quick).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@cekees
cekees merged commit 237571d into main Oct 23, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant