Intel Compiler

Programming Environment

To use the Intel compiler, swap in the Intel programming environment (PrgEnv-intel) and use the wrappers for C (cc), C++ (CC), and Fortran (ftn).  To see all available compiler versions, use the command:

 module avail intel

To switch to a different version, use the command:

 module swap intel intel/<version>

When to Use the Intel Compiler

The Intel compiler is good for vectorizing code and it provides the Intel MKL library for codes that need it.

Fortran file naming

Fortran file naming conventions for Intel's compiler.
       · Filenames with the suffix .f90 are interpreted as  free-form  Fortran
         95/90 source files.
 
       · Filenames  with  the  suffix  .f,  .for,  or  .ftn are interpreted as
         fixed-form Fortran source files.
 
       · Filenames with the suffix .fpp, .F, .FOR, .FTN, or  .FPP  are  inter-
         preted as fixed-form Fortran source files, which must be preprocessed
         by the fpp preprocessor before being compiled.
 
       · Filenames with the suffix .F90 are interpreted as  free-form  Fortran
         source  files,  which  must  be pre-processed by the fpp preprocessor
         before being compiled.
 
       · Filenames with the suffix .s are interpreted as assembler  files  and
         are passed to the assembler.
 
       · Filenames  with  the suffix .S are interpreted as assembler files and
         are preprocessed by the fpp preprocessor before being passed  to  the
         assembler.
 

Flags

There are numerous compile-time flags that can be used.  For complete listings, see the man pages:

 man ifort
man icc
man icpc  # c++

NCSA recommends: -fast -vec-report -no-ipo

For Intel 16 and previous compiler version OpenMP codes, set OMP_PROC_BIND=spread and OMP_PLACES=threads.  Do not set KMP_AFFINITY.  export OMP_PROC_BIND=spread; export OMP_PLACES=threads;  aprun -d <threads> ...

For Intel 17 and later compiler versions, set only KMP_AFFINITY=disabled and OMP_NUM_THREADS , then use aprun -d <threads> ...

MKL

For linking with Intel's mkl, use:

 ftn -dynamic <src_file.f>  -mkl=sequential