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

Roni Waldman roni181066 at gmail.com
Mon Nov 25 04:06:19 EST 2013


Hi Bill,
You might disagree, but isn't that exactly what you experienced, i.e. same
operation giving different results on different machines?

What I am saying is that this is well known, to my experience, and other
people I've asked also experienced in numerical coding.
I'm not an expert on inner workings of processors, but as far as I
understand, the standard practice is for the machine to optimize
computation speed, also by varying the order of operations, which in fact
might alter the last bit of the result.
This is even true for multiplication.
There might be, depending on the compiler, flags which prevent this
behavior, but they'll probably slow down computation a great deal.
I will be happy to learn that I'm wrong.

In the case I'm not, I don't think you're in deep-deep trouble, just in
deep trouble as anyone who deals with numerical computation. :)
You're only in deep-deep trouble if the result of a computation varies on a
macroscopic scale depending on machine.
That would mean your algorithms are unstable to small perturbations.
I don't think this is the case for mesa.

On the other hand you will sometimes encounter annoying cases, where some
bug causing the code to crash would only manifest itself on some machines,
because these small numerical differences.
To my knowledge this is unavoidable.

Cheers,
Roni



On Sun, Nov 24, 2013 at 9:40 PM, Bill Paxton <paxton at kitp.ucsb.edu> wrote:

>
> Hi Roni,
>
> Thanks for the input -- but I disagree!
> It will be useful to explore these points in detail, since if you're
> right, then I'm in deep-deep trouble.
>
>
> On Nov 24, 2013, at 1:09 AM, Roni Waldman wrote:
>
> > Hi Bill,
> > As you probably know, the accuracy of double precision real is 15
> significant digits, so the difference you detect between the platforms is
> expected and unavoidable.
>
> I disagree
>
> > You can't expect getting the exact same result in a MESA run on
> different platforms.
>
> I disagree
>
> > The best you can do is strive to avoid crashes by checking on various
> platforms and fixing bugs that get caught that way.
>
> I disagree
>
>
>
> Double precision is a specific format of 64 bits, and I see no reason why
> the different platforms given identical 64 bit input shouldn't give exactly
> the same 64 bit output for a well defined math function like log any more
> than I'd be happy with different answers for multiply or divide -- the
> answer is known damn it, there is no question about what it should be once
> you pick a standard rule for round-off (IEEE standards e.g.).   It may be
> that the operation will take slightly longer to compute in order to get the
> correct 64 bit answer, and some folks may be willing to give up accuracy
> for speed, but I certainly am not when it comes to MESA.
>
> In the past I've myself been guilty of waving off such cross platform
> differences as expected and unavoidable.  But MESA has reached a point
> where I don't think that it is still a viable option -- I just can't hope
> to make the code robust and reliable if the results vary across platforms
> like they do now.    I need to be able to develop and debug on one platform
> and have high confidence that once it works on that one it will work
> precisely (bit-for-bit) the same on a reasonable set of other platforms too
> -- for example, all platforms supported by the mesasdk.
>
> If that's impossible, I'd like to understand why it is at a deeper level
> than "we've tried, but we've never been able to make it work".
>
> Cheers,
> Bill
>
>
>
>
>
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.mesastar.org/pipermail/mesa-users/attachments/20131125/2cb4a26e/attachment.html>


More information about the Mesa-users mailing list