Skip to content

stable MPI.COMM_WORLD for scaling out to hundreds of node #100

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions dask_mpi/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@


def initialize(
comm,
interface=None,
nthreads=1,
local_directory=None,
Expand All @@ -20,7 +21,6 @@ def initialize(
protocol=None,
worker_class="distributed.Worker",
worker_options=None,
comm=None,
exit=True,
):
"""
Expand All @@ -38,6 +38,8 @@ def initialize(

Parameters
----------
comm: mpi4py.MPI.Intracomm
Optional MPI communicator to use instead of COMM_WORLD
interface : str
Network interface like 'eth0' or 'ib0'
nthreads : int
Expand All @@ -59,8 +61,6 @@ def initialize(
Class to use when creating workers
worker_options : dict
Options to pass to workers
comm: mpi4py.MPI.Intracomm
Optional MPI communicator to use instead of COMM_WORLD
exit: bool
Whether to call sys.exit on the workers and schedulers when the event
loop completes.
Expand All @@ -71,10 +71,9 @@ def initialize(
Only returned if exit=False. Inidcates whether this rank should continue
to run client code (True), or if it acts as a scheduler or worker (False).
"""
if comm is None:
from mpi4py import MPI

comm = MPI.COMM_WORLD
assert (
comm is not None
), "MPI Comm World needs to be created before import distributed."

world_size = comm.Get_size()
if world_size < 3:
Expand Down
Loading