HP Fortran Programmer's Guide (September 2007)

Compiling and linking
Compiling with the f90 command
Chapter 262
Fine-tuning optimization options
The following options allow you to fine-tune the optimization process by providing control over
the specific techniques that the optimizer applies to your program. The syntax for using these
options is
+O[no]
optimization
where
optimization
is a parameter that specifies an optimization
technique to apply to your program. The different parameters are described
below. The prefix no negates the effect of optimization.
The options do not override a specified level of optimization, nor do they imply a particular
level. To use any of these options you must also include the +O
n
option on the same command
line, where
n
specifies the level at which the type of optimization can be performed.
For example, if you find that the optimizer is causing your program to produce different
floating-point results from those produced by the unoptimized program, you could use the
following command line to suppress optimizations that affect floating-point calculations:
f90 +O3 +Onomoveflops +Ofltacc my_prog.f90
If an option is mistakenly used at a level for which the corresponding optimization is not
performed, the compiler will issue a warning message.
The defaults given in the following descriptions are in effect only at the specified optimization
levels, unless stated otherwise.
+O[no]cache_pad_common
+Ocache_pad_common can improve program performance by padding
common blocks to avoid cache collisions. Cache-line collisions occur when
the difference between the addresses of two data points is a multiple of the
cache size. By inserting empty space between large variables (for example,
arrays), the optimizer ensures that they do not start at nearby addresses,
where the possibility of a cache collision is greater. This option is only
effective at optimization level 3 or higher.
Note the following precautions when using this option:
All program modules that reference the common block must be compiled
with the +Ocache_pad_common option.
Each common block in the program should have the same layout in all
program units within which it is declared. If the layouts are different,
they must be fully independent—that is, they must not pass values
between them.
The default, +Onocache_pad_common, disables padding.