[petsc-users] lying about nullspaces

Jed Brown jedbrown at mcs.anl.gov
Tue Jan 10 07:52:45 CST 2012


On Tue, Jan 10, 2012 at 00:08, Geoffrey Irving <irving at naml.us> wrote:

> For now, I believe I can get away with a single linear iteration.
>

Single linear iteration (e.g. one GMRES cycle) or single linear solve (e.g.
one Newton step)?


> Even if I need a few, the extra cost of the first linear solve appears
> to be drastic.  However, it appears you're right that this isn't due
> to preconditioner setup.  The first solve takes over 50 times as long
> as the other solves:
>
>    step 1
>      dt = 0.00694444, time = 0
>      cg icc converged: iterations = 4, rtol = 0.001, error = 9.56519e-05
>      actual L2 residual = 1.10131e-05
>      max speed = 0.00728987
>    END step 1                                      0.6109 s
>

How are you measuring this time? In -log_summary, I see 0.02 seconds in
KSPSolve(). Maybe the time you see is because there are lots of page faults
until you get the code loaded into memory?


>    step 2
>      dt = 0.00694444, time = 0.00694444
>      cg icc converged: iterations = 3, rtol = 0.001, error = 0.000258359
>      actual L2 residual = 3.13442e-05
>      max speed = 0.0148876
>    END step 2                                      0.0089 s
>
> Note that this is a very small problem, but even if it took 100x the
> iterations the first solve would still be significant more expensive
> than the second.  However, if I pretend the nonzero pattern changes
> every iteration, I only see a 20% performance hit overall, so
> something else is happening on the first iteration.  Do you know what
> it is?  The results of -log_summary are attached if it helps.
>
> > Note that you can also enforce the constraints using Lagrange
> multipliers.
> > If the effect of the Lagrange multipliers are local, then you can likely
> get
> > away with an Uzawa-type algorithm (perhaps combined with some form of
> > multigrid for the unconstrained system). If the contact constraints cause
> > long-range response, Uzawa-type methods may not converge as quickly, but
> > there are still lots of alternatives.
>
> Lagrange multipliers are unfortunate since the system is otherwise
> definite.  The effect of the constraints will in general be global,
> since they will often be the only force combating the net effect of
> gravity.  In any case, if recomputing the preconditioner appears to be
> cheap, symbolic elimination is probably the way to go.
>

Well, if the Schur complement in the space of Lagrange multipliers is very
well conditioned (or is preconditionable) and you have a good
preconditioner for the positive definite part, then the saddle point
formulation is not a big deal. The best method will be problem dependent,
but this part of the design space is relevant when setup is high relative
to solves (e.g. algebraic multigrid).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20120110/a39db421/attachment.htm>


More information about the petsc-users mailing list