Setting thread affinity on SMT or HT enabled systems for better performance

Simultaneous MultiThreading (SMT) or Hyper-Threading Technology (HT Technology) is especially effective when each thread is performing different types of operations and when there are under-utilized resources on the processor.  However, Intel MKL fits neither of these criteria because the threaded portions of the library execute at high efficiencies using most of the available resources and perform identical operations on each thread.  You may obtain higher performance by disabling HT/SMT Technology.  See Using the Intel® MKL Parallelism for information on the default number of threads, changing this number, and other relevant details.

If you run with SMT/HT enabled, performance may be especially impacted if you run on fewer threads than physical cores.  Moreover, if, for example, there are two threads to every physical core, the thread scheduler may assign two threads to some cores and ignore the other ones altogether. If you are using the OpenMP* library of the Intel Compiler, read the respective User Guide on how to best set the thread affinity interface to avoid this situation.

For Intel MKL, you are recommended to set


Optimization Notice in English

For more complete information about compiler optimizations, see our Optimization Notice.

1 comment

Aleksey Y.'s picture

BTW, in latest version of Composer XE 2013 on Windows MKL linpack uses "KMP_AFFINITY=nowarnings,compact,granularity=fine", which gives half of peak performance on my HT enabled Core i7 950.

Linux version of MKL uses right option which you wrote above

Add a Comment

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