Discussion:
[petsc-users] Problem: matrix is missing diagonal entry
Thomas Witkowski
2011-12-08 13:49:07 UTC
Permalink
I've some strange problem: I create a mpiaij matrix, fill it with some
values and want to make use of it in kspsolve. But I get the error

[15]PETSC ERROR: Object is in wrong state!
[15]PETSC ERROR: Matrix is missing diagonal entry 1129!

I've checked the following things:
- There is a MatSetValues call that contains the entry 1129/1129 with
some value
- MatView shows that there exists the value 1129/1129
- MatAssemblyBegin/End is called correctly
- valgrind says: 0 errors
- ddt also cannot find anything unusual

I use petsc 3.2-p5, its compiled in debug mode. What could I check to
solve this problem? Any hints?

Thomas
Thomas Witkowski
2011-12-08 13:51:33 UTC
Permalink
Maybe some more note on my problem: I've thounds of matrices in my
code, where doing this works fine! The only difference here is, that
row 1129 of the matrix is owned by rank 0, but all of its entries are
created on rank 1. For all of the other matrices in my codes, at least
the diagonal element is created on the rank that owns the matrix row.

Thomas
Post by Thomas Witkowski
I've some strange problem: I create a mpiaij matrix, fill it with some
values and want to make use of it in kspsolve. But I get the error
[15]PETSC ERROR: Object is in wrong state!
[15]PETSC ERROR: Matrix is missing diagonal entry 1129!
- There is a MatSetValues call that contains the entry 1129/1129 with
some value
- MatView shows that there exists the value 1129/1129
- MatAssemblyBegin/End is called correctly
- valgrind says: 0 errors
- ddt also cannot find anything unusual
I use petsc 3.2-p5, its compiled in debug mode. What could I check to
solve this problem? Any hints?
Thomas
Matthew Knepley
2011-12-08 14:03:04 UTC
Permalink
On Thu, Dec 8, 2011 at 7:51 AM, Thomas Witkowski <
Maybe some more note on my problem: I've thounds of matrices in my code,
where doing this works fine! The only difference here is, that row 1129 of
the matrix is owned by rank 0, but all of its entries are created on rank
1. For all of the other matrices in my codes, at least the diagonal element
is created on the rank that owns the matrix row.
Did you remember to call MatAssemblyBegin/End()?

Matt
Thomas
I've some strange problem: I create a mpiaij matrix, fill it with some
Post by Thomas Witkowski
values and want to make use of it in kspsolve. But I get the error
[15]PETSC ERROR: Object is in wrong state!
[15]PETSC ERROR: Matrix is missing diagonal entry 1129!
- There is a MatSetValues call that contains the entry 1129/1129 with
some value
- MatView shows that there exists the value 1129/1129
- MatAssemblyBegin/End is called correctly
- valgrind says: 0 errors
- ddt also cannot find anything unusual
I use petsc 3.2-p5, its compiled in debug mode. What could I check to
solve this problem? Any hints?
Thomas
--
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener
Thomas Witkowski
2011-12-08 14:07:32 UTC
Permalink
Post by Matthew Knepley
Did you remember to call MatAssemblyBegin/End()?
Yes
Post by Matthew Knepley
Matt
Post by Thomas Witkowski
Thomas
Zitat von Thomas Witkowski
I've some strange problem: I create a mpiaij matrix, fill it with some
Post by Thomas Witkowski
values and want to make use of it in kspsolve. But I get the error
[15]PETSC ERROR: Object is in wrong state!
[15]PETSC ERROR: Matrix is missing diagonal entry 1129!
- There is a MatSetValues call that contains the entry 1129/1129 with
some value
- MatView shows that there exists the value 1129/1129
- MatAssemblyBegin/End is called correctly
- valgrind says: 0 errors
- ddt also cannot find anything unusual
I use petsc 3.2-p5, its compiled in debug mode. What could I check to
solve this problem? Any hints?
Thomas
--
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener
Barry Smith
2011-12-08 14:03:24 UTC
Permalink
Thomas,

As always including the ENTIRE error message makes determining the issue much easier. It tells us what functions are being called at this point and the line numbers. Without we would only be speculating.

In this case the error message is printed on process of rank 15 at location 1129 ON THAT PROCESS so the you need to determine the global row of location 1129 on the 15th process. That row is missing the diagonal.

Barry

