[petsc-dev] ksp_error_if_not_converged in multilevel solvers

Pierre Jolivet pierre.jolivet at enseeiht.fr
Sun Oct 20 07:55:20 CDT 2019


Hello,
I’m trying to get multilevel solvers to error out when coarse levels are not converging, but I’m failing…
Could someone either tell me if this is not possible to do so, or help me find what the problem in my options is, please?
(in src/ksp/ksp/examples/tutorials)
$ mpirun -n 8 ./ex71 -pde_type Elasticity -cells 7,9,8 -dim 3 -pc_bddc_monolithic -pc_bddc_use_faces -pc_bddc_coarse_pc_type none -pc_bddc_coarse_ksp_type gmres -pc_bddc_coarse_ksp_converged_reason -pc_bddc_coarse_ksp_error_if_not_converged -ksp_converged_reason
  Linear pc_bddc_coarse_ solve did not converge due to DIVERGED_ITS iterations 1 <- I want to error out here
[…]
  Linear pc_bddc_coarse_ solve did not converge due to DIVERGED_ITS iterations 1
Linear solve converged due to CONVERGED_RTOL iterations 31
$ mpirun -np 1 ./ex1 -ksp_type gmres -pc_type gamg -ksp_converged_reason -mg_coarse_pc_type lu -mg_coarse_ksp_max_it 5 -mg_coarse_ksp_type gmres -ksp_type fgmres -mg_levels_1_ksp_type fgmres -mg_coarse_ksp_error_if_not_converged -mg_coarse_ksp_converged_reason
    Linear mg_coarse_ solve did not converge due to DIVERGED_ITS iterations 5  <- I want to error out here
[…]
    Linear mg_coarse_ solve did not converge due to DIVERGED_ITS iterations 5
Linear solve converged due to CONVERGED_RTOL iterations 3

This is probably linked with this SETERRQ1 https://www.mcs.anl.gov/petsc/petsc-dev/src/ksp/ksp/interface/itfunc.c.html#line836 <https://www.mcs.anl.gov/petsc/petsc-dev/src/ksp/ksp/interface/itfunc.c.html#line836> and the condition ksp->reason != KSP_DIVERGED_ITS.
If one just wants to run a fixed number of iterations, not checking for convergence, why would one set ksp->errorifnotconverged to true?

Thanks,
Pierre

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20191020/1640a193/attachment.html>


More information about the petsc-dev mailing list