[petsc-users] Regarding help with MatGetSubMatrix parallel use

Matthew Knepley knepley at gmail.com
Wed Sep 23 15:55:47 CDT 2020


On Wed, Sep 23, 2020 at 4:12 PM Krishnan, Gautham <gautham3 at illinois.edu>
wrote:

> Hello,
>
> For a CFD code being developed with FORTRAN and MPI, I am using PETSC
> matrices and for a particular operation, I require to extract a
> submatrix(n-1 x n-1) of a matrix created (n x n). However using the petsc
> MatGetSubMatrix works for serial runs but fails when the domain is split up
> over PEs- I suspect the indexing changed for parallel runs and hence the
> global indexing that worked for serial case just shuffles around matrix
> entries in parallel undesirably. I would like to ask whether anybody could
> offer some guidance regarding this.  I would like to note that the 2D
> domain is split along both x and y axes for parallel runs on multiple PEs.
>

In parallel, you pass MatGetSubmatrix() the global indices that you want on
your process.

  Thanks,

     Matt


> Regards,
> Gautham Krishnan,
>
>

-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener

https://www.cse.buffalo.edu/~knepley/ <http://www.cse.buffalo.edu/~knepley/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20200923/15d240b9/attachment-0001.html>


More information about the petsc-users mailing list