Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 anArgumentError
. 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"sched.nchunks
,sched.chunkisze
orsched.split
no longer works and is replaced by functions of the same name (e.g.nchunks(sched)
. This is because they are encapsulated intosched.chunking_args
, so they are no longer direct fields. We could implement aBase.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.