Mondaic

salvus.flow.executors.mpi.utils

salvus.flow.executors.mpi.utils salvus flow executors mpi utils

Run simulations on MPI distributed meshes.

Functions

compute_halo_selection()

def compute_halo_selection(
    core_global_element_ids: npt.NDArray, halo_width_in_meters: float
) -> collections.abc.Callable[[Mesh], npt.NDArray]: ...

Compute a selection function that selects all elements within a halo around the given core global element IDs.

Parameters
  • core_global_element_ids npt.NDArray — The global element IDs of the core region.
  • halo_width_in_meters float — The width of the halo in meters.
Returns collections.abc.Callable[[Mesh], npt.NDArray]

get_solver_precision()

def get_solver_precision(
    comm: int, execution_config: MPIExecutionConfiguration
) -> typing.Literal["single", "double"]: ...

Get the solver precision for a given MPI execution configuration.

Collective operations.

This function will only check it on rank 0 and then broadcast the result. In addition it will be cached so that it is only computed once per binary. This should make the cost of this function negligible.

Parameters
  • comm int — The MPI communicator.
  • execution_config MPIExecutionConfiguration — The MPI execution configuration. The assumption is that it is the same across all ranks.
Returns typing.Literal['single', 'double']