PAR Lecture 21, Thurs Apr 6
Table of contents
1 OpenMP on the mic
-
OpenMP is now running on the mic (Xeon Phi).
-
Setup envars thus (assuming you're using bash or zsh):
source /opt/intel/bin/iccvars.sh arch intel64 export SINK_LD_LIBRARY_PATH=/opt/intel/lib/mic
-
To compile on parallel for running on parallel:
icpc -fopenmp sum_reduc2.cc -o sum_reduc2
-
Run it on parallel thus:
./sum_reduc2
-
To cross compile on parallel for running on mic0:
icpc -mmic -fopenmp sum_reduc2.cc -o sum_reduc2-mic
-
Run it natively on mic0 thus:
micnativeloadex sum_reduc2-mic
-
It is also possible to have an OpenMP program on parallel.ecse execute parallel threads on mic0:
#pragma offload target (mic) { #pragma omp parallel { ... } }
See /parallel-class/mic/stackoverflow/hello.c
-
Compile it thus:
icc -fopenmp hello.c -o hello
Note that there is no -mmic.
-
Run it thus:
./hello
-
/parallel-class/mic/stackoverflow/hello_omp.c shows a different syntax.
-
Degrees of parallelism: See slide 12 of https://software.intel.com/sites/default/files/managed/87/c3/using-nested-parallelism-in-openMP-r1.pdf
Comments
Comments powered by Disqus