<div dir="ltr">It works in serial. In parallel, it currently gives the diagonal of the "diagonal blocks" induced by the row and column distributions. That only matches the true diagonal for square matrices, though an actual diagonal doesn't typically make algorithmic sense for a non-square parallel matrix.</div>
<div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jan 23, 2013 at 10:16 AM, Nachiket Gokhale <span dir="ltr"><<a href="mailto:gokhalen@gmail.com" target="_blank">gokhalen@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Any chance of making this work in serial?<br>
<br>
<a href="http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatGetDiagonal.html" 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>
</blockquote></div><br></div>