partition_list_mpi#

caput.util.mpitools.partition_list_mpi(full_list: list, method: str = 'con', comm: mpi4py.MPI.Comm | None = _comm) list[source]#

Return the partition of a list specific to the current MPI process.

Parameters:
full_listlist

The full list to partition.

method{“con”, “alt”, “rand”}, optional

How to split the list, can be “con”: contiguous, “alt”: alternating, “rand”: random. Default is “con”.

commMPI.Comm | None, optional

MPI communicator to use (default COMM_WORLD).

Returns:
partitioned_listlist

The sub-list for the current MPI process.