Skip to content

Commit 2547f70

Browse files
committed
docs: Simplify and streamline quickstart
The docs were far too wordy for what's supposed to be an introduction to Dagger. This commit moves most of that information to separate deep-dive pages, and sets up the quickstart page to have simple examples of how to do common tasks. The hope is that new users will start by adapting the simple example, and read more into the deep dive when they want to do something fancy or learn how the example works.
1 parent 99b5c61 commit 2547f70

File tree

18 files changed

+669
-409
lines changed

18 files changed

+669
-409
lines changed

docs/Project.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
[deps]
2+
Dagger = "d58978e5-989f-55fb-8d15-ea34adc7bf54"
3+
DaggerWebDash = "cfc5aa84-1a2a-41ab-b391-ede92ecae40c"
24
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
5+
TimespanLogging = "a526e669-04d3-4846-9525-c66122c55f63"

docs/make.jl

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
using Dagger
1+
using Dagger, TimespanLogging, DaggerWebDash
22
using Documenter
33

44
makedocs(;
5-
modules = [Dagger],
5+
modules = [Dagger, TimespanLogging, DaggerWebDash],
66
authors = "JuliaParallel and contributors",
77
repo = "https://github.com/JuliaParallel/Dagger.jl/blob/{commit}{path}#L{line}",
88
sitename = "Dagger.jl",
@@ -13,20 +13,29 @@ makedocs(;
1313
),
1414
pages = [
1515
"Home" => "index.md",
16-
"Processors" => "processors.md",
16+
"Task Spawning" => "task-spawning.md",
17+
"Data Management" => "data-management.md",
1718
"Scopes" => "scopes.md",
18-
"Mutation and Shards" => "mutation.md",
19+
"Processors" => "processors.md",
1920
"Dynamic Scheduler Control" => "dynamic.md",
2021
"Option Propagation" => "propagation.md",
2122
"Logging and Graphing" => "logging.md",
23+
"Checkpointing" => "checkpointing.md",
2224
"Scheduler Visualization" => "scheduler-visualization.md",
2325
"Benchmarking" => "benchmarking.md",
24-
"Checkpointing" => "checkpointing.md",
25-
"API" => [
26-
"Types" => "api/types.md",
27-
"Functions and Macros" => "api/functions.md",
28-
],
2926
"Scheduler Internals" => "scheduler-internals.md",
27+
"Dagger API" => [
28+
"Types" => "api-dagger/types.md",
29+
"Functions and Macros" => "api-dagger/functions.md",
30+
],
31+
"TimespanLogging API" => [
32+
"Types" => "api-timespanlogging/types.md",
33+
"Functions and Macros" => "api-timespanlogging/functions.md",
34+
],
35+
"DaggerWebDash API" => [
36+
"Types" => "api-daggerwebdash/types.md",
37+
"Functions and Macros" => "api-daggerwebdash/functions.md",
38+
],
3039
]
3140
)
3241

docs/src/api/functions.md renamed to docs/src/api-dagger/functions.md

Lines changed: 30 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -2,44 +2,49 @@
22
CurrentModule = Dagger
33
```
44

5-
# Functions
5+
# Dagger Functions
66
```@index
77
Pages = ["functions.md"]
88
```
99

10-
## General Functions
10+
## Task Functions/Macros
1111
```@docs
12-
delayed
12+
@spawn
1313
spawn
14+
delayed
15+
@par
16+
```
17+
18+
## Task Options Functions/Macros
19+
```@docs
20+
with_options
21+
get_options
22+
@option
23+
default_option
24+
```
25+
26+
## Data Management Functions
27+
```@docs
1428
tochunk
15-
domain
16-
compute
17-
dependents
18-
noffspring
19-
order
20-
treereduce
29+
@mutable
30+
@shard
31+
shard
2132
```
2233

23-
## Table Functions
34+
## Scope Functions
2435
```@docs
25-
tabletype
26-
tabletype!
27-
trim
28-
trim!
29-
map
30-
filter
31-
reduce
32-
groupby
33-
leftjoin
34-
innerjoin
35-
keys
36-
getindex
36+
scope
37+
constrain
3738
```
3839

39-
## Array Functions
40+
## Lazy Task Functions
4041
```@docs
41-
alignfirst
42-
view
42+
domain
43+
compute
44+
dependents
45+
noffspring
46+
order
47+
treereduce
4348
```
4449

4550
## Processor Functions
@@ -50,26 +55,16 @@ default_enabled
5055
get_processors
5156
get_parent
5257
move
53-
capacity
5458
get_tls
5559
set_tls!
5660
```
5761

58-
## Shard Functions
59-
[`Dagger.@shard`](@ref)
60-
[`Dagger.shard`](@ref)
61-
6262
## Context Functions
6363
```@docs
6464
addprocs!
6565
rmprocs!
6666
```
6767

68-
## Logging Functions
69-
```@docs
70-
get_logs!
71-
```
72-
7368
## Thunk Execution Environment Functions
7469

7570
These functions are used within the function called by a `Thunk`.
@@ -92,19 +87,3 @@ Sch.exec!
9287
Sch.halt!
9388
Sch.get_dag_ids
9489
```
95-
96-
## File IO Functions
97-
98-
!!! warning
99-
These APIs are currently untested and may be removed or modified.
100-
101-
```@docs
102-
save
103-
load
104-
```
105-
106-
# Macros API
107-
```@docs
108-
@par
109-
@spawn
110-
```

docs/src/api/types.md renamed to docs/src/api-dagger/types.md

Lines changed: 24 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,28 @@
22
CurrentModule = Dagger
33
```
44

5-
# Types
5+
# Dagger Types
66
```@index
77
Pages = ["types.md"]
88
```
99

