Skip to content

Commit 66ba6a9

Browse files
authored
Merge pull request #518 from JuliaParallel/jps/dtask
Rename EagerThunk to DTask
2 parents 0f1db98 + c1b0b36 commit 66ba6a9

24 files changed

+195
-171
lines changed

docs/src/api-dagger/functions.md

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ Pages = ["functions.md"]
1111
```@docs
1212
@spawn
1313
spawn
14-
delayed
15-
@par
1614
```
1715

1816
## Task Options Functions/Macros
@@ -38,16 +36,6 @@ scope
3836
constrain
3937
```
4038

41-
## Lazy Task Functions
42-
```@docs
43-
domain
44-
compute
45-
dependents
46-
noffspring
47-
order
48-
treereduce
49-
```
50-
5139
## Processor Functions
5240
```@docs
5341
execute!

docs/src/api-dagger/types.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Pages = ["types.md"]
1010
## Task Types
1111
```@docs
1212
Thunk
13-
EagerThunk
13+
DTask
1414
```
1515

1616
## Task Options Types

docs/src/darray.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -353,8 +353,8 @@ Now, `DZ` will contain the result of computing `(DX .+ DX) .* 3`.
353353
```
354354
julia> Dagger.chunks(DZ)
355355
2×2 Matrix{Any}:
356-
EagerThunk (finished) EagerThunk (finished)
357-
EagerThunk (finished) EagerThunk (finished)
356+
DTask (finished) DTask (finished)
357+
DTask (finished) DTask (finished)
358358
359359
julia> Dagger.chunks(fetch(DZ))
360360
2×2 Matrix{Union{Thunk, Dagger.Chunk}}:
@@ -363,7 +363,7 @@ julia> Dagger.chunks(fetch(DZ))
363363
```
364364

