[petsc-dev] Extract sub-matrices efficiently

victor.magri at dicea.unipd.it victor.magri at dicea.unipd.it
Wed May 18 11:10:05 CDT 2016


 

Dear PETSc developers, 
I have a matrix of the type MATMPIAIJ from which I want to extract small
sub-matrices and sub-vectors (number of rows from 1 to 50 maximum)
several times. This is a very fundamental step of a preconditioner that
I'm writing. After that, I want to solve these sub-systems locally. 

In my current implementation I use MatGetSubMatrices with
MAT_INITIAL_MATRIX to extract the sub-matrices and MatGetRow plus some
other artifacts to extract the sub-vectors. However, I see that this
procedure is too costly, once it creates and destroys the output
variables each time they are called. I thought about using the MAT_REUSE
flag, but I can't since the nonzero pattern of the local sub-matrix may
change from call to call. 

Can you give me some hint on how to do this task efficiently? I
appreciate your help! 

-- 

Victor A. P. Magri - PhD student
Dept. of Civil, Environmental and Architectural Eng.
University of Padova
Via Marzolo, 9 - 35131 Padova, Italy 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20160518/d396366e/attachment.html>


More information about the petsc-dev mailing list