<div dir="ltr"><div dir="ltr">On Wed, Jun 10, 2020 at 8:56 AM Eda Oktay <<a href="mailto:eda.oktay@metu.edu.tr">eda.oktay@metu.edu.tr</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi all,<br>
<br>
I am trying to get all the rows of a parallel matrix as individual<br>
vectors. For instance, if I have 72*4 matrix, I want to get 72<br>
different vectors having size 4.<br>
<br>
As far as I understood, MatGetRow is only for local rows, so<br>
MatGetOwnershipRange is used, however, when I tried this one, I<br>
couldn't get the whole and desired row vectors.<br>
<br>
In MatGetRow explanation, it is written that I should use<br>
MatCreateSubMatrices first, then use MatGetRow. But I couldn't<br>
understand to which extent I should create submatrices. I just need to<br>
have all 72 rows as 72 different vectors each having 4 elements.<br></blockquote><div><br></div><div>1) For sparse matrices, the storage is always divided by row, so that values can only be retrieved for local rows with MatGetRow()</div><div><br></div><div>2) Is this matrix sparse? It sounds like it is dense.</div><div><br></div><div>3) Are you asking to get all matrix values on all processes? If so, I think the easiest thing to do is first wrap a Vec around the</div><div> values, then use VecScatterToAll(), then wrap each one in a MatDense again.</div><div><br></div><div> Thanks,</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Thanks!<br>
<br>
Eda<br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div><div><br></div><div><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>