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/iccvars.sh arch intel64
    export SINK_LD_LIBRARY_PATH=/opt/intel/lib/mic
    
  3. To compile on parallel for running on parallel:

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

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

    icpc -mmic -fopenmp sum_reduc2.cc -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:

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

  11. 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