Skip to content

Commit

Permalink
Updated split function name and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Com1t committed Aug 18, 2023
1 parent 96e7e03 commit a0259f7
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions dace/frontend/common/distr.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ def _comm_split(pv: 'ProgramVisitor',
grid: str = None):
""" Splits communicator
"""

from dace.libraries.mpi.nodes.comm_split import Comm_split

# fine a new comm world name
Expand All @@ -73,12 +72,12 @@ def _comm_split(pv: 'ProgramVisitor',
@oprepo.replaces_method('Cartcomm', 'Split')
@oprepo.replaces_method('Intracomm', 'Split')
def _intracomm_comm_split(pv: 'ProgramVisitor',
sdfg: SDFG,
state: SDFGState,
comm: Tuple[str, 'Comm'],
color: Union[str, sp.Expr, Number] = 0,
key: Union[str, sp.Expr, Number] = 0):
""" Equivalent to `dace.comm.Bcast(buffer, root)`. """
sdfg: SDFG,
state: SDFGState,
comm: Tuple[str, 'Comm'],
color: Union[str, sp.Expr, Number] = 0,
key: Union[str, sp.Expr, Number] = 0):
""" Equivalent to `dace.comm.split(color, key)`. """
from mpi4py import MPI
comm_name, comm_obj = comm
if comm_obj == MPI.COMM_WORLD:
Expand All @@ -87,13 +86,13 @@ def _intracomm_comm_split(pv: 'ProgramVisitor',


@oprepo.replaces_method('ProcessComm', 'Split')
def processcomm_comm_split(pv: 'ProgramVisitor',
sdfg: SDFG,
state: SDFGState,
comm: Tuple[str, 'Comm'],
color: Union[str, sp.Expr, Number] = 0,
key: Union[str, sp.Expr, Number] = 0):
""" Equivalent to `dace.comm.Bcast(buffer, root)`. """
def _processcomm_comm_split(pv: 'ProgramVisitor',
sdfg: SDFG,
state: SDFGState,
comm: Tuple[str, 'Comm'],
color: Union[str, sp.Expr, Number] = 0,
key: Union[str, sp.Expr, Number] = 0):
""" Equivalent to `dace.comm.split(color, key)`. """
return _comm_split(pv, sdfg, state, color, key, grid=comm)


Expand Down

0 comments on commit a0259f7

Please sign in to comment.