Developer Reference

Contents

mkl_domain_get_max_threads

Gets the number of OpenMP* threads targeted for parallelism for a particular function domain.

Syntax

int
mkl_domain_get_max_threads
(
int
domain
);
Include Files
  • mkl.h
Input Parameters
Name
Type
Description
domain
int
The named constant that defines the targeted domain.
Description
Computational functions of the
Intel® MKL
function domain defined by the
domain
parameter use the value returned by this function as a limit of the number of OpenMP threads they should request for parallel computations. The
mkl_domain_get_max_threads
function returns the thread-local number of threads or, if that value is zero or not set, the global number of threads. To determine this number, the function inspects the environment settings and return values of the function calls below in the order they are listed until it finds a non-zero value:
  • The last of the calls to mkl_set_num_threads or mkl_domain_set_num_threads( …,
    MKL_DOMAIN_ALL
    )
  • A call to
    mkl_domain_set_num_threads
    ( …,
    domain
    )
  • The
    MKL_DOMAIN_NUM_THREADS
    environment variable with the
    MKL_DOMAIN_ALL
    tag
  • The
    MKL_DOMAIN_NUM_THREADS
    environment variable (with the specific domain tag)
  • The
    MKL_NUM_THREADS
    environment variable
  • A call to
    omp_set_num_threads
  • The
    OMP_NUM_THREADS
    environment variable
Actual number of threads used by the
Intel® MKL
computational functions may vary depending on the problem size and on whether dynamic adjustment of the number of threads is enabled (see the description ofmkl_set_dynamic). For a list of supported values of the
domain
argument, see Table "Intel MKL Function Domains".
Return Values
Name
Type
Description
nt
int
The maximum number of threads for
Intel® MKL
functions from a given domain to use in internal parallel regions.
If an invalid value of
domain
is supplied, the function returns the number of threads for
MKL_DOMAIN_ALL

Example

#include "mkl.h" … if (1 <
mkl_domain_get_max_threads(MKL_DOMAIN_BLAS)
) puts("Intel MKL BLAS functions employ threading");

Product and Performance Information

1

Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.

Notice revision #20110804