[petsc-users] rtol convergence
Barry Smith
bsmith at petsc.dev
Fri Nov 27 15:59:43 CST 2020
Nicola,
With left preconditioner it is actually ||r(i)||/|| B b || < 1.e-7 as the stopping criteria (note the B inside the norm). Where B is the action of the preconditioner and r(0) = B b which is printed on the first line as 5.033493299009e+03
With left preconditioning r(i) = B (b - A x(i)) = B A (x* - x(i)) = B A error
Barry
> On Nov 25, 2020, at 12:05 PM, Nicola Varini <nicola.varini at epfl.ch> wrote:
>
> Thanks Pierre for the clarification, perhaps it would be useful to print ||r(i)||/||b|| according to ksp_norm_type?
>
>
>
>
>
> On 11/25/20 5:29 PM, Pierre Jolivet wrote:
>> Dear Nicola,
>> rtol is relative tolerance: everything is computed with respect to r_0.
>> So, for the preconditioned case: 3.759000903215e-04/5.033493299009e+03 < 1e-07
>> For the unpreconditioned case: 8.902026754193e-06/3.204525251924e+02 < 1e-07
>> Is it clearer that way?
>>
>> Thanks,
>> Pierre
>>
>>> On 25 Nov 2020, at 4:14 PM, Nicola Varini <nicola.varini at epfl.ch <mailto:nicola.varini at epfl.ch>> wrote:
>>>
>>> Dear all, forgive me if the following question is trivial, but I am trying to figure out
>>> how the convergence criteria works in case of -ksp_norm_type preconditioned.
>>> Below you can find the logs for preconditioned vs unpreconditioned. The solver converge with reason converged_rtol.
>>> -ksp_rtol=1e-7
>>> In the case of unpreconditioned norm it is clear that ||r||/||b||<1e-7 at iteration 12.
>>> In the case of preconditioned norm it should be ||r||/||b|| = 1.17e-06.
>>> What am I missing?
>>>
>>> PRECONDITIONED NORM
>>> 0 KSP preconditioned resid norm 5.033493299009e+03 true resid norm 3.204525251924e+02 ||r(i)||/||b|| 1.000000000000e+00
>>> 1 KSP preconditioned resid norm 3.425803632572e+02 true resid norm 1.937892001317e+02 ||r(i)||/||b|| 6.047360682066e-01
>>> 2 KSP preconditioned resid norm 4.382931341126e+01 true resid norm 5.154130142755e+01 ||r(i)||/||b|| 1.608391177339e-01
>>> 3 KSP preconditioned resid norm 4.272202338001e+00 true resid norm 9.790042315960e+00 ||r(i)||/||b|| 3.055067926234e-02
>>> 4 KSP preconditioned resid norm 2.728350554402e-01 true resid norm 1.065721671294e+00 ||r(i)||/||b|| 3.325677245496e-03
>>> 5 KSP preconditioned resid norm 2.269929645857e-02 true resid norm 1.475155830456e-01 ||r(i)||/||b|| 4.603352180079e-04
>>> 6 KSP preconditioned resid norm 7.380512306491e-03 true resid norm 4.703550871658e-02 ||r(i)||/||b|| 1.467783993536e-04
>>> 7 KSP preconditioned resid norm 1.413199151428e-03 true resid norm 1.452742106199e-02 ||r(i)||/||b|| 4.533408202436e-05
>>> 8 KSP preconditioned resid norm 3.759000903215e-04 true resid norm 4.907814057015e-03 ||r(i)||/||b|| 1.531526098622e-05
>>>
>>> UNPRECONDITIONED NORM
>>>
>>> 0 KSP unpreconditioned resid norm 3.204525251924e+02 true resid norm 3.204525251924e+02 ||r(i)||/||b|| 1.000000000000e+00
>>> 1 KSP unpreconditioned resid norm 1.310814475877e+02 true resid norm 1.310814475877e+02 ||r(i)||/||b|| 4.090510677331e-01
>>> 2 KSP unpreconditioned resid norm 2.319724277605e+01 true resid norm 2.319724277605e+01 ||r(i)||/||b|| 7.238901538416e-02
>>> 3 KSP unpreconditioned resid norm 2.060554152717e+00 true resid norm 2.060554152717e+00 ||r(i)||/||b|| 6.430138603150e-03
>>> 4 KSP unpreconditioned resid norm 2.471285360225e-01 true resid norm 2.471285360226e-01 ||r(i)||/||b|| 7.711861090006e-04
>>> 5 KSP unpreconditioned resid norm 6.698832182690e-02 true resid norm 6.698832182689e-02 ||r(i)||/||b|| 2.090428895409e-04
>>> 6 KSP unpreconditioned resid norm 1.941260318181e-02 true resid norm 1.941260318179e-02 ||r(i)||/||b|| 6.057871808041e-05
>>> 7 KSP unpreconditioned resid norm 5.610469571259e-03 true resid norm 5.610469571233e-03 ||r(i)||/||b|| 1.750795868394e-05
>>> 8 KSP unpreconditioned resid norm 1.357950031961e-03 true resid norm 1.357950031957e-03 ||r(i)||/||b|| 4.237601283190e-06
>>> 9 KSP unpreconditioned resid norm 4.277774357590e-04 true resid norm 4.277774357315e-04 ||r(i)||/||b|| 1.334916725885e-06
>>> 10 KSP unpreconditioned resid norm 1.171326258320e-04 true resid norm 1.171326258188e-04 ||r(i)||/||b|| 3.655225551692e-07
>>> 11 KSP unpreconditioned resid norm 3.381696730013e-05 true resid norm 3.381696731034e-05 ||r(i)||/||b|| 1.055287902320e-07
>>> 12 KSP unpreconditioned resid norm 8.902026754193e-06 true resid norm 8.902026767788e-06 ||r(i)||/||b|| 2.777954944322e-08
>>>
>>>
>>> Thanks,
>>>
>>> Nicola
>>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20201127/5ce690e4/attachment.html>
More information about the petsc-users
mailing list