365365
Here we can see the `DArray`'s internal representation of the partitions, which
366-
are stored as either `EagerThunk` objects (representing an ongoing or completed
366+
are stored as either `DTask` objects (representing an ongoing or completed
367367
computation) or `Chunk` objects (which reference data which exist locally or on
368368
other Julia workers). Of course, one doesn't typically need to worry about
369369
these internal details unless implementing low-level operations on `DArray`s.

docs/src/task-queues.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ queues".
1414
A task queue in Dagger is an object that can be configured to accept unlaunched
1515
tasks from `@spawn`/`spawn` and either modify them or delay their launching
1616
arbitrarily. By default, Dagger tasks are enqueued through the
17-
`EagerTaskQueue`, which submits tasks directly into the scheduler before
17+
`DefaultTaskQueue`, which submits tasks directly into the scheduler before
1818
`@spawn`/`spawn` returns. However, Dagger also has an `InOrderTaskQueue`, which
1919
ensures that tasks enqueued through it execute sequentially with respect to
2020
each other. This queue can be allocated with `Dagger.spawn_sequential`:

docs/src/task-spawning.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ or `spawn` if it's more convenient:
1212

1313
`Dagger.spawn(f, Dagger.Options(options), args...; kwargs...)`
1414

15-
When called, it creates an [`EagerThunk`](@ref) (also known as a "thunk" or
15+
When called, it creates an [`DTask`](@ref) (also known as a "thunk" or
1616
"task") object representing a call to function `f` with the arguments `args` and
1717
keyword arguments `kwargs`. If it is called with other thunks as args/kwargs,
1818
such as in `Dagger.@spawn f(Dagger.@spawn g())`, then, in this example, the
@@ -22,9 +22,9 @@ waits on `g()` to complete before executing.
2222

2323
An important observation to make is that, for each argument to
2424
`@spawn`/`spawn`, if the argument is the result of another `@spawn`/`spawn`
25-
call (thus it's an [`EagerThunk`](@ref)), the argument will be computed first, and then
25+
call (thus it's an [`DTask`](@ref)), the argument will be computed first, and then
2626
its result will be passed into the function receiving the argument. If the
27-
argument is *not* an [`EagerThunk`](@ref) (instead, some other type of Julia object),
27+
argument is *not* an [`DTask`](@ref) (instead, some other type of Julia object),
2828
it'll be passed as-is to the function `f` (with some exceptions).
2929

3030
## Options
@@ -75,7 +75,7 @@ The final result (from `fetch(s)`) is the obvious consequence of the operation:
7575

7676
Dagger's `@spawn` macro works similarly to `@async` and `Threads.@spawn`: when
7777
called, it wraps the function call specified by the user in an
78-
[`EagerThunk`](@ref) object, and immediately places it onto a running scheduler,
78+
[`DTask`](@ref) object, and immediately places it onto a running scheduler,
7979
to be executed once its dependencies are fulfilled.
8080

8181
```julia
@@ -114,7 +114,7 @@ One can also safely call `@spawn` from another worker (not ID 1), and it will be
114114

115115
```
116116
x = fetch(Distributed.@spawnat 2 Dagger.@spawn 1+2) # fetches the result of `@spawnat`
117-
x::EagerThunk
117+
x::DTask
118118
@assert fetch(x) == 3 # fetch the result of `@spawn`
119119
```
120120

docs/src/use-cases/parallel-nested-loops.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,12 @@ end
7272

7373
In this code we have job interdependence. Firstly, we are calculating the
7474
standard deviation `σ` and than we are using that value in the function `f`.
75-
Since `Dagger.@spawn` yields an `EagerThunk` rather than actual values, we need
75+
Since `Dagger.@spawn` yields an `DTask` rather than actual values, we need
7676
to use the `fetch` function to obtain those values. In this example, the value
7777
fetching is perfomed once all computations are completed (note that `@sync`
7878
preceding the loop forces the loop to wait for all jobs to complete). Also,
7979
note that contrary to the previous example, we do not need to implement locking
80-
as we are just pushing the `EagerThunk` results of `Dagger.@spawn` serially
80+
as we are just pushing the `DTask` results of `Dagger.@spawn` serially
8181
into the DataFrame (which is fast since `Dagger.@spawn` doesn't block).
8282

8383
The above use case scenario has been tested by running `julia -t 8` (or with

ext/GraphVizExt.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ else
77
end
88

99
import Dagger
10-
import Dagger: EagerThunk, Chunk, Processor
10+
import Dagger: DTask, Chunk, Processor
1111
import Dagger.TimespanLogging: Timespan
1212
import Graphs: SimpleDiGraph, add_edge!, add_vertex!, inneighbors, outneighbors, vertices, is_directed, edges, nv, src, dst
1313

ext/PlotsExt.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ else
99
end
1010

1111
import Dagger
12-
import Dagger: EagerThunk, Chunk, Processor
12+
import Dagger: DTask, Chunk, Processor
1313
import Dagger.TimespanLogging: Timespan
1414

1515
function logs_to_df(logs::Dict)

src/Dagger.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ include("utils/processors.jl")
4545
include("task-tls.jl")
4646
include("scopes.jl")
4747
include("utils/scopes.jl")
48-
include("eager_thunk.jl")
48+
include("dtask.jl")
4949
include("queue.jl")
5050
include("thunk.jl")
5151
include("submission.jl")

src/array/matrix.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ function (+)(a::ArrayDomain, b::ArrayDomain)
6666
end
6767

6868
struct BinaryComputeOp{F} end
69-
BinaryComputeOp{F}(x::Union{Chunk,EagerThunk}, y::Union{Chunk,EagerThunk}) where F = @spawn F(x, y)
69+
BinaryComputeOp{F}(x::Union{Chunk,DTask}, y::Union{Chunk,DTask}) where F = @spawn F(x, y)
7070
BinaryComputeOp{F}(x, y) where F = F(x, y)
7171

7272
const AddComputeOp = BinaryComputeOp{+}

0 commit comments

Comments
 (0)