[petsc-dev] MatMatMult

Hong hzhang at mcs.anl.gov
Tue Jun 6 13:44:06 CDT 2017


Pierre :
>
>
> Yes, of course I defined (*C)->ops->matmultnumeric =
> MatMatMultNumeric_MPIBAIJ_MPIDense in MatMatMultSymbolic_MPIBAIJ_MPIDense.
> However, the routine MatMatMultSymbolic_MPIBAIJ_MPIDense is never reached
> when calling MatMatMult with scall == MAT_REUSE_MATRIX (
> http://www.mcs.anl.gov/petsc/petsc-current/src/mat/interfac
> e/matrix.c.html#line9487, just to be sure I added a dummy printf in
> MatMatMultSymbolic_MPIBAIJ_MPIDense and nothing is displayed with
> MAT_REUSE_MATRIX, MAT_INITIAL_MATRIX works as intended)
>

 MatMatMultSymbolic_xxx() is called only for MAT_INITIAL_MATRIX, during
which, it defines
(*C)->ops->matmultnumeric = MatMatMultNumeric_MPIBAIJ_MPIDense;

Then MatMatMult(A,C,MAT_REUSE_MATRIX,..) calls
 (*(*C)->ops->matmultnumeric)(A,B,*C); (line 9432 in matrix.c)
which should go to MatMatMultNumeric_MPIBAIJ_MPIDense.

You may follow a debugging process
using petsc/src/mat/examples/tests/ex109.c

Are you working on a branch of petsc? If so, I may take a look and see what
is the problem.

Hong

>
>
> 2) I'm having trouble when scall == MAT_REUSE_MATRIX. Here,
>>>
>>>
>> http://www.mcs.anl.gov/petsc/petsc-current/src/mat/impls/den
>> se/mpi/mpidense.c.html#line1208
>>
>>> [2] 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
>>
>>> [3].
>>>
>> Thus, at runtime, this call fails
>>
>> Links:
>> ------
>> [1]
>>
>> http://www.mcs.anl.gov/petsc/petsc-current/src/mat/impls/aij
>> /mpi/mpimatmatmult.c.html#line556
>> [2]
>>
>> http://www.mcs.anl.gov/petsc/petsc-current/src/mat/impls/den
>> se/mpi/mpidense.c.html#line1208
>> [3]
>>
>> http://www.mcs.anl.gov/petsc/petsc-current/src/mat/impls/aij
>> /mpi/mpimatmatmult.c.html#line376
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20170606/8d8d1309/attachment.html>


More information about the petsc-dev mailing list