[mesa-users] update on mesa platform dependency bugs: natural log function different on Mac 10.6.8 vs 10.8.5

Robert Izzard izzard at astro.uni-bonn.de
Mon Nov 25 04:26:11 EST 2013


Dear Bill, Dave, et al.

Normally I lurk here, but this is something I've tackled in the past so maybe I can help...

> I agree with Bill that if the word length is really the same, through all
> the math packages, we should have the same answers. 

When working on the BINSTAR code in Brussels, I had similar problems. The same executable on different PCs would often be different (probably because shared libraries were slightly different, etc. but who really knows).

In my experience, the *only* "robust" way to detect what is going on is to drop to -O0 with *all* the mathematical optimisations turned off, and all the IEEE compliance flags turned on (gcc/gfortran has quite a few of them, "-fp-model strict" I vaguely remember but it might have changed in more recent versions) and remember to trap the floating point exceptions. You can then bisect the problem by turning optimisation flags back on one by one, rather than a blanket -O2 which turns on lots of things. There is no other way I am afraid - if you think this 15th decimal place is really the problem. [The bisect should be automated - there are tools for this (e.g. the Linux kernel has them I think) but I've never used them, sorry.]

But... I agree with Dave (I think it was) that if the result depends on this kind of accuracy then you're in trouble, and you're possibly asking for the impossible. It might be good to do some kind of ensemble analysis to determine the stability of your simulation w.r.t. the initial conditions (which reminds me of my days at the Met Office!). This is a routine technique e.g. in weather forecasting, e.g. http://www.wetterzentrale.de/pics/MT2_Essen_ens.png :-)

cheers
rob




More information about the Mesa-users mailing list