This cluster has 3 different kinds of compilers

  1. GNU
  2. Portland Group (PGI)
  3. Intel

Below is table that shows the different compilers:

LANGUAGE

GNU COMMAND(S)

PGI COMMAND

INTEL COMMAND

FILE SUFFIX

Fortran 77 g77 pgf77 ifort .f .for .FOR
** .F .fpp .FPP
Fortran 90 gfortran pgf90 ifort .f .for
** .F .f90 .F90 .fpp
Fortran 95 gfortran N/A N/A .f95
C gcc pgcc icc .c
C++ g++ pgCC icc .cc .cpp .cxx .C

** use these suffix’s for code that needs preprocessing with cpp.

  • No one compiler works best for all kinds of code.
  • If you are interested in speeding up your application, you will want to test various compiler options and compilers to see which ones work the best for your application.
  • There is a man page for each compiler that lists the compiler options.
  • In general, gcc/g++ is the most flexible since it runs on a variety of different computer platforms.
  • Many people use gcc/g++ so it will be easy to port their code to other platforms.
  • g77 is the fortran77 GNU compiler and is not as robust as the Portland Group Fortran compilers and we do not recommend its use.
    • gfortran is a better choice if using the GNU version
  • The PGI compilers will compile f77,f90, C and C++ codes.
    • They compile a variety of codes with less errors than the Intel compilers.
    • Many Fortran codes use extensions to the language and the Portland Group compilers support those extensions.
    • Portland Group recommends that you use the pgf90 for both fortran 90 and fortran 77 codes to gain additional code speed up.
  • All of the compiler commands listed above are in the standard user path.

Useful Compiler Options

  • Here are some useful compilers optimizations options to know about for each of the three kinds of compilers.
  • All three kinds of compilers generate code that is optimized for the the platform where they are compiled.
  • The comments below apply to both C/C++ and Fortran77/90 codes.
  • These optimizations will not necessarily speed up all kinds of code and should be tested individually.
Portland Group: pgcc, pgCC, pgf77, pgf90
  • If you want to use a number of more aggressive optimizations that makes use of the features of the AMD  processors to speed up your code and  use the options  -fastsse -O4.
  • In addition, here are other optimization options to try.

PG COMPILER OPTION

DESCRIPTION OF OPTION

-Munroll unroll loops
-Mvect vectorize code
-Mvect=sse make use of the sse/see2 vectorization
-Mconcur auto-parallelization using OpenMP
Mipa inter- procedural analysis
GNU compilers: gcc, g++

Use the option -O3 for the most aggressive optimization. Here are some optimization options.

GCC/G++ COMPILER OPTION

DESCRIPTION OF OPTION

-march=machinetype (i.e. pentium4) generate instruction of the machinetype (i.e. pentium4)
ffast-math use optimized math functions
(this should be used with caution)
-mfpmath=sse make use of sse vectorization for math calculations
funroll-loops unroll loops
Intel Compilers: ifort, icc
  • Use the option -O3 to obtain more aggressive optimization.
  • You can use the -parallel option to have the compiler insert multi-threaded code in loops that can be safely parallelized.
  • Here are some other optimization options.

INTEL COMPILER OPTION

DESCRIPTION OF OPTION

-ipo multi-file interprocedural analysis
-unroll[n] unroll loops
-openmp generate OpenMP code in loops that can be parallelized