- We now use ChunkSplitters version 3.0. The function
OhMyThreads.chunks
has been renamed toOhMyThreads.index_chunks
. The new functionsindex_chunks
andchunks
(different from the old one with the same name!) are now exported. See ChunkSplitters.jl for more information. - If you provide a
chunks
orindex_chunks
as input we now disable the internal chunking without a warning. Previously, we did show a warning unless you had setchunking=false
. In contrast, we now throw an error when you set any incompatible chunking related keyword arguments. - The
split
options:batch
and:scatter
are now deprecated (they still work but will be dropped at some point). Use:consecutive
and:roundrobin
, respectively, instead. - The
split
keyword argument can now also be a<: OhMyThreads.Split
. Compared to providing aSymbol
, the former can potentially give better performance. For example, you can replace:consecutive
byOhMyThreads.Consecutive()
and:roundrobin
byOhMyThreads.RoundRobin()
. -
ChannelLike
is a new public (but not exported) type.ChannelLike(itr)
provide a way to iterate overitr
in a concurrency safe manner similar toChannel
. See the docstring for more details. (#121) -
ChannelLike
is used internally for theGreedyScheduler
whenchunking=true
. This improves performance overall but it is especially noticeable when the number of chunks is large. (#121)
- For the special/fake "macros" like, e.g.,
@set
, support the verbose formOhMyThreads.@set
within a@tasks
for-loop (#107).
- For empty input (e.g.
Float64[]
or11:10
) behavior is now aligned with the serial functions inBase
.
- Within a parallel
@tasks
block one can now mark a region with@one_by_one
. This region will be run by one task at a time ("critical region"). - Within a
@tasks
block one can now mark a region as with@only_one
. This region will be run by a single parallel task only (other tasks will skip over it). - Added tentative support for
@barrier
in@tasks
blocks. See?OhMyThreads.Tools.@barrier
for more information. Note that this feature is experimental and not part of the public API (i.e. doesn't fall under SemVer). - Compat bounds for BangBang.jl have been relaxed to include v0.3.40
- The parallel functions (e.g. tmapreduce etc.) now support
scheduler::Symbol
besidesscheduler::Scheduler
. To configure the selected scheduler (e.g. setnchunks
etc.) one may now pass keyword arguments directly into the parallel functions (they will get passed on to the scheduler constructor). Example:tmapreduce(sin, +, 1:10; chunksize=2, scheduler=:static)
. Analogous support has been added to the macro API: (Most) settings (@set name = value
) will now be passed on to the parallel functions as keyword arguments (which then forward them to the scheduler constructor). Note that, to avoid ambiguity, we don't support this feature forscheduler::Scheduler
but only forscheduler::Symbol
. - Added a
SerialScheduler
that can be used to turn off any multithreading. - Added
OhMyThreads.WithTaskLocals
that represents a closure overTaskLocalValues
, but can have those values materialized as an optimization (usingOhMyThreads.promise_task_local
) - In the case
nchunks > nthreads()
, theStaticScheduler
now distributes chunks in a round-robin fashion (instead of either implicitly decreasingnchunks
tonthreads()
or throwing an error). -
@set init = ...
may now be used to specify an initial value for a reduction (only has an effect in conjuction with@set reducer=...
and triggers a warning otherwise). -
SerialScheduler
andDynamicScheduler
now support the keyword argumentntasks
as an alias fornchunks
. - Made
@tasks
useOhMyThreads.WithTaskLocals
automatically as an optimization. - Uses of
@local
within@tasks
no-longer require users to declare the type of the task local value, it can be inferred automatically if a type is not provided. - Made
using OhMyThreads: ...
more explicit in examples in the documentation and docstrings. - The
DynamicScheduler
(default) and theStaticScheduler
now support achunksize
argument to specify the desired size of chunks instead of the number of chunks (nchunks
). Note thatchunksize
andnchunks
are mutually exclusive. (This is unlikely to break existing code but technically could because the type parameter has changed fromBool
toChunkingMode
.) - The greedy scheduler now supports chunking (similar to the static and dynamic scheduler). You can opt into it with, e.g.,
chunking=true
. (This is unlikely to break existing code but technically could because we introduced a new type parameter forGreedyScheduler
.) -
DynamicScheduler
andStaticScheduler
don't supportnchunks=0
orchunksize=0
any longer. Instead, chunking can now be turned off via an explicit new keyword argumentchunking=false
. - Within a
@tasks
block, task-local values must from now on be defined via@local
instead of@init
(renamed). - The (already deprecated)
SpawnAllScheduler
has been dropped. - The default value for
ntasks
/nchunks
forDynamicScheduler
has been changed from2*nthreads()
tonthreads()
. With the new value we now align with@threads :dynamic
. The old value wasn't giving good load balancing anyways and choosing a higher value penalizes uniform use cases even more. To get the old behavior, setnchunks=2*nthreads()
. - When using the
GreedyScheduler
in combination withtmapreduce
(or functions that build upon it) there could be non-deterministic errors in some cases (small input collection, not much work per element, see #82). These cases should be fixed now. - We now handle empty collections as input in
tmapreduce
andtforeach
explicitly (#86). Our general philosophy is to try match the behavior of the serialBase
functions.
- Introduction of macro API (
@tasks
) that transforms for loops into correspondingtforeach
,tmapreduce
, andtmap
calls. This new API enables us to facilitate certain patterns, like defining task local values.
- Forward (but don't export) the macros
@fetch
and@fetchfrom
from StableTasks.jl (v0.1.5), which are analogous to the same-named macros in Distributed.jl.
-
DynamicScheduler
now supportsnchunks=0
, which turns off internal chunking entirely. -
SpawnAllScheduler
is now deprecated in favor ofDynamicScheduler(; nchunks=0)
. - Partial support for passing in a
ChunkSplitters.Chunk
when usingDynamicScheduler
(default). In this case, one should generally useDynamicScheduler(; nchunks=0)
, i.e. turn off internal chunking. -
StaticScheduler
now supportsnchunks=0
, which turns off internal chunking entirely. Only works for input that has<= nthreads()
elements.
- Added a new, simple
SpawnAllScheduler
that spawns a task per input element (can be a lot of tasks!). - Added downgrade_CI which makes sure the testsuite works on the oldest versions of dependancies.
- Instead of taking keyword arguments
schedule
,nchunks
,split
directly, we now useScheduler
structs to specify scheduling options (#22). The latter can be provided to all API functions via the newscheduler
keyword argument. - The default scheduler (
DynamicScheduler
) now, by default, creates2*nthreads()
tasks to provide load-balancing by default. The old behavior can be restored withDynamicScheduler(; nchunks=nthreads())
. - We reject unsupported keyword arguments early and give a more helpful error message.
- The documented Public API wasn't updated in 0.3.0 and thus out of sync with the actual API. Fixed in this version.
- We don't (re-)export
chunks
anymore. UseOhMyThreads.chunks
instead. - We now provide
OhMyThreads.TaskLocalValue
(from TaskLocalValue.jl) as a nice solution for task-local values. See the corresponding page in the documentation (#25). - Added a few missing
@views
. - Added three examples to the docs: monte carlo, julia set, and trapazoidal integration.
- Improved all docstrings of the exported API functions. Keyword options are now only shown in the extended help (e.g.
??tmap
) (#27). - Added a translation page that hopefully helps with the Base.Threads → OhMyThreads.jl transition (#24).
- Initial version.