On Sat, May 9, 2009 at 1:09 PM, Barry Smith <span dir="ltr"><<a href="mailto:bsmith@mcs.anl.gov">bsmith@mcs.anl.gov</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
   After looking at the code I see why it ended up being so complicated. It needs some thought.<br>
The way the line search works is<br>
<br>
1) if the full step satisfies the reduction criteria it returns<br>
2) if the full step is smaller (measured by the 2 norm) then stol it returns (in other words if the full step satisfies the "small step" SNES convergence criteria)<br>
     this catches the case when the full step is zero length (but also may return with a bigger function norm than last time) This also returns with the flag saying linesearch successful,<br>
     should it really say successful?</blockquote><div><br>My understanding was that this catches stagnation, so that a time step could be decreased or continuation parameter, etc. Thus I agree with Barry that<br>this should say unsuccessful, like a divergence tolerance.<br>
 </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
3) otherwise it fits the function to the quadratic or cubic function until<br>
    a) reduction criteria satisfied or<br>
    b) step length is too small as measured by this strange max_i p_i/x_i "norm" using again stol this returns with a flag saying line search unsuccessful</blockquote><div>       c)  or it has tried too many times (I think its 10)<br>
</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
<br>
<br>
Now my first inclination was to change 3b to use a -snes_ls_minstep <minstep> value instead of stol.  Thus one could control the minimum step size in the<br>
line search without affecting the convergence tolerances. This may be a correct fix.</blockquote><div><br>I like this.<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
But what about 2a? Do I continue to use the stol here? Do I use the new <minstep> value; I don't think so because that is used in 3a with a very different norm so minstep has two meanings. Do I introduce a third tolerance; yuck. Do I just check if it is exactly zero only?</blockquote>
<div><br>You do not need to check for zero step since the sufficient reduction criterion will rule this out. I think this also ought to rule out<br>checking stol. If sufficient reduction is achieved, I could care less about how small the step is.<br>
 </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
My inclination is to have a check for exactly zero only and then let 3b determine if it should return immediately (because the line search length is too small). If we totally remove 2 (and the step is zero) then 3b will return immediately BUT it will return with a flag saying linesearch failed (while 2 currently says success).</blockquote>
<div><br>I think failure is fine.<br><br>  Matt<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
  Thoughts anyone?<br>
<br>
   Barry<br>
<br>
<br>
On May 8, 2009, at 6:34 PM, Eric Meier wrote:<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br>
<br>
In the line search routines within SNES, I think there is some confusion about the option -snes_stol <stol>.<br>
<br>
On this page<br>
<a href="http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/docs/manualpages/SNES/SNESSetTolerances.html" target="_blank">http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/docs/manualpages/SNES/SNESSetTolerances.html</a><br>

stol is defined one way.  But on this page<br>
<a href="http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/docs/manualpages/SNES/SNESLineSearchQuadratic.html" target="_blank">http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/docs/manualpages/SNES/SNESLineSearchQuadratic.html</a><br>

it is defined another way.<br>
<br>
When I look in the PETSc code (ls.c), it seems to me that PETSc uses the option set with -snes_stol as the minimum step size in the line search routines (quadratic and cubic).  But, it seems to use that same tolerance in the sense that<br>

<br>
stol<br>
- convergence tolerance in terms of the norm of the change in the solution between steps<br>
<br>
Therefore, I don't see how to control the minimum step size in the line search routines without affecting the convergence tolerances.<br>
<br>
Eric<br>
</blockquote>
<br>
</blockquote></div><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<br>