<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Dec 9, 2019 at 10:57 AM hg <<a href="mailto:hgbk2008@gmail.com">hgbk2008@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">I think the manual is also insufficient in this case. The vector must be VECMPI and contains only the portion in the local process. Is that correct?</div></blockquote><div><br></div><div>The vector and matrix (row) maps must match. This is assumed for any method that I can think of that takes a matrix and a vector(s). This will dictate if its MPI and the data layout.</div><div><br></div><div>Perhaps there is some ambiguity as to whether it is the row or column map, but they are usually the same for a square matrix and MatGetDiagonal makes no sense for a rectangular matrix.</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"><div dir="ltr"><div><br clear="all"><div><div dir="ltr"><div dir="ltr">Giang</div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jan 23, 2013 at 5:24 PM Nachiket Gokhale <<a href="mailto:gokhalen@gmail.com" target="_blank">gokhalen@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Thanks, I guess I misinterpreted the manual.<br>
<br>
-Nachiket<br>
<br>
On Wed, Jan 23, 2013 at 11:20 AM, Jed Brown <<a href="mailto:jedbrown@mcs.anl.gov" target="_blank">jedbrown@mcs.anl.gov</a>> wrote:<br>
> It works in serial. In parallel, it currently gives the diagonal of the<br>
> "diagonal blocks" induced by the row and column distributions. That only<br>
> matches the true diagonal for square matrices, though an actual diagonal<br>
> doesn't typically make algorithmic sense for a non-square parallel matrix.<br>
><br>
><br>
> On Wed, Jan 23, 2013 at 10:16 AM, Nachiket Gokhale <<a href="mailto:gokhalen@gmail.com" target="_blank">gokhalen@gmail.com</a>><br>
> wrote:<br>
>><br>
>> Any chance of making this work in serial?<br>
>><br>
>><br>
>> <a href="http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatGetDiagonal.html" rel="noreferrer" target="_blank">http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatGetDiagonal.html</a><br>
>><br>
>> Not a show stopper, I am trying to get the diagonal of some small<br>
>> projected, dense matrices (which come from large sparse matrices). I<br>
>> am running in serial because 1) Since my projected matrices are small,<br>
>> and 2) PETSc does not do certain matrix multiplications involving a<br>
>> dense matrix in parallel,<br>
>><br>
>> -Nachiket<br>
><br>
><br>
</blockquote></div>
</blockquote></div></div>