<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Feb 22, 2013 at 6:19 PM, Barry Smith <span dir="ltr"><<a href="mailto:bsmith@mcs.anl.gov" target="_blank">bsmith@mcs.anl.gov</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><br>
</div>   Ok, I did a search through the code to see where we are checking it.<br>
<br>
   1) VecNorm, VecDot, VecMDot  -- and generate an error<br></blockquote><div><br></div><div>Yeah, I never liked this.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<br>
   2) Many of the Krylov solvers and nonlinear solvers check the results of (most - should be all) norms and dots and either<br>
<br>
        a)  generate a not converged KSP or SNES converged reason (good)<br>
<br>
        b) generate an error (bad, most do this).<br></blockquote><div><br></div><div>We want the solvers to have an option to raise an error because it helps users track down where they made a mistake (especially if they're running in a shitty environment where -fp_trap and gdb doesn't work nicely). I'm not sure which should be the default.<br>
</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
      Note that currently the checks in the solvers are redundant because an error was already generated in the VecNorm, Dot or MDot so NaN never<br>
      gets to the iterative solver<br>
<br>
   3) Few other irrelevant places.<br>
<br>
  The simplest thing would be to simply remove the checks in 1).  Then, eventually, update all the solvers to NOT generate an error but instead return with<br>
an appropriate diverged reason. The drawback is that other code using dots and norms will always chug along without generating an error if users don't<br>
check the results themselves.<br></blockquote><div><br></div><div>I think this is an event that the caller should deal with since only they have enough context to return cleanly. Yes, it's more code, but it's the right thing.<br>
</div><div> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
   I vote we just make a patch in 3.3 to remove the checks in norm, dot, mdot and Jed adds another project to the bitbucket list saying upgrade the checks in the solvers to return with appropriate diverged reason instead of generating an error. Then the whole flag business goes away.</blockquote>
</div><br></div><div class="gmail_extra">That's fine with me.<br></div></div>