[petsc-dev] -ksp_error_if_not_converged

Pierre Jolivet pierre at joliv.et
Sun Aug 8 07:42:43 CDT 2021


Hello,
I’d like to trigger an error if a linear solve does not converge due to DIVERGED_ITS.
Since this MR https://gitlab.com/petsc/petsc/-/merge_requests/1294 <https://gitlab.com/petsc/petsc/-/merge_requests/1294>, no error is triggered anymore if ksp->reason == KSP_DIVERGED_ITS.
This seems to be inconsistent with -snes_error_if_not_converged.
Is there a workaround? Shouldn’t this be clarified in the manual page?

Thank you,
Pierre

$ src/ksp/ksp/tutorials/ex1 -ksp_max_it 1 -ksp_converged_reason -ksp_error_if_not_converged && echo "No error"
Linear solve did not converge due to DIVERGED_ITS iterations 1
KSP Object: 1 MPI processes
  type: gmres
    restart=30, using Classical (unmodified) Gram-Schmidt Orthogonalization with no iterative refinement
    happy breakdown tolerance 1e-30
  maximum iterations=1, initial guess is zero
  tolerances:  relative=1e-05, absolute=1e-50, divergence=10000.
  left preconditioning
  using PRECONDITIONED norm type for convergence test
PC Object: 1 MPI processes
  type: jacobi
    type DIAGONAL
  linear system matrix = precond matrix:
  Mat Object: 1 MPI processes
    type: seqaij
    rows=10, cols=10
    total: nonzeros=28, allocated nonzeros=50
    total number of mallocs used during MatSetValues calls=0
      not using I-node routines
Norm of error 2.95296, Iterations 1
No error
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20210808/12dcd835/attachment.html>


More information about the petsc-dev mailing list