Re: forall and do loop
- From: highegg <highegg@xxxxxxxxx>
- Date: Fri, 27 Jul 2007 09:55:51 -0000
On Jul 27, 10:29 am, aeroguy <sukhbinder.si...@xxxxxxxxx> wrote:
Ok thanks... I like the easier-to-read concept!! okay then i will
proceed with that and complete the coding and also begin looking for
a good freeware profiler tool to look into the bottlenecks. Any
suggestions in this regard.
For gfortran there's -pg option for profiling run and gprof for
parsing the output and building statistics.
Note that the Heisenberg uncertainty principle holds for profiling -
profiling itself affects the optimized program (and disables some
optimizations), so it's never a perfect measurement, but it's
certainly useful to get an idea where most of the time is being spent.
Commercial compilers (Intel, EkoPath) even offer the possibility to
use the profiling information for subsequent optimizations, which is
potentially very powerful approach.
So from the discussion i conclude that coding style is not relevant in
some extent for code optimization and i can use the easier-to-read
concept and let the complier take care of the rest and if there are
some bottlenecks then i can use highegg's suggestions.
Not so long ago, I thought the same way as you - that I should develop
a Fortran coding style that will make my programs automatically well-
optimized. By this newsgroup and subsequent own experiences I was
taught differently. My code looks simpler and
more elegant now, and even the coding is more fun :)
On one project (propeller aerodynamics), I have also wasted my time
for an experiment - I developed two versions of the code, one using
assumed shape arrays and array results and expressions and all that
performance-dangerous stuff, other using assumed size arrays with
storage associations and explicit loops and such stuff. In the end,
the running times were differing by 1.5% at most, and the "optimized"
code looked fairly more clunky (particularly using assumed size +
storage association instead of assumed shape+sections) and took more
time. On the other optimizing the real bootleneck (a numerical
integral evaluation) reduced runtime by 50% afterwards.
After that, I was convinced of the "Knuth's law".
.
- Follow-Ups:
- Re: forall and do loop
- From: Richard Edgar
- Re: forall and do loop
- From: Tobias Burnus
- Re: forall and do loop
- References:
- forall and do loop
- From: aeroguy
- Re: forall and do loop
- From: glen herrmannsfeldt
- Re: forall and do loop
- From: aeroguy
- Re: forall and do loop
- From: highegg
- Re: forall and do loop
- From: aeroguy
- forall and do loop
- Prev by Date: Re: forall and do loop
- Next by Date: Re: forall and do loop
- Previous by thread: Re: forall and do loop
- Next by thread: Re: forall and do loop
- Index(es):
Relevant Pages
|