<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Wed, Oct 10, 2018 at 3:12 PM Zhang, Junchao <<a href="mailto:jczhang@mcs.anl.gov">jczhang@mcs.anl.gov</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">
<div id="m_-9094558541213758904divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif" dir="ltr">
<p style="margin-top:0;margin-bottom:0"></p>
<pre width="80"><a name="m_-9094558541213758904_line1199" class="m_-9094558541213758904OWAAutoLink" id="m_-9094558541213758904LPlnk845485">I met a case where MUMPS numeric factorization returned an error code -9 in </a>mumps->id.INFOG(1) but <span>A->erroriffailure was false in the following code in mumps.c</span></pre>
<pre width="80"><a name="m_-9094558541213758904_line1199" id="m_-9094558541213758904LPlnk262316" class="m_-9094558541213758904OWAAutoLink" style="font-family:Calibri,Helvetica,sans-serif,Helvetica,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols;font-size:12pt">1199: </a><strong style="font-family:Calibri,Helvetica,sans-serif,Helvetica,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols;font-size:12pt"><font color="#4169E1"><a name="m_-9094558541213758904_MatFactorNumeric_MUMPS" id="m_-9094558541213758904LPlnk124983" class="m_-9094558541213758904OWAAutoLink"></a><a href="https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/PetscErrorCode.html#PetscErrorCode" id="m_-9094558541213758904LPlnk352392" class="m_-9094558541213758904OWAAutoLink" target="_blank">PetscErrorCode</a> MatFactorNumeric_MUMPS(<a href="https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/Mat.html#Mat" id="m_-9094558541213758904LPlnk183498" class="m_-9094558541213758904OWAAutoLink" target="_blank">Mat</a> F,<a href="https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/Mat.html#Mat" id="m_-9094558541213758904LPlnk1002" class="m_-9094558541213758904OWAAutoLink" target="_blank">Mat</a> A,const <a href="https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatFactorInfo.html#MatFactorInfo" id="m_-9094558541213758904LPlnk978200" class="m_-9094558541213758904OWAAutoLink" target="_blank">MatFactorInfo</a> *info)</font></strong><br></pre>
<p></p>
<p style="margin-top:0;margin-bottom:0"></p>
<pre width="80"><a name="m_-9094558541213758904_line1200" id="m_-9094558541213758904LPlnk208341" class="m_-9094558541213758904OWAAutoLink">1200: </a>{
...
<a name="m_-9094558541213758904_line1227" id="m_-9094558541213758904LPlnk634701" class="m_-9094558541213758904OWAAutoLink"><span style="color:rgb(255,0,0)">1227: </span></a><span style="color:rgb(255,0,0)"> PetscMUMPS_c(mumps);</span>
<a name="m_-9094558541213758904_line1228" id="m_-9094558541213758904LPlnk890898" class="m_-9094558541213758904OWAAutoLink">1228: </a> <font color="#4169E1">if</font> (mumps->id.INFOG(1) < 0) {
<a name="m_-9094558541213758904_line1229" id="m_-9094558541213758904LPlnk489254" class="m_-9094558541213758904OWAAutoLink">1229: </a> <font color="#4169E1">if</font> (A->erroriffailure) {
<a name="m_-9094558541213758904_line1230" id="m_-9094558541213758904LPlnk369072" class="m_-9094558541213758904OWAAutoLink">1230: </a> <a href="https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/SETERRQ2.html#SETERRQ2" id="m_-9094558541213758904LPlnk167748" class="m_-9094558541213758904OWAAutoLink" target="_blank">SETERRQ2</a>(<a href="https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/PETSC_COMM_SELF.html#PETSC_COMM_SELF" id="m_-9094558541213758904LPlnk977899" class="m_-9094558541213758904OWAAutoLink" target="_blank">PETSC_COMM_SELF</a>,PETSC_ERR_LIB,<font color="#666666">"Error reported by MUMPS in numerical factorization phase: INFOG(1)=%d, INFO(2)=%d\n"</font>,mumps->id.INFOG(1),mumps->id.INFO(2));
<a name="m_-9094558541213758904_line1231" id="m_-9094558541213758904LPlnk528918" class="m_-9094558541213758904OWAAutoLink">1231: </a> } <font color="#4169E1">else</font> {
<a name="m_-9094558541213758904_line1232" id="m_-9094558541213758904LPlnk733089" class="m_-9094558541213758904OWAAutoLink">1232: </a> <font color="#4169E1">if</font> (mumps->id.INFOG(1) == -10) { <font color="#B22222">/* numerically singular matrix */</font>
<a name="m_-9094558541213758904_line1233" id="m_-9094558541213758904LPlnk306593" class="m_-9094558541213758904OWAAutoLink">1233: </a> PetscInfo2(F,<font color="#666666">"matrix is numerically singular, INFOG(1)=%d, INFO(2)=%d\n"</font>,mumps->id.INFOG(1),mumps->id.INFO(2));
<a name="m_-9094558541213758904_line1234" id="m_-9094558541213758904LPlnk922593" class="m_-9094558541213758904OWAAutoLink">1234: </a> F->factorerrortype = MAT_FACTOR_NUMERIC_ZEROPIVOT;
<br></pre>
<pre width="80"><pre width="80">The code continued to KSPSolve and finished successfully (with wrong answer). The user did not call KSPGetConvergedReason() after KSPSolve. I found I had to either add -ksp_error_if_not_converged or call KSPSetErrorIfNotConverged(ksp,PETSC_TRUE) to make the code fail. </pre><pre width="80">Is it expected? In my view, it is dangerous. If MUMPS fails in one stage, PETSc should not proceed to the next stage because it may hang there.</pre></pre>
<p></p>
</div>
</div>
</blockquote></div>We made the executive decision to have solves complete by default. This is consistent with that decision. Users who want safety can ask for the error. It would be nice of MUMPS would cleanup correctly, but we can report that to them as a bug.<div><br></div><div> Matt<br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="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></div>