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 <[email protected]<mailto:[email protected]>> 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
