Skip to content
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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

BrieucNicolas
Copy link
Contributor

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

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
Copy link
Contributor

@devreal devreal left a 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,
Copy link
Contributor

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)

parsec/interfaces/dtd/insert_function.c Show resolved Hide resolved
* - 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;
Copy link
Contributor

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);
Copy link
Contributor

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?

Copy link
Contributor Author

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

@BrieucNicolas BrieucNicolas marked this pull request as draft August 14, 2023 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants