110
POWER7 and Optimization and Tuning Guide
6.2.2 XL compiler family
There are several XL compiler programming errors that can provide guidance
toward optimization.
Prerequisites
The XL compilers assists with identifying certain programming errors that are outlined 6.2.1,
“Common prerequisites” on page 109:
Static analysis/warnings: The XL compilers can identify suspicious code constructs, and
provide some information about these constructs through the
-qinfo=all
option. You
should examine the output of this option to identify suspicious code constructs and
validate that the constructs are correct.
Runtime analysis or warning: The XL compilers can cause the application to perform
runtime checks to validate program correctness by using the
-qcheck
option. This option
triggers a program abort when an error condition (such as a null pointer dereference or
out-of-bounds array access) is run, identifying a problem and making it easier for you to
identify it. This option has a significant performance cost, so use it only during functional
verification, not on a production environment.
Aliasing compliance: The C, C++, and Fortran languages specify rules that govern the
access of data through overlapping pointers. These rules are brought into play
aggressively by optimization techniques, but they can lead to incorrect results if they are
broken. The compiler can be instructed not to take advantage of these rules, at a cost of
runtime performance. This situation can be useful for older code that is written without
following these rules. The options to request this optimization are
-qalias=noansi
for
C/C++ and
-qalias=nostd
for Fortran.
High-order transformations
The XL compilers have sophisticated optimizations to improve the performance of numeric
applications. These applications often contain regular loops that process large amounts of
data. The high-order transformations (HOT) optimizations in these compilers analyze these
loops, identify opportunities for restructuring them to improve cache usage, improve data
reuse, and expose more instruction-level parallelism to the hardware. For these types of
applications, the performance impact of this option can be substantial.
There are two levels of aggressiveness to the HOT optimization framework in these
compilers:
Level 0, which is the default at optimization level
-O3
, performs a minimal amount of loop
optimization, focusing on simple opportunities while it minimizes compilation time.
Level 1, which is the default at optimization levels
-O4
and up, performs full loop analysis
and transformation of loops, and is preferred for numerical applications.
The HOT optimizations can be explicitly requested through the
-qhot=level=0
and
-qhot=level=1
options.
OpenMP
The OpenMP API is an industry specification for shared-memory parallel programming. The
latest XL Compilers provide a full implementation of the OpenMP 3.0 specification in C, C++,
and Fortran. You can program with OpenMP to capitalize on the incremental introduction of
parallelism in an existing application by adding pragmas or directives to specify how the
application can be parallelized.
Содержание Power System POWER7 Series
Страница 2: ......
Страница 36: ...20 POWER7 and POWER7 Optimization and Tuning Guide...
Страница 70: ...54 POWER7 and POWER7 Optimization and Tuning Guide...
Страница 112: ...96 POWER7 and POWER7 Optimization and Tuning Guide...
Страница 140: ...124 POWER7 and POWER7 Optimization and Tuning Guide...
Страница 162: ...146 POWER7 and POWER7 Optimization and Tuning Guide...
Страница 170: ...154 POWER7 and POWER7 Optimization and Tuning Guide...
Страница 222: ...POWER7 and POWER7 Optimization and Tuning Guide POWER7 and POWER7 Optimization and Tuning Guide...
Страница 223: ......