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

Schedulers as structs #45

Merged
merged 12 commits into from
Feb 8, 2024
Merged

Schedulers as structs #45

merged 12 commits into from
Feb 8, 2024

Conversation

carstenbauer
Copy link
Member

@carstenbauer carstenbauer commented Feb 7, 2024

This PR introduces structs for different schedulers. This enables us to have different options (fields) and default values for different schedulers (#22).

Notes:

  • The static and dynamic schedulers have nchunks but the greedy scheduler has ntasks, because it doesn't do any chunking.
  • We default to nthreads() tasks for static and greedy but 2*nthreads() tasks for dynamic to have a bit of load balancing by default. (unclear if this is the best choice, see questions below)

Questions:

  • Should the default for DynamicScheduler be nchunks = 2*nthreads() or nchunks = nthreads(), i.e. load balancing or not?
  • Maybe we should choose the latter and have a separate LoadBalancingScheduler as an alias for DynamicScheduler(nchunks=2*nthreads)?
  • Should we export all scheduler structs? (I currently do)

Closes #22

@carstenbauer
Copy link
Member Author

Copy link
Member

@MasonProtter MasonProtter left a comment

Choose a reason for hiding this comment

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

Yep, it all looks good to me!

Regarding the questions:

  1. I typically like 2*nthreads() as the default for dynamic. I think it makes the most sense in almost all cases, and then people can tune from there if they have a problem where those extra tasks really are expensive. IMO 1*nthreads() only really makes sense if your workload is highly uniform, or you're right on the cusp of when multithreading is not profitable (order 10-100 microseconds or whatever)

  2. I think the alias there would be kinda misleading. The greedy scheduler is much more of a load balancer than just oversubscribing.

  3. If people don't want them in their namespace, they can just choose what to import.

@carstenbauer carstenbauer marked this pull request as ready for review February 8, 2024 18:17
@carstenbauer carstenbauer merged commit 2dc2f3a into master Feb 8, 2024
11 checks passed
@carstenbauer carstenbauer deleted the carstenbauer/issue22 branch February 8, 2024 18:18
@carstenbauer carstenbauer restored the carstenbauer/issue22 branch June 28, 2024 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make scheduler options structs
2 participants