@@ -14,28 +14,35 @@ downloading datasets.
14
14
15
15
## Installation
16
16
17
- Currently it is not registred so you can install it with the url.
18
17
``` julia
19
- ] add https : // github . com / albheim / DistributedEnvironments. jl
18
+ julia > ] add DistributedEnvironments
20
19
```
21
20
22
- ## Example
21
+ ## Usage
23
22
24
23
Make sure the current active environment is the one that should be copied.
25
24
26
25
``` julia
27
26
using DistributedEnvironments
28
27
29
- nodes = [" 10.0.0.1" , " otherserver" ]
30
- @initcluster nodes
28
+ machines = [" 10.0.0.1" , " otherserver" ]
29
+ @initcluster machines # Copies environment and sets up workers on all machines
31
30
32
- @everywhere using SomePackage
31
+ @everywhere using DelimitedFiles # Want this loaded on all machines
32
+ @eachmachine download (" somepage.com/somedata.csv" ) # If each worker wants same data we only need to download once per machine
33
+ @everywhere data = readdlm (" somedata.csv" , ' ,' ) # Want to read the data everywhere
33
34
...
34
35
```
35
36
36
- For example, one could run hyperparameter optimization using the ` @phyperopt ` macro from [ Hypteropt.jl] ( https://github.com/baggepinnen/Hyperopt.jl )
37
+ ## Example
38
+
39
+ One could for example run hyperparameter optimization using the ` @phyperopt ` macro from [ Hypteropt.jl] ( https://github.com/baggepinnen/Hyperopt.jl )
37
40
``` julia
38
- ... # Initial setup as above
41
+ using DistributedEnvironments
42
+
43
+ machines = [" 10.0.0.1" , " otherserver" ]
44
+ @initcluster machines
45
+
39
46
@everywhere using Hyperopt, Flux, MLDatasets, Statistics
40
47
@eachmachine MNIST. download (i_accept_the_terms_of_use= true )
41
48
0 commit comments