Affinity Mask - Windows API

Windows API

Thread affinity in Microsoft Windows can be specified with the SetThreadAffinityMask function. Forcing of each OpenMP thread to distinctive cores in Windows can be accomplished by means of the following C code:

#include #include // Set OpenMP thread affinity void set_thread_affinity { #pragma omp parallel default(shared) { DWORD_PTR mask = (1 << omp_get_thread_num); SetThreadAffinityMask( GetCurrentThread, mask ); } }

Read more about this topic:  Affinity Mask

Famous quotes containing the word windows:

    Among a hundred windows shining
    dully in the vast side
    of greater-than-palace number such-and-such
    one burns
    these several years, each night
    as if the room within were aflame.
    Denise Levertov (b. 1923)