Connecting and running Xeon Phi Accelerators
In order to connect to Xeon Phi co-processor, compile or run software directly on the co-processor (not via offload), the following steps are required:
1. From the main machine (rclsms, 10.10.10.74) connect via ssh to xphi1.
2. Update the environment variables according to the Intel Parallel Studio environment, using the command:
source /opt/sw/intel/parallel_studio_xe_2017/psxevars.sh
3. The program can be compiled using icc for c / cpp code, or using ifort for fortran code. Use the following flags:
-mmic - performs compilation for the co-processor.
-O3 - optimization.
-qopenmp - parallelize using OpenMP .
-o {name} - name of the executable file.
For example:
ifort -O3 -mmic -qopenmp -o prog mycode.f90
4. Update the environment variable:
export SINK_LD_LIBRARY_PATH=/opt/sw/intel/compilers_and_libraries/linux/lib/mic/
This environment variable defines the micnativeloadex tool where to search the co-processor libraries.
5. To run the program use the command:
micnativeloadex {program_name}
The micnativeloadex tool loads and runs the program in the co-processor, saving the need for connection to ssh and setting environment variables in the mic.