Why is Fortran running much slower on Linux?

  • Context: Fortran 
  • Thread starter Thread starter Rotarman
  • Start date Start date
  • Tags Tags
    Fortran Linux Running
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
1 reply · 3K views
Rotarman
Messages
3
Reaction score
0
I have a Fortran95 program that I run on my Windows laptop (i7 2.0Ghz); its in serial, so its running on one thread, which seems consistent with task manager results (12.5% processor usage), so I figure it should be using ~1 ghz. I am compiling using the standard one that came with my F95 download and it takes about 22 minutes. Now I'm trying to run it on a RedHat computer; I just use the terminal to compile it (>gfortran FileName) then run it in the terminal and it takes more than 50 minutes. I poked around and found out its 2.8 Ghz pentium 4 in there. The system monitor says 100% usage for one core (which I assume is the hyperthreading), so by my rudimentary math that's 1.4ghz for the program. I understand this is a gross simplification, but I just don't understand how there can be 100-150% discrepancy. Linux and programming newb btw, so feel free to suggest some obvious thing I'm missing.
 
Physics news on Phys.org
There's lot of variables there, different computers and different compilers, but your results seem to be fairly close to what I'd expect.

The MHz figure of a cpu is no longer a very good indicator of its speed in terms of instructions per second. The data here (see link) suggests a quad core i7 at 2GHz would be about 60,000 MIPS and the P4 at 2.8GHz about 8,000 MIPS. Even if using only one of the four cores the i7 would have about double the MIPS.

The actual number of MIPs that a cpu can achieve depends upon the exact mix of instructions, and different compilers have different capability to optimize the exact mix (and ordering) of instructions for best result on a particular target processor. So you could potentially get an even larger speed difference, depending on the code.

http://en.wikipedia.org/wiki/Instructions_per_second
 
Last edited: