Distributed memory#

class meshmode.distributed.MPIMeshDistributor(mpi_comm, manager_rank=0)[source]#
is_mananger_rank()[source]#
send_mesh_parts(mesh, part_per_element, num_parts)[source]#
Parameters:
  • mesh – A Mesh to distribute to other ranks.

  • part_per_element – A numpy.ndarray containing one integer per element of mesh indicating which part of the partitioned mesh the element is to become a part of.

  • num_parts – The number of parts to divide the mesh into.

Sends each part to a different rank. Returns one part that was not sent to any other rank.

receive_mesh_part()[source]#

Returns the mesh sent by the manager rank.

class meshmode.distributed.InterRankBoundaryInfo(local_part_id: Hashable, remote_part_id: Hashable, remote_rank: int, local_boundary_connection: DirectDiscretizationConnection)[source]#
local_part_id#

An opaque, hashable, picklable identifier for the local part.

remote_part_id#

An opaque, hashable, picklable identifier for the remote part.

remote_rank#

The MPI rank with which this boundary communicates.

local_boundary_connection#

A DirectDiscretizationConnection from the volume onto the boundary described by BTAG_PARTITION(remote_part_id).

__init__(local_part_id: Hashable, remote_part_id: Hashable, remote_rank: int, local_boundary_connection: DirectDiscretizationConnection) None#
class meshmode.distributed.MPIBoundaryCommSetupHelper(mpi_comm: mpi4py.MPI.Intracomm, actx: ArrayContext, inter_rank_bdry_info: Union[Sequence[InterRankBoundaryInfo], Mapping[int, DirectDiscretizationConnection]], bdry_grp_factory: ElementGroupFactory)[source]#

Helper for setting up inter-part facial data exchange.

__init__(mpi_comm: mpi4py.MPI.Intracomm, actx: ArrayContext, inter_rank_bdry_info: Union[Sequence[InterRankBoundaryInfo], Mapping[int, DirectDiscretizationConnection]], bdry_grp_factory: ElementGroupFactory)[source]#
Parameters:
  • local_bdry_conns – A dict mapping remote part to local_bdry_conn, where local_bdry_conn is a DirectDiscretizationConnection that performs data exchange from the volume to the faces adjacent to part i_remote_part.

  • bdry_grp_factory – Group factory to use when creating the remote-to-local boundary connections

__enter__()[source]#
__exit__(type, value, traceback)[source]#
complete_some()[source]#

Returns a dict mapping a subset of remote parts to remote-to-local boundary connections, where a remote-to-local boundary connection is a DirectDiscretizationConnection that performs data exchange across faces from part i_remote_part to the local mesh. When an empty dictionary is returned, setup is complete.

meshmode.distributed.get_partition_by_pymetis(mesh, num_parts, *, connectivity='facial', **kwargs)[source]#

Return a mesh partition created by pymetis.

Parameters:
  • mesh – A meshmode.mesh.Mesh instance

  • num_parts – the number of parts in the mesh partition

  • connectivity – the adjacency graph to be used for partitioning. Either "facial" or "nodal" (based on vertices).

  • kwargs – Passed unmodified to pymetis.part_graph().

Returns:

a numpy.ndarray with one entry per element indicating to which part each element belongs, with entries between 0 and num_parts-1.

Changed in version 2020.2: connectivity was added.

meshmode.distributed.membership_list_to_map(membership_list)[source]#

Convert a numpy.ndarray that maps an index to a key into a dict that maps a key to a set of indices (with each set of indices stored as a sorted numpy.ndarray).

meshmode.distributed.get_connected_parts(mesh: Mesh) Set[Hashable][source]#

For a local mesh part in mesh, determine the set of connected parts.

class meshmode.distributed.RemoteGroupInfo(inter_part_adj_groups: List[meshmode.mesh.InterPartAdjacencyGroup], vol_elem_indices: numpy.ndarray, bdry_elem_indices: numpy.ndarray, bdry_faces: numpy.ndarray)[source]#
class meshmode.distributed.make_remote_group_infos(actx: ArrayContext, remote_part_id: Hashable, bdry_conn: DirectDiscretizationConnection)[source]#