PGI
PGI on Nyx
The default compilers on nyx are from PGI.
The CAC highly recommends users use the PGI compilers over the GNU (gcc, g++,g77,gfortran) compilers.pgcc C Compiler
pgCC C++ Compiler
pgf90 f77/f90 Compiler
pgf95 f95 Compiler
pgprof Serial Profiler
pgdbg Serial Debugger (See DDT our prefered debugger)
| PGI Compiler Options All options below apply to C C++ and Fortran unless stated otherwise. All options also apply to mpicc, mpif90, mpiCC |
||
| -fast | Equivalent: -fast -Mvect=sse -Mscalarsse -Mcache_align -Mflushz Produces highly optimized code taking advantage of vector processing via the SSE/SIMD ability in the AMD64 and Intel CPUs. |
|
| -O# | Basic optimizations, -O is the same as -O2. # can be 0,1,2, 3 or 4. All code should compile with at least -O2 and produce correct results. | |
| -Minline | Inline functions that are extracted. | |
| -Mipa=fast,inline | Enables a large set of optimization between multiple source files. You must link with this option in additon to compiling with it. |
|
| -tp CPUTYPES |
Target processor to optimize for. Multiple cpu types allowed, helps avoid SIGILL(4). See List of cpu types on Nyx. |
|
| -g | Produce information for debuggers. When debugging code should be compiled without optimizations. | |
| -mp | Enable OpenMP directives for parallel code. Be sure to set OMP_NUM_THEADS before running your application. | |
| -Mconcur | Try to auto-parallel serial code. Implies -mp | |
| -Mprof | Generate profile/call-graph data. Should be used with -g | |
| -Mfree -Mfixed | Fortran Only: Assume free/fixed form fortran code. | |
Useful Commands
| pgf90 anyoption -help | Gives verbose help on an option. Example: pgf90 -fast -help |
| pgaccelinfo |
Lists any available accelerators, and details of that accelerator. This applies to gpgpus. |
| pgcpuid |
Lists the CPU type the compiler sees, includes the recomended -tp options. |
| -Minfo |
Gives information about what the compiler is doing. See pgf90 -Minfo -help for a full list of available information targets. |
| -Mneginfo |
Gives information about what the compiler tried but failed todo. Helps finding why SMID or parallel code is not being created. |
CPU Types for CAC Machines
A Full list of supported types can be found with pgf90 -tp -help, note the list may vary between compiler versions. These options are used with the -tp option to the PGI compilers. The compilers can optimize for more than 1 cpu type, avoiding SIGILL (Illegal Instruction), while getting the maximum performance out of the CPU your executable runs on. If the -tp option is omitted the compiler optimized for the cpu you are compiling on.
Example: pgf90 -fast -tp x64,barcelona-64,core2-64 source.f90
The command pgcpuid shows the -tp option that should be used with a specific cpu.
| x64 | Generic amd64 and intel64 targets |
| amd64e |
Revision E AMD opteron |
| barcelona-64 |
AMD 10h cpu, added 128bit SMID |
| shanghai-64 |
AMD 10h update |
| core2-64 |
Intel core2 clovertown |
| penryn-64 |
Core i7 and Nehalem Intel CPUs |


