Re: Fortran vs C++ for scientific computing



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


.



Relevant Pages

  • Re: Fortran vs C++ for scientific computing
    ... Blitz++ library performs better than Fortran (e.g. lattice QCD ... optimization of scientific code. ... Fortran vs C++ for scientific computing? ... F77 is a proper subset of F95. ...
    (comp.lang.fortran)
  • Re: Fortran vs C++ for scientific computing
    ... I was surfing the web looking for comparisons about Fortran vs. C++ for scientific computing. ... I've been told that Fortran compilers are the top for optimization of scientific code. ... what the experts of this newsgroup honestly think about Fortran vs C++ for scientific computing? ... So, C++ is a good choice for computer scientists who will do a lot of non-math programming, and Fortran is a good choice for a mathematical/physical scientist. ...
    (comp.lang.fortran)
  • Fortran vs C++ for scientific computing
    ... I was surfing the web looking for comparisons about Fortran vs. C++ for scientific computing. ... and from the benchmarks of the above site, it seems that C++ with Blitz++ library performs better than Fortran. ... I've been told that Fortran compilers are the top for optimization of scientific code. ... what the experts of this newsgroup honestly think about Fortran vs C++ for scientific computing? ...
    (comp.lang.fortran)
  • Re: Fortran vs C++ for scientific computing
    ... and from the benchmarks of the above site, ... Blitz++ library performs better than Fortran (e.g. lattice QCD ... optimization of scientific code. ... Fortran vs C++ for scientific computing? ...
    (comp.lang.fortran)
  • Re: What do you LISPers think of Haskell?
    ... modern CL implementations is in the same league as C and Fortran". ... in the kind of scientific computing I ...  This is where Lisp has a spectacular ... good debugging facilities if something goes wrong. ...
    (comp.lang.lisp)