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

Fix race between creating collective groups and submitting host tasks #152

Merged
merged 1 commit into from
Nov 8, 2022

Conversation

fknorr
Copy link
Contributor

@fknorr fknorr commented Nov 7, 2022

Current Celerity has a race condition on worker nodes between submission of collective host tasks and the submission of their kernels to the host queue. Choosing a non-default collective group creates an additional worker thread from the main thread, and kernel submission requires that thread to be up and running.

  • The executor busy-waits for the task definition to be available, but the collective group thread was created after task insertion into the ringbuffer. This has been reversed to ensure the worker thread is ready when the task becomes available to the executor.
  • Even though the set of worker threads in host_queue was accessed by both main and executor thread, it was left unsynchronized. The class member is now protected by a mutex.

@fknorr fknorr requested review from psalz and BlackMark29A November 7, 2022 17:51
@fknorr fknorr self-assigned this Nov 7, 2022
Copy link
Member

@psalz psalz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

include/host_queue.h Outdated Show resolved Hide resolved
@fknorr fknorr force-pushed the fix-collective-submit-race branch from 09a62e2 to ecc4344 Compare November 8, 2022 15:12
@fknorr fknorr merged commit 0a4fca5 into master Nov 8, 2022
@fknorr fknorr deleted the fix-collective-submit-race branch November 10, 2022 13:51
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