tbb::internal::binding_handler Class Reference
Collaboration diagram for tbb::internal::binding_handler:

## Public Member Functions

| binding_handler (size_t size)
| ~binding_handler ()
void | bind_thread_to_node (unsigned slot_num, unsigned numa_node_id)
void | restore_previous_affinity_mask (unsigned slot_num)

## Private Types

typedef std::vector< platform_topology::affinity_mask > | affinity_masks_container

## Private Attributes

affinity_masks_container | affinity_backup

## Detailed Description

Definition at line 221 of file tbb_bind.cpp.

## Member Typedef Documentation

## affinity_masks_container

typedef std::vector<platform_topology::affinity_mask> tbb::internal::binding_handler::affinity_masks_container

private

Definition at line 224 of file tbb_bind.cpp.

## Constructor & Destructor Documentation

## binding_handler()

tbb::internal::binding_handler::binding_handler | ( | size_t | size | ) |

inline

Definition at line 228 of file tbb_bind.cpp.

: affinity_backup(size) {
for (affinity_masks_container::iterator it = affinity_backup.begin();
it != affinity_backup.end(); it++) {
*it = platform_topology::allocate_process_affinity_mask();
}
}

References affinity_backup, and tbb::internal::platform_topology::allocate_process_affinity_mask().

Here is the call graph for this function:

## ~binding_handler()

tbb::internal::binding_handler::~binding_handler | ( |  | ) |

inline

Definition at line 235 of file tbb_bind.cpp.

{
for (affinity_masks_container::iterator it = affinity_backup.begin();
it != affinity_backup.end(); it++) {
platform_topology::free_affinity_mask(*it);
}
}

References affinity_backup, and tbb::internal::platform_topology::free_affinity_mask().

Here is the call graph for this function:

## Member Function Documentation

## bind_thread_to_node()

void tbb::internal::binding_handler::bind_thread_to_node | ( | unsigned | slot_num,
|  | unsigned | numa_node_id
| ) |  |

inline

Definition at line 242 of file tbb_bind.cpp.

{
__TBB_ASSERT(slot_num < affinity_backup.size(),
"The slot number is greater than the number of slots in the arena");
__TBB_ASSERT(platform_topology::is_topology_parsed(),
"Trying to get access to uninitialized platform_topology");
platform_topology::store_current_affinity_mask(affinity_backup[slot_num]);
platform_topology::set_new_affinity_mask(
platform_topology::get_node_affinity_mask(numa_node_id));
}

References __TBB_ASSERT, affinity_backup, tbb::internal::platform_topology::get_node_affinity_mask(), tbb::internal::platform_topology::is_topology_parsed(), tbb::internal::platform_topology::set_new_affinity_mask(), and tbb::internal::platform_topology::store_current_affinity_mask().

Referenced by tbb::internal::bind_to_node().

Here is the call graph for this function:
Here is the caller graph for this function:

## restore_previous_affinity_mask()

void tbb::internal::binding_handler::restore_previous_affinity_mask | ( | unsigned | slot_num | ) |

inline

Definition at line 253 of file tbb_bind.cpp.

{
__TBB_ASSERT(platform_topology::is_topology_parsed(),
"Trying to get access to uninitialized platform_topology");
platform_topology::set_new_affinity_mask(affinity_backup[slot_num]);
};

References __TBB_ASSERT, affinity_backup, tbb::internal::platform_topology::is_topology_parsed(), and tbb::internal::platform_topology::set_new_affinity_mask().

Referenced by tbb::internal::restore_affinity().

Here is the call graph for this function:
Here is the caller graph for this function:

## Member Data Documentation

## affinity_backup

affinity_masks_container tbb::internal::binding_handler::affinity_backup

private

Definition at line 225 of file tbb_bind.cpp.

Referenced by bind_thread_to_node(), binding_handler(), restore_previous_affinity_mask(), and ~binding_handler().

The documentation for this class was generated from the following file:

- tbb_bind.cpp

__TBB_ASSERT
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
Definition: tbb_stddef.h:165
size
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t size
Definition: ittnotify_static.h:109
tbb::internal::binding_handler::affinity_backup
affinity_masks_container affinity_backup
Definition: tbb_bind.cpp:225
tbb::internal::platform_topology::allocate_process_affinity_mask
static affinity_mask allocate_process_affinity_mask()
Definition: tbb_bind.cpp:182
tbb::internal::platform_topology::set_new_affinity_mask
static void set_new_affinity_mask(const_affinity_mask new_mask)
Definition: tbb_bind.cpp:199
tbb::internal::platform_topology::free_affinity_mask
static void free_affinity_mask(affinity_mask mask_to_free)
Definition: tbb_bind.cpp:187
tbb::internal::platform_topology::is_topology_parsed
static bool is_topology_parsed()
Definition: tbb_bind.cpp:67
tbb::internal::platform_topology::get_node_affinity_mask
static const_affinity_mask get_node_affinity_mask(int node_index)
Definition: tbb_bind.cpp:203
tbb::internal::platform_topology::store_current_affinity_mask
static void store_current_affinity_mask(affinity_mask current_mask)
Definition: tbb_bind.cpp:191

Copyright © 2005-2020 Intel Corporation. All Rights Reserved.

Intel, Pentium, Intel Xeon, Itanium, Intel XScale and VTune are registered trademarks or trademarks of Intel Corporation or its subsidiaries in the United States and other countries.

* Other names and brands may be claimed as the property of others.