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

rewrite schedulers #135

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

arnaud-ma
Copy link

I tried to implement #114 and I quickly got lost in all these if/else branches (surely added bit by bit). I noticed that the problem was that everything was mixed up between what is chunking and what is not. And everything that is chunking is common to each scheduler.

So I rewrote the module to make the difference between the two clear. This is done by encapsulating everything related to chunking into a new internal type ChunkingArgs. Then each Scheduler contains only one instance of this type instead of all the chunking arguments.

Otherwise nothing should really change outside the module, except:

  • shed(;chunking=false, split=:whatever) returned an ArgumentError. It's no longer the case. This makes the code simpler and I think it fits better with what the documentation describes: "For chunking=false, the arguments nchunks/ntasks, chunksize, and split are ignored"
  • Using sched.nchunks, sched.chunkisze or sched.split no longer works and is replaced by functions of the same name (e.g. nchunks(sched). This is because they are encapsulated into sched.chunking_args, so they are no longer direct fields. We could implement a Base.getproperty though, but I don't think it's really necessary.

With these changes, adding chunking arguments or even a new type of Scheduler becomes easier.

@codecov-commenter
Copy link

codecov-commenter commented Feb 18, 2025

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 96.34146% with 3 lines in your changes missing coverage. Please review.

Project coverage is 90.28%. Comparing base (cba9127) to head (5b79e03).
Report is 132 commits behind head on master.

Files with missing lines Patch % Lines
src/schedulers.jl 97.50% 2 Missing ⚠️
src/implementation.jl 50.00% 1 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #135      +/-   ##
==========================================
+ Coverage   90.24%   90.28%   +0.04%     
==========================================
  Files           3        7       +4     
  Lines          82      556     +474     
==========================================
+ Hits           74      502     +428     
- Misses          8       54      +46     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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