co_manager shortcuting the scheduler - #566
Conversation
1eaf883 to
b7a0309
Compare
fix for multiple gpus Added debug output and some documentation, error tolerance for multiple gpu and no manager, refactored loop in insert_function, got rid of deadlock
b7a0309 to
b535ab2
Compare
| if (PARSEC_DTD_FLUSH_TC_ID == current_task->task_class->task_class_id) | ||
| { | ||
| PARSEC_DEBUG_VERBOSE(10, parsec_gpu_output_stream,"GPU[%s]: Thread %d scheduling task %s at %s:%d", | ||
| ((parsec_device_module_t*)*co_manager_tls_val)->name, es->th_id, |
There was a problem hiding this comment.
These casts are not necessary (here and elsewhere)
| */ | ||
| while(1) { | ||
| rc = gpu_device->mutex; | ||
| rc = rc1 = gpu_device->mutex; |
There was a problem hiding this comment.
I don't like rc1 for its lack of information. I suggest using a boolean variable like was_first_co_manager (you get the point :)) that is set to true if the CAS below succeeds and rc == 1.
| PARSEC_DEBUG_VERBOSE(4, parsec_gpu_output_stream,"GPU[%s]: gpu_task %p completed by co-manager %d at %s:%d", gpu_device->super.name, | ||
| gpu_task, es->th_id, __FILE__, __LINE__); | ||
| parsec_atomic_fetch_dec_int32( &(gpu_device->complete_mutex) ); | ||
| parsec_list_push_back(gpu_tasks_to_free, (parsec_list_item_t*)gpu_task); |
There was a problem hiding this comment.
Why do we have to accumulate task objects here? Can they not be free'd directly?
There was a problem hiding this comment.
Yes, thank you for pointing that out. i found a fix for this, it will be applied
|
We have a simpler and less intrusive approach in #762. It lacks the DTD support for executing the ready tasks returned by the completion immediately, but if we really want that capability we should reimplement it instead of reviving this PR. |
Continuation of #509 adding a shortcut when discovering tasks in the dtd. The co-manager executes ready tasks discovered during completion immediatly instead of scheduling them