Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
6941 Discussions

Intel MKL threading behavior on Hyper-Threading systems


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. Intel MKL fits neither of these criteria as 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 when using Intel MKL without HT Technology enabled.

If the requested number of threads exceeds the number of physical cores (perhaps because of hyper-threading), and MKL_DYNAMIC is not changed from its default value (the default is TRUE), Intel MKL will scale down the number of threads to the number of physical cores. In some hyper-threading system, users may find Intel MKL may run with only half of total LOGICAL threadings. If users want to control the total threading numbers, users can change

MKL_NUM_THREADS= number of the threadings.

Moreover, whenrun MKL at Hyper-Threading systems, there are two threads to every physical core, the thread scheduler may assign two threads to some cores and ignore the other ones altogether. You can check the document of OpenMP* library to set the thread affinity interface to avoid this situation. For Intel MKL, you are recommended to set:


To find more information on MKL threading, users can check the following two article on MKL threading:

Intel MKL 10.0 threading:

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

0 Kudos
1 Reply
I'm really glad to read this post!
I recently bought an Intel i3 laptop, and was confused about only two threads were launched automatically.
Yes, setting up 4 threads does NOT help!
0 Kudos