On Fri, Aug 10, 2012 at 8:22 PM, Peter Zhoujie Lu <span dir="ltr"><<a href="mailto:lzj@umich.edu" target="_blank">lzj@umich.edu</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Dear all,<div><br></div><div>I have some issue with my code using petsc. The exact same code runs fine on a linux box with ifort. Is that still be a possible memory corruption? I have some issue with getting valgrind working on 10.7. Is there any better way to debug this? Thanks. Here is the error message I got for OSX 10.7 with gcc. </div>
</blockquote><div><br></div><div>This is almost certainly you passing in an invalid pointer for the Vec you are creating. Why not just use gdb? Also,</div><div>everyone here has valgrind running on OSX.</div><div><br></div>
<div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>Peter<br><div><br></div><div><div>0]PETSC ERROR: ------------------------------------------------------------------------</div>
<div>[0]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation, probably memory access out of range</div>
<div>[0]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger</div><div>[0]PETSC ERROR: or see <a href="http://www.mcs.anl.gov/petsc/documentation/faq.html#valgrind[0]PETSC" target="_blank">http://www.mcs.anl.gov/petsc/documentation/faq.html#valgrind[0]PETSC</a> ERROR: or try <a href="http://valgrind.org" target="_blank">http://valgrind.org</a> on GNU/linux and Apple Mac OS X to find memory corruption errors</div>
<div>[0]PETSC ERROR: likely location of problem given in stack below</div><div>[0]PETSC ERROR: --------------------- Stack Frames ------------------------------------</div><div>[0]PETSC ERROR: Note: The EXACT line numbers in the stack are not available,</div>
<div>[0]PETSC ERROR: INSTEAD the line number of the start of the function</div><div>[0]PETSC ERROR: is given.</div><div>[0]PETSC ERROR: [0] VecCreateMPIWithArray line 312 /Users/lvzhoujie/Work/petsc-3.3-p2/src/vec/vec/impls/mpi/pbvec.c</div>
<div>--------------------------------------------------------------------------</div><div>MPI_ABORT was invoked on rank 0 in communicator MPI_COMM_WORLD </div><div>with errorcode 59.</div><div><br></div><div>NOTE: invoking MPI_ABORT causes Open MPI to kill all MPI processes.</div>
<div>You may or may not see output from other processes, depending on</div><div>exactly when Open MPI kills them.</div><div>--------------------------------------------------------------------------</div></div></div><div>
<br></div><div>p.s. I also found /src/ksp/pc/examples/test/ex7.c not working on my computer. Here is the error message:</div><div><br></div><div><div>[0]PETSC ERROR: --------------------- Error Message ------------------------------------</div>
<div>[0]PETSC ERROR: Object is in wrong state!</div><div>[0]PETSC ERROR: Must call MatXXXSetPreallocation() or MatSetUp() on argument 1 "mat" before MatSetValues()!</div><div>[0]PETSC ERROR: ------------------------------------------------------------------------</div>
<div>[0]PETSC ERROR: Petsc Release Version 3.3.0, Patch 2, Fri Jul 13 15:42:00 CDT 2012 </div><div>[0]PETSC ERROR: See docs/changes/index.html for recent updates.</div><div>[0]PETSC ERROR: See docs/faq.html for hints about trouble shooting.</div>
<div>[0]PETSC ERROR: See docs/index.html for manual pages.</div><div>[0]PETSC ERROR: ------------------------------------------------------------------------</div><div>[0]PETSC ERROR: ./ex7 on a linux-ifo named peter-lu by plu Fri Aug 10 21:06:23 2012</div>
<div>[0]PETSC ERROR: Libraries linked from /Users/lvzhoujie/Work/petsc-3.3-p2/linux-ifort-opt/lib</div><div>[0]PETSC ERROR: Configure run at Fri Aug 10 10:44:21 2012</div><div>[0]PETSC ERROR: Configure options --with-pic --download-openmpi=1 --with-fortran=1 --with-debugging=1 --with-shared-libraries=1 --download-superlu_dist=yes --with-fortran-interfaces=1 --with-scalar-type=real --download-f-blas-lapack --with-cc=gcc --with-fc=gfortran --with-cxx=c++ --with-petsc-arch=linux-ifort-opt --download-parmetis=yes --download-metis</div>
<div>[0]PETSC ERROR: ------------------------------------------------------------------------</div><div>[0]PETSC ERROR: MatSetValues() line 993 in /Users/lvzhoujie/Work/petsc-3.3-p2/src/mat/interface/matrix.c</div><div>[0]PETSC ERROR: main() line 25 in src/ksp/pc/examples/tests/ex7.c</div>
<div>--------------------------------------------------------------------------</div><div>MPI_ABORT was invoked on rank 0 in communicator MPI_COMM_WORLD </div><div>with errorcode 73.</div><div><br></div><div>NOTE: invoking MPI_ABORT causes Open MPI to kill all MPI processes.</div>
<div>You may or may not see output from other processes, depending on</div><div>exactly when Open MPI kills them.</div><div>--------------------------------------------------------------------------</div></div><div><br></div>
<div><br></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>
-- Norbert Wiener<br>