[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: FORTRAN implementation in Lenny



On 2/21/2010 4:44 PM, Fuentes, Adolfo wrote:
     ]$ gcc -O3 -lm -march=nocona -o nbody.x nbody.c
     ]$ time ./-o nbody.x 50000000
          Energy 0: -0.169075164
          Energy 1: -0.169059907
          Elapsed time: 1m 17.4s

     ]$ f95 -O3 -lm -march=nocona -o nbody.x nbody.f90
     ]$ time ./nbody.x 50000000
          Energy 0: -0.169075164
          Energy 1: -0.169059907
          Elapsed time: 2m 31.7s

     ]$ g95 -O3 -lm -march=nocona -o nbody.x nbody.f90
     ]$ time ./nbody.x 50000000
          Energy 0: -0.169075164
          Energy 1: -0.169059907
          Elapsed time: 1m 40.3s


gcc is "highly"* optimized, the g95 compiler would have similar optimizations, because they share back ends. The Intel compiler should beat it, however, if you are very familiar with Intel architecture, and are willing to learn the ins and outs. I'm not personally acquainted with other compilers, so can't answer questions about them.

(And my FORTRAN days are behind me. I can only answer in these general terms. I hope someone else can be more specific.)

Hope this helps,

Mark Allums


*It's been losing ground in some areas, last few releases. gcc has emitted-code-performance regressions due to tighter requirements with floating-point precision and its corresponding standards for some architectures; the g++ people are working-in new code for the upcoming c++ standard. It's always a work in progress. As long as gcc can compile and ld link working Linux kernels, though, most people will be happy.





Reply to: