13.07.2015 Views

Intel(R) Math Kernel Library for Linux* OS User's Guide

Intel(R) Math Kernel Library for Linux* OS User's Guide

Intel(R) Math Kernel Library for Linux* OS User's Guide

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

6 <strong>Intel</strong>® <strong>Math</strong> <strong>Kernel</strong> <strong>Library</strong> User’s <strong>Guide</strong>MKL_ALL=2; MKL_BLAS=1; MKL_FFT=4MKL_ALL = 2 MKL_BLAS 1 , MKL_FFT 4MKL_ALL,2: MKL_BLAS 1, MKL_FFT,4 .The global variables MKL_ALL, MKL_BLAS, MKL_FFT, and MKL_VML, as well as theinterface <strong>for</strong> the <strong>Intel</strong> MKL threading control functions, can be found in the mkl.h headerfile.Table 6-3 illustrates how values of MKL_DOMAIN_NUM_THREADS are interpreted.Table 6-3Interpretation of MKL_DOMAIN_NUM_THREADS ValuesValue ofMKL_DOMAIN_NUM_THREADSMKL_ALL=4MKL_ALL=1, MKL_BLAS=4MKL_VML = 2InterpretationAll parts of <strong>Intel</strong> MKL should try four threads. The actual number ofthreads may be still different because of the MKL_DYNAMIC setting orsystem resource issues. The setting is equivalent toMKL_NUM_THREADS = 4.All parts of <strong>Intel</strong> MKL should try one thread, except <strong>for</strong> BLAS, which issuggested to try four threads.VML should try two threads. The setting affects no other part of <strong>Intel</strong>MKL.Be aware that the domain-specific settings take precedence over the overall ones. Forexample, the "MKL_BLAS=4" value of MKL_DOMAIN_NUM_THREADS suggests trying fourthreads <strong>for</strong> BLAS, regardless of later setting MKL_NUM_THREADS, and a function call"mkl_domain_set_num_threads ( 4, MKL_BLAS );" suggests the same, regardless oflater calls to mkl_set_num_threads().However, a function call with input "MKL_ALL", such as "mkl_domain_set_num_threads(4, MKL_ALL);" is equivalent to "mkl_set_num_threads(4)", and thus it will beoverwritten by later calls to mkl_set_num_threads. Similarly, the environment setting ofMKL_DOMAIN_NUM_THREADS with "MKL_ALL=4" will be overwritten with MKL_NUM_THREADS= 2.Whereas the MKL_DOMAIN_NUM_THREADS environment variable enables you set severalvariables at once, <strong>for</strong> example, "MKL_BLAS=4,MKL_FFT=2", the corresponding functiondoes not take string syntax. So, to do the same with the function calls, you may need tomake several calls, which in this example are as follows:mkl_domain_set_num_threads ( 4, MKL_BLAS );mkl_domain_set_num_threads ( 2, MKL_FFT );6-12

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!