Intel(R) - Computational and Systems Biology at MIT
Intel(R) - Computational and Systems Biology at MIT
Intel(R) - Computational and Systems Biology at MIT
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 GuideHere are several cases with recommend<strong>at</strong>ions depending on the threading model youemploy:Table 6-1How to avoid conflicts in the execution environment for your threadingmodelThreading modelYou thread the program using OS threads(pthreads on the Linux* OS).You thread the program using OpenMP directives<strong>and</strong>/or pragmas <strong>and</strong> compile the program using acompiler other than a compiler from <strong>Intel</strong>.There are multiple programs running on amultiple-cpu system, as in the case of a parallelizedprogram running using MPI for communic<strong>at</strong>ion inwhich each processor is tre<strong>at</strong>ed as a node.DiscussionIf more than one thread calls the library, <strong>and</strong> thefunction being called is threaded, it may beimportant th<strong>at</strong> you turn off <strong>Intel</strong> MKL threading. Setthe number of threads to one by any of the availablemeans (see Techniques to Set the Number ofThreads).This is more problem<strong>at</strong>ic in th<strong>at</strong> setting ofOMP_NUM_THREADS in the environment affects boththe compiler's threading library <strong>and</strong> libguide(libiomp). In this case, you should try to choosethe Threading layer library th<strong>at</strong> m<strong>at</strong>ches the layered<strong>Intel</strong> MKL with the OpenMP compiler you employ (seeLinking Examples on how to do this). If this isimpossible, the sequential version of <strong>Intel</strong> MKL canbe used as the Threading layer. To do this, youshould link with the appropri<strong>at</strong>e Threading layerlibrary: libmkl_sequential.a orlibmkl_sequential.so (see the High-levelDirectory Structure section in chapter 3).The threading software will see multiple processorson the system even though each processor has asepar<strong>at</strong>e MPI process running on it. In this case, setthe number of threads to one by any of the availablemeans (see Techniques to Set the Number ofThreads).To avoid correctness <strong>and</strong> performance problems, you are also strongly encouraged todynamically link with the <strong>Intel</strong>® Legacy OpenMP run-time library libguide <strong>and</strong> <strong>Intel</strong>®Comp<strong>at</strong>ibility OpenMP run-time library libiomp.Setting the Number of Threads Using OpenMP* EnvironmentVariableYou can set the number of threads using the environment variable OMP_NUM_THREADS. Tochange the number of threads, in the comm<strong>and</strong> shell in which the program is going to run,enter:6-4