-
-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
439 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Dynamic Scheduler Control | ||
|
||
Normally, Dagger executes static graphs defined with `delayed` and `@par`. | ||
However, it is possible for thunks to dynamically modify the graph at runtime, | ||
and to generally exert direct control over the scheduler's internal state. The | ||
`Dagger.sch_handle` function provides this functionality within a thunk: | ||
|
||
```julia | ||
function mythunk(x) | ||
h = Dagger.sch_handle() | ||
Dagger.halt!(h) | ||
return x | ||
end | ||
``` | ||
|
||
The above example prematurely halts a running scheduler at the next | ||
opportunity using `Dagger.halt!`: | ||
|
||
[`Dagger.halt!`](@ref) | ||
|
||
There are a variety of other built-in functions available for | ||
various uses: | ||
|
||
[`Dagger.get_dag_ids`](@ref) | ||
[`Dagger.add_thunk!`](@ref) | ||
[`Dagger.set_return!`](@ref) | ||
|
||
Users with needs not covered by the built-in functions should use the `Dagger.exec!` function to pass a user-defined function, closure, or callable struct to the scheduler, along with a payload which will be provided to that function: | ||
|
||
[`Dagger.exec!`](@ref) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.