-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
co_manager shortcuting the scheduler #566
base: master
Are you sure you want to change the base?
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not familiar with #509 so I might be missing something in my review.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These casts are not necessary (here and elsewhere)
* - rc > 0: there is a manager, and at the exit of the while, this thread has | ||
* committed new work that the manager will need to do, but the work is | ||
* not in the queue yet. | ||
*/ | ||
while(1) { | ||
rc = gpu_device->mutex; | ||
rc = rc1 = gpu_device->mutex; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we have to accumulate task objects here? Can they not be free'd directly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, thank you for pointing that out. i found a fix for this, it will be applied
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