[mesa-users] mesa-users Digest, Vol 51, Issue 35
David Arnett
wdarnett at gmail.com
Sun Nov 24 23:19:18 EST 2013
Hi all,
There is a dragon lurking here. Chaotic systems have the property that
slight differences in initial conditions allow the solutions to diverge
with time. Edward Lorenz found this on his SuperBee computer in 1962 or so;
he saved a dump to less than machine accuracy and rerunning it gave
significantly different answers. This was the discovery of deterministic
chaos. Does MESA have this? We hope not, but there are chaotic elements.
We know that convection is chaotic. The mixing-length theory is a steady
state approximation, probably surviving because it is a a time average
which smooths the chaotic excursions. So MESA should PROBABLY not be
chaotic, unless we have some unidentified chaos going on (with nonlinear
systems, there is no insurance they are not chaotic in some regimes).
I claim (hope?) that MESA at present should not be chaotic. It should
capture the robust AVERAGE behavior, independent of computer word length.
However this suggests that we should be sophisticated about our tests on
different platforms. Identity and statistical equivalence are not the same;
it is the latter we want. We need to be careful to distinguish between the
two.
I agree with Bill that if the word length is really the same, through all
the math packages, we should have the same answers. I suspect that this is
not the case, so we have to come to grips with the idea of ROBUST average
behavior.
Sorry not to have a clean and easy solution, but I think this is correct,
Dave
On Sun, Nov 24, 2013 at 8:56 PM,
<mesa-users-request at lists.sourceforge.net>wrote:
> Send mesa-users mailing list submissions to
> mesa-users at lists.sourceforge.net
>
> To subscribe or unsubscribe via the World Wide Web, visit
> https://lists.sourceforge.net/lists/listinfo/mesa-users
> or, via email, send a message with subject or body 'help' to
> mesa-users-request at lists.sourceforge.net
>
> You can reach the person managing the list at
> mesa-users-owner at lists.sourceforge.net
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of mesa-users digest..."
>
>
> Today's Topics:
>
> 1. Re: update on mesa platform dependency bugs: natural log
> function different on Mac 10.6.8 vs 10.8.5 (Bill Paxton)
> 2. update on mesa platform dependency bugs: natural log function
> different on Mac 10.6.8 vs 10.8.5 (Ben Brown)
> 3. Re: update on mesa platform dependency bugs: natural log
> function different on Mac 10.6.8 vs 10.8.5 (Bill Paxton)
> 4. Re: update on mesa platform dependency bugs: natural log
> function different on Mac 10.6.8 vs 10.8.5 (John ZuHone)
> 5. Re: update on mesa platform dependency bugs: natural log
> function different on Mac 10.6.8 vs 10.8.5 (Tomasz Plewa)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Sun, 24 Nov 2013 11:40:14 -0800
> From: Bill Paxton <paxton at kitp.ucsb.edu>
> Subject: Re: [mesa-users] update on mesa platform dependency bugs:
> natural log function different on Mac 10.6.8 vs 10.8.5
> To: Roni Waldman <roni181066 at gmail.com>
> Cc: mesa-users group <mesa-users at lists.sourceforge.net>
> Message-ID: <246DA20F-9DE7-4009-A26E-131E98B70586 at kitp.ucsb.edu>
> Content-Type: text/plain; charset=us-ascii
>
>
> 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
>
>
>
>
>
>
>
>
>
>
>
>
> ------------------------------
>
> Message: 2
> Date: Sun, 24 Nov 2013 14:23:53 -0600 (CST)
> From: Ben Brown <bpbrown at astro.wisc.edu>
> Subject: [mesa-users] update on mesa platform dependency bugs: natural
> log function different on Mac 10.6.8 vs 10.8.5
> To: mesa-users at lists.sourceforge.net
> Message-ID: <alpine.LNX.2.00.1311241420260.9237 at uwast.astro.wisc.edu>
> Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
>
> Bill,
> Fascinating, if that is indeed the major culprit.
>
> Are we using "fast-math" complier flags? If so, turn those off, as they
> allow more permissive (less accurate) routines for things like log, etc.
>
> (sorry, don't have a recent enough copy of MESA on my laptop to try
> myself, and bandwidth at home is very low today)
> -B
>
>
> > Message: 1
> > Date: Sat, 23 Nov 2013 14:21:27 -0800
> > From: Bill Paxton <paxton at kitp.ucsb.edu>
> > Subject: [mesa-users] update on mesa platform dependency bugs: natural
> > log function different on Mac 10.6.8 vs 10.8.5
> > To: mesa-users group <mesa-users at lists.sourceforge.net>
> > Message-ID: <BEA42B07-7367-43F8-807A-14BD9E96FC02 at kitp.ucsb.edu>
> > Content-Type: text/plain; charset="us-ascii"
> >
> > Hi,
> >
> > This is an update on the battle to get the same answers from mesa on
> different platforms.
> >
> > As you may recall this started with the test case wd_cool_0.6M failing
> on some systems in spite of succeeding on mine.
> >
> > I've been slogging away at comparing wd_cool_0.6M on my Mac with OS X
> 10.6.8 vs Ed Brown's Mac with 10.8.5 -- both running the same mesa and
> mesasdk.
> >
> > We know they give different final results, but now I'm looking to find
> where the two computations 1st start to diverge.
> >
> > And it happens very early -- I find a tiny difference already on the 2nd
> newton iteration of the 1st timestep.
> >
> > After much searching, it turns out that the log of
> 4.8099321922881207D+26 is different
> > on 10.6.8: 6.1437895404626090D+01
> > on 10.8.5: 6.1437895404626097D+01
> >
> > So who cares about that last crummy little digit?
> > But that tiny difference changes the residual for the density equation
> for cell 627,
> > and that leads tiny changes in the solutions for the densities and radii
> of nearby cells,
> > and that makes tiny changes the net and the opacities and the eos,
> > and .... if you keep going, the divergence keeps growing and spreading.
> >
> > So we really want to have zero tolerance for these differences.
> >
> > Perhaps someone knows some compiler flags that will get higher accuracy
> from the math routines?
> >
> > -Bill
> >
>
>
>
> ------------------------------
>
> Message: 3
> Date: Sun, 24 Nov 2013 12:37:03 -0800
> From: Bill Paxton <paxton at kitp.ucsb.edu>
> Subject: Re: [mesa-users] update on mesa platform dependency bugs:
> natural log function different on Mac 10.6.8 vs 10.8.5
> To: Ben Brown <bpbrown at astro.wisc.edu>
> Cc: mesa-users at lists.sourceforge.net
> Message-ID: <91401B1A-BA61-47F9-B351-BA3BCB2D3B9F at kitp.ucsb.edu>
> Content-Type: text/plain; charset="us-ascii"
>
>
> On Nov 24, 2013, at 12:23 PM, Ben Brown wrote:
>
> > Are we using "fast-math" complier flags?
>
> no, we are not using -ffast-math
> we use -O2 but hopefully that isn't turning on fast-math for us.
> I want a "slow-but-correct-math" option!
>
> BTW: you might be interested in the reply I just sent to Mike.
> it does seem like a fast-math sort of problem as you suggest.
>
> -B
>
>
>
>
> On Nov 23, 2013, at 3:07 PM, Michael Zingale wrote:
>
> > Can you reproduce it in a simple 1-line Fortran code that just computes
> that log?
> >
>
> no -- that would be too simple!
>
> when I do this at the start of a run on 10.6.8,
> write(*,1) 'log(4.8099321922881207D+26)', log(4.8099321922881207D+26)
> I get
> log(4.8099321922881207D+26)
> 6.1437895404626097D+01
> which is the same value as I get on 10.8.5 during the mesa run.
>
> during the mesa run on 10.6.8 these output lines give different story:
>
> write(*,3) 'rp13 + dr3', k, s% newton_iter, rp13 + dr3
> write(*,3) 'log(rp13 + dr3)', k, s% newton_iter, log(rp13 +
> dr3)
> write(*,3) 'log(4.8099321922881207D+26)', &
> k, s% newton_iter, log(4.8099321922881207D+26)
> write(*,*) '(rp13 + dr3) == 4.8099321922881207D+26', &
> ((rp13 + dr3) == 4.8099321922881207D+26)
>
> output:
>
> rp13 + dr3 627
> 1 4.8099321922881207D+26
> log(rp13 + dr3) 627
> 1 6.1437895404626090D+01
> log(4.8099321922881207D+26) 627
> 1 6.1437895404626097D+01
> (rp13 + dr3) == 4.8099321922881207D+26 T
>
>
>
>
> So it looks like the exact same input gives different results at different
> times during the execution.
>
> Perhaps a side-effect of not taking the required extra cycles in the math
> routines to ensure same results by doing things like clearing lower order
> bits?
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
>
> ------------------------------
>
> Message: 4
> Date: Sun, 24 Nov 2013 18:45:32 -0500
> From: John ZuHone <jzuhone at gmail.com>
> Subject: Re: [mesa-users] update on mesa platform dependency bugs:
> natural log function different on Mac 10.6.8 vs 10.8.5
> To: Bill Paxton <paxton at kitp.ucsb.edu>
> Cc: mesa-users group <mesa-users at lists.sourceforge.net>
> Message-ID: <E78AF841-B735-4391-844F-28A463EFF2C0 at gmail.com>
> Content-Type: text/plain; charset=us-ascii
>
> It seems to me that unless you're prepared to believe that all of the
> libraries that MESA depends on have been verified to that kind of accuracy
> across platforms, that you're not going to get that kind of precision.
>
> It might be reasonable to expect that from the math intrinsics from the
> compilers, but you're probably going to end up chasing differences in
> precision in the libraries.
>
> John ZuHone
> Laboratory for High-Energy Astrophysics
> NASA/Goddard Space Flight Center
> 8800 Greenbelt Rd., Mail Code 662
> Greenbelt, MD 20771
> (w) 301-286-2531
> (m) 781-708-5004
> john.zuhone at nasa.gov
> jzuhone at gmail.com
>
> > On Nov 24, 2013, at 2: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
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> ------------------------------------------------------------------------------
> > Shape the Mobile Experience: Free Subscription
> > Software experts and developers: Be at the forefront of tech innovation.
> > Intel(R) Software Adrenaline delivers strategic insight and game-changing
> > conversations that shape the rapidly evolving mobile landscape. Sign up
> now.
> >
> http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
> > _______________________________________________
> > mesa-users mailing list
> > mesa-users at lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/mesa-users
>
>
>
> ------------------------------
>
> Message: 5
> Date: Sun, 24 Nov 2013 22:54:06 -0500
> From: Tomasz Plewa <tplewa at fsu.edu>
> Subject: Re: [mesa-users] update on mesa platform dependency bugs:
> natural log function different on Mac 10.6.8 vs 10.8.5
> To: <mesa-users at lists.sourceforge.net>
> Message-ID: <5292C9DE.5010202 at fsu.edu>
> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed
>
> Hi Bill -
>
> I think you both are right. I think it is important to understand the
> root cause of such differences. But I also think the nature does not
> know much about intricacies of the floating point arithmetics. That is,
> model predictions should not depend on the last floating point digit. If
> they do, the model is not robust.
>
> Tomek
> --
> On 11/24/2013 2:40 PM, Bill Paxton 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
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> ------------------------------------------------------------------------------
> > Shape the Mobile Experience: Free Subscription
> > Software experts and developers: Be at the forefront of tech innovation.
> > Intel(R) Software Adrenaline delivers strategic insight and game-changing
> > conversations that shape the rapidly evolving mobile landscape. Sign up
> now.
> >
> http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
> > _______________________________________________
> > mesa-users mailing list
> > mesa-users at lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/mesa-users
> >
>
>
>
>
>
> ------------------------------
>
>
> ------------------------------------------------------------------------------
> Shape the Mobile Experience: Free Subscription
> Software experts and developers: Be at the forefront of tech innovation.
> Intel(R) Software Adrenaline delivers strategic insight and game-changing
> conversations that shape the rapidly evolving mobile landscape. Sign up
> now.
> http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
>
> ------------------------------
>
> _______________________________________________
> mesa-users mailing list
> mesa-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mesa-users
>
>
> End of mesa-users Digest, Vol 51, Issue 35
> ******************************************
>
--
David Arnett
Regents Professor
Steward Observatory
University of Arizona
Facts are stubborn, but statistics are more pliable. Mark Twain
Facts do not cease to exist because they are ignored. Aldous Huxley
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.mesastar.org/pipermail/mesa-users/attachments/20131124/0dbad86a/attachment.html>
More information about the Mesa-users
mailing list