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

Add a mechanism to reset the default task spawn order #136

Merged
merged 1 commit into from
Aug 28, 2023

Conversation

ronawho
Copy link
Contributor

@ronawho ronawho commented Aug 21, 2023

Add qthread_reset_target_shep(), which resets the shepherd that tasks created with NO_SHEPHERD get spawned to. This is useful in Chapel for cases where we want to use the default spawn location, but get good NUMA affinity between data parallel loops sepreated by some other task spawn.

Just using the qthread_fork_to API would disable future stealing, so this is a mechanism to get tasks in consecutive data parallel loops to spawn to the same shepherds without preventing stealing.

This was originally done in chapel-lang/chapel#12868, which includes some perf results. At the time I expected we'd update our shim to use qthread_fork_to, but had not considered the work-stealing implications at the time.

Add `qthread_reset_target_shep()`, which resets the shepherd that tasks
created with `NO_SHEPHERD` get spawned to. This is useful in Chapel for
cases where we want to use the default spawn location, but get good NUMA
affinity between data parallel loops sepreated by some other task spawn.

Just using the `qthread_fork_to` API would disable future stealing, so
this is a mechanism  to get tasks in consecutive data parallel loops to
spawn to the same shepherds without preventing stealing.

This was originally done in chapel-lang/chapel 12868, which includes
some perf results. At the time I expected we'd update our shim to use
`qthread_fork_to`, but had not considered the work-stealing implications
at the time.
@janciesko
Copy link
Collaborator

LGTM. Thanks! I will add documentation and an entry to the 1.19 release log shortly.

@janciesko janciesko self-requested a review August 22, 2023 19:53
@janciesko janciesko merged commit c4c5c6e into sandialabs:main Aug 28, 2023
7 checks passed
@ronawho ronawho deleted the add-task-spawn-reset branch August 28, 2023 16:41
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