Re: Fortran vs C++ for scientific computing
- From: "robin" <robin_v@xxxxxxxxxxx>
- Date: Fri, 24 Mar 2006 21:29:16 GMT
Kobe wrote in message ...
I was surfing the web looking for comparisons about Fortran vs. C++ for
scientific computing.
I found this:
<http://osl.iu.edu/~tveldhui/papers/DrDobbs2/drdobbs2.html>
and from the benchmarks of the above site, it seems that C++ with
Blitz++ library performs better than Fortran (e.g. lattice QCD
benchmark, etc.).
Well, not really. Some of the tests are invalid.
For example, take the Fortran subroutine relating to Figure 5.
This subroutine consists of three nested loops for handling 3-D arrays.
The actual operation required was matrix multiplication.
The control variables for all the loops, and consequently the
subscript references to the arrays, are all REAL.
There are 15 conversions from REAL to INTEGER in the innermost loop.
The author complains of register spillage. No wonder!
Then in the C++ version, vectors are used, with one loop and one subscript.
No wonder that the Fortran code ran slow.
On the other side, I've been told that Fortran compilers are the top for
optimization of scientific code.
My question is: what the experts of this newsgroup honestly think about
Fortran vs C++ for scientific computing?
Are the two languages both very good for scientific computing? Is
Fortran better than C++, or vice-versa, and *why* ?
What languages importan scientific organizations (e.g. NASA, CERN) use
for their scientific code?
I was going to learn Fortran 77 because I've been told that:
- Fortran compilers give top performances when compiling scientific code
(better e.g. than C++);
- there are lots of Fortran scientific routines tested and widely used.
[I already know C++, even if I'm not a guru of this language.]
What do you think about these points, too?
Thanks very much for your time and your contributions.
Best regards,
Kobe
.
- References:
- Fortran vs C++ for scientific computing
- From: Kobe
- Fortran vs C++ for scientific computing
- Prev by Date: Re: Converting fixed-to-free format
- Next by Date: Re: Fortran vs C++ for scientific computing
- Previous by thread: Re: Fortran vs C++ for scientific computing
- Next by thread: how to eleminate the spurious ??
- Index(es):
Relevant Pages
|