The Intel Compilers consist of both C/C++ and Fortran compilers that create highly optimized executables for the Intel architecture. It supports multithreading and highly optimized performance libraries.

Using Intel Compilers

The Intel compilers and debugger are available in the cluster systems. Users should use the following command to set up the required environment variables:

System Compiler version Module command
HPC2015 Intel Parallel Studio 2015 Update 3 module load intel/15.0.3
Intel Parallel Studio 2016 Update 3 module load intel/16.0.3
Intel Parallel Studio 2017 Update 4 module load intel/17.0.4
Intel Parallel Studio 2017 Update 7 module load intel/17.0.7
Intel Parallel Studio 2018 Update 4 module load intel/18.0.4
HPC2021 Intel Parallel Studio 2019 Update 4 module load intel/2019u4
Intel Parallel Studio 2020 Update 4 module load intel/2020u4
Intel OneAPI 2021.1 module load intel/2021.1

Compilation Commands

C programs :
         icc [options] program.c -o program.exe
C++ programs :
         icpc [options] program.cpp -o program.exe

Fortran programs :
         ifort [options] program.f -o program.exe

Using Compiler Options

Compiler option is case-sensitive. Command line expression used to change the compilers’ default operation. Compiler options are not required to compile your program, but they are useful in helping you control the code generation, optimization, linking properties, speed of executable, etc.

Option Flag Comment
-O3 Default setting is ‘-O2‘ with maximize speed. The ‘-O3‘ option enables ‘-O2‘ optimizations plus more aggressive loop and memory-access optimizations. It is particularly recommended for applications that have loops that do many floating-point calculations or process large data sets. It may result in slow down compared to ‘-O2‘ option.
-qopenmp Cause multi-threaded code to be generated when OpenMP directives are present. May require an increased stack size.
-parallel The auto-parallelizer detects simply structured loops that may be safely executed in parallel, including loops implied by Intel® Cilk™ Plus array notation, and automatically generates multi-threaded code for these loops.
-xtarget or -xHost Generate specialized codes that are optimized for various instruction sets(target) used in specific processors.

Processor Type System target
Intel Ivy Bridge (E5 v2) HPC2015 (SP nodes) AVX
Intel Haswell (E5 v3), Broadwell (E5 v4) HPC2015 (GP nodes) CORE-AVX2
AMD Rome (EPYC 7xx2) HPC2021 (GP-AMD, Hugemem)
Intel Cascade Lake (Xeon Gold 62XX) HPC2015 (mehpc2 nodes)
HPC2021 (Frontend, GP-Intel nodes)
CORE-AVX512

The instruction set is upward compatible. Therefore, applications compiled with -xCORE-AVX2 can run on Haswell or Broadwell processors, but not on Ivy Bridge.
If you do not sure the processor type, ‘-xHost‘ will generate optimized code targeted for execution on the system you compile on.

-ip or -ipo -ip‘ enables additional interprocedural(IP) optimizations for single-file compilation. ‘-ipo‘ permits inlining and other interprocedural optimizations among multiple source files.
-g Generates debug information for use with any of the common platform debuggers
-fast Optimize for speed across the entire program to evaluate performance with a set of best optimization switches.

Intel Xeon Phi coprocessor (Intel MIC Architecture) is supported in the HPC2015 system. To build/execute code for Intel MIC architecture based coprocessors, option flags are required:

Option Flag Comment
-mmic Build applications on host, download and execute natively on coprocessor
-qoffload=option Build and execute application on host. Offload code will be downloaded and executed on runtime.
Option to control offloading: none, mandatory or optional

For information about Intel MKL,please visit Intel Math Kernel Library(MKL).

Further Information

There are User Guides, language Reference Manuals, and Quick-Reference Guides available at Intel compilers Home page

Man pages are available via command man ifort (for Fortran) or man icc (for C/C++).

Performance Optimization with Intel C Compiler:https://software.intel.com/en-us/articles/step-by-step-optimizing-with-intel-c-compiler