[petsc-dev] handling user domain errors

Barry Smith bsmith at mcs.anl.gov
Fri May 1 19:32:15 CDT 2015

> On May 1, 2015, at 6:43 PM, Jed Brown <jed at jedbrown.org> wrote:
> Barry Smith <bsmith at mcs.anl.gov> writes:
>>   1) This simplifies the needed code since we won't need to put
>>   checks all over the place on returns about failure nor do we need
>>   to worry about propagating errors from one process to another
>>   (since the Nan/Inf get moved by the MPI_Allreduce()).
> My concern is that -fp_trap will become a lot less useful.

  I agree there is a tradeoff; but under "normal" circumstances where there are no Nan or Inf around (which I think is most of the time) -fp_trap will be just as useful as now. For the other cases the user will have to have some idea where (and when) in the code to turn on the trapping to catch the "true" problems.


  The only other way I see to do it is carry a validity flag around with each vector and reduce that flag in all the vector reductions; but this alone is not enough we would also have to have some propagation code for things like zero pivot, for example setting a validity flag in the Mat factor (saying the factor is not valid) and propagating up those flags. We get all these things "for free" with the Inf Nan approach.


More information about the petsc-dev mailing list