Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Why is Fortran running much slower on Linux?

  1. Oct 6, 2012 #1
    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. Im 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 thats 1.4ghz for the program. I understand this is a gross simplification, but I just dont understand how there can be 100-150% discrepancy. Linux and programming newb btw, so feel free to suggest some obvious thing I'm missing.
  2. jcsd
  3. Oct 6, 2012 #2


    User Avatar
    Science Advisor

    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.

    Last edited: Oct 7, 2012
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook