[petsc-users] MatGetSubMatrices or VecCreateGhost

Bikash Kanungo bikash at umich.edu
Fri Oct 16 07:52:20 CDT 2015


Hi,

I need to multiply a matrix A with several vectors v_i's and use the
resultant vectors in my calculation which involves access to non-local
nodes. I can think of two possible ways to do it:

1. Store the vectors v_i's into an MPIDENSE matrix and perform MatMatMult
with A to get a resultant dense matrix B. I can now use MatGetSubMatrices
on B to access the non-local part required in my subsequent calculations.

2. Use MatMult to evaluate A*v_i for each of the vectors and provide ghost
padding through VecCreateGhost for the resultant vector.

Which of the two is a more efficient way to perform the task? Also, if
there is a better way possible to achieve the same, then kindly let me know.

Thanks,
Bikash

-- 
Bikash S. Kanungo
PhD Student
Computational Materials Physics Group
Mechanical Engineering
University of Michigan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20151016/c9c8b6a8/attachment.html>


More information about the petsc-users mailing list