I don't think there's any good answer that has a lifetime longer than the
current version of the compiler you're using.
The best rule is simply: write high-level code and don't use tricks. For
example, use whole array ops rather than DO loops wherever possible. If you
mean x**3 don't write x*x*x.
Quite a lot of the features that are in Fortran 9x are there to make this
possible. Even now, not all Fortran compilers optimize everything perfectly,
but I think recent benchmarks have proved that switching from F77
circumlocutions to F9x usually produces faster code.
I could give you a history of attempts to out-guess the optimizer. You can
often beat it in the short run, but if you are doing something useful,
Fortran optimizer technology will soon catch up and your tricks can end up
slowing you down, besides making your code less portable.
= Loren P Meissner
-----Original Message-----
From: [log in to unmask]
[mailto:[log in to unmask]] On Behalf Of Gerd Bruno
Rocha
Sent: Saturday, September 02, 2000 12:03 PM
To: [log in to unmask]
Subject: books for F90
Hi all,
Does anybody indicate me any text (books, papers or internet address)
about optimization techniques for Fortran 90 code? The basic question
is: how I can write a Fortran code efficiently?
Thanks in advance,
--
Gerd Bruno
DQF - UFPE
www.dqf.ufpe.br
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|