<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">FWIW, I’ve fixed MatMatMult and MatTransposeMatMult here <a href="https://gitlab.com/petsc/petsc/commit/93d7d1d6d29b0d66b5629a261178b832a925de80" class="">https://gitlab.com/petsc/petsc/commit/93d7d1d6d29b0d66b5629a261178b832a925de80</a> (with MAT_INITIAL_MATRIX).<div class="">I believe there is something not right in your MR (2032) with MAT_REUSE_MATRIX (without having called MAT_INITIAL_MATRIX first), cf. <a href="https://gitlab.com/petsc/petsc/merge_requests/2069#note_220269898" class="">https://gitlab.com/petsc/petsc/merge_requests/2069#note_220269898</a>.</div><div class="">Of course, I’d love to be proved wrong!</div><div class=""><br class=""></div><div class="">Thanks,</div><div class="">Pierre<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On 22 Sep 2019, at 5:04 PM, Zhang, Hong <<a href="mailto:hzhang@mcs.anl.gov" class="">hzhang@mcs.anl.gov</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" class="">

<div class="">
<div dir="ltr" class="">I'll check it tomorrow.
<div class="">Hong</div>
</div>
<br class="">
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Sun, Sep 22, 2019 at 1:04 AM Pierre Jolivet via petsc-dev <<a href="mailto:petsc-dev@mcs.anl.gov" class="">petsc-dev@mcs.anl.gov</a>> wrote:<br class="">
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div style="overflow-wrap: break-word;" class="">Jed,
<div class="">I’m not sure how easy it is to put more than a few lines of code on GitLab, so I’ll just send the (tiny) source here, as a follow-up of our discussion <a href="https://gitlab.com/petsc/petsc/merge_requests/2069#note_220229648" target="_blank" class="">https://gitlab.com/petsc/petsc/merge_requests/2069#note_220229648</a>.</div>
<div class="">Please find attached a .cpp showing the brokenness of C=A*B with A of type MPIAIJ and B of type MPIDense when the LDA of B is not equal to its number of local rows.</div>
<div class="">It does [[1,1];[1,1]] * [[0,1,2,3];[0,1,2,3]]</div>
<div class="">C should be equal to 2*B, but it’s not, unless lda = m (= 1).</div>
<div class="">
<div class="">Mat Object: 2 MPI processes</div>
<div class="">  type: mpidense</div>
<div class="">0.0000000000000000e+00 1.0000000000000000e+00 2.0000000000000000e+00 3.0000000000000000e+00</div>
<div class="">0.0000000000000000e+00 1.0000000000000000e+00 2.0000000000000000e+00 3.0000000000000000e+00</div>
</div>
<div class=""><br class="">
</div>
<div class="">If you change Bm here <a href="https://www.mcs.anl.gov/petsc/petsc-dev/src/mat/impls/aij/mpi/mpimatmatmult.c.html#line549" target="_blank" class="">https://www.mcs.anl.gov/petsc/petsc-dev/src/mat/impls/aij/mpi/mpimatmatmult.c.html#line549</a> to the LDA of B, you’ll
 get the correct result.</div>
<div class="">
<div class="">Mat Object: 2 MPI processes</div>
<div class="">  type: mpidense</div>
<div class="">0.0000000000000000e+00 2.0000000000000000e+00 4.0000000000000000e+00 6.0000000000000000e+00</div>
<div class="">0.0000000000000000e+00 2.0000000000000000e+00 4.0000000000000000e+00 6.0000000000000000e+00</div>
</div>
<div class=""><br class="">
</div>
<div class="">Unfortunately, w.r.t. MR 2069, I still don’t get the same results with a plain view LDA > m (KO) and a view + duplicate LDA = m (OK).</div>
<div class="">So there might be something else to fix (or this might not even be a correct fix), but the only reproducer I have right now is the full solver.</div>
<div class=""><br class="">
</div>
<div class="">Thanks,</div>
<div class="">Pierre</div>
<div class=""><br class="">
</div>
<div class=""></div>
</div>
<div style="overflow-wrap: break-word;" class="">
<div class=""></div>
</div>
</blockquote>
</div>
</div>

</div></blockquote></div><br class=""></div></body></html>