You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reducing the max. allowed parallelism via tbb::global_control does not "stop" threads anymore. The worker threads are spinning in thread_dispatcher::process() and are eating CPU power, meaning that the execution is slower.
The problem gets triggered when executing first e.g. tbb::parallel_for_each (to "fire up" threads), then reducing the number of threads to 1 via tbb::global_control and then executing a second tbb::parallel_for_each. While the second tbb::parallel_for_each is executed, only a single core should be active. Using the debugger I also see that the business logic is executed only by a single thread. However, looking in the task manager, I see that all cores are busy. The unnecessary threads cause the code to run slower by ~50% (either because of oversubscription, or because the CPU frequency gets reduced, not sure).
Version
Version 2021.10.0 was ok. Version 2021.11.0 is broken. The current master (55bf2b3) is still broken.
I was able to bisect the problem to commit c456844 (pull request: #758).
Environment
Windows 11
Intel Core i9-13900
Microsoft Compiler version 19.40 (_MSC_FULL_VER=194033811)
Observed Behavior
100% CPU load (all cores are busy) even though tbb::global_control was used to reduce the max. allowed parallelism to 1.
Expected Behavior
After setting the max. allowed parallelism to 1 via tbb::global_control, only a single core should be busy (corresponds to ~3% CPU load in the task manager because of 32 virtual cores of my Intel i9-13900).
Execute and observe in the task manager that all cores are busy. (That is the problem). Also take note of the execution time.
Then either revert to an older TBB version, or set TRIGGER_BUG=false. Then run again. Result: Only a single core is busy, and the execution time dropped by ~50%.
The text was updated successfully, but these errors were encountered:
Summary
Reducing the max. allowed parallelism via
tbb::global_control
does not "stop" threads anymore. The worker threads are spinning inthread_dispatcher::process()
and are eating CPU power, meaning that the execution is slower.The problem gets triggered when executing first e.g.
tbb::parallel_for_each
(to "fire up" threads), then reducing the number of threads to 1 viatbb::global_control
and then executing a secondtbb::parallel_for_each
. While the secondtbb::parallel_for_each
is executed, only a single core should be active. Using the debugger I also see that the business logic is executed only by a single thread. However, looking in the task manager, I see that all cores are busy. The unnecessary threads cause the code to run slower by ~50% (either because of oversubscription, or because the CPU frequency gets reduced, not sure).Version
Version 2021.10.0 was ok. Version 2021.11.0 is broken. The current master (55bf2b3) is still broken.
I was able to bisect the problem to commit c456844 (pull request: #758).
Environment
_MSC_FULL_VER=194033811
)Observed Behavior
100% CPU load (all cores are busy) even though
tbb::global_control
was used to reduce the max. allowed parallelism to 1.Expected Behavior
After setting the max. allowed parallelism to 1 via
tbb::global_control
, only a single core should be busy (corresponds to ~3% CPU load in the task manager because of 32 virtual cores of my Intel i9-13900).Steps To Reproduce
TRIGGER_BUG=false
. Then run again. Result: Only a single core is busy, and the execution time dropped by ~50%.The text was updated successfully, but these errors were encountered: