Visible to Intel only — GUID: GUID-C7B2A2A6-195C-43F3-A2EE-FA91F28BB069
Visible to Intel only — GUID: GUID-C7B2A2A6-195C-43F3-A2EE-FA91F28BB069
mkl_get_dynamic
Determines whether Intel® oneAPI Math Kernel Library (oneMKL) is enabled to dynamically change the number of OpenMP* threads.
Syntax
ret = mkl_get_dynamic()
Fortran Include Files/Modules
- Include file: mkl.fi
- Module (compiled): mkl_service.mod
- Module (source): mkl_service.f90
Description
This function returns the status of dynamic adjustment of the number of OpenMP* threads. To determine this status, the function inspects the return value of the following function call and if it is undefined, inspects the environment setting below:
A call to mkl_set_dynamic
The MKL_DYNAMIC environment variable
Dynamic adjustment of the number of threads is enabled by default.
The dynamic adjustment works as follows. Suppose that the mkl_get_max_threads function returns the number of threads equal to N. If dynamic adjustment is enabled, Intel® oneAPI Math Kernel Library (oneMKL) may request up toNthreads, depending on the size of the problem. If dynamic adjustment is disabled, Intel® oneAPI Math Kernel Library (oneMKL) requests exactlyN threads for internal parallel regions (provided it uses a threaded algorithm with at least Ncomputations that can be done in parallel). However, the OpenMP* run-time library may be configured to supply fewer threads than Intel® oneAPI Math Kernel Library (oneMKL) requests, depending on the OpenMP* setting of dynamic adjustment.
Return Values
Name |
Type |
Description |
---|---|---|
ret |
INTEGER*4 |
0 - Dynamic adjustment of the number of threads is disabled. 1 - Dynamic adjustment of the number of threads is enabled. |
Example
use mkl_service integer(4) :: nt … nt = mkl_get_max_threads() if (1 == mkl_get_dynamic()) then print '("Intel MKL may use less than "I0" threads for a large problem")', nt else print '("Intel MKL should use "I0" threads for a large problem")', nt end if