@@ -19,30 +19,54 @@ At the core of Dagger.jl is a scheduler heavily inspired by [Dask](https://docs.
19
19
20
20
## Installation
21
21
22
- Dagger.jl can be installed using the Julia package manager. Enter the Pkg REPL mode by typing "] " in the Julia REPL and then run:
22
+ Dagger.jl can be installed using the Julia package manager. Enter the Pkg REPL
23
+ mode by typing "] " in the Julia REPL and then run:
23
24
24
25
``` julia
25
26
pkg> add Dagger
26
27
```
27
- Or, equivalently, via the Pkg API:
28
+
29
+ Or, equivalently, install Dagger via the Pkg API:
30
+
28
31
``` julia
29
32
julia> import Pkg; Pkg. add (" Dagger" )
30
33
```
31
34
32
35
## Usage
33
36
34
- Once installed, the ` Dagger ` package can by used like so
37
+ Once installed, the ` Dagger ` package can be loaded with ` using Dagger ` , or if
38
+ you want to use Dagger for distributed computing, it can be loaded as:
35
39
36
40
``` julia
37
- using Distributed; addprocs () # get us some workers
41
+ using Distributed; addprocs () # Add one Julia worker per CPU core
38
42
using Dagger
43
+ ```
44
+
45
+ You can run the following example to see how Dagger exposes easy parallelism:
46
+
47
+ ``` julia
48
+ # This runs first:
49
+ a = Dagger. @spawn rand (100 , 100 )
39
50
40
- # do some stuff in parallel!
41
- a = Dagger. @spawn 1 + 3
42
- b = Dagger. @spawn rand (a, 4 )
43
- c = Dagger. @spawn sum (b)
44
- fetch (c) # some number!
51
+ # These run in parallel:
52
+ b = Dagger. @spawn sum (a)
53
+ c = Dagger. @spawn prod (a)
54
+
55
+ # Finally, this runs:
56
+ wait (Dagger. @spawn println (" b: " , b, " , c: " , c))
45
57
```
58
+
59
+ ## Use Cases
60
+
61
+ Dagger can support a variety of use cases that benefit from easy, automatic
62
+ parallelism, such as:
63
+
64
+ - [ Parallelizing Nested Loops] ( https://juliaparallel.github.io/Dagger.jl/dev/use-cases/#Parallel-Nested-Loops )
65
+
66
+ This isn't an exhaustive list of the use cases that Dagger supports. There are
67
+ more examples in the docs, and more use cases examples are welcome (just file
68
+ an issue or PR).
69
+
46
70
## Contributing Guide
47
71
[ ![ PRs Welcome] ( https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square )] ( http://makeapullrequest.com )
48
72
[ ![ GitHub issues] ( https://img.shields.io/github/issues/JuliaParallel/Dagger.jl )] ( https://github.com/JuliaParallel/Dagger.jl/issues )
0 commit comments