PGI

Category: Program Dev-Compilers

Description

The Portland Group (PGI) compilers are available on the analysis machines as modules. The analysis machines have PGI versions 7.2.5 and 8.0.x.

To see man pages on PGI compilers with a full list of compiler options, first make sure a "pgi" module is loaded, and then do a man on any of the following:

For more detailed information, see PGI documentation.

Use

To use the PGI compilers, just load the PGI programming module, and then optionally follow that by loading the PGI version you want:
  module load PE-pgi       # you may want to unload any other PE- modules you have loaded
  module swap pgi pgi/7.2.1

It is best to review the pgcc, pgCC, and pgf90 man pages for a list of their options.

C/C++ Options

The following options control the amount of debugging information generated by the compiler. They can adversely affect optimization.
Option Description
-g Generates symbolic debug information. Turns off optimization.
-MboundsAdds array bound checking.

For most cases, the usual levels of optimization are appropriate (-O0, -O1, -O2 [default], -O3). Here are a few exceptions.
Option Description
-fastChooses generally optimal flags for the target platform. Use pgcc -fast -help to see the equivalent switches. Note this sets the optimization level to a minimum of 2; see -O.
-fastsseChooses generally optimal flags for a processor that supports the streaming SIMD extensions (SSE) (Pentium 3/4, AthlonXP/MP, Opteron) and SSE2 (Pentium 4, Opteron) instructions. Use pgcc -fastsse -help to see the equivalent switches.
-tp k8-64Targets optimization to the 64-bit Opteron processor.
-MflushzSets SSE to flush-to-zero mode.
-pg, -MprofInstrument program for profiling. These flags imply different types of profiling. Please check the performance tuning pages for more information.
-MinfoGenerates an optimization report to standard error. This has several suboptions, so check the man page.
-mp=nonumaEnables the compiler to generate multithreaded code based on the OpenMP directives. Use the nonuma suboption when linking with the Cray wrappers.

Fortran Options

The following options control how source files are translated into machine code.
Option Description
-M fixedThe source code uses fixed-form syntax, as in Fortran 77. This option is on by default for source files ending in .f, .F, .for, and .fpp.
-M freeThe source code uses free-form syntax, introduced in Fortran 90. This option is on by default for source files ending in .f90, .F90, .f95, .F95.
-FThis option preprocesses each file and leaves the output in a file named file.f for each file named file.F.
-i8This option treats INTEGER variables as 8 bytes. For operations involving integers, uses 64 bits for computations.
-r8This option interprets REAL variables as DOUBLE PRECISION. Equivalent to using the options -Mr8 and -Mr8intrinsics.

The following options control the amount of debugging information generated by the compiler. They can adversely affect optimization.
Option Description
-gGenerates symbolic debugging information. Turns off optimization.
-MboundsAdds array bound checking.
-MchkptrChecks for unintended dereferencing of null pointers.

For most cases, the usual levels of optimization are appropriate (-O0, -O1, -O2 [default], -O3). Here are a few exceptions.
Option Description
-fastChooses generally optimal flags for the target platform. Use pgf90 -fast -help to see the equivalent switches. Note this sets the optimization level to a minimum of 2; see -O.
-fastsseChooses generally optimal flags for a processor that supports the SSE (Pentium 3/4, AthlonXP/MP, Opteron) and SSE2 (Pentium 4, Opteron) instructions. Use pgf90 -fastsse -help to see the equivalent switches.
-MflushzSets SSE to flush-to-zero mode.
-pg, -MprofInstrument program for profiling. These flags imply different types of profiling. Please check the performance tuning pages for more information.
-MinfoGenerates an optimization report to standard error. This has several suboptions, so check the man page.
-MlistGenerates a listing file.
-mp=nonumaEnables the compiler to generate multithreaded code based on the OpenMP directives. Use the nonuma suboption when linking with the Cray wrappers.

Support

This package has the following support level : Supported

Available Versions

All versions of this software are provided by the system vendor and are not installed by NICS staff.