[MacPorts] #69108: gfortran-mp-13: gfortran-compiled binary randomly gives right or wrong outcome
MacPorts
noreply at macports.org
Mon Jan 15 15:14:35 UTC 2024
#69108: gfortran-mp-13: gfortran-compiled binary randomly gives right or wrong
outcome
-----------------------+--------------------
Reporter: tpcklaver | Owner: (none)
Type: defect | Status: new
Priority: Normal | Milestone:
Component: ports | Version: 2.8.1
Keywords: | Port: gcc13
-----------------------+--------------------
I have a piece of f90 research code that I've compiled on an M2 Pro Apple
Silicon Macbook, running macOS Sonoma 14.2.1, Xcode 15.2. I've compiled it
with gfortran-mp-13, part of gcc-13, which was installed with MacPorts
2.8.1.
About half the time the binary produces the right outcome (checked against
the same code compiled with gfortran on an Intel Macbook), about half the
time it produces a wrong outcome (but always the same wrong outcome, it's
wrong but not random noise). This random alternating happens when running
the same calculation with the same input in the same working directory
with the same binary like 10 times in a row.
As it works fine with a gfortran-compiled binary on an Intel Macbook, I
wonder if the gfortran portion of gcc-13 on Apple Silicon has a problem.
Then again, I also tried with gfortran from Homebrew on my Apple Silicon
Macbook, and there I had the exact same problem, sometimes the binary
gives the right outcome, sometimes the wrong outcome. I guess this may
indicate a more generral problem in gfortran on Apple Silicon, not
necessarily the MacPort port of it?
I attach an archive to this ticket that contains the f90 source code
(Aneto, a code to determine elastic interaction energy between periodic
defect images), two input files (OUTCAR, input_elast) for a test case, and
the binary I compiled. The calculation is run by simply running the binary
from a directory containing the two input files. If the calculation goes
right, the outcome contains a line
Delta E = 1.65765823 eV
If it goes wrong, the outcome contains a line
Delta E = 0.137904249 eV
If anyone can make sence of this, please let me know.
--
Ticket URL: <https://trac.macports.org/ticket/69108>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list