[petsc-users] MatMatMult Question

Nachiket Gokhale gokhalen at gmail.com
Tue Dec 18 09:36:30 CST 2012


 Hong:

I used 3.3-p2 but I was able to reproduce this error with 3.3-p5 as well. I
ran it with one MPI process. I got the same error,

[0]PETSC ERROR: --------------------- Error Message
------------------------------------
[0]PETSC ERROR: Arguments are incompatible!
[0]PETSC ERROR: MatMatMult requires A, seqdense, to be compatible with B,
seqdense!
[0]PETSC ERROR:
------------------------------------------------------------------------
[0]PETSC ERROR: Petsc Release Version 3.3.0, Patch 5, Sat Dec  1 15:10:41
CST 2012
[0]PETSC ERROR: See docs/changes/index.html for recent updates.
[0]PETSC ERROR: See docs/faq.html for hints about trouble shooting.
[0]PETSC ERROR: See docs/index.html for manual pages.
[0]PETSC ERROR:
------------------------------------------------------------------------
[0]PETSC ERROR: /home/gokhale/WAIGEN/GDEB-WAIGEN2012/bin/waigen on a
linux-gcc named asd1.wai.com by gokhale Tue Dec 18 10:44:18 2012
[0]PETSC ERROR: Libraries linked from
/opt/petsc/petsc-3.3-p5/linux-gcc-g++-mpich-mumps-complex-debug/lib
[0]PETSC ERROR: Configure run at Tue Dec 18 10:09:32 2012
[0]PETSC ERROR: Configure options --with-x=0 --with-mpi=1
--download-mpich=yes --with-x11=0 --with-debugging=1 --with-clanguage=C++
--with-shared-libraries=1 --download-mumps=yes --download-f-blas-lapack=1
--download-parmetis=1 --download-metis --download-scalapack=1
--download-blacs=1 --with-cmake=/usr/bin/cmake28 --with-scalar-type=complex
[0]PETSC ERROR:
------------------------------------------------------------------------
[0]PETSC ERROR: MatMatMult() line 8617 in
/opt/petsc/petsc-3.3-p5/src/mat/interface/matrix.c
[0]PETSC ERROR: waigensolvprojforc() line 31 in
src/examples/waigensolvprojforc.c


Using one MPI process, this error goes away when I make a temporary matrix
and store the result of the first multiplication in it as in:

  ierr = MatLoad(ProjR,viewer);CHKERRQ(ierr);
  ierr = PetscViewerDestroy(&viewer);CHKERRQ(ierr);
  ierr =
MatMatMult(*KFullMat,ProjR,MAT_INITIAL_MATRIX,PETSC_DEFAULT,&TempMat);CHKERRQ(ierr);
  ierr = MatDuplicate(TempMat,MAT_COPY_VALUES,&TempMat2); CHKERRQ(ierr);
  ierr =
MatMatMult(ProjLT,TempMat2,MAT_INITIAL_MATRIX,PETSC_DEFAULT,&KProj);
CHKERRQ(ierr);
  ierr = MatDestroy(&TempMat);CHKERRQ(ierr);
  ierr = MatDestroy(&TempMat2);CHKERRQ(ierr);

If I run more than one process the error returns.

[0]PETSC ERROR: --------------------- Error Message
------------------------------------
[0]PETSC ERROR: Arguments are incompatible!
[0]PETSC ERROR: MatMatMult requires A, mpidense, to be compatible with B,
mpidense!
[0]PETSC ERROR:
------------------------------------------------------------------------
[0]PETSC ERROR: Petsc Release Version 3.3.0, Patch 5, Sat Dec  1 15:10:41
CST 2012
[0]PETSC ERROR: See docs/changes/index.html for recent updates.
[0]PETSC ERROR: See docs/faq.html for hints about trouble shooting.
[0]PETSC ERROR: See docs/index.html for manual pages.
[0]PETSC ERROR:
------------------------------------------------------------------------
[0]PETSC ERROR: /home/gokhale/WAIGEN/GDEB-WAIGEN2012/bin/waigen on a
linux-gcc named asd1.wai.com by gokhale Tue Dec 18 10:42:15 2012
[0]PETSC ERROR: Libraries linked from
/opt/petsc/petsc-3.3-p5/linux-gcc-g++-mpich-mumps-complex-debug/lib
[0]PETSC ERROR: Configure run at Tue Dec 18 10:09:32 2012
[0]PETSC ERROR: Configure options --with-x=0 --with-mpi=1
--download-mpich=yes --with-x11=0 --with-debugging=1 --with-clanguage=C++
--with-shared-libraries=1 --download-mumps=yes --download-f-blas-lapack=1
--download-parmetis=1 --download-metis --download-scalapack=1
--download-blacs=1 --with-cmake=/usr/bin/cmake28 --with-scalar-type=complex
[0]PETSC ERROR:
------------------------------------------------------------------------
[0]PETSC ERROR: MatMatMult() line 8617 in
/opt/petsc/petsc-3.3-p5/src/mat/interface/matrix.c
[0]PETSC ERROR: waigensolvprojforc() line 31 in
src/examples/waigensolvprojforc.c


