Re: question about efficiency of fortran in parallel environments
- From: "James Giles" <jamesgiles@xxxxxxxxxxxxxxxx>
- Date: Fri, 27 May 2005 19:25:40 GMT
C used to be provably slower than Fortran, just on theoretical grounds.
That is, it was possible to write compilers for Fortran that could
regularly make optimizations that simply could not be applied to
the corresponding C code. Of course, not all Fortran compilers
made full use of these possibilities. So, it has always been true
that an occasional really good C implementation might beat
the occasional really bad Fortran on corresponding code.
Some of this you could code around by writing the optimizations
yourself (forcing a given code order by making it explicit in C, for
example). This had the disadvantage that different optimizations
may be better on different platforms and your hand optimized C
would have to be rewritten as you port.
Fortran's default behavior is to allow the compiler more flexibility
while C's default behavior (and, until the C99 standard, the *only*
way) does not. With modern C is is possible to carefully write code
that matches Fortran for the "optimizability" of your program. However,
most C (or C++, etc.) programmers still don't use such techniques and
those compilers that recognize the new features may still not fully
optimize based upon them.
All of this ignores the more subjective issues of programming style
that Rich Maine mentioned.
--
J. Giles
"I conclude that there are two ways of constructing a software
design: One way is to make it so simple that there are obviously
no deficiencies and the other way is to make it so complicated
that there are no obvious deficiencies." -- C. A. R. Hoare
.
- References:
- question about efficiency of fortran in parallel environments
- From: Randall Mackie
- question about efficiency of fortran in parallel environments
- Prev by Date: Re: Troubles with some IMSL routines (eg EVLRG, and some other)
- Next by Date: advance="no" not portable
- Previous by thread: Re: question about efficiency of fortran in parallel environments
- Next by thread: Re: question about efficiency of fortran in parallel environments
- Index(es):
Relevant Pages
|