[petsc-users] Line search Ended due to ynorm, nondeterministic stagnation

Smith, Barry F. bsmith at mcs.anl.gov
Mon Nov 11 16:49:12 CST 2019


 
  Mark,

   What are you using for KSP rtol ? It looks like 1.e-1 from 

>      0 KSP Residual norm 2.654593713313e-03 
> ...
>       41 KSP Residual norm 2.515907124549e-04 

   What about SNES stol, are you setting that?

>         Line search: Ended due to ynorm < stol*xnorm (1.047067861804e-04 < 2.190637006857e-04).


   Any idea of the order of magnitude of the solution? These numbers are much larger than one normally sees in this situation.

   It looks like the linear solve is just not accurate enough so a descent direction is not generated and hence the line search has to give up. The problem comes up only in some runs because the linear solve is right on the cusp of good enough to find a descent direction and depending on the order of operations in the linear solve the solution sometimes is a descent direction and sometimes is not producing inconsistent behavior.

   I would just make the linear solver more accurate, pay the cost of a bit more time in trade off for removing the problems with failure


   Barry





> On Nov 11, 2019, at 8:20 AM, Mark Lohry via petsc-users <petsc-users at mcs.anl.gov> wrote:
> 
> Symptom: running the same code on the same core count multiple times, 80% of the time it converges out no problem. 20% of the time SNES seems to reset to the previous step, showing 
> "Line search: Ended due to ynorm < stol*xnorm"
> 
> Sample output below. Everything is healthy until TS step 7, which starts with a norm of 1.181275684011e-04. After that point, every KSP converges to RTOL and I see the line search message, and the subsequent timesteps all seem like they don't use the previous update, because they have exactly the same residuals.
> 
> Running the same thing again, it happily proceeds through and converges out without the stagnation.
> 
> Does this sound familiar to anyone?
> 
> 
> 5 TS dt 30. time 150.
>     0 SNES Function norm 2.654593713313e-03 
>       0 KSP Residual norm 2.654593713313e-03 
> ...
>       41 KSP Residual norm 2.515907124549e-04 
>     Linear solve converged due to CONVERGED_RTOL iterations 41
>         Line search: gnorm after quadratic fit 2.445531672458e-03
>         Line search: Quadratically determined step, lambda=1.5043681801723077e-01
>     1 SNES Function norm 2.445531672458e-03
>       0 KSP Residual norm 2.445531672458e-03 
> ...
>      40 KSP Residual norm 2.281075491298e-04 
>     Linear solve converged due to CONVERGED_RTOL iterations 40
>         Line search: gnorm after quadratic fit 2.158781959371e-03
>         Line search: Quadratically determined step, lambda=2.1593140643569805e-01
>     2 SNES Function norm 2.158781959371e-03 
>       0 KSP Residual norm 2.158781959371e-03 
>      40 KSP Residual norm 1.902363860750e-04 
>     Linear solve converged due to CONVERGED_RTOL iterations 40
>         Line search: gnorm after quadratic fit 1.727564041943e-03
>         Line search: Quadratically determined step, lambda=3.7179194957755984e-01
>     3 SNES Function norm 1.727564041943e-03 
>       0 KSP Residual norm 1.727564041943e-03 
> ...
>      38 KSP Residual norm 1.572811703375e-04 
>     Linear solve converged due to CONVERGED_RTOL iterations 38
>         Line search: Using full step: fnorm 1.727564041943e-03 gnorm 1.074289112389e-03
>     4 SNES Function norm 1.074289112389e-03 
>       0 KSP Residual norm 1.074289112389e-03 
> ...
>       18 KSP Residual norm 1.047939125382e-04 
>     Linear solve converged due to CONVERGED_RTOL iterations 18
>         Line search: Using full step: fnorm 1.074289112389e-03 gnorm 1.049627557624e-04
>     5 SNES Function norm 1.049627557624e-04 
>   Nonlinear solve converged due to CONVERGED_FNORM_RELATIVE iterations 5
>       TSAdapt none beuler 0: step   5 accepted t=150        + 3.000e+01 dt=3.000e+01 
>  6 TS dt 30. time 180.
>     0 SNES Function norm 1.181275684011e-04 
>       0 KSP Residual norm 1.181275684011e-04 
> ...
> 
>      44 KSP Residual norm 1.107203720458e-05 
>     Linear solve converged due to CONVERGED_RTOL iterations 44
>         Line search: Ended due to ynorm < stol*xnorm (1.034132241459e-04 < 2.190637006857e-04).
>     1 SNES Function norm 1.181275684011e-04 
>   Nonlinear solve converged due to CONVERGED_SNORM_RELATIVE iterations 1
>       TSAdapt none beuler 0: step   6 accepted t=180        + 3.000e+01 dt=3.000e+01 
> 7 TS dt 30. time 210.
>     0 SNES Function norm 1.181275684011e-04 
>       0 KSP Residual norm 1.181275684011e-04 
> ...
> 44 KSP Residual norm 1.110103600083e-05 
>     Linear solve converged due to CONVERGED_RTOL iterations 44
>         Line search: Ended due to ynorm < stol*xnorm (1.047067861804e-04 < 2.190637006857e-04).
>     1 SNES Function norm 1.181275684011e-04 
>   Nonlinear solve converged due to CONVERGED_SNORM_RELATIVE iterations 1
>       TSAdapt none beuler 0: step   7 accepted t=210        + 3.000e+01 dt=3.000e+01 
> 8 TS dt 30. time 240.
>     0 SNES Function norm 1.181275684011e-04 
>       0 KSP Residual norm 1.181275684011e-04 
> ...
>      44 KSP Residual norm 1.102709658960e-05 
>     Linear solve converged due to CONVERGED_RTOL iterations 44
>         Line search: Ended due to ynorm < stol*xnorm (1.035351833216e-04 < 2.190637006857e-04).
>     1 SNES Function norm 1.181275684011e-04 
>   Nonlinear solve converged due to CONVERGED_SNORM_RELATIVE iterations 1
>       TSAdapt none beuler 0: step   8 accepted t=240        + 3.000e+01 dt=3.000e+01 
>          9  2.700e+02  3.000e+01  1.72412e-09  2.28859e-07  2.39889e-07  9.69858e-08  4.71512e-06  3.30532e-02  1.83203e+00 -3.38502e-01 -3.09701e+00  1.96301e-02  3.53675e-02  3.96395e+01
> 9 TS dt 30. time 270.
>     0 SNES Function norm 1.181275684011e-04 
>       0 KSP Residual norm 1.181275684011e-04 
> ...
> 
> 



More information about the petsc-users mailing list