[petsc-dev] MatMatMult

Pierre Jolivet Pierre.Jolivet at enseeiht.fr
Tue Jun 6 09:51:29 CDT 2017


Hello,
I'm implementing MatMatMult for A of type MPIBAIJ, B and C of type 
MPIDENSE.
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? 
http://www.mcs.anl.gov/petsc/petsc-current/src/mat/impls/aij/mpi/mpimatmatmult.c.html#line556
2) I'm having trouble when scall == MAT_REUSE_MATRIX. Here, 
http://www.mcs.anl.gov/petsc/petsc-current/src/mat/impls/dense/mpi/mpidense.c.html#line1208 
it looks that the numeric part of the MatMatMult (which is called when 
scall == MAT_REUSE_MATRIX) is hardwired to this routine 
http://www.mcs.anl.gov/petsc/petsc-current/src/mat/impls/aij/mpi/mpimatmatmult.c.html#line376. 
Thus, at runtime, this call fails 
http://www.mcs.anl.gov/petsc/petsc-current/src/mat/interface/matrix.c.html#line9492 
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)?

Thanks in advance for your help,
Pierre



More information about the petsc-dev mailing list