The reason I know it is the not the global row 1129 but the 1129th row on process 15 is because the I know the check for diagonal entries is done in the factorization that is taking place on each process (each factorization is running at the same time on different processes). This would be clear with the entire error message.
I've some strange problem: I create a mpiaij matrix, fill it with some values and want to make use of it in kspsolve. But I get the error
[15]PETSC ERROR: Object is in wrong state!
[15]PETSC ERROR: Matrix is missing diagonal entry 1129!
- There is a MatSetValues call that contains the entry 1129/1129 with some value
- MatView shows that there exists the value 1129/1129
- MatAssemblyBegin/End is called correctly
- valgrind says: 0 errors
- ddt also cannot find anything unusual
I use petsc 3.2-p5, its compiled in debug mode. What could I check to solve this problem? Any hints?
Thomas
Thomas Witkowski
2011-12-08 14:11:35 UTC
Permalink
Okay, if the entry number is the local one, than I can check this
again. In this case, I think that I know where the problem is: By the
way, the error message is as follows:

[15]PETSC ERROR: Object is in wrong state!
[15]PETSC ERROR: Matrix is missing diagonal entry 1129!
[15]PETSC ERROR:
------------------------------------------------------------------------
[15]PETSC ERROR: Petsc Release Version 3.2.0, Patch 5, Sat Oct 29
13:45:54 CDT 2011
[15]PETSC ERROR: See docs/changes/index.html for recent updates.
[15]PETSC ERROR: See docs/faq.html for hints about trouble shooting.
[15]PETSC ERROR: See docs/index.html for manual pages.
[15]PETSC ERROR:
------------------------------------------------------------------------
[15]PETSC ERROR: ./ch2 on a arch-linu named p1q024 by witkowsk Thu Dec
8 13:39:46 2011
[15]PETSC ERROR: Libraries linked from
/fastfs/witkowsk/petsc/install/petsc-3.2-p5-dbg/lib
[15]PETSC ERROR: Configure run at Fri Dec 2 14:45:50 2011
[15]PETSC ERROR: Configure options
--prefix=/fastfs/witkowsk/petsc/install/petsc-3.2-p5-dbg
--download-blacs --download-parmetis --download-scalapack
--download-umfpac\
k --with-blas-lapack-dir=/work/licsoft/libraries/mkl/9.1.023/lib/em64t
--with-c++-support --download-mumps --download-superlu
--with-clanguage=cxx
[15]PETSC ERROR:
------------------------------------------------------------------------
[15]PETSC ERROR: MatILUFactorSymbolic_SeqAIJ_ilu0() line 1636 in
src/mat/impls/aij/seq/aijfact.c
[15]PETSC ERROR: MatILUFactorSymbolic_SeqAIJ() line 1740 in
src/mat/impls/aij/seq/aijfact.c
[15]PETSC ERROR: MatILUFactorSymbolic() line 6092 in
src/mat/interface/matrix.c
[15]PETSC ERROR: PCSetUp_ILU() line 216 in src/ksp/pc/impls/factor/ilu/ilu.c
[15]PETSC ERROR: PCSetUp() line 819 in src/ksp/pc/interface/precon.c
[15]PETSC ERROR: KSPSetUp() line 260 in src/ksp/ksp/interface/itfunc.c
[15]PETSC ERROR: PCSetUpOnBlocks_BJacobi_Multiblock() line 973 in
src/ksp/pc/impls/bjacobi/bjacobi.c
[15]PETSC ERROR: PCSetUpOnBlocks() line 852 in src/ksp/pc/interface/precon.c
[15]PETSC ERROR: KSPSetUpOnBlocks() line 154 in src/ksp/ksp/interface/itfunc.c
Post by Barry Smith
Thomas,
As always including the ENTIRE error message makes determining
the issue much easier. It tells us what functions are being called
at this point and the line numbers. Without we would only be
speculating.
In this case the error message is printed on process of rank 15
at location 1129 ON THAT PROCESS so the you need to determine the
global row of location 1129 on the 15th process. That row is
missing the diagonal.
Barry
The reason I know it is the not the global row 1129 but the 1129th
row on process 15 is because the I know the check for diagonal
entries is done in the factorization that is taking place on each
process (each factorization is running at the same time on different
processes). This would be clear with the entire error message.
Post by Thomas Witkowski
I've some strange problem: I create a mpiaij matrix, fill it with
some values and want to make use of it in kspsolve. But I get the
error
[15]PETSC ERROR: Object is in wrong state!
[15]PETSC ERROR: Matrix is missing diagonal entry 1129!
- There is a MatSetValues call that contains the entry 1129/1129 with some value
- MatView shows that there exists the value 1129/1129
- MatAssemblyBegin/End is called correctly
- valgrind says: 0 errors
- ddt also cannot find anything unusual
I use petsc 3.2-p5, its compiled in debug mode. What could I check
to solve this problem? Any hints?
Thomas
Barry Smith
2011-12-08 16:03:20 UTC
Permalink
These lines make it clear the problem is detected on a sequential matrix on process 15. This is why we like the full message.

