Category: Program Dev-Compilers
Cray provides the Portland Group (PGI) compilers as part of several programming environments. PGI versions 9.0.x, 8.0.x and 7.2.x are available.
XTs have two kinds of nodes:
The Cray wrappers cc, CC, and ftn will automatically link against MPI (-lmpi) and SciLib (-lsci). This is not true when calling the PGI compilers directly. See the cc, CC, and ftn man pages for more information on their usage.
To see man pages on PGI compilers with a full list of compiler options, first make sure the "PrgEnv-pgi" module is loaded, and then do a man on any of the following:
For more detailed information, see PGI documentation and Cray's documentation.
To use the Cray wrappers with the PGI compilers, the PrgEnv-pgi module should be loaded:
module avail PrgEnv module swap PrgEnv-pgi PrgEnv-pgi # this loads some version of pgi, currently 7.2.3To just use the PGI compilers directly, just load the pgi module you want:
module avail pgi module load pgi/7.2.3 # Note that this does not changed the Cray wrappers.It is possible to use the PGI compiler versions directly without loading the Cray Programming Environments, but note that the Cray wrappers will probably not work as expected if you do that.
Also note that with CNL 2.0.49 and above, the following options are set automatically by the xtpe-quadcore module (loaded by default):
jaguar12> module display xtpe-quadcore ------------------------------------------------------------------- /opt/xt-asyncpe/1.0/modulefiles/xtpe-quadcore: prepend-path PE_PRODUCT_LIST XTPE_QUADCORE setenv XTPE_QUADCORE_ENABLED ON setenv LIBSCI_PRE_LINK_OPTS -lsci_quadcore setenv PGI_POST_COMPILE_OPTS -tp barcelona-64 setenv PATHSCALE_POST_COMPILE_OPTS -march=barcelona setenv GNU_POST_COMPILE_OPTS -march=barcelona setenv LLVM_AMD_10H 1 -------------------------------------------------------------------
However, the "barcelona" option works with many versions of the compiler.
Version | barcelona support |
---|---|
7.2.x | yes |
It is best to review the pgcc, pgCC, and pgf90 man pages for a list of their 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. |
-Mbounds | Adds 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 |
---|---|
-fast | Chooses 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. |
-fastsse | Chooses 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 barcelona-64 | Targets optimization to the 64-bit Opteron quad-core processor. |
-Mflushz | Sets SSE to flush-to-zero mode. |
-pg, -Mprof | Instrument program for profiling. These flags imply different types of profiling. Please check the performance tuning pages for more information. |
-Minfo | Generates an optimization report to standard error. This has several suboptions, so check the man page. |
-mp=nonuma | Enables the compiler to generate multithreaded code based on the OpenMP directives. Use the nonuma suboption when linking with the Cray wrappers. |
The following options control how source files are translated into machine code.
Option | Description |
---|---|
-M fixed | The 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 free | The 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. |
-F | This option preprocesses each file and leaves the output in a file named file.f for each file named file.F. |
-i8 | This option treats INTEGER variables as 8 bytes. For operations involving integers, uses 64 bits for computations. |
-r8 | This 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 |
---|---|
-g | Generates symbolic debugging information. Turns off optimization. |
-Mbounds | Adds array bound checking. |
-Mchkptr | Checks 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 |
---|---|
-fast | Chooses 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. |
-fastsse | Chooses 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. |
-Mflushz | Sets SSE to flush-to-zero mode. |
-pg, -Mprof | Instrument program for profiling. These flags imply different types of profiling. Please check the performance tuning pages for more information. |
-Minfo | Generates an optimization report to standard error. This has several suboptions, so check the man page. |
-Mlist | Generates a listing file. |
-mp=nonuma | Enables the compiler to generate multithreaded code based on the OpenMP directives. Use the nonuma suboption when linking with the Cray wrappers. |
This package has the following support level : Supported
All versions of this software are provided by the system vendor and are not installed by NICS staff.