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

salvus.mesh.algorithms.distributed_mesh.mesh_from_domain_mpi

An MPI version of mesh_from_domain().

Functions

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
  • comm int — The MPI communicator to use.
  • domain domain_module.Domain | None — The mesh’s domain. Can be None on non-root ranks.
  • model Material | LayeredModel | MeshingProtocol | None — Either a single Material, a LayeredModel, or a MeshingProtocol. If either a Material or a LayeredModel is passed, it will internally be wrapped in a default MeshingProtocol. For complete control over the meshing algorithms and associated policies, pass a MeshingProtocol object that contains the LayeredModel you 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_resolution MeshResolution — The desired mesh resolution.
  • model_override Material | 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_policy bindings.ExecutionPolicy — Execution policy governing the maximum allowable parallelism of child routines.
  • mesh_postprocessing_callback_function typing.Callable[[Mesh], Mesh] | None — Optional callback function that takes a single Mesh as input and returns a possibly modified Mesh. This function will be applied on each chunk after it has been built, and finally also on the embedding mesh.
  • timer Timer | None — Execution timer.
  • verbosity int — The verbosity level.
Returns DistributedMesh