salvus.mesh.algorithms.distributed_mesh.broadcast
MPI broadcast utilities for Salvus meshes.
Functions
broadcast_mesh()
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
meshMesh | None — The Mesh to broadcast. Only needs to be valid on the root rank; can be None on other ranks.commint — MPI communicator handle.rootint — The rank that holds the mesh to broadcast.
Returns Mesh — The broadcasted Mesh on all ranks.