PETSC ERROR: Segmentation Violation, probably memory access out of range

 

 

 

[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/petsc-as/documentation/troubleshooting.html#Signal[0]PETSC ERROR: or try http://valgrind.org on GNU/linux and Apple Mac OS X to find memory corruption errors [0]PETSC ERROR: likely location of problem given in stack below [0]PETSC ERROR: --------------------- Stack Frames ------------------------------------ [0]PETSC ERROR: Note: The EXACT line numbers in the stack are not available, [0]PETSC ERROR: INSTEAD the line number of the start of the function [0]PETSC ERROR: is given. [0]PETSC ERROR: [0] F90Array1dCreate line 52 src/sys/f90-src/f90_cwrap.c [0]PETSC ERROR: --------------------- Error Message ------------------------------------ [0]PETSC ERROR: Signal received! [0]PETSC ERROR: ------------------------------------------------------------------------ [0]PETSC ERROR: Petsc Release Version 3.1.0, Patch 7, Mon Dec 20 14:26:37 CST 2010 [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: ./simple on a linux-gnu named c0109 by root Mon Apr 18 22:24:20 2011 [0]PETSC ERROR: Libraries linked from /opt/petsc-3.1-p7/lib [0]PETSC ERROR: Configure run at Mon Mar 28 16:37:34 2011 [0]PETSC ERROR: Configure options --download-f-blas-lapack=../fblaslapack-3.1.1.tar.gz --prefix=/opt/petsc-3.1-p7 [0]PETSC ERROR: ------------------------------------------------------------------------ [0]PETSC ERROR: User provided function() line 0 in unknown directory unknown file aborting job: application called MPI_Abort(MPI_COMM_WORLD, 59) - process 0

 

作为初学者,我无法给出更深的解释,一般应该是内存操作出现了问题(memory corruption),比如说如下代码:

! call VecGetArrayF90(x,xx_v,ierr) call VecRestoreArrayF90(x,xx_v,ierr) 

也有可能是申请了内存空间,没有释放,程序执行到一定阶段时,便会报错。

MPI程序,一不小心就会出现很多错误,并且调试起来灰常复杂……

有人建议使用valgrind http://www.mcs.anl.gov/petsc/petsc-as/documentation/faq.html#valgrind

“With valgrind you will find  your bug in less then five minutes, without it you could waste hours  

futzing around before finding the exact problem.”

这个东东好像挺复杂的,调试出一堆结果,看不太懂……

无奈,只好一行一行的仔细检查代码了……

mpiexec -n 2 valgrind --tool=memcheck -q --num-callers=20 ./simple  -malloc off

 

 

 

 

 

 

你可能感兴趣的:(PETSC ERROR: Segmentation Violation, probably memory access out of range)