13.07.2015 Views

Intel(R) - Computational and Systems Biology at MIT

Intel(R) - Computational and Systems Biology at MIT

Intel(R) - Computational and Systems Biology at MIT

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

6 <strong>Intel</strong>® M<strong>at</strong>h Kernel Library User’s GuideWhereas the MKL_DOMAIN_NUM_THREADS environment variable enables you set severalvariables <strong>at</strong> once, for 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 );Setting the Environment Variables for Threading ControlTo set the environment variables used for threading control, in the comm<strong>and</strong> shell in whichthe program is going to run, enter:export = for certain shells, such as bash.For example,export MKL_NUM_THREADS=4export MKL_DOMAIN_NUM_THREADS="MKL_ALL=1, MKL_BLAS=4"export MKL_DYNAMIC=FALSEFor other shells, such as csh or tcsh, enterset = .For example,set MKL_NUM_THREADS=4set MKL_DOMAIN_NUM_THREADS="MKL_ALL=1, MKL_BLAS=4"set MKL_DYNAMIC=FALSENote on FFT UsageIntroduction of additional threading control made it possible to optimize the commit stageof the FFT implement<strong>at</strong>ion <strong>and</strong> get rid of double d<strong>at</strong>a initializ<strong>at</strong>ion. However, thisoptimiz<strong>at</strong>ion requires a change in the FFT usage. Suppose you cre<strong>at</strong>e threads in theapplic<strong>at</strong>ion yourself after initializing all FFT descriptors. In this case, threading is employedfor the parallel FFT comput<strong>at</strong>ion only, the descriptors are released upon return from theparallel region, <strong>and</strong> each descriptor is used only within the corresponding thread. Startingwith <strong>Intel</strong> MKL 10.0, you must explicitly instruct the library before the commit stage towork on one thread. To do this, set MKL_NUM_THREADS=1 orMKL_DOMAIN_NUM_THREADS="MKL_FFT=1" or call the corresponding pair of servicefunctions. Otherwise, the actual number of threads may be different because theDftiCommitDescriptor function is not in a parallel region. See Example C-27a "UsingParallel Mode with Multiple Descriptors Initialized in One Thread" in the <strong>Intel</strong> MKLReference Manual.6-12

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

Saved successfully!

Ooh no, something went wrong!