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

How to run a single-thread, single-core version?

zalia64
New Contributor I
1,327 Views

I am new to the forum. I have a most trivial question:

In order to gain some insight into Parallel Gain, I would like to run the basic form of the algorithm, on my computer.

For example, I would like to compare the timing of  ( using my own timing loop) :  a single-core, single-thread version of FFT, compared to the best multi-thread, multi-core version.

I will measure the time (in clocks) for one piece of code, and compared it to the other. If the number of clocks exceeds 10 K, any out-of-order-execution effects will be negligible. If a piece of code is too quick, I execute it multiple times.  Likewise, I will run each code a few times and use the lowest 50% results - against cases of interrupts.

How Do I Disable Parallel Execution In MKL ? 

0 Kudos
2 Replies
mecej4
Honored Contributor III
1,327 Views

Use the MKL Link Line Advisor at https://software.intel.com/en-us/articles/intel-mkl-link-line-advisor and select threading layer = sequential. Compile and link using the options that the advisor tool gives you.

0 Kudos
Ying_H_Intel
Employee
1,327 Views

Hi zalia64,

You may simply control the thread by export OMP_NUM_THREAD=1  or 2, 4  to change the parallel thread number.

and see more methods in MKL user guide:

https://software.intel.com/en-us/mkl-linux-developer-guide-techniques-to-set-the-number-of-threads

Best Regards,

Ying

0 Kudos
Reply