[petsc-users] problem running petsc4py

Jed Brown jedbrown at mcs.anl.gov
Wed Jan 2 10:41:05 CST 2013


On Wed, Jan 2, 2013 at 8:09 AM, Hoang Giang Bui <hgbk2008 at gmail.com> wrote:

>
> Hi
>
> When I ran the standard example of petsc4py, I got the error below
>
> [0]PETSC ERROR: ------------------------------**
> ------------------------------**------------
> [0]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation,
> probably memory access out of range
> [0]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger
> [0]PETSC ERROR: or see http://www.mcs.anl.gov/petsc/**
> documentation/faq.html#**valgrind[0]PETSC<http://www.mcs.anl.gov/petsc/documentation/faq.html#valgrind[0]PETSC>ERROR: or try
> http://valgrind.org on GNU/linux and Apple Mac OS X to find memory
> corruption errors
> [0]PETSC ERROR: configure using --with-debugging=yes, recompile, link, and
> run
> [0]PETSC ERROR: to get more information on the crash.
>

If you followed these directions, you'd have gotten this error message:

Traceback (most recent call last):
  File "/home/jed/dl/ex1.py", line 27, in <module>
    Istart, Iend = A.getOwnershipRange()
  File "Mat.pyx", line 453, in petsc4py.PETSc.Mat.getOwnershipRange
(src/petsc4py.PETSc.c:83937)
petsc4py.PETSc.Error: error code 73
[0] MatGetOwnershipRange() line 6025 in
/home/jed/petsc/src/mat/interface/matrix.c
[0] Object is in wrong state
[0] Must call MatXXXSetPreallocation() or MatSetUp() on argument 1 "mat"
before MatGetOwnershipRange()

If you add A.setUp() or use a preallocation routine, you'll get the picture
you wanted.


> ------------------------------**------------------------------**
> --------------
> MPI_ABORT was invoked on rank 0 in communicator MPI_COMM_WORLD
> with errorcode 59.
>
> NOTE: invoking MPI_ABORT causes Open MPI to kill all MPI processes.
> You may or may not see output from other processes, depending on
> exactly when Open MPI kills them.
>
> Moreover, printing out the value of Istart and Iend returns 0 (at
> A.getOwnershipRange())
>
> Please advise the root cause of this problem. I compiled petsc4py-dev
> against petsc-3.3-p5 in debug mode.
>
> BR
> Giang Bui
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20130102/11a4a9b2/attachment-0001.html>


More information about the petsc-users mailing list