pylops_mpi.basicoperators.MatrixMult.local_block_split#
- pylops_mpi.basicoperators.MatrixMult.local_block_split(global_shape, rank, comm)[source]#
Local sub‐block of a 2D global array
Compute the local sub‐block of a 2D global array for a process in a square process grid.
- Parameters:
- global_shape
tuple
Dimensions of the global 2D array
(n_rows, n_cols)
.- rank
int
Rank of the MPI process in comm for which to get the owned block partition.
- comm
mpi4py.MPI.Comm
MPI communicator whose total number of processes \(P\) must be a perfect square \(P = \sqrt{P'}}\).
- global_shape
- Returns:
- Tuple[slice, slice]
Two slice objects (row_slice, col_slice) representing the sub‐block of the global array owned by this rank.
- Raises:
- ValueError
If rank is not an integer value or out of range.
- RuntimeError
If the number of processes participating in the provided communicator is not a perfect square.