Developer Reference

  • 2020.2
  • 07/15/2020
  • Public Content
Contents

mkl_set_num_threads

Specifies the number of OpenMP* threads to use.

Syntax

call mkl_set_num_threads
(
nt
)
Fortran Include Files/Modules
  • Include file:
    mkl.fi
  • Module (compiled):
    mkl_service.mod
  • Module (source):
    mkl_service.f90
Input Parameters
Name
Type
Description
nt
INTEGER
nt
> 0 - The number of threads suggested by the user.
nt
0 - Invalid value, which is ignored.
Description
This function enables you to specify how many OpenMP threads
Intel® MKL
should use for internal parallel regions. If this number is not set (default),
Intel® MKL
functions use the default number of threads for the OpenMP run-time library. The specified number of threads applies:
The number specified is a hint, and
Intel® MKL
may actually use a smaller number.
This function takes precedence over the
MKL_NUM_THREADS
environment variable.

Example

use mkl_service …
call mkl_set_num_threads(4)
call my_compute_using_mkl !Intel MKL uses up to 4 OpenMP threads

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