- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
How many threads will an MKL routine (e.g. cblas_sgemm) launches when that routine is included within an OMP parallel loop? Is it the same in both Xeon and Xeon Phi?
Thanks!
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
By default, only 1 thread will be created for MKL, if it's an openmp parallel region. If you want MKL to use multiple threads, you can set MKL_DYNAMIC=false.
--Vipin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Vipin Kumar E K (Intel) wrote:
Hi,
By default, only 1 thread will be created for MKL, if it's an openmp parallel region. If you want MKL to use multiple threads, you can set MKL_DYNAMIC=false.
--Vipin
Thanks! It seems that the number of running threads is easy to go wild if MKL_NYNAMIC is set to be false, right? Is there a way to control the number of threads (>1 but smaller than a certain number) an MKL routines could launch?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please refer https://software.intel.com/en-us/node/528380 for more details on various api functions and env. variables to set for calling MKL in a nested region.
--Vipin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can also control the threads by setting these. Assuming that the user openmp regions use 60 threads and 4 threads should run dgemm (any mkl function), set these variables at the run time.
#enable nested OpenMP export OMP_NESTED=TRUE export OMP_NUM_THREADS=60,4 #OpenMP 4 placement: 4 threads per core do dgemm export OMP_PLACES=threads export OMP_PROC_BIND=spread,close #Enable HOT TEAMS: Intel compiler 15 update 1 export KMP_HOT_TEAMS_MAX_LEVEL=2 export KMP_HOT_TEAMS_MODE=1

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