UW AMath High Performance Scientific Computing
 
AMath 483/583 Class Notes
 
Spring Quarter, 2011

Table Of Contents

Previous topic

Optimizing code

Next topic

Debugging and debuggers

This Page

Optimizing Fortran

Several simple examples are given in $CLASSHG/codes/fortran/optimizing.

See Rotating particles and Fortran efficiency and $CLASSHG/codes/fortran/particles for some other examples.

Compiler such as gfortran can automatically perform some optimizations. The level of optimization is typically denoted by the -O flag, and -O3 is commonly used. See Rotating particles and Fortran efficiency for examples of this in action, including a case where using -O3 makes the code run slower, which can happen.

But there are many sorts of optimizations that the compiler cannot do for you, where some care in coding can make the program run much faster.

Further reading