[petsc-users] MatMatMult with MAT_INITIAL_MATRIX

Stefano Zampini stefano.zampini at gmail.com
Sun Apr 19 11:26:30 CDT 2020


Matrix C should always inherit the number of local rows from A and the
number of local columns from B. Is it not the case for your code? If so,
please provide a MWE to reproduce
Also, which version of PETSc are you using?

Il Dom 19 Apr 2020, 19:21 Marius Buerkle <mbuerkle at web.de> ha scritto:

>
> Hi,
>
> I have a question about the behavior of MAT_INITIAL_MATRIX for MatMatMult.
> I a have a set of MPIDENSE and MPIAIJ matrices for which I have defined the
> number of local rows (and local columns) manually, i.e. not used
> PETSC_DECIDE for MatSetSizes. The number of local rows is different from
> what PETSC_DECIDE would choose. If I do a MatMatMult with A=MPIDENSE and
> B=MPIAIJ with MAT_INITIAL_MATRIX then matrix C will have the number of
> local rows corresponding to A and B, namely what I have defined with
> MatSetSizes when creating the matrices A and B. But when both matrices are
> dense, A=MPIDENSE and B=MPIDENSE, then the resulting matrix C will have
> different number of local rows, namely what I would get with if I would
> create the matrix with PETSC_DECIDE. Is this behavior normal? The problem
> is that I have to multiply both resulting matrices which will then throw a
> "Nonconforming object sizes error" as they have different number of local
> rows. Any ideas what goes wrong here?
>
>
> Marius
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20200419/2389853a/attachment.html>


More information about the petsc-users mailing list