[petsc-dev] SNESConvergedDefault() side effect?

Dmitry Karpeyev karpeev at mcs.anl.gov
Wed Jul 24 17:58:02 CDT 2013


On Wed, Jul 24, 2013 at 6:26 PM, Jed Brown <jedbrown at mcs.anl.gov> wrote:

> Dmitry Karpeyev <karpeev at mcs.anl.gov> writes:
>
> > Yes.  How should EW version 3 be implemented then?  Currently EW3
> > piggybacks on snes->ttol to get a measure of the initial norm of the
> > residual, and relies on it having been set elsewhere.  If no
> > references to snes->ttol in SNESKSPEW_PreSolve() are allowed, what
> > should take its place?
>
> I would say that EW3 should call VecNorm() on the first iteration.  Vecs
> cache their norms internally so this will only do one reduction, even if
> the SNES convergence test calls VecNorm() itself.
>
Okay.
Also, this is a minor point, but isn't SNESKSPEW_PreSolve() misnamed?
It operates on a KSP and takes a SNES context, so shouldn't it be
KSPPreSolve_SNESEW() or some such?
Should we also fix SNESSkipConverged() --> SNESConvergedSkip() at the same
time?
Dmitry.

>
> > I was just thinking of a single cache for the initial residual norm.
> > Currently there are at least two, it seems to me.
>
> Well, snes->norm_init is currently serving a different purpose, but it's
> not entirely clear that it needs to be set.  In particular, do we ever
> compute a norm using a side channel rather than by calling VecNorm,
> possibly followed by VecCopy?  If not, isn't calling
> SNESSetInitialFunction enough?  SNES can just call VecNorm on F and
> it'll use the cached value if it was set.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20130724/802e91bd/attachment.html>


More information about the petsc-dev mailing list