[Users] GRHydro: NaN checks

Christian D. Ott cott at tapir.caltech.edu
Mon Jul 19 09:04:20 CDT 2010


Hi,

On Mon, Jul 19, 2010 at 08:43:00AM -0500, Frank Loeffler wrote:
>
> I agree with Erik that if they affect performance that much we should
> protect them with #defines, but leave them in the code - even if this
> clutters it. They are much easier to put back in by setting a #define
> than by putting them all in back by hand. They can help quite a bit when
> you know that there are NaNs produces somewhere in GRHydro and you want
> to know quickly where and why.

they don't do that. 

(a) They are not general -- i.e., in Prim2Con, there is a check on
the lorentz factor and on dens, but that's it (it's even redunant!).
This test won't tell you if there is a nan in another var.

(b) They are only in some parts of the code (i.e., the parts that
the person who needed them was using).

(c) They don't tell you 'quickly where and why'. If you get an error 
    message like:

   call CCTK_WARN(GRHydro_NaN_verbose, 
     "c2p failed and being told not to reset the pressure")

    Do you have any clue what happened? You are not even being told
    where (what physical location; what reflevel).

Of course, one could spend one's life making these messages better.
But we are paid for doing science, not for writing foolproof code.

I maintain that there is no point in having such messages.  They don't
help -- if you catch yourself a NaN (like I did yesterday!), you still
have to go in and do old-fashioned debugging to see what is going on.

Since we are not reaching a conclusion via e-mail, I would like
to discuss this in today's call.

 - Christian 








More information about the Users mailing list