On 4/24/06, <b class="gmail_sendername">Letian Wang</b> &lt;<a href="mailto:letian.wang@ghiocel-tech.com">letian.wang@ghiocel-tech.com</a>&gt; wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div style="direction: ltr;">













<div>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">Dear All:</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">&nbsp;</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">Question 1):</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">&nbsp;</span></font></p>



<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">For an optimization task, I need to loop Petsc (I'm
using Petsc-2.3.0). But I had problems to reinitialize Petsc after finalize,
here is a simple FORTRAN program to explain my problem:</span></font></p></div></div></blockquote><div>It is not possible to call MPI_Init() after an MPI_Finalize(). Therefore you should only call PetscInitialize/Finalize() once.
<br>
&nbsp;</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div style="direction: ltr;"><div><p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">
Question 2):</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">&nbsp;</span></font></p>





<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">Follow up my previous question, I also tried to Initiallize and
Finalize Petsc only once and perform the do-loop between Petscinitialize and PetscFinalize.
I used KSP CR solver with Prometheus PCs to solver large linear equations.
After several loops, the program was interrupted by segmentation violation
error. I suppose there was a memory leak somewhere. The error message is like
this: Any suggestion for this? Thanks</span></font></p></div></div></blockquote><div><br>
This is a memory corruption problem. Use the debugger (-start_in_debugger) to get a stack trace so at<br>
least we know where&nbsp; the SEGV is occurring. Then we can try to fix it. <br>
</div><br>
&nbsp;&nbsp; Thanks,<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Matt<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div style="direction: ltr;"><div><p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">
*********Doing job -- nosort0001</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">&nbsp;</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">Task No.&nbsp;&nbsp;&nbsp; 1&nbsp;&nbsp;&nbsp; Total
CPU=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 52.3&nbsp;&nbsp;&nbsp; </span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">&nbsp;---------------------------------------------------</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">&nbsp;</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">&nbsp;*********Doing job -- nosort0002</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">&nbsp;</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">Task No.&nbsp;&nbsp;&nbsp; 2&nbsp;&nbsp;&nbsp; Total
CPU=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 52.1&nbsp;&nbsp;&nbsp; </span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">&nbsp;---------------------------------------------------</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">&nbsp;</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">&nbsp;*********Doing job -- nosort0003</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">--------------------------------------------------------------------------</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">Petsc Release Version 2.3.0, Patch 44, </span></font><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">April, 26, 2005
</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">See docs/changes/index.html for recent updates.</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">See docs/faq.html for hints about trouble shooting.</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">See docs/index.html for manual pages.</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">-----------------------------------------------------------------------</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">../feap on a linux-gnu named <a href="http://GPTnode3.cl.ghiocel-tech.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
GPTnode3.cl.ghiocel-tech.com</a> by
ltwang Mon Apr 24 </span></font><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">15:25:04</span></font><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;"> 2006</span>
</font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">Libraries linked from
/home/ltwang/Library/petsc-2.3.0/lib/linux-gnu</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">Configure run at Tue Mar 14 </span></font><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">11:19:49</span></font>
<font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;"> 2006</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">Configure options --with-mpi-dir=/usr --with-debugging=0
--download-spooles=1 --download-f-blas-lapack=1 --download-parmetis=1
--download-prometheus=1 --with-shared=0</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">-----------------------------------------------------------------------</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">[1]PETSC ERROR: Caught signal number 11 SEGV: Segmentation
Violation, probably memory access out of range</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">[1]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">[1]PETSC ERROR: configure using --with-debugging=yes, recompile,
link, and run </span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">[1]PETSC ERROR: to get more information on the crash.</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">[1]PETSC ERROR: User provided function() line 0 in unknown
directory unknown file</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">[1]PETSC ERROR: Signal received!</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">[1]PETSC ERROR:&nbsp; !</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">[cli_1]: aborting job:</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">application called MPI_Abort(MPI_COMM_WORLD, 59) - process 1</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">[cli_0]: aborting job:</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">Fatal error in MPI_Allgather: Other MPI error, error stack:</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">MPI_Allgather(949)........................: MPI_Allgather(sbuf=0xbffeea14,
scount=1, MPI_INT, rbuf=0x8bf0a0c, rcount=1, MPI_INT, comm=0x84000000) failed</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">MPIR_Allgather(180).......................: </span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">MPIC_Sendrecv(161)........................: </span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">MPIC_Wait(321)............................: </span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">MPIDI_CH3_Progress_wait(199)..............: an error
occurred while handling an event returned by MPIDU_Sock_Wait()</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">MPIDI_CH3I_Progress_handle_sock_event(422): </span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">MPIDU_Socki_handle_read(649)..............: connection
failure (set=0,sock=2,errno=104:(strerror() not found))</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">rank 1 in job 477&nbsp; GPTMaster_53830&nbsp;&nbsp; caused
collective abort of all ranks</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">&nbsp; exit status of rank 1: return code 59 </span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">&nbsp;</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">&nbsp;</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">&nbsp;</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">Letian</span></font></p></div>





</div></blockquote></div>-- <br>&quot;Failure has a thousand explanations. Success doesn't need one&quot; -- Sir Alec Guiness