Replies: 1 comment 1 reply
-
|
@johnmauff Have you tried There is probably merit in replacing |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Recently, when I compared the ocean.stats file for the double-gyre test case, I discovered that there is not a bit-4-bit agreement between the AMReX versions of the code and the Fortran. After some investigation, I narrowed it down to the following lines of code from the routine PPM_limit_pos from MOM_continuity_PPM.F90
The AMReX equivalent is
I was using the GCC compiler with a '-02' flag, which, as I learned, allows FMA. So I deactivated FMA by using the flag:
'-O2 -ffp-contract=off'. Strangely, Fortran and C++ still did not match. So I decided to be more specific about the order of operation, and rewrote the Fortran and C++ to be
Finally, with FMAs deactivated, I got the Fortran and C++ to match. However, when I turned FMA back on, neither Fortran nor C++ matched. Furthermore, even the original Fortran with the **2 operator and the modified Fortran did not match. So this creates a couple of problems/questions:
(1). Currently, we do not have a way to reproduce the original Fortran results in C++. Is this a problem, or does this fall into the category that different compilers will have unavoidable bit-rounding differences?
(2). I expect that the differences in floating point results for Fortran and C++ are well known to the E3SM group that did the Kokkos port of CAM. Can we leverage their knowledge base to match Fortran and C++
(3). Do we potentially sacrifice performance to match Fortran results, or should we just use some compatibility mode to simplify the verification of new AMReX functions?
Beta Was this translation helpful? Give feedback.
All reactions