<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]--><style>
<!--
/* Font Definitions */
@font-face
        {font-family:\5B8B\4F53;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"\@\5B8B\4F53";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:\5B8B\4F53;}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:blue;
        text-decoration:underline;}
p
        {mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:\5B8B\4F53;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:595.3pt 841.9pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
        {page:Section1;}
-->
</style>
</head>
<body lang="ZH-CN" link="blue" vlink="blue">
<div class="Section1">
<p class="MsoNormal"><font size="1" color="navy" face="Arial"><span lang="EN-US" style="font-size:9.0pt;font-family:Arial;color:navy">Hi, Matt:
<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="1" color="navy" face="Arial"><span lang="EN-US" style="font-size:9.0pt;font-family:Arial;color:navy"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font size="1" color="navy" face="Arial"><span lang="EN-US" style="font-size:9.0pt;font-family:Arial;color:navy"><a href="http://www.mcs.anl.gov/petsc/petsc-as/miscellaneous/petscthreads.html">http://www.mcs.anl.gov/petsc/petsc-as/miscellaneous/petscthreads.html</a>
says “PETSc is </span></font><font size="1" color="red" face="Arial"><span lang="EN-US" style="font-size:9.0pt;font-family:Arial;color:red">not</span></font><font size="1" color="navy" face="Arial"><span lang="EN-US" style="font-size:9.0pt;
font-family:Arial;color:navy">
currently thread-safe”.<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="1" color="navy" face="Arial"><span lang="EN-US" style="font-size:9.0pt;font-family:Arial;color:navy">And, you said “PETSc allows threads”, I was confused, can you explain a little for me?
<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="1" color="navy" face="Arial"><span lang="EN-US" style="font-size:9.0pt;font-family:Arial;color:navy"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font size="1" color="navy" face="Arial"><span lang="EN-US" style="font-size:9.0pt;font-family:Arial;color:navy">Thanks a lot.
<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="1" color="navy" face="Arial"><span lang="EN-US" style="font-size:9.0pt;font-family:Arial;color:navy"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font size="1" color="navy" face="Arial"><span lang="EN-US" style="font-size:9.0pt;font-family:Arial;color:navy">Debao
<o:p></o:p></span></font></p>
<div>
<div class="MsoNormal" align="center" style="text-align:center"><font size="3" face="宋体"><span lang="EN-US" style="font-size:12.0pt">
<hr size="2" width="100%" align="center" tabindex="-1">
</span></font></div>
<p class="MsoNormal"><b><font size="2" face="Tahoma"><span lang="EN-US" style="font-size:10.0pt;font-family:Tahoma;font-weight:bold">From:</span></font></b><font size="2" face="Tahoma"><span lang="EN-US" style="font-size:10.0pt;font-family:Tahoma"> petsc-users-bounces@mcs.anl.gov
[mailto:petsc-users-bounces@mcs.anl.gov] <b><span style="font-weight:bold">On Behalf Of
</span></b>Matthew Knepley<br>
<b><span style="font-weight:bold">Sent:</span></b> Saturday, August 06, 2011 11:19 AM<br>
<b><span style="font-weight:bold">To:</span></b> PETSc users list<br>
<b><span style="font-weight:bold">Subject:</span></b> Re: [petsc-users] PETSC ERROR: Caught signal number 15 Terminate</span></font><span lang="EN-US"><o:p></o:p></span></p>
</div>
<p class="MsoNormal"><font size="3" face="宋体"><span lang="EN-US" style="font-size:12.0pt"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font size="3" face="宋体"><span lang="EN-US" style="font-size:12.0pt">On Sat, Aug 6, 2011 at 1:34 AM, Debao Shao <<a href="mailto:Debao.Shao@brion.com">Debao.Shao@brion.com</a>> wrote:<o:p></o:p></span></font></p>
<div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;
margin-left:4.8pt;margin-right:0cm">
<div link="blue" vlink="blue">
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><font size="1" color="navy" face="Arial"><span lang="EN-US" style="font-size:9.0pt;
font-family:Arial;color:navy">Thanks a lot, Jed and Aron.
</span></font><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><font size="1" color="navy" face="Arial"><span lang="EN-US" style="font-size:9.0pt;
font-family:Arial;color:navy"> </span></font><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><font size="1" color="navy" face="Arial"><span lang="EN-US" style="font-size:9.0pt;
font-family:Arial;color:navy">Do you have ideas for this problem?</span></font><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><font size="1" color="navy" face="Arial"><span lang="EN-US" style="font-size:9.0pt;
font-family:Arial;color:navy"> </span></font><span lang="EN-US"><o:p></o:p></span></p>
<p style="layout-grid-mode:char"><font size="1" face="宋体"><span lang="EN-US" style="font-size:9.0pt">But I encounter a new problem, the situation is:</span></font><span lang="EN-US"><o:p></o:p></span></p>
<p style="layout-grid-mode:char"><font size="1" face="宋体"><span lang="EN-US" style="font-size:9.0pt">1, the matrix is big, and can be partitioned to several blocks;</span></font><span lang="EN-US"><o:p></o:p></span></p>
<p style="layout-grid-mode:char"><font size="1" face="宋体"><span lang="EN-US" style="font-size:9.0pt">2, started several threads to handle each block of matrix;</span></font><span lang="EN-US"><o:p></o:p></span></p>
<p style="layout-grid-mode:char"><font size="1" face="宋体"><span lang="EN-US" style="font-size:9.0pt">3, integrated all block matrices together.</span></font><span lang="EN-US"><o:p></o:p></span></p>
<p style="layout-grid-mode:char"><font size="1" face="宋体"><span lang="EN-US" style="font-size:7.5pt"> </span></font><span lang="EN-US"><o:p></o:p></span></p>
<p style="layout-grid-mode:char"><font size="1" face="宋体"><span lang="EN-US" style="font-size:9.0pt">Again, the program crashed with reporting:
</span></font><span lang="EN-US"><o:p></o:p></span></p>
<p style="layout-grid-mode:char"><font size="1" face="宋体"><span lang="EN-US" style="font-size:9.0pt">"</span></font><span lang="EN-US">[0]PETSC ERROR: Caught
<font color="red"><span style="color:red">signal number 11 SEGV</span></font>: Segmentation Violation, probably memory access out of range"<o:p></o:p></span></p>
</div>
</div>
</blockquote>
<div>
<p class="MsoNormal"><font size="3" face="宋体"><span lang="EN-US" style="font-size:12.0pt"><o:p> </o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="3" face="宋体"><span lang="EN-US" style="font-size:12.0pt">Yes, PETSc allows threads, but one of your threads is illegally accessing memory. I suggest using valgrind to track this down.<o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="3" face="宋体"><span lang="EN-US" style="font-size:12.0pt"><o:p> </o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="3" face="宋体"><span lang="EN-US" style="font-size:12.0pt"> Matt<o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="3" face="宋体"><span lang="EN-US" style="font-size:12.0pt"> <o:p></o:p></span></font></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;
margin-left:4.8pt;margin-right:0cm">
<div link="blue" vlink="blue">
<div>
<p style="layout-grid-mode:char"><span class="apple-style-span"><font size="1" face="宋体"><span lang="EN-US" style="font-size:9.0pt">My libpetsc.a is built with option "<font color="red"><span style="color:red">--with-mpi=0</span></font> --with-debugging=0 -with-log=0
-with-info=0".</span></font></span><span lang="EN-US"><o:p></o:p></span></p>
<p style="layout-grid-mode:char"><font size="1" face="宋体"><span lang="EN-US" style="font-size:9.0pt">Will it support this type of multiple threads?</span></font><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><font size="1" color="navy" face="Arial"><span lang="EN-US" style="font-size:9.0pt;
font-family:Arial;color:navy"> </span></font><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><font size="1" color="navy" face="Arial"><span lang="EN-US" style="font-size:9.0pt;
font-family:Arial;color:navy">Thanks,</span></font><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><font size="1" color="navy" face="Arial"><span lang="EN-US" style="font-size:9.0pt;
font-family:Arial;color:navy">Debao</span></font><span lang="EN-US"><o:p></o:p></span></p>
<div>
<div class="MsoNormal" align="center" style="text-align:center"><font size="3" face="宋体"><span lang="EN-US" style="font-size:12.0pt">
<hr size="2" width="100%" align="center">
</span></font></div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><font size="2" face="Tahoma"><span lang="EN-US" style="font-size:10.0pt;font-family:Tahoma;
font-weight:bold">From:</span></font></b><font size="2" face="Tahoma"><span lang="EN-US" style="font-size:10.0pt;font-family:Tahoma">
<a href="mailto:petsc-users-bounces@mcs.anl.gov" target="_blank">petsc-users-bounces@mcs.anl.gov</a> [mailto:<a href="mailto:petsc-users-bounces@mcs.anl.gov" target="_blank">petsc-users-bounces@mcs.anl.gov</a>]
<b><span style="font-weight:bold">On Behalf Of </span></b>Jed Brown<br>
<b><span style="font-weight:bold">Sent:</span></b> Friday, August 05, 2011 9:26 PM<br>
<b><span style="font-weight:bold">To:</span></b> PETSc users list<br>
<b><span style="font-weight:bold">Subject:</span></b> Re: [petsc-users] PETSC ERROR: Caught signal number 15 Terminate</span></font><span lang="EN-US"><o:p></o:p></span></p>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><font size="3" face="宋体"><span lang="EN-US" style="font-size:12.0pt"> <o:p></o:p></span></font></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><font size="3" face="宋体"><span lang="EN-US" style="font-size:12.0pt">On Fri, Aug 5, 2011 at 04:00, Debao Shao <<a href="mailto:Debao.Shao@brion.com" target="_blank">Debao.Shao@brion.com</a>>
wrote:<o:p></o:p></span></font></p>
<p><font size="1" face="宋体"><span lang="EN-US" style="font-size:9.0pt">1, I put "PetscInitialize" at the beginning of main, and "PetscInitialize" registers a signal handler to capture "SIGTERM";</span></font><span lang="EN-US"><o:p></o:p></span></p>
<p><font size="1" face="宋体"><span lang="EN-US" style="font-size:9.0pt">2, the problem ran in server side will send SIGTERM to kill all of clients after one stage is done.</span></font><span lang="EN-US"><o:p></o:p></span></p>
<p><font size="1" face="宋体"><span lang="EN-US" style="font-size:9.0pt">3, then, unfortunately, the signal "SIGTERM" is caught by the signal handler installed by "PetscInitialize", and caused to abort.</span></font><span lang="EN-US"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><font size="3" face="宋体"><span lang="EN-US" style="font-size:12.0pt">You can remove the order dependence by running with -no_signal_handler or setting your own signal handler with:<o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><font size="3" face="宋体"><span lang="EN-US" style="font-size:12.0pt"> <o:p></o:p></span></font></p>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><font size="3" face="宋体"><span lang="EN-US" style="font-size:12.0pt"><a href="http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-dev/docs/manualpages/Sys/PetscPushSignalHandler.html" target="_blank">http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-dev/docs/manualpages/Sys/PetscPushSignalHandler.html</a>
<o:p></o:p></span></font></p>
</div>
<p class="MsoNormal"><font size="3" face="宋体"><span lang="EN-US" style="font-size:12.0pt"><o:p> </o:p></span></font></p>
<div class="MsoNormal" align="center" style="text-align:center"><font size="3" face="宋体"><span lang="EN-US" style="font-size:12.0pt">
<hr size="2" width="100%" align="center">
</span></font></div>
<p class="MsoNormal"><font size="1" color="gray" face="Arial"><span lang="EN-US" style="font-size:7.5pt;font-family:Arial;color:gray">-- The information contained in this communication and any attachments is confidential and may be privileged, and is for the
sole use of the intended recipient(s). Any unauthorized review, use, disclosure or distribution is prohibited. Unless explicitly stated otherwise in the body of this communication or the attachment thereto (if any), the information is provided on an AS-IS
basis without any express or implied warranties or liabilities. To the extent you are relying on this information, you are doing so at your own risk. If you are not the intended recipient, please notify the sender immediately by replying to this message and
destroy all copies of this message and any attachments. ASML is neither liable for the proper and complete transmission of the information contained in this communication, nor for any delay in its receipt.</span></font><span lang="EN-US"><o:p></o:p></span></p>
</div>
</blockquote>
</div>
<p class="MsoNormal"><font size="3" face="宋体"><span lang="EN-US" style="font-size:12.0pt"><br>
<br clear="all">
<br>
-- <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<o:p></o:p></span></font></p>
</div>
<br>
<hr>
<font face="Arial" color="Gray" size="1">-- The information contained in this communication and any attachments is confidential and may be privileged, and is for the sole use of the intended recipient(s). Any unauthorized review, use, disclosure or distribution
is prohibited. Unless explicitly stated otherwise in the body of this communication or the attachment thereto (if any), the information is provided on an AS-IS basis without any express or implied warranties or liabilities. To the extent you are relying on
this information, you are doing so at your own risk. If you are not the intended recipient, please notify the sender immediately by replying to this message and destroy all copies of this message and any attachments. ASML is neither liable for the proper and
complete transmission of the information contained in this communication, nor for any delay in its receipt.<br>
</font>
</body>
</html>