-
Notifications
You must be signed in to change notification settings - Fork 9
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 struct
s
#45
Conversation
Documentation preview: https://juliafolds2.github.io/OhMyThreads.jl/previews/PR45/ |
There was a problem hiding this 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:
-
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. IMO1*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) -
I think the alias there would be kinda misleading. The greedy scheduler is much more of a load balancer than just oversubscribing.
-
If people don't want them in their namespace, they can just choose what to import.
This PR introduces structs for different schedulers. This enables us to have different options (fields) and default values for different schedulers (#22).
Notes:
nchunks
but the greedy scheduler hasntasks
, because it doesn't do any chunking.nthreads()
tasks for static and greedy but2*nthreads()
tasks for dynamic to have a bit of load balancing by default. (unclear if this is the best choice, see questions below)Questions:
DynamicScheduler
benchunks = 2*nthreads()
ornchunks = nthreads()
, i.e. load balancing or not?LoadBalancingScheduler
as an alias forDynamicScheduler(nchunks=2*nthreads)
?Closes #22