- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When I use MKL 2021.2.0 functions for calculating my Intel Core i7-9750H CPU is 100% loaded (all cores). What tools are there to manage CPU utilization?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Serjio,
Additionally to what Shanmukh wrote, you could try specifying the number of OpenMP (or MKL) threads.
This can be done through environment variables or by using certain functions. This link to an Intel Developer Guide explains this. And this link shows more practical information.
Additional tips for setting the number of threads locally (you might not need the folder locations if you set the environment variables or use Visual Studio, but I have written them for reference):
`MKL_Set_Dynamic(int flat)` and `MKL_Set_Num_Threads(int nt)` can be found in mkl_service.h (in the folder .\IntelOneAPI\mkl\latest\include).
`omp_set_dynamic(int)`, `omp_set_num_threads(int)` and `kmp_set_warnings_off()` (you'll may eventually find out why this last one is useful hehehe) can be found in omp.h (in the folder .\IntelOneAPI\compiler\latest\windows\compiler\include).
Best regards,
Breno
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Thanks for reaching out to us.
We suggest you to use latest version of oneMKL(2021.3) and check if the issue persists.
In addition, You can limit cpu utilization by running the code in sequential mode of oneMKL.
Below is the link for setting oneMKL in sequential mode.
Best Regards,
Shanmukh.SS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi!
Depending on what kind of functionality you're using form oneMKL, there are different tools.
For OpenMP:
See https://software.intel.com/content/www/us/en/develop/documentation/onemkl-developer-reference-c/top/support-functions/threading-control.html with various service routines which can be used. E.g., you can limit all MKL calls to a fixed number of threads and then, by pinning threads to a subset of CPUs limit the CPU usage.
For TBB: refer to TBB documentation, there are things like tbb arenas and which can help set the max concurrency limit.
For MPI (used for cluster components): controls are on the side of the application calling MKL (# MPI processes + potentially if it is MPI/OpenMP, see the OpenMP part).
Best,
Kirill
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Serjio,
Additionally to what Shanmukh wrote, you could try specifying the number of OpenMP (or MKL) threads.
This can be done through environment variables or by using certain functions. This link to an Intel Developer Guide explains this. And this link shows more practical information.
Additional tips for setting the number of threads locally (you might not need the folder locations if you set the environment variables or use Visual Studio, but I have written them for reference):
`MKL_Set_Dynamic(int flat)` and `MKL_Set_Num_Threads(int nt)` can be found in mkl_service.h (in the folder .\IntelOneAPI\mkl\latest\include).
`omp_set_dynamic(int)`, `omp_set_num_threads(int)` and `kmp_set_warnings_off()` (you'll may eventually find out why this last one is useful hehehe) can be found in omp.h (in the folder .\IntelOneAPI\compiler\latest\windows\compiler\include).
Best regards,
Breno
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Reminder:
Has the solution provided helped? Could you please confirm whether we could close this thread from our end.
Best Regards,
Shanmukh.SS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Thanks for accepting the solution.
Please raise a new thread if you have any other question as this thread will no longer be monitored.
Best Regards,
Shanmukh.SS

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page