PAR Lecture 21, Thurs Apr 6

Table of contents

1   OpenMP on the mic

  1. OpenMP is now running on the mic (Xeon Phi).

  2. Setup envars thus (assuming you're using bash or zsh):

    source /opt/intel/bin/ arch intel64
    export SINK_LD_LIBRARY_PATH=/opt/intel/lib/mic
  3. To compile on parallel for running on parallel:

    icpc -fopenmp -o sum_reduc2
  4. Run it on parallel thus:

  5. To cross compile on parallel for running on mic0:

    icpc -mmic -fopenmp -o sum_reduc2-mic
  6. Run it natively on mic0 thus:

    micnativeloadex sum_reduc2-mic
  7. 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

  8. Compile it thus:

    icc -fopenmp hello.c -o hello

    Note that there is no -mmic.

  9. Run it thus:

  10. /parallel-class/mic/stackoverflow/hello_omp.c shows a different syntax.

  11. Degrees of parallelism: See slide 12 of


Comments powered by Disqus