Intel Xeon Phi Coprocessor

How to access/use Intel Xeon Phi coprocessor in CRC

Please request an Intel Xeon Phi Coprocessor user account to <>.

1) Setup the Intel Compiler environment:

source /opt/crc/intel/14.0/bin/ intel64

2) Using the Native mode

For OpenMP code:

icpc -openmp -mmic hello_native.cpp -o exe-native.x -L/opt/crc/intel/14.0/lib/mic -liomp5
ifort -openmp  hello_world.f90  -o  hello_world.x
ifort -openmp -mmic hello_world.f90  -o  hello_world.x
scp hello_world.x
export LD_LIBRARY_PATH=/opt/crc/intel/14.0/mkl/lib/mic:/opt/crc/intel/14.0/lib/mic

For MKL code:

ifort matrix-mkl.f90 -mkl=parallel -mmic -o matrix-mkl.x -L/opt/crc/intel/14.0/mkl/lib/intel64 -lmkl_intel_lp64
scp matrix-mkl.x
export LD_LIBRARY_PATH=/opt/crc/intel/14.0/mkl/lib/mic:/opt/crc/intel/14.0/lib/mic
./matrix-mkl.x 9600

3) Using the Offload mode

The offload behavior is controlled by compiler directives: pragmas in C/C++, and directives in Fortran.

For example, Fotran 90 program, example.f90:

 program main
   use omp_lib
   integer :: nprocs

   !dir$ offload target(mic:0)

   print*, "procs: ",nprocs
 end program
   #pragma offload target(mic:1)

in C/C++ program.

Then, just complie and run it in the host machine:

ifort example.f90 -o exaqmple.x

As an option, you can see the data movement by the runtime engine if you set

export H_TRACE=1

in the host environment.