You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+44-7Lines changed: 44 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,14 @@
1
1
# Distributed (with a multiscale parallelism extension)
2
2
3
-
The `Distributed` package provides functionality for creating and controlling multiple Julia processes remotely, and for performing distributed and parallel computing. It uses network sockets or other supported interfaces to communicate between Julia processes, and relies on Julia's `Serialization` stdlib package to transform Julia objects into a format that can be transferred between processes efficiently. It provides a full set of utilities to create and destroy new Julia processes and add them to a "cluster" (a collection of Julia processes connected together), as well as functions to perform Remote Procedure Calls (RPC) between the processes within a cluster. See the `API` section for details.
4
-
3
+
The `Distributed` package provides functionality for creating and controlling
4
+
multiple Julia processes remotely, and for performing distributed and parallel
5
+
computing. It uses network sockets or other supported interfaces to communicate
6
+
between Julia processes, and relies on Julia's `Serialization` stdlib package to
7
+
transform Julia objects into a format that can be transferred between processes
8
+
efficiently. It provides a full set of utilities to create and destroy new Julia
9
+
processes and add them to a "cluster" (a collection of Julia processes connected
10
+
together), as well as functions to perform Remote Procedure Calls (RPC) between
11
+
the processes within a cluster. See the `API` section for details.
5
12
This package ships as part of the Julia stdlib.
6
13
7
14
> [!NOTE]
@@ -23,17 +30,38 @@ To use a newer version of this package, you need to build Julia from scratch. Th
23
30
24
31
It's also possible to load a development version of the package using [the trick used in the Section named "Using the development version of Pkg.jl" in the `Pkg.jl` repo](https://github.com/JuliaLang/Pkg.jl#using-the-development-version-of-pkgjl), but the capabilities are limited as all other packages will depend on the stdlib version of the package and will not work with the modified package.
25
32
33
+
### On Julia 1.11+
34
+
In Julia 1.11 Distributed was excised from the default system image and became
35
+
more of an independent package. As such, to use a different version it's enough
36
+
to just `dev` it explicitly:
37
+
```julia-repl
38
+
pkg> dev https://github.com/JuliaLang/Distributed.jl.git
39
+
```
40
+
### On older Julia versions
41
+
To use a newer version of this package on older Julia versions, you need to build
42
+
Julia from scratch. The build process is the same as any other build except that
43
+
you need to change the commit used in `stdlib/Distributed.version`.
44
+
It's also possible to load a development version of the package using [the trick
45
+
used in the Section named "Using the development version of Pkg.jl" in the
but the capabilities are limited as all other packages will depend on the stdlib
49
+
version of the package and will not work with the modified package.
50
+
26
51
## API
27
52
28
-
The public API of `Distributed` consists of a variety of functions for various tasks; for creating and destroying processes within a cluster:
53
+
The public API of `Distributed` consists of a variety of functions for various
54
+
tasks; for creating and destroying processes within a cluster:
29
55
30
56
-`addprocs` - create one or more Julia processes and connect them to the cluster
31
57
-`rmprocs` - shutdown and remove one or more Julia processes from the cluster
32
58
33
59
For controlling other processes via RPC:
34
60
35
61
-`remotecall` - call a function on another process and return a `Future` referencing the result of that call
36
-
-`Future` - an object that references the result of a `remotecall` that hasn't yet completed - use `fetch` to return the call's result, or `wait` to just wait for the remote call to finish
62
+
-`Future` - an object that references the result of a `remotecall` that hasn't
63
+
yet completed - use `fetch` to return the call's result, or `wait` to just
64
+
wait for the remote call to finish.
37
65
-`remotecall_fetch` - the same as `fetch(remotecall(...))`
38
66
-`remotecall_wait` - the same as `wait(remotecall(...))`
39
67
-`remote_do` - like `remotecall`, but does not provide a way to access the result of the call
@@ -62,6 +90,15 @@ For controlling multiple processes at once:
62
90
63
91
### Process Identifiers
64
92
65
-
Julia processes connected with `Distributed` are all assigned a cluster-unique `Int` identifier, starting from `1`. The first Julia process within a cluster is given ID `1`, while other processes added via `addprocs` get incrementing IDs (`2`, `3`, etc.). Functions and macros which communicate from one process to another usually take one or more identifiers to determine which process they target - for example, `remotecall_fetch(myid, 2)` calls `myid()` on process 2.
66
-
67
-
**Note:** Only process 1 (often called the "head", "primary", or "master") may add or remove processes, and manages the rest of the cluster. Other processes (called "workers" or "worker processes") may still call functions on each other and send and receive data, but `addprocs`/`rmprocs` on worker processes will fail with an error.
93
+
Julia processes connected with `Distributed` are all assigned a cluster-unique
94
+
`Int` identifier, starting from `1`. The first Julia process within a cluster is
95
+
given ID `1`, while other processes added via `addprocs` get incrementing IDs
96
+
(`2`, `3`, etc.). Functions and macros which communicate from one process to
97
+
another usually take one or more identifiers to determine which process they
98
+
target - for example, `remotecall_fetch(myid, 2)` calls `myid()` on process 2.
99
+
100
+
**Note:** Only process 1 (often called the "head", "primary", or "master") may
101
+
add or remove processes, and manages the rest of the cluster. Other processes
102
+
(called "workers" or "worker processes") may still call functions on each other
103
+
and send and receive data, but `addprocs`/`rmprocs` on worker processes will
0 commit comments