[petsc-users] MatMatMult densemat

Zhang, Hong hongzhang at anl.gov
Tue Mar 5 21:47:18 CST 2019


What happens if you try to preallocate C matrix (in the same way as A and B) and use MatMatMult with MAT_REUSE_MATRIX?

Hong (Mr.)

On Mar 5, 2019, at 6:19 PM, Marius Buerkle via petsc-users <petsc-users at mcs.anl.gov<mailto:petsc-users at mcs.anl.gov>> wrote:


Hi,



I have a question regarding MatMatMult for MPIDENSE matrices. I have two dense matrices A and B for which I set the number up the number of local rows each processor owns manually (same for A and B) when creating them with MatCreateDense (which is different from what PETSC_DECIDE what do). When I calculate A*B=C using MatMatMult with MAT_INITIAL_MATRIX the resulting matrix C has a different distribution of the rows among the processes. Is this normal? I would have expected that C inherits the local row structure from A and B. Later on, I want to multiply C let’s say with A which gives then accordingly an error that the local size is not conform.

If on the other hand A is MATMPIAIJ then C has the same local row structure.



Best,

Marius

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20190306/fd418696/attachment.html>


More information about the petsc-users mailing list