[petsc-dev] Line search

Barry Smith bsmith at mcs.anl.gov
Wed Feb 15 13:30:50 CST 2017


> On Feb 15, 2017, at 8:40 AM, Matthew Knepley <knepley at gmail.com> wrote:
> 
> On Wed, Feb 15, 2017 at 8:39 AM, Mark Adams <mfadams at lbl.gov> wrote:
> I am getting a lot of time in line search. see below. This is what I see with view:
> 
>   SNESLineSearch Object: 1 MPI processes
>     type: basic
>     maxstep=1.000000e+08, minlambda=1.000000e-12
>     tolerances: relative=1.000000e-08, absolute=1.000000e-15, lambda=1.000000e-08
>     maximum iterations=1
> 
> Shouldn't my line search time be tiny?
> 
> Its not a coincidence that it is equal to the FunctionEval time. That is the main cost.

   Mark,

    When Newton is in the quadratic basin then it will do one Function evaluation and one Jacobian evaluation per Newton step. The one function evaluation takes place inside the line search code (and the result is used also at the beginning of the next iteration). If Newton is not in the quadratic basin it may do several function evaluations inside the line search (to find a suitable decrease in the function norm); again basically all the work in the line search is the function evaluations, there is nothing else computationally expensive in a line search (maybe a matrix-vector product).
> 
>   Matt
>  
> SNESSolve              1 1.0 1.3222e-01 1.0 2.87e+08 1.0 2.7e+02 4.5e+03 0.0e+00 14 50  8  9  0  14 50  8  9  0 590811
> SNESFunctionEval       2 1.0 1.2035e-01 1.0 2.87e+08 1.0 2.7e+02 4.5e+03 0.0e+00 13 50  8  9  0  13 50  8  9  0 648067
> SNESJacobianEval       1 1.0 7.8297e-04 4.0 0.00e+00 0.0 0.0e+00 0.0e+00 0.0e+00  0  0  0  0  0   0  0  0  0  0     0 
> SNESLineSearch         1 1.0 1.2040e-01 1.0 2.87e+08 1.0 2.7e+02 4.5e+03 0.0e+00 13 50  8  9  0  13 50  8  9  0 647734
> KSPGMRESOrthog         1 1.0 6.4087e-0413.4 2.24e+03 1.0 0.0e+00 0.0e+00 0.0e+00  0  0  0  0  0   0  0  0  0  0   952 
> KSPSetUp               1 1.0 3.5691e-04 1.8 0.00e+00 0.0 0.0e+00 0.0e+00 0.0e+00  0  0  0  0  0   0  0  0  0  0     0 
> KSPSolve               1 1.0 1.1965e-02 1.1 4.49e+05 1.0 0.0e+00 0.0e+00 0.0e+00  1  0  0  0  0   1  0  0  0  0 10199
> 
> 
> 
> -- 
> What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.
> -- Norbert Wiener




More information about the petsc-dev mailing list