10-
## General Types
10+
## Task Types
1111
```@docs
1212
Thunk
1313
EagerThunk
14-
Chunk
15-
UnitDomain
1614
```
1715

18-
## Array Types
19-
```@docs
20-
DArray
21-
Blocks
22-
ArrayDomain
16+
## Task Options Types
17+
```
18+
Options
19+
Sch.ThunkOptions
20+
Sch.SchedulerOptions
21+
```
22+
23+
## Data Management Types
24+
```
25+
Chunk
26+
Shard
2327
```
2428

2529
## Processor Types
@@ -34,6 +38,8 @@ ThreadProc
3438
AnyScope
3539
NodeScope
3640
ProcessScope
41+
ProcessorTypeScope
42+
TaintScope
3743
UnionScope
3844
ExactScope
3945
```
@@ -43,25 +49,17 @@ ExactScope
4349
Context
4450
```
4551

46-
## Logging Types
47-
```@docs
48-
NoOpLog
49-
LocalEventLog
50-
```
51-
52-
## Scheduling Types
52+
## Array Types
5353
```@docs
54-
Sch.SchedulerOptions
55-
Sch.ThunkOptions
56-
Sch.MaxUtilization
57-
Sch.DynamicThunkException
54+
DArray
55+
Blocks
56+
ArrayDomain
57+
UnitDomain
5858
```
5959

60-
## File IO Types
61-
62-
!!! warning
63-
These APIs are currently untested and may be removed or modified.
64-
60+
## Logging Event Types
6561
```@docs
66-
FileReader
62+
Events.BytesAllocd
63+
Events.ProcessorSaturation
64+
Events.WorkerSaturation
6765
```
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
```@meta
2+
CurrentModule = DaggerWebDash
3+
```
4+
5+
# DaggerWebDash Functions
6+
```@index
7+
Pages = ["functions.md"]
8+
```
9+

docs/src/api-daggerwebdash/types.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
```@meta
2+
CurrentModule = DaggerWebDash
3+
```
4+
5+
# DaggerWebDash Types
6+
```@index
7+
Pages = ["types.md"]
8+
```
9+
10+
## Logging Event Types
11+
```@docs
12+
D3Renderer
13+
TableStorage
14+
ProfileMetrics
15+
```
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
```@meta
2+
CurrentModule = TimespanLogging
3+
```
4+
5+
# TimespanLogging Functions
6+
```@index
7+
Pages = ["functions.md"]
8+
```
9+
10+
## Basic Functions
11+
```@docs
12+
timespan_start
13+
timespan_finish
14+
get_logs!
15+
make_timespan
16+
```
17+
18+
## Logging Metric Functions
19+
```@docs
20+
init_similar
21+
```

docs/src/api-timespanlogging/types.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
```@meta
2+
CurrentModule = TimespanLogging
3+
```
4+
5+
# TimespanLogging Types
6+
```@index
7+
Pages = ["types.md"]
8+
```
9+
10+
## Log Sink Types
11+
```@docs
12+
MultiEventLog
13+
LocalEventLog
14+
NoOpLog
15+
```
16+
17+
## Event Types
18+
```@docs
19+
Event
20+
```
21+
22+
## Built-in Event Types
23+
```@docs
24+
Events.CoreMetrics
25+
Events.IDMetrics
26+
Events.TimelineMetrics
27+
Events.FullMetrics
28+
Events.CPULoadAverages
29+
Events.MemoryFree
30+
Events.EventSaturation
31+
Events.DebugMetrics
32+
Events.LogWindow
33+
```
34+
```

docs/src/mutation.md renamed to docs/src/data-management.md

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,32 @@
1-
# Mutation Support
1+
# Data Management
2+
3+
Dagger is not just a computing platform - it also has awareness of where each
4+
piece of data resides, and will move data between workers and perform
5+
conversions as necessary to satisfy the needs of your tasks.
6+
7+
## Chunks
8+
9+
Dagger often needs to move data between workers to allow a task to execute. To
10+
make this efficient when communicating potentially large units of data, Dagger
11+
uses a remote reference, called a `Chunk`, to refer to objects which may
12+
exist on another worker. `Chunk`s are backed by a distributed refcounting
13+
mechanism provided by MemPool.jl, which ensures that the referenced data is not
14+
garbage collected until all `Chunk`s referencing that object are GC'd from all
15+
workers.
16+
17+
Conveniently, if you pass in a `Chunk` object as an input to a Dagger task,
18+
then the task's payload function will get executed with the value contained in
19+
the `Chunk`. The scheduler also understands `Chunk`s, and will try to schedule
20+
tasks close to where their `Chunk` inputs reside, to reduce communication
21+
overhead.
22+
23+
`Chunk`s also have a cached type, a "processor", and a "scope", which are
24+
important for identifying the type of the object, where in memory (CPU RAM, GPU
25+
VRAM, etc.) the value resides, and where the value is allowed to be transferred
26+
and dereferenced. See [Processors](@ref) and [Scopes](@ref) for more details on
27+
how these properties can be used to control scheduling behavior around `Chunk`s.
28+
29+
## Mutation
230

331
Normally, Dagger tasks should be functional and "pure": never mutating their
432
inputs, always producing identical outputs for a given set of inputs, and never
@@ -74,4 +102,4 @@ per shard "piece", and each result is considered immutable. `map` is an easy
74102
way to make a copy of each piece of the shard, to be later reduced, scanned,
75103
etc.
76104

77-
Further details about what arguments can be passed to `@shard`/`shard` can be found in [Shard Functions](@ref).
105+
Further details about what arguments can be passed to `@shard`/`shard` can be found in [Data Management Functions](@ref).

0 commit comments

Comments
 (0)