<div dir="ltr">What is your calling procedure for using MatMatMultNumeric_MPIBAIJ_MPID<wbr>ense?<div>Hong<br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jun 6, 2017 at 1:52 PM, Pierre Jolivet <span dir="ltr"><<a href="mailto:Pierre.Jolivet@enseeiht.fr" target="_blank">Pierre.Jolivet@enseeiht.fr</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-">On Tue, 6 Jun 2017 13:44:06 -0500, Hong wrote:<br>
</span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-">
Pierre :<br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Yes, of course I defined (*C)->ops->matmultnumeric =<br>
MatMatMultNumeric_MPIBAIJ_MPID<wbr>ense in<br>
MatMatMultSymbolic_MPIBAIJ_MPI<wbr>Dense.<br>
However, the routine MatMatMultSymbolic_MPIBAIJ_MPI<wbr>Dense is never<br>
reached when calling MatMatMult with scall == MAT_REUSE_MATRIX<br>
<br>
</blockquote>
<br>
(<a href="http://www.mcs.anl.gov/petsc/petsc-current/src/mat/interface/matrix.c.html#line9487" rel="noreferrer" target="_blank">http://www.mcs.anl.gov/petsc/<wbr>petsc-current/src/mat/interfac<wbr>e/matrix.c.html#line9487</a><br>
</span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
[1], just to be sure I added a dummy printf in<span class="gmail-"><br>
MatMatMultSymbolic_MPIBAIJ_MPI<wbr>Dense and nothing is displayed with<br>
MAT_REUSE_MATRIX, MAT_INITIAL_MATRIX works as intended)<br>
</span></blockquote><span class="gmail-">
<br>
 MatMatMultSymbolic_xxx() is called only for MAT_INITIAL_MATRIX,<br>
during which, it defines<br>
(*C)->ops->matmultnumeric = MatMatMultNumeric_MPIBAIJ_MPID<wbr>ense;<br>
</span></blockquote>
<br>
Sorry, I was not thorough enough. What I meant to say is that I never call MatMatMult with MAT_INITIAL_MATRIX, so MatMatMultSymbolic_xxx is never called.<br>
Is there another way?<br>
I cannot use MAT_INITIAL_MATRIX because I want to manage the underlying memory, and I'm guessing MAT_INITIAL_MATRIX will delete whatever is in C and reallocate memory on its own.<span class="gmail-"><br>
<br>
Thanks in advance for your help,<br>
Pierre<br>
<br>
</span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-">
Then MatMatMult(A,C,MAT_REUSE_<wbr>MATRIX,..) calls <br>
 (*(*C)->ops->matmultnumeric)(<wbr>A,B,*C); (line 9432 in matrix.c)<br>
