Why is Fortran running much slower on Linux?

  • Context: Fortran 
  • Thread starter Thread starter Rotarman
  • Start date Start date
  • Tags Tags
    Fortran Linux Running
Click For Summary
SUMMARY

The discussion highlights significant performance discrepancies when running a Fortran95 program on different operating systems and hardware configurations. A program that takes 22 minutes on a Windows laptop with an i7 2.0GHz processor takes over 50 minutes on a RedHat system with a 2.8GHz Pentium 4. The difference is attributed to the varying MIPS (Million Instructions Per Second) capabilities of the CPUs, where the i7 can achieve approximately 60,000 MIPS compared to the P4's 8,000 MIPS. Compiler optimization also plays a crucial role in performance, affecting the execution speed based on the specific mix of instructions utilized.

PREREQUISITES
  • Understanding of Fortran95 programming
  • Familiarity with Linux command line operations
  • Knowledge of CPU architecture and performance metrics (MIPS)
  • Experience with compiler optimization techniques
NEXT STEPS
  • Research "Fortran compiler optimization flags" for gfortran
  • Learn about CPU performance metrics and benchmarking tools
  • Explore differences between Windows and Linux Fortran environments
  • Investigate multi-threading capabilities in Fortran programs
USEFUL FOR

This discussion is beneficial for Fortran developers, system administrators, and performance engineers looking to optimize code execution across different operating systems and hardware configurations.

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.
 
Technology 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:

Similar threads

  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 8 ·
Replies
8
Views
6K
  • · Replies 3 ·
Replies
3
Views
5K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
6K
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 9 ·
Replies
9
Views
9K