Mondaic
This API reference is not for the latest stable Salvus version.

salvus.mesh.algorithms.distributed_mesh.broadcast

MPI broadcast utilities for Salvus meshes.

Functions

broadcast_mesh()

def broadcast_mesh(mesh: Mesh | None, comm: int, root: int) -> Mesh: ...

Broadcast a Mesh from the root rank to all other ranks.

This function broadcasts a Salvus Mesh efficiently by transferring each numpy array individually, avoiding memory duplication on the root rank that would occur with full serialization. Scalar values and non-array objects are serialized using dill.

Parameters
  • mesh Mesh | None — The Mesh to broadcast. Only needs to be valid on the root rank; can be None on other ranks.
  • comm int — MPI communicator handle.
  • root int — The rank that holds the mesh to broadcast.
Returns Mesh — The broadcasted Mesh on all ranks.