ippSetAffinity

Binds OpenMP threads to OS processors.

Syntax

IppStatus ippSetAffinity(IppAffinityType aType, int offset);

Parameters

aType

Type of affinity settings, the possible values:

ippAffinityCompactFineCore

ippAffinityCompactFineHT

ippAffinityAllEnabled

ippAffinityRestore

ippTstAffinityCompactFineCore

ippTstAffinityCompactFineHT

offset

Specified the starting position for thread assignment.

Description

The function ippSetAffinity is declared in the ippcore.h file. This function sets OpenMP thread affinity for all OpenMP parallel regions in the current context.

Note iconNote

Thread affinity is supported only on systems running Windows* OS and those versions of Linux* OS that have kernel support for thread affinity.

 

The function ippSetAffinity increases performance of the threaded functions on the homogeneous systems. Specifically it is very effective if there are several packages that don't share the same last level cache (LLC), or when hyper threading is enabled. In last case highly optimized functions can't take any advantage from HT because of sharing the same hardware resources.

Once the function ippSetAffinity sets affinity for a number of threads equal to number of OS processors [ICCC] on the machine, then each thread remains bound to the corresponding OS processor, unless reset via a subsequent call to ippSetAffinity.

This function use Intel OpenMP low-level affinity API, and it takes effect if OMP_AFFINITY environment variable is not set to disabled.

In accordance with the values of the parameter aType, the following thread affinity types are possible:

Return Values

ippStsNoErr

Indicates that OPenMP thread affinity is set.

ippStsLLADisable

Indicates a warning that the OpenMP Low Level Affinity is disabled.

ippStsNotSupportedCpu

Indicates a warning that the processor is not supported, or the operating system does not support thread affinity.

Optimization Notice

The Intel® Integrated Performance Primitives (Intel® IPP) library contains functions that are more highly optimized for Intel microprocessors than for other microprocessors. While the functions in the Intel® IPP library offer optimizations for both Intel and Intel-compatible microprocessors, depending on your code and other factors, you will likely get extra performance on Intel microprocessors.

While the paragraph above describes the basic optimization approach for the Intel® IPP library as a whole, the library may or may not be optimized to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include Intel® Streaming SIMD Extensions 2 (Intel® SSE2), Intel® Streaming SIMD Extensions 3 (Intel® SSE3), and Supplemental Streaming SIMD Extensions 3 (Intel® 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.

Intel recommends that you evaluate other library products to determine which best meets your requirements.


Submit feedback on this help topic

Copyright © 2000 - 2010, Intel Corporation. All rights reserved.