Hybrid applications: Intel MPI Library and OpenMP*

I have a mixed application which uses both MPI and OpenMP* calls. Does the Intel® MPI Library support this type of hybrid functionality?

Yes, Intel MPI does support mixed MPI/OpenMP applications. To make sure your hybrid code runs correctly, follow these steps:

  1. Use the thread safe version of the Intel MPI Library by using the -mt_mpi compiler driver option
  2. Set the I_MPI_PIN_DOMAIN environment variable to select the desired process pinning scheme. The recommended setting is omp:
    $ export I_MPI_PIN_DOMAIN=omp

    This will set the process pinning domain size to be equal to OMP_NUM_THREADS. Therefore, each MPI process can create $OMP_NUM_THREADS number of children threads for running within the corresponding domain. If OMP_NUM_THREADS is not set, each node is treated as a separate domain (which will allow as many threads per MPI processes as there are cores).

    NOTE: In order to pin OpenMP threads inside the domain, use the corresponding OpenMP feature by setting the KMP_AFFINITY environment variable.

  3. See the “Interoperability with OpenMP*” section in the Intel® MPI Library for Linux* Reference Manual for more details
For more complete information about compiler optimizations, see our Optimization Notice.

1 comment

zhubq's picture

What if KMP_affinity is not set? OpenMP threads will not be pinned inside the domain?

Add a Comment

Have a technical question? Visit our forums. Have site or software product issues? Contact support.