<div dir="ltr"><div dir="ltr">On Fri, Mar 19, 2021 at 8:50 PM Jorti, Zakariae via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov">petsc-users@mcs.anl.gov</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">




<div dir="ltr">
<div id="gmail-m_-957574042023914286divtagdefaultwrapper" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif" dir="ltr">
<p style="font-size:12pt">Hi,</p>
<p style="font-size:12pt"><br>
</p>
<p style="font-size:12pt">I have a PETSc code which works in some cases circumstances whereas in others it gives me the error message below.</p>
<p style="font-size:12pt"><span style="font-size:12pt">The code works </span><span style="font-size:12pt">on my machine</span><span style="font-size:12pt"> </span><span style="font-size:12pt">when I compile PETS</span><span style="font-size:12pt">c</span><span style="font-size:12pt"> with
 debug flag on:</span></p>
<p style="margin-right:0px;margin-left:0px;color:rgb(33,33,33);font-size:11px;line-height:normal;font-family:Menlo">
<span style="font-family:Menlo,serif,EmojiFont">./configure PETSC_DIR=/Users/zjorti/software/petsc-3.14.5 PETSC_ARCH=macx --with-fc=0 --with-mpi-dir=$HOME/.brew --download-hypre  --with-debugging=1 --with-cxx-dialect=C++11</span></p>
<p style="font-size:12pt"><span style="font-size:12pt"> </span><br>
</p>
<p style="font-size:12pt">It does not work however when I compile Petsc with debug flag off: </p>
<p style="margin-right:0px;margin-left:0px;color:rgb(33,33,33);font-size:11px;line-height:normal;font-family:Menlo">
<span style="font-family:Menlo,serif,EmojiFont">./configure PETSC_DIR=/Users/zjorti/software/petsc-3.14.5 PETSC_ARCH=macx --with-fc=0 --with-mpi-dir=$HOME/.brew --download-hypre  --with-debugging=0 --with-cxx-dialect=C++11</span></p>
<p style="font-size:12pt"> </p>
<p style="font-size:12pt">I asked a colleague to test this same code. </p>
<p style="font-size:12pt">He compiles PETSc with debug flag off, runs the code and it works for him. He has an older machine but we both use the same version PETSc version which is 3.14.5. </p></div></div></blockquote><div>These are the symptoms of an uninitialized variable or memory overwrite. Both things should be caught by valgrind,</div><div>which we highly recommend, but you can start by running with -malloc_debug.</div><div><br></div><div> Thanks,</div><div><br></div><div>     Matt <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div id="gmail-m_-957574042023914286divtagdefaultwrapper" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif" dir="ltr">
<p style="margin-right:0px;margin-left:0px;color:rgb(33,33,33);font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif,serif,EmojiFont;font-size:15px;line-height:normal">
<font size="3" style="font-family:Calibri,Helvetica,sans-serif,serif,EmojiFont"><span style="color:rgb(0,0,0);font-size:12pt;font-family:Calibri,Helvetica,sans-serif">As I do not have any </span></font><font style="font-family:Calibri,Helvetica,sans-serif,serif,EmojiFont"><span style="color:rgb(0,0,0);font-size:12pt;font-family:Calibri,Helvetica,sans-serif">debugger</span></font><font size="3" style="font-family:Calibri,Helvetica,sans-serif,serif,EmojiFont"><span style="color:rgb(0,0,0);font-size:12pt;font-family:Calibri,Helvetica,sans-serif"> I
 could not identify the cause of this runtime error. </span></font></p>
