[petsc-users] [KSP] PETSc not reporting a KSP fail when true residual is NaN

Mark Adams mfadams at lbl.gov
Fri Feb 25 18:03:59 CST 2022


On Fri, Feb 25, 2022 at 4:00 PM Giovane Avancini via petsc-users <
petsc-users at mcs.anl.gov> wrote:

> Mark, Matthew and Barry,
>
> Thank you all for the quick responses.
>
> Others might have a better idea, but you could run with '-info :ksp' and
> see if you see any messages like "Linear solver has created a not a number
> (NaN) as the residual norm, declaring divergence \n"
> You could also run with -log_trace and see if it is
> using KSPConvergedDefault. I'm not sure if this is the method used given
> your parameters, but I think it is.
>
> Mark, I ran with both options. I didn't get any messages like "linear
> solver has created a not a number..." when using -info: ksp. When turning
> on -log_trace, I could verify that it is using KSPConvergedDefault but what
> does it mean exactly?
>

It was not clear to me where the check was done and as Barry said it is
done in the FGMRES iteration, and not in the separate common function
KSPConvergedDefault, and that is where the bug was. (-log_trace prints a
message when you enter and exit a method so it is a quick way to see where
you are) So nevermind.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20220225/3b45d000/attachment-0001.html>


More information about the petsc-users mailing list