Skip to content

Commit f4f6177

Browse files
authored
Merge pull request #615 from JuliaParallel/jps/docs-spawn-move-options
docs: Move Options subsection in task-spawning.md
2 parents 16b1ef9 + 9a450a6 commit f4f6177

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

docs/src/task-spawning.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -32,21 +32,6 @@ it'll be passed as-is to the function `f` (with some exceptions).
3232
This default can be controlled by specifying [`Sch.ThunkOptions`](@ref) (more details can be found under [Scheduler and Thunk options](@ref)).
3333
The section [Changing the thread occupancy](@ref) shows a runnable example of how to achieve this.
3434

35-
## Options
36-
37-
The [`Options`](@ref Dagger.Options) struct in the second argument position is
38-
optional; if provided, it is passed to the scheduler to control its
39-
behavior. [`Options`](@ref Dagger.Options) contains a `NamedTuple` of option
40-
key-value pairs, which can be any of:
41-
- Any field in [`Sch.ThunkOptions`](@ref) (see [Scheduler and Thunk options](@ref))
42-
- `meta::Bool` -- Pass the input [`Chunk`](@ref) objects themselves to `f` and
43-
not the value contained in them.
44-
45-
There are also some extra options that can be passed, although they're considered advanced options to be used only by developers or library authors:
46-
- `get_result::Bool` -- return the actual result to the scheduler instead of [`Chunk`](@ref) objects. Used when `f` explicitly constructs a [`Chunk`](@ref) or when return value is small (e.g. in case of reduce)
47-
- `persist::Bool` -- the result of this Thunk should not be released after it becomes unused in the DAG
48-
- `cache::Bool` -- cache the result of this Thunk such that if the thunk is evaluated again, one can just reuse the cached value. If it’s been removed from cache, recompute the value.
49-
5035
## Simple example
5136

5237
Let's see a very simple directed acyclic graph (or DAG) constructed with Dagger:
@@ -125,6 +110,21 @@ x::DTask
125110

126111
This is useful for nested execution, where an `@spawn`'d thunk calls `@spawn`. This is detailed further in [Dynamic Scheduler Control](@ref).
127112

113+
## Options
114+
115+
The [`Options`](@ref Dagger.Options) struct in the second argument position is
116+
optional; if provided, it is passed to the scheduler to control its
117+
behavior. [`Options`](@ref Dagger.Options) contains a `NamedTuple` of option
118+
key-value pairs, which can be any of:
119+
- Any field in [`Sch.ThunkOptions`](@ref) (see [Scheduler and Thunk options](@ref))
120+
- `meta::Bool` -- Pass the input [`Chunk`](@ref) objects themselves to `f` and
121+
not the value contained in them.
122+
123+
There are also some extra options that can be passed, although they're considered advanced options to be used only by developers or library authors:
124+
- `get_result::Bool` -- return the actual result to the scheduler instead of [`Chunk`](@ref) objects. Used when `f` explicitly constructs a [`Chunk`](@ref) or when return value is small (e.g. in case of reduce)
125+
- `persist::Bool` -- the result of this Thunk should not be released after it becomes unused in the DAG
126+
- `cache::Bool` -- cache the result of this Thunk such that if the thunk is evaluated again, one can just reuse the cached value. If it’s been removed from cache, recompute the value.
127+
128128
## Errors
129129

130130
If a thunk errors while running under the eager scheduler, it will be marked as

0 commit comments

Comments
 (0)