Intel Xeon Phi Coprocessor

How to access/use Intel Xeon Phi coprocessor in CRC

Please request an Intel Xeon Phi Coprocessor user account to <CRCSupport@nd.edu>.

1) Setup the Intel Compiler environment:

source /opt/crc/intel/14.0/bin/compilervars.sh intel64
export INTEL_LICENSE_FILE=/afs/crc.nd.edu/x86_64_linux/intel/licenses

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 sciphi-mic0.crc.nd.edu:
ssh sciphi-mic0.crc.nd.edu
export LD_LIBRARY_PATH=/opt/crc/intel/14.0/mkl/lib/mic:/opt/crc/intel/14.0/lib/mic
./hello_world.x

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 sciphi-mic1.crc.nd.edu:
ssh sciphi-mic1.crc.nd.edu
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)

   nprocs=omp_get_num_procs()
   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
./example.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.