about Jed's changes to MatGetSubMatrix

Jed Brown jed at 59A2.org
Thu Jun 4 18:16:20 CDT 2009


Lisandro Dalcin wrote:
> I like a lot the new API, though I would like to comment on the change
> below and previous behaviour of MatGetSubMatrix() in 3.0.:
> 
> Author: Jed Brown <jed at 59A2.org>  2009-05-27 15:15:56
> Committer: Jed Brown <jed at 59A2.org>  2009-05-27 15:15:56
> Parent: 13687:1da19bea6533 (Update ex19 output for minlambda)
> Child:  13689:7903ebaee227 (documentation update for the
> PetscComposedDataGet* routines)
> 
>     Compose gathered IS to amortize cost of ISAllGather with
> MatGetSubMatrix (MPIAIJ,MPIBAIJ)
> 
> 
> It is really required to make the call fail if MAT_REUSE_MATRIX is
> requested, but the submat is not the same that the original one but
> anyway have appropriate layout and nonzero pattern?
> 
> See this bit of Python code, it currently fails, but perhaps it should not?
> 
> S1 = A.getSubMatrix(isrows,iscols) # uses MAT_INITIAL_MATRIX
> S2 = S1.duplicate()
> A.getSubMatrix(isrows,iscols,S2) # uses MAT_REUSE_MATRIX

Did this really work in the past (in parallel)?  The MPIXAIJ
implementation uses a sequential matrix to extract values.  It is
composed with the object under the name "SubMatrix", and errors if that
doesn't exist, so I'll be very confused if it did.

We could create a new one if it doesn't exist, even with
MAT_REUSE_MATRIX, but that feels wrong to me.  Implementation is
trivial, but I think it's likely to be confusing and it becomes more
difficult to give meaningful error messages.  What do you think?

Jed

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 260 bytes
Desc: OpenPGP digital signature
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20090605/6e3c1dc6/attachment.sig>


More information about the petsc-dev mailing list