- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have some problems about multithreaded intel MKL
1. I use the function MKL_SET_NUM_THREADS(2) to change the thread number. Then I want to check the value of MKL_NUM_THREADS, by using function getnv (mklname, value), mklname = MKL_NUM_THREADS. The value is always 1.
I wonder if the value of MKL_NUM_THREADS will be changed when the parallelization starts.
If so, is there a way to check the value of MKL_NUM_THREADS? How do I know if the value of MKL_NUM_THREADS is really changed after I set it?
2. I use the function MKL_SET_NUM_THREADS(2) to change the thread number. According to the runtime it works and the cpu efficiency is about 200%. The function I test is DGEMM. But when I test DGEQP3 or DGEQPF, the runtime is not changed and the cpu efficiency is always 100%.
I think there is something wrong but I can’t figure it out.
I want to know why.
Is there some examples for me about how to use multithreaded intel MKL?
Thank you !
OS: Linux, Red Hat 5.5
MKL: compilerpro-12.0.0.084
Ifort: composerxe-2011.0.084
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
MKL doesn’t provide routine to track env variables value, but by design this env variable have not to be changed. If this happens then this is the real issue.
Regard to DGEQP3 or DGEQPF – what is the problem size did you tried to solve?
Is there some examples for me about how to use multithreaded intel MKL? -- pls have a look at the MKL User Guide. You may find out there the “Changing the Number of OpenMP* Threads at Run Time” example
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please check the following link for reference
https://software.intel.com/en-us/mkl-linux-developer-guide-improving-performance-with-threading
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
At runtime mkl_set_num_threads needs to be used instead to change running number of OpenMP processing threads and here is a C example: ... printf("Finding max number of threads Intel(R) MKL can use for parallel runs\n\n"); max_threads = mkl_get_max_threads(); printf("Running Intel(R) MKL from 1 to %i threads\n\n", max_threads); for( i = 4; i <= max_threads; i += 16 ) { for( j = 0; j < (m*n); j++ ) C= 0.0; printf("Requesting Intel(R) MKL to use %i thread(s)\n\n", i ); mkl_set_num_threads( i ); printf("Measuring performance of matrix product using Intel(R) MKL dgemm function \n" "via CBLAS interface on %i thread(s)\n\n", i); s_initial = dsecnd(); for( r = 0; r < LOOP_COUNT; r++ ) { cblas_dgemm( CblasRowMajor, CblasNoTrans, CblasNoTrans, m, n, p, alpha, A, p, B, n, beta, C, n ); } s_elapsed = (dsecnd() - s_initial) / LOOP_COUNT; printf("== Matrix multiplication using Intel(R) MKL dgemm completed ==\n" "== at %.5f seconds using %d thread(s) ==\n\n", (s_elapsed), i); } ...

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