[petsc-users] MatCreateComposite question

Nachiket Gokhale gokhalen at gmail.com
Thu Dec 13 11:50:42 CST 2012


I am trying to create a composite matrix -  the relevant snippet of the
code is -

Mat KK, AA[3];
ierr = MatDuplicate(KFullMat,MAT_COPY_VALUES,&AA[0]);CHKERRQ(ierr);
ierr = MatDuplicate(CFullMat,MAT_COPY_VALUES,&AA[1]); CHKERRQ(ierr);
ierr = MatDuplicate(MFullMat,MAT_COPY_VALUES,&AA[2]); CHKERRQ(ierr);

ierr = MatScale(AA[1],iomega);CHKERRQ(ierr);
ierr = MatScale(AA[2],-forcomega2); CHKERRQ(ierr);

ierr = MatCreateComposite(PETSC_COMM_WORLD,3,AA,&KK); CHKERRQ(ierr);
ierr = MatCompositeMerge(KK); CHKERRQ(ierr);

This crashes with the error at the end of the message. Do you have any
ideas about what might be causing this?  Is there any other debugging
output I should send - log_summary perhaps?

-Nachiket

[0]PETSC ERROR: --------------------- Error Message
------------------------------------
[0]PETSC ERROR: Object is in wrong state!
[0]PETSC ERROR: Must call MatXXXSetPreallocation() or MatSetUp() on
argument 1 "mat" before MatAssemblyBegin()!
[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 Thu Dec 13 12:54:51 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
[2]PETSC ERROR: --------------------- Error Message
------------------------------------
[2]PETSC ERROR: Object is in wrong state!
[2]PETSC ERROR: Must call MatXXXSetPreallocation() or MatSetUp() on
argument 1 "mat" before MatAssemblyBegin()!
[2]PETSC ERROR:
------------------------------------------------------------------------
[2]PETSC ERROR: Petsc Release Version 3.3.0, Patch 2, Fri Jul 13 15:42:00
CDT 2012
[2]PETSC ERROR: See docs/changes/index.html for recent updates.
[2]PETSC ERROR: See docs/faq.html for hints about trouble shooting.
[2]PETSC ERROR: See docs/index.html for manual pages.
[2]PETSC ERROR: [3]PETSC ERROR: --------------------- Error Message
------------------------------------
[3]PETSC ERROR: Object is in wrong state!
[3]PETSC ERROR: Must call MatXXXSetPreallocation() or MatSetUp() on
argument 1 "mat" before MatAssemblyBegin()!
[3]PETSC ERROR:
------------------------------------------------------------------------
[3]PETSC ERROR: Petsc Release Version 3.3.0, Patch 2, Fri Jul 13 15:42:00
CDT 2012
[3]PETSC ERROR: See docs/changes/index.html for recent updates.
[3]PETSC ERROR: See docs/faq.html for hints about trouble shooting.
[3]PETSC ERROR: See docs/index.html for manual pages.
[3]PETSC ERROR:
------------------------------------------------------------------------
[3]PETSC ERROR: /home/gokhale/WAIGEN/GDEB-WAIGEN2012/bin/waigen on a
linux-gcc named asd1.wai.com by gokhale Thu Dec 13 12:54:51 2012
[3]PETSC ERROR: [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: MatAssemblyBegin() line 4683 in
/opt/petsc/petsc-3.3-p2/src/mat/interface/matrix.c
[0]PETSC ERROR: MatCreateComposite() line 440 in
/opt/petsc/petsc-3.3-p2/src/mat/impls/composite/mcomposite.c
[0]PETSC ERROR: main() line 141 in src/examples/waigen.c
------------------------------------------------------------------------
[2]PETSC ERROR: /home/gokhale/WAIGEN/GDEB-WAIGEN2012/bin/waigen on a
linux-gcc named asd1.wai.com by gokhale Thu Dec 13 12:54:51 2012
[2]PETSC ERROR: Libraries linked from
/opt/petsc/petsc-3.3-p2/linux-gcc-g++-mpich-mumps-complex-debug/lib
[2]PETSC ERROR: Configure run at Mon Oct 29 18:41:24 2012
[2]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
[2]PETSC ERROR:
------------------------------------------------------------------------
Libraries linked from
/opt/petsc/petsc-3.3-p2/linux-gcc-g++-mpich-mumps-complex-debug/lib
[3]PETSC ERROR: Configure run at Mon Oct 29 18:41:24 2012
[3]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
[3]PETSC ERROR:
------------------------------------------------------------------------
[3]PETSC ERROR: MatAssemblyBegin() line 4683 in
/opt/petsc/petsc-3.3-p2/src/mat/interface/matrix.c
[3]PETSC ERROR: application called MPI_Abort(MPI_COMM_WORLD, 73) - process 0
[cli_0]: aborting job:
application called MPI_Abort(MPI_COMM_WORLD, 73) - process 0
[2]PETSC ERROR: MatAssemblyBegin() line 4683 in
/opt/petsc/petsc-3.3-p2/src/mat/interface/matrix.c
[2]PETSC ERROR: MatCreateComposite() line 440 in
/opt/petsc/petsc-3.3-p2/src/mat/impls/composite/mcomposite.c
MatCreateComposite() line 440 in
/opt/petsc/petsc-3.3-p2/src/mat/impls/composite/mcomposite.c
[3]PETSC ERROR: main() line 141 in src/examples/waigen.c
[2]PETSC ERROR: main() line 141 in src/examples/waigen.c
application called MPI_Abort(MPI_COMM_WORLD, 73) - process 3
application called MPI_Abort(MPI_COMM_WORLD, 73) - process 2
[cli_2]: aborting job:
application called MPI_Abort(MPI_COMM_WORLD, 73) - process 2
[cli_3]: aborting job:
application called MPI_Abort(MPI_COMM_WORLD, 73) - process 3
[1]PETSC ERROR: --------------------- Error Message
------------------------------------
[1]PETSC ERROR: Object is in wrong state!
[1]PETSC ERROR: Must call MatXXXSetPreallocation() or MatSetUp() on
argument 1 "mat" before MatAssemblyBegin()!
[1]PETSC ERROR:
------------------------------------------------------------------------
[1]PETSC ERROR: Petsc Release Version 3.3.0, Patch 2, Fri Jul 13 15:42:00
CDT 2012
[1]PETSC ERROR: See docs/changes/index.html for recent updates.
[1]PETSC ERROR: See docs/faq.html for hints about trouble shooting.
[1]PETSC ERROR: See docs/index.html for manual pages.
[1]PETSC ERROR:
------------------------------------------------------------------------
[1]PETSC ERROR: /home/gokhale/WAIGEN/GDEB-WAIGEN2012/bin/waigen on a
linux-gcc named asd1.wai.com by gokhale Thu Dec 13 12:54:51 2012
[1]PETSC ERROR: Libraries linked from
/opt/petsc/petsc-3.3-p2/linux-gcc-g++-mpich-mumps-complex-debug/lib
[1]PETSC ERROR: Configure run at Mon Oct 29 18:41:24 2012
[1]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
[1]PETSC ERROR:
------------------------------------------------------------------------
[1]PETSC ERROR: MatAssemblyBegin() line 4683 in
/opt/petsc/petsc-3.3-p2/src/mat/interface/matrix.c
[1]PETSC ERROR: MatCreateComposite() line 440 in
/opt/petsc/petsc-3.3-p2/src/mat/impls/composite/mcomposite.c
[1]PETSC ERROR: main() line 141 in src/examples/waigen.c
application called MPI_Abort(MPI_COMM_WORLD, 73) - process 1
[cli_1]: aborting job:
application called MPI_Abort(MPI_COMM_WORLD, 73) - process 1
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20121213/4342c226/attachment-0001.html>


More information about the petsc-users mailing list