[petsc-dev] SNESConvergedDefault() side effect?

Jed Brown jedbrown at mcs.anl.gov
Wed Jul 24 17:26:23 CDT 2013


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.

> 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 --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20130724/7565cd6f/attachment.sig>


More information about the petsc-dev mailing list