[petsc-users] KSP no longer returning NaNs?

Sean Farley sean at mcs.anl.gov
Wed Jul 25 18:35:00 CDT 2012


>> This is probably the main complaint:
>>
>> http://petsc.cs.iit.edu/petsc/petsc-dev/rev/7d6f5cbe67bc
>
> Thanks, Jed.  The trace is below.  Indeed, a call to VecNorm exits with an
> error, where previously it would have returned the NaN.   So this may be in
> user code before handing b off to the KSP object.
>
> Is there an alternative, recommended way to ask a PETSc vector if it has
> NaNs without causing an abort?

You mention in your first email that checking for NAN is due to your
timestep; perhaps an alternative route would be to use the newer TS
code which has some adaptive options, namely:

  -ts_max_snes_failures <1>: Maximum number of nonlinear solve
failures (TSSetMaxSNESFailures)
  -ts_max_reject <10>: Maximum number of step rejections before step
fails (TSSetMaxStepRejections)
  -ts_adapt_dt_min <1e-20>: Minimum time step considered (TSAdaptSetStepLimits)
  -ts_adapt_dt_max <1e+50>: Maximum time step considered (TSAdaptSetStepLimits)
  -ts_adapt_scale_solve_failed <0.25>: Scale step by this factor if
solve fails ()

But this only addresses your issue in the case of adjusting the time
step (perhaps you test for NAN for more reasons). Just a thought.


More information about the petsc-users mailing list