Skip to content

mpiexec hangs with multiprocessing with a non-fork start method #501

Open

Description

@mihaic

See the following example:

mpiexec -n 2 python3 test_pool.py  # runs forever, kill it manually
cat test_pool.py
import multiprocessing

from mpi4py import MPI

def test_pool():
    multiprocessing.set_start_method("spawn")
    with multiprocessing.Pool(2) as pool:
        pool.apply(f, ())

def f():
    pass

if __name__ == "__main__":
    test_pool()

This affects us when running on macOS, where the the start method is "spawn". I will disable the affected tests so CI can pass.

We should probably disable multiprocessing in this situation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions