Developer Guide

Developer Guide for Intel® oneAPI Math Kernel Library Linux*

ID 766690
Date 10/31/2024
Public
Document Table of Contents

Calling oneMKL Functions from Multi-threaded Applications

This section summarizes typical usage models and available options for calling Intel® oneAPI Math Kernel Library (oneMKL) functions from multi-threaded applications. These recommendations apply to any multi-threading environments: OpenMP*, Intel® Threading Building Blocks,POSIX* threads, and others.

Usage model: disable oneMKL internal threading for the whole application

When used:Intel® oneAPI Math Kernel Library (oneMKL) internal threading interferes with application's own threading or may slow down the application.

Example: the application is threaded at top level, or the application runs concurrently with other applications.

Options:

  • Link statically or dynamically with the sequential library

  • Link with the Single Dynamic Library mkl_rt.so and select the sequential library using an environment variable or a function call:

    • Set MKL_THREADING_LAYER=sequential

    • Call mkl_set_threading_layer(MKL_THREADING_SEQUENTIAL)

For details of the mentioned functions, see the Support Functions section of the Intel® oneAPI Math Kernel Library (oneMKL) Developer Reference, available in the Intel Software Documentation Library.

Product and Performance Information

Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex.

Notice revision #20201201