MatGetSubMatrix question

Jed Brown jed at
Tue May 26 12:38:00 CDT 2009

Matthew Knepley wrote:
> On Tue, May 26, 2009 at 12:11 PM, Lisandro Dalcin <dalcinl at> wrote:
>> On Mon, May 25, 2009 at 10:20 AM, Jed Brown <jed at> wrote:
>>> Is it really necessary that iscol be a sequential index set that covers
>>> all columns, with csize selecting the local columns?  I realize this
>>> might be natural/easy for AIJ formats, but it feels clumsy (not to
>>> mention not scalable due to the ISAllGather).
>> Your are right, this is not scalable, but...
>>> I'm guessing this is a relic from when IS was not a real parallel
>>> object.  Am I missing some deep reason for this interface, or could
>>> iscol be parallel and csize be dropped?
>> unless things have changed very recently (after 3.0.0 release), IS is
>> far from being a real parallel object.
> I agree. I am trying to think of a scenario is which you would want to
> create a distributed IS, which would then gather those columns to each
> process without gathering the integers. Theoretically, we might want
> this, but is it worth any time to implement?

So I already have the submatrix, either assembled or in matrix-free
form.  My preconditioning matrix does not even implement MatMult, it's
just a container for the submatrices that PCFieldSplit is going to ask
me for.  Having a look at where MatGetSubMatrix is used, it looks like
it's always either using the default csize, or is doing the ISAllGather
just to determine this information, thus a better interface is for
MatGetSubMatrix to take a parallel iscol and the implementations that
need it can do the ISAllGather themselves.  All I'm going to do with
isrow and iscol is compare (ISEqual) to a couple IS in my
preconditioning matrix and if they match, return the requested matrix,
otherwise error.

Unless I'm missing something critical, this would be a pretty minor
change.  At some later date (e.g. when PCFieldSplit is used on really
big problems) we could consider more scalable implementations of
MatGetSubMatrix.  But the current interface doesn't allow it.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 260 bytes
Desc: OpenPGP digital signature
URL: <>

More information about the petsc-dev mailing list