split_local#

caput.util.mpitools.split_local(n: int, comm: mpi4py.MPI.Comm | None = _comm) numpy.ndarray[source]#

Split a range of integers [0, n) into sub-ranges for each MPI Process.

This returns the parameters only for the current rank.

Parameters:
nint

Length of range to split.

commMPI.Comm | None

MPI Communicator to use (default COMM_WORLD).

Returns:
split_params: ndarray

Array of shape (3, …) with rows corresponding to:

  • Number on this rank.

  • Starting of the sub-range for this rank.

  • End of rank for this rank.