-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
Closed
Closed
Copy link
Labels
type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
The following code throws a CalledProcessError
under Linux (Ubuntu 24) but passed under macOS (15.4).
Using mpi4py
here is not essential, any program calling MPI_Init()
will do.
The code works as expected if one either calls MPI.finalize()
before calling subprocess.run()
or just run echo
in the subprocess without wrapping it with mpirun
.
I used OpenMPI 4.1.6 under Ubuntu and OpenMPI 5.0.7 under macOS.
import subprocess
from mpi4py import MPI
# Uncomment the next line and it works
# MPI.Finalize()
res = subprocess.run(["mpirun", "-np", "1", # comment out "mpirun" ... and it works
"echo", "This is the subprocess"],
check=True, capture_output=True)
CPython versions tested on:
3.13, 3.12
Operating systems tested on:
Linux, macOS
Metadata
Metadata
Assignees
Labels
type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error