<br>
which should go to MatMatMultNumeric_MPIBAIJ_MPID<wbr>ense.<br>
<br>
You may follow a debugging process<br>
using petsc/src/mat/examples/t<wbr>ests/ex109.c<br>
<br>
Are you working on a branch of petsc? If so, I may take a look and<br>
see what is the problem.<br>
<br>
Hong<br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
2) I'm having trouble when scall == MAT_REUSE_MATRIX. Here,<br>
</blockquote>
<br>
<br>
<br>
</blockquote>
<br>
</blockquote>
<br>
<a href="http://www.mcs.anl.gov/petsc/petsc-current/src/mat/impls/dense/mpi/mpidense.c.html#line1208" rel="noreferrer" target="_blank">http://www.mcs.anl.gov/petsc/p<wbr>etsc-current/src/mat/impls/den<wbr>se/mpi/mpidense.c.html#line120<wbr>8</a><br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
[2]<br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
[2] it looks that the numeric part of the MatMatMult (which is<br>
called when scall == MAT_REUSE_MATRIX) is hardwired to this<br>
routine<br>
</blockquote>
<br>
<br>
<br>
</blockquote>
<br>
</blockquote>
<br>
<a href="http://www.mcs.anl.gov/petsc/petsc-current/src/mat/impls/aij/mpi/mpimatmatmult.c.html#line376" rel="noreferrer" target="_blank">http://www.mcs.anl.gov/petsc/p<wbr>etsc-current/src/mat/impls/aij<wbr>/mpi/mpimatmatmult.c.html#line<wbr>376</a><br>
</span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
[3]<br>
[3]. <br>
br><br>
<br>
</blockquote>
<br>
</blockquote>
<br>
<a href="http://s.anl.gov/petsc/petsc-current/src/mat/impls/aij/mpi/mpimatmatmult.c.html#line556" rel="noreferrer" target="_blank">s.anl.gov/petsc/petsc-current/<wbr>src/mat/impls/aij/mpi/mpimatma<wbr>tmult.c.html#line556</a>"<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
rel="noreferrer"<br>
<br>
</blockquote>
<br>
</blockquote>
<br>
target="_blank"><a href="http://www.mcs.anl.gov/petsc/petsc-current/src/mat/impls/aij/mpi/mpimatmatmult.c.html#line556" rel="noreferrer" target="_blank">http://www.mcs<wbr>.anl.gov/petsc/petsc-current/<wbr>src/mat/impls/aij/mpi/mpimatma<wbr>tmult.c.html#line556</a><br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
[2]<br>
<br>
<br>
<br>
</blockquote>
<br>
</blockquote>
<br>
<a href="http://www.mcs.anl.gov/petsc/petsc-current/src/mat/impls/dense/mpi/mpidense.c.html#line1208" rel="noreferrer" target="_blank">http://www.mcs.anl.gov/petsc/p<wbr>etsc-current/src/mat/impls/den<wbr>se/mpi/mpidense.c.html#line120<wbr>8</a><br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
[4]<br>
[3]<br>
<br>
<br>
<br>
</blockquote>
<br>
</blockquote>
<br>
<a href="http://www.mcs.anl.gov/petsc/petsc-current/src/mat/impls/aij/mpi/mpimatmatmult.c.html#line376" rel="noreferrer" target="_blank">http://www.mcs.anl.gov/petsc/p<wbr>etsc-current/src/mat/impls/aij<wbr>/mpi/mpimatmatmult.c.html#line<wbr>376</a><br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
[5]<br>
</blockquote></blockquote>
<br>
<br>
<br>
Links:<br>
------<br>
[1]<br>
<br>
<a href="http://www.mcs.anl.gov/petsc/petsc-current/src/mat/interface/matrix.c.html#line9487" rel="noreferrer" target="_blank">http://www.mcs.anl.gov/petsc/p<wbr>etsc-current/src/mat/interface<wbr>/matrix.c.html#line9487</a><span class="gmail-"><br>
[2]<br>
<br>
<a href="http://www.mcs.anl.gov/petsc/petsc-current/src/mat/impls/dense/mpi/mpidense.c.html#line1208" rel="noreferrer" target="_blank">http://www.mcs.anl.gov/petsc/p<wbr>etsc-current/src/mat/impls/den<wbr>se/mpi/mpidense.c.html#line120<wbr>8</a><br>
[3]<br>
<br>
<a href="http://www.mcs.anl.gov/petsc/petsc-current/src/mat/impls/aij/mpi/mpimatmatmult.c.html#line376" rel="noreferrer" target="_blank">http://www.mcs.anl.gov/petsc/p<wbr>etsc-current/src/mat/impls/aij<wbr>/mpi/mpimatmatmult.c.html#line<wbr>376</a><br></span>
[4]<br>
<br>
<a href="http://www.mcs.anl.gov/petsc/petsc-current/src/mat/impls/dense/mpi/mpidense.c.html#line1208" rel="noreferrer" target="_blank">http://www.mcs.anl.gov/petsc/p<wbr>etsc-current/src/mat/impls/den<wbr>se/mpi/mpidense.c.html#line120<wbr>8</a><br>
[5]<br>
<br>
<a href="http://www.mcs.anl.gov/petsc/petsc-current/src/mat/impls/aij/mpi/mpimatmatmult.c.html#line376" rel="noreferrer" target="_blank">http://www.mcs.anl.gov/petsc/p<wbr>etsc-current/src/mat/impls/aij<wbr>/mpi/mpimatmatmult.c.html#line<wbr>376</a><br>
</blockquote>
<br>
</blockquote></div><br></div></div></div>