pylops_mpi.basicoperators.MatrixMult.block_gather#
- pylops_mpi.basicoperators.MatrixMult.block_gather(x, orig_shape, comm)[source]#
Local block from 2D block distributed matrix
Gather distributed local blocks from 2D block distributed matrix distributed amongst a square process grid into the full global array.
- Parameters:
- x
pylops_mpi.DistributedArray
The distributed array to gather locally.
- orig_shape
tuple
Global shape
(N, M)
of the global array to be gathered.- comm
mpi4py.MPI.Comm
MPI communicator whose size must be a perfect square (\(P = P'^2\)).
- x
- Returns:
- Array
The reconstructed 2D array of shape
orig_shape
, assembled from the distributed blocks.
- Raises:
- RuntimeError
If the number of processes participating in the provided communicator is not a perfect square.