Barry

[15]PETSC ERROR: MatILUFactorSymbolic_SeqAIJ_ilu0() line 1636 in src/mat/impls/aij/seq/aijfact.c
[15]PETSC ERROR: MatILUFactorSymbolic_SeqAIJ() line 1740 in src/mat/impls/aij/seq/aijfact.c
[15]PETSC ERROR: MatILUFactorSymbolic() line 6092 in src/mat/interface/matrix.c
Post by Thomas Witkowski
[15]PETSC ERROR: Object is in wrong state!
[15]PETSC ERROR: Matrix is missing diagonal entry 1129!
[15]PETSC ERROR: ------------------------------------------------------------------------
[15]PETSC ERROR: Petsc Release Version 3.2.0, Patch 5, Sat Oct 29 13:45:54 CDT 2011
[15]PETSC ERROR: See docs/changes/index.html for recent updates.
[15]PETSC ERROR: See docs/faq.html for hints about trouble shooting.
[15]PETSC ERROR: See docs/index.html for manual pages.
[15]PETSC ERROR: ------------------------------------------------------------------------
[15]PETSC ERROR: ./ch2 on a arch-linu named p1q024 by witkowsk Thu Dec 8 13:39:46 2011
[15]PETSC ERROR: Libraries linked from /fastfs/witkowsk/petsc/install/petsc-3.2-p5-dbg/lib
[15]PETSC ERROR: Configure run at Fri Dec 2 14:45:50 2011
[15]PETSC ERROR: Configure options --prefix=/fastfs/witkowsk/petsc/install/petsc-3.2-p5-dbg --download-blacs --download-parmetis --download-scalapack --download-umfpac\
k --with-blas-lapack-dir=/work/licsoft/libraries/mkl/9.1.023/lib/em64t --with-c++-support --download-mumps --download-superlu --with-clanguage=cxx
[15]PETSC ERROR: ------------------------------------------------------------------------
[15]PETSC ERROR: MatILUFactorSymbolic_SeqAIJ_ilu0() line 1636 in src/mat/impls/aij/seq/aijfact.c
[15]PETSC ERROR: MatILUFactorSymbolic_SeqAIJ() line 1740 in src/mat/impls/aij/seq/aijfact.c
[15]PETSC ERROR: MatILUFactorSymbolic() line 6092 in src/mat/interface/matrix.c
[15]PETSC ERROR: PCSetUp_ILU() line 216 in src/ksp/pc/impls/factor/ilu/ilu.c
[15]PETSC ERROR: PCSetUp() line 819 in src/ksp/pc/interface/precon.c
[15]PETSC ERROR: KSPSetUp() line 260 in src/ksp/ksp/interface/itfunc.c
[15]PETSC ERROR: PCSetUpOnBlocks_BJacobi_Multiblock() line 973 in src/ksp/pc/impls/bjacobi/bjacobi.c
[15]PETSC ERROR: PCSetUpOnBlocks() line 852 in src/ksp/pc/interface/precon.c
[15]PETSC ERROR: KSPSetUpOnBlocks() line 154 in src/ksp/ksp/interface/itfunc.c
Post by Barry Smith
Thomas,
As always including the ENTIRE error message makes determining the issue much easier. It tells us what functions are being called at this point and the line numbers. Without we would only be speculating.
In this case the error message is printed on process of rank 15 at location 1129 ON THAT PROCESS so the you need to determine the global row of location 1129 on the 15th process. That row is missing the diagonal.
Barry
The reason I know it is the not the global row 1129 but the 1129th row on process 15 is because the I know the check for diagonal entries is done in the factorization that is taking place on each process (each factorization is running at the same time on different processes). This would be clear with the entire error message.
I've some strange problem: I create a mpiaij matrix, fill it with some values and want to make use of it in kspsolve. But I get the error
[15]PETSC ERROR: Object is in wrong state!
[15]PETSC ERROR: Matrix is missing diagonal entry 1129!
- There is a MatSetValues call that contains the entry 1129/1129 with some value
- MatView shows that there exists the value 1129/1129
- MatAssemblyBegin/End is called correctly
- valgrind says: 0 errors
- ddt also cannot find anything unusual
I use petsc 3.2-p5, its compiled in debug mode. What could I check to solve this problem? Any hints?
Thomas
Continue reading on narkive:
Search results for '[petsc-users] Problem: matrix is missing diagonal entry' (Questions and Answers)
4
replies
Does anyone know any cool/neat/awesome paradoxes?
started 2006-09-11 20:36:11 UTC
philosophy
Loading...