[petsc-users] Convergence criterion for composite preconditioner
Barry Smith
bsmith at mcs.anl.gov
Wed Apr 30 20:46:46 CDT 2014
On Apr 30, 2014, at 2:01 PM, Federico Marini <federico.marini at unimi.it> wrote:
> Dear PETSc users,
>
> I implemented PCCOMPOSITE preconditioner of type PC_COMPOSITE_ADDITIVE. It has two components:
>
> - pc1: PCASM 1-level additive Schwarz preconditioning
> - pc2: PCSHELL 2-level additive Schwarz preconditioning
>
> so basically the whole preconditioner is a 2-level additive Schwarz preconditioner, where the second level is hand-made in a MATSHELL matrix structure. For PCASM, I use defalut options.
Be careful here. By default PCASM uses RASM (restricted Additive Schwarz method) which is not a symmetric preconditioner so will not work properly with KSPCG. You can use PCASMSetType(pc1, PC_ASM_BASIC) or -sub_1_pc_asm_type basic
> I run tests with PCSHELL activated and deactivated.
>
> I use the default stopping criterion with this setting:
>
> ierr=KSPSetTolerances(ksp,1e-7,PETSC_DEFAULT,PETSC_DEFAULT,PETSC_DEFAULT);CHKERRQ(ierr);
>
> In the end I get these convergence results with 256 MPI tasks (1054729 total dofs) using KSPCG
>
> PSASM only:
> ...
> 134 KSP preconditioned resid norm 4.680038240771e-06 true resid norm 5.417972183036e-07 ||r(i)||/||b|| 2.402197263846e-06
> 135 KSP preconditioned resid norm 3.681603361690e-06 true resid norm 4.091445069661e-07 ||r(i)||/||b|| 1.814047363013e-06
> 136 KSP preconditioned resid norm 2.938575711894e-06 true resid norm 3.280865690135e-07 ||r(i)||/||b|| 1.454656155040e-06
> - convergence detected
>
> PCASM + PCSHELL
> ...
> 22 KSP preconditioned resid norm 6.610753500258e-05 true resid norm 4.725684013113e-06 ||r(i)||/||b|| 2.095253504927e-05
> 23 KSP preconditioned resid norm 1.173818907551e-04 true resid norm 2.984650385207e-06 ||r(i)||/||b|| 1.323321483881e-05
> 24 KSP preconditioned resid norm 4.409443889428e-05 true resid norm 1.959757043931e-06 ||r(i)||/||b|| 8.689086709369e-06
> - convergence detected
>
> The preconditioner, in both (1- and 2-level) versions, works fine, but the relative residual norm stopping criterion is not achieved. Observing the residual norms, I don't think the next iteration would achieve the requested 10^-7 tolerance.
The default test for CG uses left preconditioner and the relative decrease in the preconditioned residual norm. So in this case it is 2.938575711894e-06/initialpreconditionednorm and 4.409443889428e-05/initialpreconditionednorm. Since you didn’t send the 0th iteration I don’t know what the initial norms are but I am confident it has decreased by 1e-7.
BTW: with CG you can use -ksp_norm_type preconditioned or unpreconditioned or natural or KSPSetNormType(ksp, see the manual page) to use different norms for testing.
Barry
>
> Can anyone explain me why?
>
> Thank you in advance,
> Federico Marini
>
> Il 5 x mille alla nostra Università è un investimento sui giovani,
> sui loro migliori progetti.
> Sostiene la libera ricerca.
> Alimenta le loro speranze nel futuro.
>
> Investi il tuo 5 x mille sui giovani.
>
More information about the petsc-users
mailing list