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

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


Submit feedback on this help topic

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