<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jul 24, 2013 at 5:26 PM, Jed Brown <span dir="ltr"><<a href="mailto:jedbrown@mcs.anl.gov" target="_blank">jedbrown@mcs.anl.gov</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>Dmitry Karpeyev <<a href="mailto:karpeev@mcs.anl.gov" target="_blank">karpeev@mcs.anl.gov</a>> writes:<br>

<br>
> Yes.  How should EW version 3 be implemented then?  Currently EW3<br>
> piggybacks on snes->ttol to get a measure of the initial norm of the<br>
> residual, and relies on it having been set elsewhere.  If no<br>
> references to snes->ttol in SNESKSPEW_PreSolve() are allowed, what<br>
> should take its place?<br>
<br>
</div>I would say that EW3 should call VecNorm() on the first iteration.  Vecs<br>
cache their norms internally so this will only do one reduction, even if<br>
the SNES convergence test calls VecNorm() itself.<br>
<div><br>
> I was just thinking of a single cache for the initial residual norm.<br>
> Currently there are at least two, it seems to me.<br>
<br>
</div>Well, snes->norm_init is currently serving a different purpose,</blockquote><div><br></div><div>Yep, this was a cached value used to initialize the value in order to avoid extra global reductions for FAS and nonlinear preconditioning, not something to be used in tolerance tests.  This was pretty obvious from the docs.  The SNESSetInitialFunction(Norm)() stuff has some logic in it based upon the function being the same or different from the user set one, so it's really not the place to set things for tolerance tests either.<br>

</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> but it's<br>
not entirely clear that it needs to be set.  In particular, do we ever<br>
compute a norm using a side channel rather than by calling VecNorm,<br>
possibly followed by VecCopy?  If not, isn't calling<br>
SNESSetInitialFunction enough?</blockquote><div><br></div><div>I'm convinced.  Created a branch getting rid of it and merged it into next.<br><br><a href="https://bitbucket.org/petsc/petsc/commits/082749e3fd29b5b736d87e346c0f1a52377b27cf">https://bitbucket.org/petsc/petsc/commits/082749e3fd29b5b736d87e346c0f1a52377b27cf</a><br>
</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
  SNES can just call VecNorm on F and<br>
it'll use the cached value if it was set.<br>
</blockquote></div><br></div></div>