[petsc-users] Linesearch type cp change from 3.7.6 to 3.9.1
Matthew Knepley
knepley at gmail.com
Mon Jul 2 07:59:41 CDT 2018
On Mon, Jul 2, 2018 at 4:54 AM Carles Bona-Casas <carles.bona at uib.es> wrote:
> Dear all,
>
> I have been running a code with the option -snes_linesearch_type cp using
> petsc 3.7.6.
>
> I have updated my code to use petsc 3.9.1. If I run a simulation with the
> updated code and the option -snes_linesearch_type cp included, I obtain the
> same behaviour in the solution for a while, but then it suddenly stops
> converging for no apparent reason.
>
> If I run the same example with both petsc versions without using
> -snes_linesearch_type cp then I obtain exactly the same behaviour.
>
> My code currently runs quite faster with that option activated. Is there
> some default behaviour regarding -snes_linesearch_type cp that has been
> changed from petsc 3.7 to petsc 3.9?
>
> I attach my 3 outputs. With petsc 3.7.6 and cp option activated. With
> petsc 3.9.1 and cp option activated (not converging). And without cp option
> activated (only one file, same result with both petsc versions).
>
> I am also open to suggestions of different solvers that could work better
> than using -snes_linesearch_type cp.
>
The first real difference between the files occurs here:
254,265c254,907
< Linear solve converged due to CONVERGED_RTOL iterations 7
< FirstNewton = 0
< Linear solve converged due to CONVERGED_RTOL iterations 7
< FirstNewton = 0
< 4 SNES Function norm 1.219642897375e-06
< NORM2F: 1.219643e-06 NORM2F/NORM2F0: 1.366681e-07
< NORM2dof0: 7.904453e-07 NORM2dof0/NORM2dof00: 8.857402e-08
< NORM2dof1: 5.299586e-07 NORM2dof1/NORM2dof10: 2.277562e-04
< NORM2dof2: 7.627955e-07 NORM2dof2/NORM2dof20: 3.462714e-04
< NORM2dof3: 3.457406e-09 NORM2dof3/NORM2dof30: 4.131767e-01
< isolid: 0 NORM2S: 1.174284e-13 NORM2S/NORM2S0: 1.630586e-04
< Nonlinear solve converged due to CONVERGED_FNORM_RELATIVE iterations 4
---
> 4 SNES Function norm 1.411908637477e-05
> NORM2F: 1.411909e-05 NORM2F/NORM2F0: 1.582126e-06
> NORM2dof0: 7.713374e-06 NORM2dof0/NORM2dof00: 8.643286e-07
> NORM2dof1: 5.780273e-06 NORM2dof1/NORM2dof10: 2.484143e-03
> NORM2dof2: 1.031702e-05 NORM2dof2/NORM2dof20: 4.683416e-03
> NORM2dof3: 4.547591e-09 NORM2dof3/NORM2dof30: 5.434590e-01
> isolid: 0 NORM2S: 1.069509e-12 NORM2S/NORM2S0: 1.485097e-03
> 0 KSP Residual norm 1.411908637477e-05
> 1 KSP Residual norm 1.147024084989e-05
> 2 KSP Residual norm 1.642505389042e-06
> 3 KSP Residual norm 9.393394019526e-08
> 4 KSP Residual norm 3.802608124054e-08
> 5 KSP Residual norm 3.488335294398e-09
> Linear solve converged due to CONVERGED_ATOL iterations 5
> 5 SNES Function norm 1.411908637477e-05
> NORM2F: 1.411909e-05 NORM2F/NORM2F0: 1.582126e-06
> NORM2dof0: 7.713374e-06 NORM2dof0/NORM2dof00: 8.643286e-07
> NORM2dof1: 5.780273e-06 NORM2dof1/NORM2dof10: 2.484143e-03
> NORM2dof2: 1.031702e-05 NORM2dof2/NORM2dof20: 4.683416e-03
> NORM2dof3: 4.547591e-09 NORM2dof3/NORM2dof30: 5.434590e-01
> isolid: 0 NORM2S: 1.069509e-12 NORM2S/NORM2S0: 1.485097e-03
As you can see, something is being solved in 3.7.6 that is absent in 3.9.2:
< Linear solve converged due to CONVERGED_RTOL iterations 7
< FirstNewton = 0
< Linear solve converged due to CONVERGED_RTOL iterations 7
< FirstNewton = 0
Where does the 'FirstNewton' output come from in your code? Maybe this is a
clue. I would
get in the debugger, and follow the control flow after SNES iterate 3.
Finally, are you sure that CP line search is being used in 3.9.2? I cannot
see the -snes_view
output. Maybe you want -snes_view_pre?
Thanks,
Matt
> Many thanks,
>
> Carles
>
--
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
https://www.cse.buffalo.edu/~knepley/ <http://www.caam.rice.edu/~mk51/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20180702/3d1c4ee3/attachment.html>
More information about the petsc-users
mailing list