Intel
compilers are installed on Xeon server 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 -qopenmp
flag.
icc
<-mmic>
source_code.c -o exec_code
(Compile C code)
icpc <-mmic>
source_code.cpp -o exec_code
(Compile
Cpp code)
ifort <-mmic>
source_code.f90 -o exec_code
(Compile
fortran code)
-mmic:
Used only for compiling the code as a native application, i.e., run
on
Intel Xeon Phi coprocessor.
-o <file>: place the output into
<file>. If this option is
omitted, the compiler will create executable program named a.out
in working directory.
Native execution occurs when an
application runs entirely on an Intel Xeon Phi coprocessor.
Generraly we use extension .mic in the
exec_code name for
native applications.
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.