pylops_mpi.MPILinearOperator#
- class pylops_mpi.MPILinearOperator(Op=None, shape=None, dims=None, dimsd=None, dtype=None, base_comm=<mpi4py.MPI.Intracomm object>)[source]#
MPI-enabled PyLops Linear Operator
Common interface for performing matrix-vector products in distributed fashion.
In practice, this class provides methods to perform matrix-vector and adjoint matrix-vector products between any
pylops.LinearOperator(which must be the same across ranks) and apylops_mpi.DistributedArraywithPartition.BROADCASTandPartition.UNSAFE_BROADCASTpartition. It internally handles the extraction of the local array from the distributed array and the creation of the outputpylops_mpi.DistributedArray.Note that whilst this operator could also be used with different
pylops.LinearOperatoracross ranks, and with apylops_mpi.DistributedArraywithPartition.SCATTER, it is however recommended to use thepylops_mpi.basicoperators.MPIBlockDiagoperator instead as this can also handle distributed arrays with subcommunicators.- Parameters:
- Op
pylops.LinearOperator, optional If other arguments are provided, they will overwrite those obtained from
Op. Defaults toNone.- shape
tuple(int, int), optional Shape of the MPI Linear Operator. If not provided, obtained from
dimsanddimsd.- dims
tuple(int, ..., int), optional Dimensions of model. If not provided,
(self.shape[1],)is used.- dimsd
tuple(int, ..., int), optional Dimensions of data. If not provided,
(self.shape[0],)is used.- dtype
str, optional Type of elements in input array. Defaults to
None.- base_comm
mpi4py.MPI.Comm, optional MPI Base Communicator. Defaults to
mpi4py.MPI.COMM_WORLD.
- Op
Methods
__init__([Op, shape, dims, dimsd, dtype, ...])adjoint()Adjoint MPI LinearOperator
conj()Complex conjugate operator
dot(x)Matrix Vector Multiplication
matvec(x)Matrix-vector multiplication.
rmatvec(x)Adjoint Matrix-vector multiplication.
transpose()Transposition of MPI LinearOperator
Examples using pylops_mpi.MPILinearOperator#
Distributed Matrix Multiplication - Block-row-column decomposition