salvus.mesh.algorithms.distributed_mesh.reduce
salvus.mesh.algorithms.distributed_mesh.reduce salvus mesh algorithms distributed_mesh reduce Convert an MPI distributed mesh to a regular Mesh on a single rank.
Functions
from_mesh()
from_mesh()def from_mesh(
distributed_mesh: DistributedMesh,
element_selection_function: collections.abc.Callable,
mesh: Mesh | None,
reduction_operations_per_field: dict[str, str],
timer: Timer | None = None,
log_to_logger: bool = True,
reentrant_timer: bool = False,
artifacts: ArtifactsFromToMesh | None = None,
) -> None: ...Reduce a mesh into the distributed mesh.
This function needs to be called on all ranks of a distributed mesh’s communicator. Each rank usually will define its own element selection function.
Parameters
distributed_meshDistributedMesh — The distributed mesh to reduce into.element_selection_functioncollections.abc.Callable — Function that takes the global element indices returns the indices to keep.meshMesh | None — The mesh to reduce from. Can be None on ranks that have no elements selected by the element selection function.reduction_operations_per_fielddict[str, str] — Dictionary mapping field names to reduction operations. Reduction operations can be “sum”, “min”, “max”, or “replace”. This must be the same per rank.timerTimer | None — Execution timer.log_to_loggerbool — Whether to log timing to the logger.reentrant_timerbool — Whether the timer is reentrant.artifactsArtifactsFromToMesh | None — Optional cached intermediates from a previousto_mesh_with_artifacts()call on the same distributed mesh and selection. When provided, the element selection call,discretize_blocks, andget_aperture_sfsare skipped. Ignored on the legacy code path.
Returns None