gather_local#

caput.util.mpitools.gather_local(global_array: numpy.typing.NDArray, local_array: numpy.typing.NDArray, local_start: collections.abc.Sequence[int], root: int = 0, comm: mpi4py.MPI.Comm | None = _comm) None[source]#

Gather data array in each process to the global array in root process.

Parameters:
global_arrayarray_like

The global array which will collect data from local_array in each process.

local_arrayarray_like

The local array in each process to be collected to global_array.

local_startSequence[int]

The starting index of the local array to be placed in global_array.

rootint, optional

The process local array gathered to.

commMPI.Comm | None, optional

MPI communicator that array is distributed over. Default is MPI.COMM_WORLD.