You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+5
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,11 @@
1
1
OhMyThreads.jl Changelog
2
2
=========================
3
3
4
+
Version 0.8.2
5
+
------------
6
+
-![Feature][badge-feature] Added a `minchunksize` chunking argument for schedulers, so that they can specify a lower bound on the size of chunks which are worth parallelizing. For example, `treduce(+, 1:10; minchunksize=100)` will run serially, but `treduce(+, 1:1000000; minchunksize=100)` will be parallelized.
7
+
-![Enhancement][badge-enhancement] Operations on collections with only one 'chunk' no longer spawn an unnecessary task. That means operations like `treduce(+, 1:10; minchunksize=100)` will have less overhead.
8
+
4
9
Version 0.8.1
5
10
------------
6
11
-![Feature][badge-feature] Added a `@localize` macro which turns `@localize x y expr` into `let x=x, y=y; expr end` ([#142][gh-pr-142])
* Sets a lower bound on the size of chunks. This argument takes priority over `nchunks`, so `treduce(+, 1:10; nchunks=10, minchunksize=5)` will only operate on `2` chunks for example.
* Determines how the collection is divided into chunks (if chunking=true). By default, each chunk consists of contiguous elements and order is maintained.
185
197
* See [ChunkSplitters.jl](https://github.com/JuliaFolds2/ChunkSplitters.jl) for more details and available options. We also allow users to pass `:consecutive` in place of `Consecutive()`, and `:roundrobin` in place of `RoundRobin()`
@@ -209,14 +221,15 @@ function DynamicScheduler(;
209
221
ntasks::MaybeInteger=NotGiven(), # "alias" for nchunks
210
222
chunksize::MaybeInteger=NotGiven(),
211
223
chunking::Bool=true,
212
-
split::Union{Split, Symbol}=Consecutive())
224
+
split::Union{Split, Symbol}=Consecutive(),
225
+
minchunksize::Union{Nothing, Int}=nothing)
213
226
ifisgiven(ntasks)
214
227
ifisgiven(nchunks)
215
228
throw(ArgumentError("For the dynamic scheduler, nchunks and ntasks are aliases and only one may be provided"))
216
229
end
217
230
nchunks = ntasks
218
231
end
219
-
ca =ChunkingArgs(DynamicScheduler, nchunks, chunksize, split; chunking)
232
+
ca =ChunkingArgs(DynamicScheduler, nchunks, chunksize, split; chunking, minsize=minchunksize)
220
233
returnDynamicScheduler(threadpool, ca)
221
234
end
222
235
from_symbol(::Val{:dynamic}) = DynamicScheduler
@@ -250,6 +263,8 @@ Isn't well composable with other multithreaded code though.
250
263
- `chunksize::Integer` (default not set)
251
264
* Specifies the desired chunk size (instead of the number of chunks).
252
265
* The options `chunksize` and `nchunks`/`ntasks` are **mutually exclusive** (only one may be non-zero).
* Sets a lower bound on the size of chunks. This argument takes priority over `nchunks`, so `treduce(+, 1:10; nchunks=10, minchunksize=5)` will only operate on `2` chunks for example.
253
268
- `chunking::Bool` (default `true`):
254
269
* Controls whether input elements are grouped into chunks (`true`) or not (`false`).
255
270
* For `chunking=false`, the arguments `nchunks`/`ntasks`, `chunksize`, and `split` are ignored and input elements are regarded as "chunks" as is. Hence, there will be one parallel task spawned per input element. Note that, depending on the input, this **might spawn many(!) tasks** and can be costly!
@@ -267,14 +282,15 @@ function StaticScheduler(;
267
282
ntasks::MaybeInteger=NotGiven(), # "alias" for nchunks
268
283
chunksize::MaybeInteger=NotGiven(),
269
284
chunking::Bool=true,
270
-
split::Union{Split, Symbol}=Consecutive())
285
+
split::Union{Split, Symbol}=Consecutive(),
286
+
minchunksize::Union{Nothing, Int}=nothing)
271
287
ifisgiven(ntasks)
272
288
ifisgiven(nchunks)
273
289
throw(ArgumentError("For the static scheduler, nchunks and ntasks are aliases and only one may be provided"))
274
290
end
275
291
nchunks = ntasks
276
292
end
277
-
ca =ChunkingArgs(StaticScheduler, nchunks, chunksize, split; chunking)
293
+
ca =ChunkingArgs(StaticScheduler, nchunks, chunksize, split; chunking, minsize=minchunksize)
278
294
returnStaticScheduler(ca)
279
295
end
280
296
from_symbol(::Val{:static}) = StaticScheduler
@@ -315,6 +331,8 @@ some additional overhead.
315
331
- `chunksize::Integer` (default not set)
316
332
* Specifies the desired chunk size (instead of the number of chunks).
317
333
* The options `chunksize` and `nchunks` are **mutually exclusive** (only one may be a positive integer).
* Sets a lower bound on the size of chunks. This argument takes priority over `nchunks`, so `treduce(+, 1:10; nchunks=10, minchunksize=5)` will only operate on `2` chunks for example.
* Determines how the collection is divided into chunks (if chunking=true).
320
338
* See [ChunkSplitters.jl](https://github.com/JuliaFolds2/ChunkSplitters.jl) for more details and available options. We also allow users to pass `:consecutive` in place of `Consecutive()`, and `:roundrobin` in place of `RoundRobin()`
@@ -334,11 +352,12 @@ function GreedyScheduler(;
334
352
nchunks::MaybeInteger=NotGiven(),
335
353
chunksize::MaybeInteger=NotGiven(),
336
354
chunking::Bool=false,
337
-
split::Union{Split, Symbol}=RoundRobin())
355
+
split::Union{Split, Symbol}=RoundRobin(),
356
+
minchunksize::Union{Nothing, Int}=nothing)
338
357
ifisgiven(nchunks) ||isgiven(chunksize)
339
358
chunking =true
340
359
end
341
-
ca =ChunkingArgs(GreedyScheduler, nchunks, chunksize, split; chunking)
360
+
ca =ChunkingArgs(GreedyScheduler, nchunks, chunksize, split; chunking, minsize=minchunksize)
0 commit comments