<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">Pierre:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello,<br>
I'm implementing MatMatMult for A of type MPIBAIJ, B and C of type MPIDENSE.<br>
1) I copied around some code for the case where A is of type MPIAIJ. Any reason why communications and computations are not overlapped in the MatMatMult implementation? <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.anl.gov/petsc/p<wbr>etsc-current/src/mat/impls/aij<wbr>/mpi/mpimatmatmult.c.html#line<wbr>556</a></blockquote><div><br></div><div>Do you mean overlapping </div><div>MPI_Isend()/MPI_Waitany() in MatMPIDenseScatter() <br></div><div>with local call MatMatMultNumeric_SeqAIJ_SeqDense() ?</div><div><br></div><div>I guess you can implement overlapping. If it gives better performance, you can improve MatMatMultNumeric_MPIAIJ_MPIDense().</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
2) I'm having trouble when scall == MAT_REUSE_MATRIX. Here, <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> it looks that the numeric part of the MatMatMult (which is called when scall == MAT_REUSE_MATRIX) is hardwired to this routine <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>. </blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Thus, at runtime, this call fails <a href="http://www.mcs.anl.gov/petsc/petsc-current/src/mat/interface/matrix.c.html#line9492" rel="noreferrer" target="_blank">http://www.mcs.anl.gov/petsc/p<wbr>etsc-current/src/mat/interface<wbr>/matrix.c.html#line9492</a> because it is trying to cast a matrix to Mat_MPIAIJ instead of Mat_MPIBAIJ. Any chance you could let me know how to dispatch the call (*(*C)->ops->matmultnumeric) to the proper implementation (depending on the type of A)?<br></blockquote><div><br></div><div>You define </div><div>(*C)->ops->matmultnumeric = MatMatMultNumeric_MPIBAIJ_MPIDense;<br></div><div> in your MatMatMultSymbolic_MPIBAIJ_MPIDense</div><div><br></div><div>Hong</div></div></div></div>