salvus.mesh.algorithms.distributed_mesh.mesh_from_domain_mpi
An MPI version of mesh_from_domain().
Functions
mesh_from_domain_mpi()
mesh_from_domain_mpi()def mesh_from_domain_mpi(
comm: int,
domain: domain_module.Domain | None,
model: Material | LayeredModel | MeshingProtocol | None,
mesh_resolution: MeshResolution,
model_override: Material | str | None = None,
execution_policy: bindings.ExecutionPolicy = salvus._core.lib.salvus_core_python_bindings.ExecutionPolicy,
mesh_postprocessing_callback_function: (
typing.Callable[[Mesh], Mesh] | None
) = None,
timer: Timer | None = None,
verbosity: int = 1,
) -> DistributedMesh: ...Create a distributed mesh on multiple ranks, avoiding duplicate work.
An MPI version of mesh_from_domain(). Note that some arguments only need to be provided on the root rank. If so, computational cost on the system as a whole can be reduced by avoiding creating of large objects on the remaining ranks at the call site.
Parameters
commint — The MPI communicator to use.domaindomain_module.Domain | None — The mesh’s domain. Can be None on non-root ranks.modelMaterial | LayeredModel | MeshingProtocol | None — Either a singleMaterial, aLayeredModel, or aMeshingProtocol. If either aMaterialor aLayeredModelis passed, it will internally be wrapped in a defaultMeshingProtocol. For complete control over the meshing algorithms and associated policies, pass aMeshingProtocolobject that contains theLayeredModelyou would like to mesh. The model only needs to be passed on rank 0. Pass None on the other ranks, although it will be ignored if passed, even if different per rank.mesh_resolutionMeshResolution — The desired mesh resolution.model_overrideMaterial | str | None — A single material instance that will override the size functions that the mesh has been built with. Alternatively the string “skip_model_interpolation” can be passed here which will return a mesh with no model parameters attached. Currently not supported in distributed meshing.execution_policybindings.ExecutionPolicy — Execution policy governing the maximum allowable parallelism of child routines.mesh_postprocessing_callback_functiontyping.Callable[[Mesh], Mesh] | None — Optional callback function that takes a singleMeshas input and returns a possibly modifiedMesh. This function will be applied on each chunk after it has been built, and finally also on the embedding mesh.timerTimer | None — Execution timer.verbosityint — The verbosity level.
Returns DistributedMesh