Re: Speed Test between C and Fortran 95
- From: nospam@xxxxxxxxxxxxx (Richard E Maine)
- Date: Wed, 30 Nov 2005 10:42:12 -0800
Paul Van Delst <Paul.vanDelst@xxxxxxxx> wrote:
> awgreynolds@xxxxxxxxxxxxx wrote:
> > Oops! I didn't read your post carefully enough since it looks like you
> > already tried row/column reversal.
>
> But he followed that comment with "but still the speed [for Fortran95
> code] was the same".
> In my, albeit limited, experience, I have never seen row/column reversal
> to the "correct", contiguous order for Fortran *NOT* speed up the code
> significantly. The lack of speed-up makes me suspicious (but not
> suspicious enough to actually unpack and inspect the code... :o)
I have neither the time right now nor the inclination to delve into the
particular code in question deeply. I will note that there are certainly
times when changing the order makes negligable difference. For example,
that can happen if the arrays in question are small enough or if
something unrelated dominates timing (I've seen people try timing
analysis while having formatted I/O in the innermost loop :-().
But assuming this is a case where it really should matter... It sounds
really stupid, but I do not mean it as an insult. I have personally made
the mistake myself.... of editing code, but then failing to use the
edited version. There are actually quite a lot of ways that can happen,
such as 1) specifying the wrong file name when invoking the compiler, 2)
forgetting to recompile after editing, 3) forgetting to save the edited
file before recompiling, 4) quite an amazing number of other ways. I'm
not saying that this happened, but it is one kind of thing to
double-check if you seem to be getting no change in results when a
change is really strongly expected.
I'll also note that all generalizations are false. :-) And that this
certainly includes the generalization that "Fortran [is/is not] faster
than C." There can be several reasons to recode something in a different
language, but I wouldn't suggest undertaking a huge Fortran/C conversion
(in either direction) solely based on a generalization about language
speed, without specific reason to believe that the code in question
would benefit substantially. On the other hand, if the code really runs
for multiple tens of hours, perhaps a modest investment in
experimentation is worthwhile anyway.
--
Richard Maine | Good judgment comes from experience;
email: my first.last at org.domain| experience comes from bad judgment.
org: nasa, domain: gov | -- Mark Twain
.
- References:
- Speed Test between C and Fortran 95
- From: BornAgainFortraner
- Re: Speed Test between C and Fortran 95
- From: awgreynolds
- Re: Speed Test between C and Fortran 95
- From: awgreynolds
- Re: Speed Test between C and Fortran 95
- From: Paul Van Delst
- Speed Test between C and Fortran 95
- Prev by Date: Re: Speed Test between C and Fortran 95
- Next by Date: Re: Speed Test between C and Fortran 95
- Previous by thread: Re: Speed Test between C and Fortran 95
- Next by thread: Re: Speed Test between C and Fortran 95
- Index(es):