File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -157,15 +157,16 @@ TEST_CASE("Test reserved slots argument in create_numa_task_arenas") {
157157 [](const index_info &lhs, const index_info &rhs) {
158158 return lhs.concurrency < rhs.concurrency ;
159159 })->concurrency ;
160-
160+ const int max_threads = int (utils::get_platform_max_threads ()); // respects cgroup
161+ const int max_tbb_workers = max_threads - 1 ;
161162 for (int reserved_slots = 0 ; reserved_slots <= expected_numa_concurrency; ++reserved_slots) {
162163 auto numa_task_arenas = tbb::create_numa_task_arenas ({}, reserved_slots);
163164 tbb::task_group tg{};
164165 // Having only NUMA node means that the default total number of workers is equal to
165166 // concurrnecy of the single NUMA - 1. This means that for task_arena with reserved_slots=0
166167 // worker threads won't be able to fully saturate the arena.
167168 // This flag is set to adjust test expectations accordingly.
168- bool workers_cannot_fully_occupy_arena = numa_nodes_info. size () == 1 && reserved_slots == 0 ;
169+ bool workers_cannot_fully_occupy_arena = max_tbb_workers < expected_numa_concurrency && reserved_slots == 0 ;
169170 for (auto & ta : numa_task_arenas) {
170171 // For the case when task_arena is created with both max_concurrency and reserved_slots
171172 // equal to 1 oneTBB creates a special additional worker to execute an "enqueue" task.
You can’t perform that action at this time.
0 commit comments