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

Use stackless threads where appropriate #1037

Merged
merged 9 commits into from
Nov 23, 2023

Conversation

msimberg
Copy link
Collaborator

@msimberg msimberg commented Nov 15, 2023

Changes a lot of tasks to use the thread_stacksize::nostack stack size (i.e. no separate stack, thus no context switching or yielding either). I've manually opted tasks in to this rather than make it the default because the worst case is that we end up with deadlocks if we apply nostack to tasks that shouldn't have it. The worst that happens if we use a stack on tasks that don't need it is bad performance. Tasks that shouldn't use nostack are anything that might yield, meaning anything that calls barrier::arrive, semaphore::acquire, sync_wait, etc.

Full benchmarking results are available here: https://confluence.cscs.ch/display/SCISWDEV/2023-11+stackless+threads. GEVP results on LUMI MC and Piz Daint MC:

LUMI:
gevp_strong_time_20480_lumi_mc_nostack

Daint:
gevp_strong_time_20480

@msimberg msimberg added this to the Optimizations milestone Nov 15, 2023
@msimberg msimberg self-assigned this Nov 15, 2023
@msimberg msimberg changed the title Stackless threads Use stackless threads where appropriate Nov 15, 2023
@msimberg
Copy link
Collaborator Author

cscs-ci run

@msimberg
Copy link
Collaborator Author

cscs-ci run

@msimberg msimberg marked this pull request as ready for review November 17, 2023 11:03
@msimberg msimberg requested review from albestro and rasolca November 20, 2023 15:23
Copy link
Collaborator

@aurianer aurianer left a comment

Choose a reason for hiding this comment

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

LGTM thanks!

@msimberg
Copy link
Collaborator Author

cscs-ci run

@rasolca rasolca merged commit 463df55 into eth-cscs:master Nov 23, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants