Information on TBB Scheduler and Task Stealing

Dmitriy Vyukov
Total Points:
25,462
Status Points:
25,462
Black Belt
November 9, 2008 4:46 AM PST
Rate
 
#5
Quoting - abhishek84
I am trying to get some information on the details of the TBB scheduler code in task.cpp. I basically want to profile how well the random task scheduler performs by tracking each instance of a false negative -- that is, one thread tries to steal a task from another randomly selected task queue, and fails to do so despite the fact that other task queues in fact do have tasks available.

I am curious what do you mean by "how well the random task scheduler performs"? What sources of false-negatives are you looking for?

I see only 2 possible sources of false-negatives:

(1) thread is unable to steal too "low-level" tasks, i.e.:

task* GenericScheduler::steal_task( UnpaddedArenaSlot& arena_slot, depth_type d ) {
task* result = NULL;
ExponentialBackoff backoff;
bool sync_prepare_done = false;
depth_type steal_end = arena_slot.steal_end;
for(;;) {
if( steal_end>>1<d ) {
// Nothing of interest to steal
if( sync_prepare_done )
ITT_NOTIFY(sync_cancel, &arena_slot);
goto done;
}


(2) thread fails to "strip the proxy" after task stealing:

t = steal_task( *victim, d );
if( !t ) goto fail;
if( is_proxy(*t) ) {
t = strip_proxy((task_proxy*)t);
if( !t ) goto fail;
GATHER_STATISTIC( ++proxy_steal_count );
}

If you are trying to track these sources of false-negatives, then probably it's easier to insert statistics collection directly into the places marked with bold.

 



Intel Software Network Forums Statistics

8479 users have contributed to 31611 threads and 100667 posts to date.
In the past 24 hours, we have 31 new thread(s) 108 new posts(s), and 167 new user(s).

In the past 3 days, the most popular thread for everyone has been gemm(A,A,A) like possible? The most posts were made to gemm(A,A,A) like possible? The post with the most views is Dear Steve, excuse me for a d

Please welcome our newest member zhpn