<p style="margin-right:0px;margin-left:0px;color:rgb(33,33,33);font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif,serif,EmojiFont;font-size:15px;line-height:normal">
<font size="3" style="font-family:Calibri,Helvetica,sans-serif,serif,EmojiFont"><span style="color:rgb(0,0,0);font-size:12pt;font-family:Calibri,Helvetica,sans-serif">One more thing: We did not run the code in parallel. </span></font></p>
<p style="margin-right:0px;margin-left:0px;color:rgb(33,33,33);font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif,serif,EmojiFont;font-size:15px;line-height:normal">
<font size="3" style="font-family:Calibri,Helvetica,sans-serif,serif,EmojiFont"><span style="color:rgb(0,0,0);font-size:12pt;font-family:Calibri,Helvetica,sans-serif">Is this a hardware related issue or is it something else?</span></font></p>
<p style="margin-right:0px;margin-left:0px;color:rgb(33,33,33);font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif,serif,EmojiFont;font-size:15px;line-height:normal">
<font size="3" style="font-family:Calibri,Helvetica,sans-serif,serif,EmojiFont"><span style="color:rgb(0,0,0);font-size:12pt;font-family:Calibri,Helvetica,sans-serif">Thanks,</span></font></p>
<p style="margin-right:0px;margin-left:0px;color:rgb(33,33,33);font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif,serif,EmojiFont;font-size:15px;line-height:normal">
<font size="3" style="font-family:Calibri,Helvetica,sans-serif,serif,EmojiFont"><br>
</font></p>
<p style="margin-right:0px;margin-left:0px;color:rgb(33,33,33);font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif,serif,EmojiFont;font-size:15px;line-height:normal">
<font size="3" style="font-family:Calibri,Helvetica,sans-serif,serif,EmojiFont"><span style="color:rgb(0,0,0);font-size:12pt;font-family:Calibri,Helvetica,sans-serif">Zakariae</span></font></p>
<p style="font-size:12pt"><br>
</p>
<p style="font-size:12pt"><br>
</p>
<p style="margin-right:0px;margin-left:0px;font-family:Menlo;font-size:11px;line-height:normal">
<span style="font-family:Menlo,serif,EmojiFont">[0]PETSC ERROR: ------------------------------------------------------------------------</span></p>
<p style="margin-right:0px;margin-left:0px;font-family:Menlo;font-size:11px;line-height:normal">
<span style="font-family:Menlo,serif,EmojiFont">[0]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation, probably memory access out of range</span></p>
<p style="margin-right:0px;margin-left:0px;font-family:Menlo;font-size:11px;line-height:normal">
<span style="font-family:Menlo,serif,EmojiFont">[0]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger</span></p>
<p style="margin-right:0px;margin-left:0px;font-family:Menlo;font-size:11px;line-height:normal">
<span style="font-family:Menlo,serif,EmojiFont">[0]PETSC ERROR: or see <a href="https://www.mcs.anl.gov/petsc/documentation/faq.html#valgrind" target="_blank">https://www.mcs.anl.gov/petsc/documentation/faq.html#valgrind</a></span></p>
<p style="margin-right:0px;margin-left:0px;font-family:Menlo;font-size:11px;line-height:normal">
<span style="font-family:Menlo,serif,EmojiFont">[0]PETSC 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</span></p>
<p style="margin-right:0px;margin-left:0px;font-family:Menlo;font-size:11px;line-height:normal">
<span style="font-family:Menlo,serif,EmojiFont">[0]PETSC ERROR: configure using --with-debugging=yes, recompile, link, and run </span></p>
<p style="margin-right:0px;margin-left:0px;font-family:Menlo;font-size:11px;line-height:normal">
<span style="font-family:Menlo,serif,EmojiFont">[0]PETSC ERROR: to get more information on the crash.</span></p>
<p style="margin-right:0px;margin-left:0px;color:rgb(180,36,25);font-family:Menlo;font-size:11px;line-height:normal">
<span style="font-family:Menlo,serif,EmojiFont"><b>[0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------</b></span></p>
<p style="margin-right:0px;margin-left:0px;font-family:Menlo;font-size:11px;line-height:normal">
<span style="font-family:Menlo,serif,EmojiFont">[0]PETSC ERROR: Signal received</span></p>
<p style="margin-right:0px;margin-left:0px;font-family:Menlo;font-size:11px;line-height:normal">
<span style="font-family:Menlo,serif,EmojiFont">[0]PETSC ERROR: See <a href="https://www.mcs.anl.gov/petsc/documentation/faq.html" target="_blank">https://www.mcs.anl.gov/petsc/documentation/faq.html</a> for trouble shooting.</span></p>
<p style="margin-right:0px;margin-left:0px;font-family:Menlo;font-size:11px;line-height:normal">
<span style="font-family:Menlo,serif,EmojiFont">[0]PETSC ERROR: Petsc Release Version 3.14.5, Mar 03, 2021 </span></p>
<p style="margin-right:0px;margin-left:0px;font-family:Menlo;font-size:11px;line-height:normal">
<span style="font-family:Menlo,serif,EmojiFont">[0]PETSC ERROR: ./mimeticcurleuler2 on a macx named <a href="http://pn2032683.lanl.gov" target="_blank">pn2032683.lanl.gov</a> by zjorti Fri Mar 19 16:07:03 2021</span></p>
<p style="margin-right:0px;margin-left:0px;font-family:Menlo;font-size:11px;line-height:normal">
<span style="font-family:Menlo,serif,EmojiFont">[0]PETSC ERROR: Configure options PETSC_DIR=/Users/zjorti/software/petsc-3.14.5 PETSC_ARCH=macx --with-fc=0 --with-mpi-dir=/Users/zjorti/.brew --download-hypre --with-debugging=0 --with-cxx-dialect=C++11</span></p>
<p style="margin-right:0px;margin-left:0px;font-family:Menlo;font-size:11px;line-height:normal">
<span style="font-family:Menlo,serif,EmojiFont">[0]PETSC ERROR: #1 User provided function() line 0 in  unknown file</span></p>
<p style="margin-right:0px;margin-left:0px;font-family:Menlo;font-size:11px;line-height:normal">
<span style="font-family:Menlo,serif,EmojiFont">[0]PETSC ERROR: Run with -malloc_debug to check if memory corruption is causing the crash.</span></p>
<p style="margin-right:0px;margin-left:0px;font-family:Menlo;font-size:11px;line-height:normal">
<span style="font-family:Menlo,serif,EmojiFont">--------------------------------------------------------------------------</span></p>
<p style="margin-right:0px;margin-left:0px;font-family:Menlo;font-size:11px;line-height:normal">
<span style="font-family:Menlo,serif,EmojiFont">MPI_ABORT was invoked on rank 0 in communicator MPI_COMM_WORLD</span></p>
<p style="margin-right:0px;margin-left:0px;font-family:Menlo;font-size:11px;line-height:normal">
<span style="font-family:Menlo,serif,EmojiFont">with errorcode 50176059.</span></p>
<p style="margin-right:0px;margin-left:0px;font-family:Menlo;font-size:11px;line-height:normal;min-height:13px">
<span style="font-family:Menlo,serif,EmojiFont"></span><br>
</p>
<p style="margin-right:0px;margin-left:0px;font-family:Menlo;font-size:11px;line-height:normal">
<span style="font-family:Menlo,serif,EmojiFont">NOTE: invoking MPI_ABORT causes Open MPI to kill all MPI processes.</span></p>
<p style="margin-right:0px;margin-left:0px;font-family:Menlo;font-size:11px;line-height:normal">
<span style="font-family:Menlo,serif,EmojiFont">You may or may not see output from other processes, depending on</span></p>
<p style="margin-right:0px;margin-left:0px;font-family:Menlo;font-size:11px;line-height:normal">
<span style="font-family:Menlo,serif,EmojiFont">exactly when Open MPI kills them.</span></p>
</div>
</div>

</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>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</div><div><br></div><div><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>