[petsc-users] understanding snes_view output

Barry Smith bsmith at mcs.anl.gov
Thu Mar 30 16:38:23 CDT 2017


> On Mar 30, 2017, at 3:02 PM, Gideon Simpson <gideon.simpson at gmail.com> wrote:
> 
> When running something with -snes_monitor and -snes_view, I see two sets of numbers that I'm trying to understand (see below).  
> 
> The first is the sequence X SNES Function norm, with X going from 0 to 3.  I had interpreted this as saying that it takes 3 steps of Newton, though perhaps this is not the case.  

   This is correct.
> 
> The next is "total number of linear solves=4" and "total number of function evaluations=31".  How do these numbers relegate to the SNES Function norm statements?  Also, I was surprised by the number of function evaluations given that I specify a SNESSetJacobian in the problem.

   Each Newton step takes exactly one linear solve but one or more __linear solver iterations__

   Each Newton step requires at a minimum 1 function evaluation. The line search may take any number of additional function evaluations (different types of line search will take more or less function evaluations). 

   You can run with -ksp_monitor -snes_linesearch_monitor to get more details about linear solver iterations and the line search steps

    The number of function evaluations is "high" for thee Newton steps.

> 
>  0 SNES Function norm 7.630295941712e-03 
>  1 SNES Function norm 3.340185037212e-06 
>  2 SNES Function norm 1.310176068229e-13 
>  3 SNES Function norm 1.464821375527e-14 
> SNES Object: 4 MPI processes
>  type: newtonls
>  maximum iterations=50, maximum function evaluations=10000
>  tolerances: relative=1e-15, absolute=1e-50, solution=1e-15
>  total number of linear solver iterations=4
>  total number of function evaluations=31
>  norm schedule ALWAYS
>  SNESLineSearch Object:   4 MPI processes
>    type: bt
>      interpolation: cubic
>      alpha=1.000000e-04
>    maxstep=1.000000e+08, minlambda=1.000000e-12
>    tolerances: relative=1.000000e-08, absolute=1.000000e-15, lambda=1.000000e-08
>    maximum iterations=40
>  KSP Object:   4 MPI processes
>    type: gmres
>      GMRES: restart=30, using Classical (unmodified) Gram-Schmidt Orthogonalization with no iterative refinement
>      GMRES: happy breakdown tolerance 1e-30
>    maximum iterations=10000, initial guess is zero
>    tolerances:  relative=1e-05, absolute=1e-50, divergence=10000
>    left preconditioning
>    using PRECONDITIONED norm type for convergence test
>  PC Object:   4 MPI processes
>    type: bjacobi
>      block Jacobi: number of blocks = 4
>      Local solve is same for all blocks, in the following KSP and PC objects:
>    KSP Object:    (sub_)     1 MPI processes
>      type: preonly
>      maximum iterations=10000, initial guess is zero
>      tolerances:  relative=1e-05, absolute=1e-50, divergence=10000
>      left preconditioning
>      using NONE norm type for convergence test
>    PC Object:    (sub_)     1 MPI processes
>      type: ilu
>        ILU: out-of-place factorization
>        0 levels of fill
>        tolerance for zero pivot 2.22045e-14
>        matrix ordering: natural
>        factor fill ratio given 1, needed 1
>          Factored matrix follows:
>            Mat Object:             1 MPI processes
>              type: seqaij
>              rows=2, cols=2
>              package used to perform factorization: petsc
>              total: nonzeros=4, allocated nonzeros=4
>              total number of mallocs used during MatSetValues calls =0
>                using I-node routines: found 1 nodes, limit used is 5
>      linear system matrix = precond matrix:
>      Mat Object:       1 MPI processes
>        type: seqaij
>        rows=2, cols=2
>        total: nonzeros=4, allocated nonzeros=10
>        total number of mallocs used during MatSetValues calls =0
>          using I-node routines: found 1 nodes, limit used is 5
>    linear system matrix = precond matrix:
>    Mat Object:     4 MPI processes
>      type: mpiaij
>      rows=2, cols=2
>      total: nonzeros=4, allocated nonzeros=20
>      total number of mallocs used during MatSetValues calls =0
>        using I-node (on process 0) routines: found 1 nodes, limit used is 5
> 
> -gideon



More information about the petsc-users mailing list