<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>Hi Matt, <br>Thanks for the reply, Closer inspection showed the presence of a few large (10^300) values in the initial condition vector while running in debug mode. <div>Subramanya <br><div><br><div><hr id="stopSpelling">Date: Sun, 14 Jul 2013 05:51:12 -0500<br>Subject: Re: [petsc-users] Really Really Really Weird SNES behaviour<br>From: knepley@gmail.com<br>To: potaman@outlook.com<br>CC: libmesh-users@lists.sourceforge.net; petsc-users@mcs.anl.gov<br><br><div dir="ltr">On Sun, Jul 14, 2013 at 12:17 AM, subramanya sadasiva <span dir="ltr"><<a href="mailto:potaman@outlook.com" target="_blank">potaman@outlook.com</a>></span> wrote:<br><div class="ecxgmail_extra"><div class="ecxgmail_quote">
<blockquote class="ecxgmail_quote" style="border-left:1px #ccc solid;padding-left:1ex;">


<div><div dir="ltr">Hi, <div>I am observing some really really really weird SNES behavior in my SNESVI code called through Libmesh. This behaviour appeared after I changed some initial conditions and only happens in an optimized build. I am running this code on a Macbook pro running os x 10.8.. </div>
<div><br></div><div>When the debug code is run, the residuals computed for the initial conditions provided give norms which are of the expected magnitude.. so the SNES_Monitor output is, </div><div><div><br></div><div>solving the cahn hilliard time step</div>
<div>  0 SNES Function norm 8.223262421671e-01</div><div>  1 SNES Function norm 3.793806858333e-03</div><div>Nonlinear solve did not converge due to DIVERGED_MAX_IT iterations 1</div></div><div><br></div><div>The output from SNES_Monitor with the optimized code on the other hand is, </div>
<div><br></div><div><div>solving the cahn hilliard time step</div><div>  0 SNES Function norm 5.153882032022e+19</div><div>  1 SNES Function norm 1.446612980133e+19</div><div>Nonlinear solve did not converge due to DIVERGED_MAX_IT iterations 1</div>
</div><div><br></div><div><br></div><div>Absolutely nothing else has changed in the code except that one code is built with a debugging and one with an optimized version of the code. </div><div><br></div><div>Any ideas?</div>
</div></div></blockquote><div><br></div><div>This sound like an uninitialized variable in your residual evaluation routine. Very often, debugging code</div><div>will initialize variables to 0, whereas optimized leaves them alone.</div>
<div><br></div><div>   Matt</div><div> </div><blockquote class="ecxgmail_quote" style="border-left:1px #ccc solid;padding-left:1ex;"><div><div dir="ltr"><span class="ecxHOEnZb"><font color="#888888"><div>Subramanya</div>
                                          </font></span></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <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
</div></div></div></div></div>                                      </div></body>
</html>