-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IEEE invalid operation when checking for central body collision #20
Comments
I reproduced this using the supplied initialization files. My system:
mercury 6 stdout/stderr:
|
Added flag -ffpe-trap=invalid:
|
Ran again with the custom parameter files supplied by @tobiscode.
Note that algor = 10 (HYBRID) is specified in the custom param.in. Something is wrong with the collision with central body logic. One other thing although not related to this issue. The calculations specific to algor=11 look suspicious. Uninitialized arrays are used in calculations. Assumed to be zero? Bad practice. My customized source files used for tracing are attached - ZIP of 2 files: mercury6_2.for and mercury.inc. I added a tracing flag which controls whether or not to trace. Once this bug is fixed, the customization isn't really needed. |
Ran again with the custom parameter files supplied by @tobiscode. but mercury6 continued to the end without issues. Note that when algor=HYBRID, this display appears before the program crash: In summary,
It could be that @tobiscode tried a combination of parameters with algor=HYBRID that makes no sense (I am not qualified to judge). If that is true, then, optimally, the initialization code should be amended to diagnose such combinations. Needs an astrophysicist, I believe. Clearly this early 1990s Fortran code was written to be used by scientists who would first check their parameters should a crash occur. |
@tobiscode, @texadactyl, Hi guys!
Celestial mechanics specialist, to be precise ;-) |
@idovgalyov-4xxi See? I didn't event know who the right fixer would be! (=: |
@tobiscode |
Hi, |
Hi all,
I sometimes stumbled across the following warning message when running Mercury:
Note: The following floating-point exceptions are signalling: IEEE_INVALID_FLAG
With not much more to go on, I added the gfortran compiler flag
-ffpe-trap=invalid
(and removed-O2
as otherwise the debugger didn't shoe the correct line) to find the problem: calling acos() for an undefined value. Here is the part (line 963 in mercury6_2.for):u0 = sign (acos((1.d0 - r0/a )/e), rv0)
I then added some debug output to check the values of r0, a, e and rv0 right before the error:
I run large suites of simulations, keeping big.in the same but having randomized particles in small.in, so every run is slightly different, and it doesn't happen in most runs. I attached the initial conditions for a sample run where the bug does occur.
A possible solution is referenced in #18, but it's probably not the best way as it masks possible other bugs as was pointed out.
Cheers
The text was updated successfully, but these errors were encountered: