This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: -ffast-math and gfortran


On Sun, Jun 04, 2006 at 02:43:15PM -0700, Steve Kargl wrote:
>On Sun, Jun 04, 2006 at 05:37:55PM -0400, Iwan Kawrakow wrote:
>> 
>>> What bothers me about all this discussion on -ffast-math is
>>> what is the driver for using it?  What is the percentage gain
>>> in execution speed?  Is it really that important that a
>>> computation gets done in 30 minutes rather than 35 minutes?
>>> 
>>
>> my group spends on average ~$20k/year to keep our computing
>> cluster up do date. -ffast-math gives ~10% faster execution for
>> our type of problem (Monte Carlo simulation of coupled electron-
>> photon transport). I.e., -ffast-math is worth ~$2000/year to us.
>> 
>
>How much are correct answer worth?

If the errors are small enough to be within an acceptable range,
then you may be able to live with them, obviously.
Incorrect answers OTOH are completely worthless.
Be it gcc's -ffast-math or overdoing it with -rcd -complex-limited-range
-you-name-it with other compilers, it doesn't buy you anything if you
get a wrong answer, even if you get it fast.

-- 
$ echo -e "\twrite(*,*) \"42\"\n\tend" | gfortran_ -o 42 -x f95 - && \
time ./42
Warning: Reading file '<stdin>' as free form.
 42

real	0m0.003s
user	0m0.000s
sys	0m0.003s


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]