[petsc-users] How to use rtol as stopping criteria for PCMG subksp solver
Patrick Sanan
patrick.sanan at gmail.com
Thu Sep 1 09:40:28 CDT 2016
On Thu, Sep 1, 2016 at 4:02 PM, Aulisa, Eugenio <eugenio.aulisa at ttu.edu> wrote:
> Hi,
>
> I have
>
> ksp GMRES->preconditioned with PCMG
>
> and at each level
> subksp GMRES -> preconditioned with different PCs
>
> I would like to control the stopping criteria of each level-subksp
> using either the relative tolerance or the npre/npost number of smoothings
>
> I set at each level
>
> KSPSetNormType(subksp, KSP_NORM_PRECONDITIONED); // assuming left preconditioner
> KSPSetTolerances(subksp, rtol, PETSC_DEFAULT, PETSC_DEFAULT, npre);
>
> It seams (but I am not sure how to check it properly) that rtol is completely uninfluential,
> rather it always uses the fix number of iterations fixed by npre.
>
> When I run with the option -ksp_view I see that the norm for the subksp
> has effectively changed from NONE to PRECONDITIONED
> for example with rtol=0.1 and npre=10 I get
>
> %%%%%%%%%%%%%%%%%%%
>
> Down solver (pre-smoother) on level 2 -------------------------------
> KSP Object: (level-2) 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=10
> tolerances: relative=0.1, absolute=1e-50, divergence=10000.
> left preconditioning
> using nonzero initial guess
> using PRECONDITIONED norm type for convergence test
>
> %%%%%%%%%%%%%%%%%%%%%
>
> however when I run the code with -ksp_monitor_true_residual
> I only see the iteration info of the external ksp GMRES,
> but I do not see any iteration info relative to the subksps.
Note that each subksp has its own prefix which you can use to control
its behavior. It looks like you set this to "level-2", so (assuming
that you can have dashes in options prefixes, which I'm not completely
certain of), you should be able to do things like
-level-2_ksp_converged_reason
-level-2_ksp_monitor_true_residual
To see what's going on with the sub solver.
>
> I assume (but I am not sure) that subksp is behaving
> as the NONE norm were set.
>
> Any idea if I set something wrong?
> How do I effectively check how many iterations subksp does?
>
> thanks,
> Eugenio
>
>
>
>
>
>
>
>
>
> Eugenio Aulisa
>
> Department of Mathematics and Statistics,
> Texas Tech University
> Lubbock TX, 79409-1042
> room: 226
> http://www.math.ttu.edu/~eaulisa/
> phone: (806) 834-6684
> fax: (806) 742-1112
>
>
>
More information about the petsc-users
mailing list