[petsc-users] MatGetRow for global rows of a parallel matrix

Eda Oktay eda.oktay at metu.edu.tr
Wed Jun 10 07:56:06 CDT 2020


Hi all,

I am trying to get all the rows of a parallel matrix as individual
vectors. For instance, if I have 72*4 matrix, I want to get 72
different vectors having size 4.

As far as I understood, MatGetRow is only for local rows, so
MatGetOwnershipRange is used, however, when I tried this one, I
couldn't get the whole and desired row vectors.

In MatGetRow explanation, it is written that I should use
MatCreateSubMatrices first, then use MatGetRow. But I couldn't
understand to which extent I should create submatrices. I just need to
have all 72 rows as 72 different vectors each having 4 elements.

Thanks!

Eda


More information about the petsc-users mailing list