Compiling openMP programs by using Intel compilers

Intel compilers are installed on Xeon machine in the PDS Lab.

In order to compile a C/C++ code to an Intel Xeon Phi executable, Intel compilers must be given the argument -mmic for native mode. The same way, for openMP application we must use -openmp flag.


icc <-mmic> -qopenmp source_code -o mic_code           (Compile C code)

icpc <-mmic> -qopenmp source_code -o mic_code          (Compile Cpp code)

ifort <-mmic> -qopenmp source_code -o mic_code         (Compile fortran code)

Compiling options:

-mmic: Used only for compiling the code as a native application, i.e., run on  Intel Xeon Phi coprocessor.

-qopenmp: Used for compiling openmp code.

-o <file>: place the output into <file>. If this option is omitted, the compiler will create executable program named a.out in working directory.

Compiling OpenMP code on Native Application

Native execution occurs when an application runs entirely on an Intel Xeon Phi coprocessor.

Compiling OpenMP/C++ program on Native application

Compiling OpenMP/C program on Native application

Compiling OpenMP code on Offload Application

Offload applications run on the host and employ the MIC (Many Integrated Core) architecture by transferring only some of the data and functions to the coprocessors. in this case -mmic argumet is not used by the compilers.

The process of data and code transfer to the coprocessor is generally called offload, and applications using this procedure are known as offload applications.

Compiling OpenMP/C++ program on offload application

Compiling OpenMP/C program on offload application