pylops_mpi.MPILinearOperator#
- class pylops_mpi.MPILinearOperator(Op=None, shape=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 reccomended to use thepylops_mpi.basicoperators.MPIBlockDiagoperator instead as this can also handle distributed arrays with subcommunicators.- Parameters:
- Op
pylops.LinearOperator, optional PyLops Linear Operator to wrap. Defaults to
None.- shape
tuple(int, int), optional Shape of the MPI Linear Operator. Defaults to
None.- 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, dtype, base_comm])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