Intel® oneAPI Threading Building Blocks
Ask questions and share information about adding parallelism to your applications when using this threading library.

task_scheduler_init does not obey number_of_threads parameter in debug mode

iliyang
Beginner
384 Views
Hi,

I've been having a weird issue for a while with TBB. Even with the latest Windows x64 binaries (tbb40_297oss), in debug mode when I create my task_scheduler_init object by setting the number_of_threads parameter to 1, my program still runs in many threads with parallel_for. In release mode, it seems to spawn one thread, cause my Core i7 CPU is loaded on 1/8. In debug it's fully loaded and jumps across threads when debugging. And I want to debug with a single thread. Any ideas?

Thanks,
Iliyan
0 Kudos
5 Replies
Kirill_R_Intel
Employee
384 Views
I've just tested with the latest tbb40_20120408oss (aligned with TBB 4.0 update 4). All works correct, I don't see the issue. If Intel TBB is built in Debug mode when I initialize task_scheduler_init to 1 thread it creates only 1 thread. I've check number of threads with Intel VTune Amplifier XE.
0 Kudos
iliyang
Beginner
384 Views
Thanks for the reply. I'll investigate and try to prepare and share a small example, if I cannot resolve the problem.
0 Kudos
SergeyKostrov
Valued Contributor II
384 Views
This is a follow up: Did you resolve the problem?
0 Kudos
Summer_D_
Beginner
384 Views
Hi, I am now facing a similar problem. The number of threads I designate in task_scheduler_init does not conform what Intel Vtune Amplifier XE shows. Here is the difference: task_scheduler_init threads count in Intel Vtune Amplifier 1 1 2 3 3 5 4 6 5 7 6 8 7 9 ...... And I have another question. Somebody say that set __TBB_ARENA_PER_MASTER to 0 would help. But I can not find this var. I searched the file in /usr/include/tbb/tbb_config.h My tbb is installed from Synaptic and is 3.0+r147. Hoping to get messages. Thanks!
0 Kudos
Kirill_R_Intel
Employee
384 Views
Could you please attach a code sample representing this behavior?
0 Kudos
Reply