17 #include "../tbb/tbb_assert_impl.h"
20 #if _MSC_VER && !__INTEL_COMPILER
21 #pragma warning( push )
22 #pragma warning( disable : 4100 )
25 #if _MSC_VER && !__INTEL_COMPILER
26 #pragma warning( pop )
33 #define assertion_hwloc_wrapper(command, ...) \
34 __TBB_ASSERT_EX( (command(__VA_ARGS__)) >= 0, "Error occurred during call to hwloc API.");
75 if ( hwloc_topology_init( &
topology ) == 0 ) {
77 if ( hwloc_topology_load(
topology ) == 0 ) {
123 unsigned counter = 0;
125 int max_numa_index = -1;
127 hwloc_obj_t node_buffer;
129 node_buffer = hwloc_get_obj_by_type(
topology, HWLOC_OBJ_NUMANODE, i);
137 } hwloc_bitmap_foreach_end();
138 __TBB_ASSERT(max_numa_index >= 0,
"Maximal NUMA index must not be negative");
146 node_buffer = hwloc_get_obj_by_type(
topology, HWLOC_OBJ_NUMANODE, i);
147 index = static_cast<int>(node_buffer->logical_index);
150 current_mask = hwloc_bitmap_dup(node_buffer->cpuset);
153 __TBB_ASSERT(!hwloc_bitmap_iszero(current_mask),
"hwloc detected unavailable NUMA node");
155 } hwloc_bitmap_foreach_end();
175 static void fill(
int& nodes_count,
int*& indexes_list,
int*& concurrency_list ) {
188 hwloc_bitmap_free(mask_to_free);
196 "Current affinity mask must intersects with process affinity mask");
205 "Trying to get affinity mask for uninitialized NUMA node");
244 "The slot number is greater than the number of slots in the arena");
246 "Trying to get access to uninitialized platform_topology");
255 "Trying to get access to uninitialized platform_topology");
264 int& nodes_count,
int*& indexes_list,
int*& concurrency_list ) {
270 __TBB_ASSERT(slot_num > 0,
"Trying to create numa handler for 0 threads.");
275 __TBB_ASSERT(handler_ptr != NULL,
"Trying to deallocate NULL pointer.");
280 __TBB_ASSERT(handler_ptr != NULL,
"Trying to get access to uninitialized metadata.");
282 "to uninitialized platform_topology.");
287 __TBB_ASSERT(handler_ptr != NULL,
"Trying to get access to uninitialized metadata.");
289 "to uninitialized platform_topology.");
298 #undef assertion_hwloc_wrapper