Hi Hong,
Yes exactly, I would like C2 to maintain the local number of A. Do you think this is possible? I tried to allocated A before with the correct local number and use MAT_REUSE but this gave a segmentation fault.
Best
Marius
Marius,
C1 = Ampidense*Bmpiaij inherits the number of local rows from A and the number of local columns from B.
C2 = Ampidense*Bmpidense is computed via external package Elemental, which petsc does not dictate the parallel layout of C2 in current petsc/elemental interface. I am not sure if we can do it. Do you want C2 maintains local number of A?
Hong
From: petsc-users <[email protected]> on behalf of Stefano Zampini <[email protected]>
Sent: Sunday, April 19, 2020 11:26 AM
To: Marius Buerkle <[email protected]>
Cc: PETSc users list <[email protected]>
Subject: Re: [petsc-users] MatMatMult with MAT_INITIAL_MATRIX
Sent: Sunday, April 19, 2020 11:26 AM
To: Marius Buerkle <[email protected]>
Cc: PETSc users list <[email protected]>
Subject: Re: [petsc-users] MatMatMult with MAT_INITIAL_MATRIX
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?
Also, which version of PETSc are you using?
Il Dom 19 Apr 2020, 19:21 Marius Buerkle <[email protected]> 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