If it matters I am using Petsc through SlepC-3.3-p3

-Nachiket


On Mon, Dec 17, 2012 at 11:05 PM, Hong Zhang <hzhang at mcs.anl.gov> wrote:

> Nachiket :
>
> Which version of petsc is used? Did you run the code in sequential?
>
> > ------------------------------------
> > [0]PETSC ERROR: Arguments are incompatible!
> > [0]PETSC ERROR: MatMatMult requires A, seqdense, to be compatible with B,
> > seqdense!
> [0]PETSC ERROR: MatMatMult() line 8601 in
> /opt/petsc/petsc-3.3-p2/src/mat/interface/matrix.c
>
> The line (8601) does not match the latest petsc-3.3 and petsc-dev.
> I cannot reproduce this error from the latest petsc-3.3 and petsc-dev.
>
> The error complains about a failure to find MatMatMult_SeqDense_SeqDense().
> Can you update to the latest petsc-3.3 or petsc-dev and see if your
> code still crashes?
>
> Hong
>
> > I am trying to multiply the transpose of a matrix with another matrix
> using
> > matmatmult.  The transpose operator is created using MatTranspose. I get
> the
> > error at the end of the email. Is this an error saying that cols of
> matrix 1
> > and not equal to the rows of matrix 2? I checked and the rows and columns
> > seem to allow matrix multiplication: Left = (54,1760), Right=(1760,54).
>  The
> > snipped of the code which produces this is
> >
> >   ierr =
> >
> MatMatMult(*KFullMat,ProjR,MAT_INITIAL_MATRIX,PETSC_DEFAULT,&TempMat);CHKERRQ(ierr);
> >   ierr = MatGetSize(ProjLT,&nrowl,&ncoll); CHKERRQ(ierr);
> >   ierr = MatGetSize(TempMat,&nrowr,&ncolr); CHKERRQ(ierr);
> >   ierr = PetscPrintf(PETSC_COMM_WORLD,"Left = (%d,%d),
> > Right=(%d,%d)\n",nrowl,ncoll,nrowr,ncolr); CHKERRQ(ierr);
> >   ierr =
> MatMatMult(ProjLT,TempMat,MAT_INITIAL_MATRIX,PETSC_DEFAULT,&KProj);
> > CHKERRQ(ierr);
> >   ierr = MatDestroy(&TempMat);
> >
> > Thanks,
> >
> > -Nachiket
> >
> > [0]PETSC ERROR: --------------------- Error Message
> > ------------------------------------
> > [0]PETSC ERROR: Arguments are incompatible!
> > [0]PETSC ERROR: MatMatMult requires A, seqdense, to be compatible with B,
> > seqdense!
> > [0]PETSC ERROR:
> > ------------------------------------------------------------------------
> > [0]PETSC ERROR: Petsc Release Version 3.3.0, Patch 2, Fri Jul 13 15:42:00
> > CDT 2012
> > [0]PETSC ERROR: See docs/changes/index.html for recent updates.
> > [0]PETSC ERROR: See docs/faq.html for hints about trouble shooting.
> > [0]PETSC ERROR: See docs/index.html for manual pages.
> > [0]PETSC ERROR:
> > ------------------------------------------------------------------------
> > [0]PETSC ERROR: /home/gokhale/WAIGEN/GDEB-WAIGEN2012/bin/waigen on a
> > linux-gcc named asd1.wai.com by gokhale Mon Dec 17 16:58:13 2012
> > [0]PETSC ERROR: Libraries linked from
> > /opt/petsc/petsc-3.3-p2/linux-gcc-g++-mpich-mumps-complex-debug/lib
> > [0]PETSC ERROR: Configure run at Mon Oct 29 18:41:24 2012
> > [0]PETSC ERROR: Configure options --with-x=0 --with-mpi=1
> > --download-mpich=yes --with-x11=0 --with-debugging=1 --with-clanguage=C++
> > --with-shared-libraries=1 --download-mumps=yes --download-f-blas-lapack=1
> > --download-parmetis=1 --download-metis --download-scalapack=1
> > --download-blacs=1 --with-cmake=/usr/bin/cmake28
> --with-scalar-type=complex
> > [0]PETSC ERROR:
> > ------------------------------------------------------------------------
> > [0]PETSC ERROR: MatMatMult() line 8601 in
> > /opt/petsc/petsc-3.3-p2/src/mat/interface/matrix.c
> > [0]PETSC ERROR: waigensolvprojforc() line 33 in
> > src/examples/waigensolvprojforc.c
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20121218/055dd880/attachment.html>


More information about the petsc-users mailing list