about Jed's changes to MatGetSubMatrix

Lisandro Dalcin dalcinl at gmail.com
Thu Jun 4 17:52:52 CDT 2009

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

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

Lisandro Dalcín
Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC)
Instituto de Desarrollo Tecnológico para la Industria Química (INTEC)
Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
PTLC - Güemes 3450, (3000) Santa Fe, Argentina
Tel/Fax: +54-(0)342-451.1594

More information about the petsc-dev mailing list