Skip to content

Commit 047ca83

Browse files
authored
Merge pull request #184 from r-barnes/patch-4
Clarified read-only access
2 parents e6915d2 + 48ccea6 commit 047ca83

File tree

2 files changed

+16
-17
lines changed

2 files changed

+16
-17
lines changed

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
## Introduction
1010

1111
`DistributedArrays.jl` uses the stdlib [`Distributed`][distributed-docs] to implement a *Global Array* interface.
12-
A `DArray` is distributed accross a set of worker, but the entire array can be transparently
13-
accessed from all workers.
12+
A `DArray` is distributed across a set of workers. Each worker can read and write from its local portion of the array and each worker has read-only access to the portions of the array held by other workers.
1413

1514
## Installation
1615

docs/src/index.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
Distributed Arrays
77
------------------
88

9-
Large computations are often organized around large arrays of data. In
10-
these cases, a particularly natural way to obtain parallelism is to
11-
distribute arrays among several processes. This combines the memory
12-
resources of multiple machines, allowing use of arrays too large to fit
13-
on one machine. Each process operates on the part of the array it
14-
owns, providing a ready answer to the question of how a program should
15-
be divided among machines.
9+
Large computations are often organized around large arrays of data. In these
10+
cases, a particularly natural way to obtain parallelism is to distribute arrays
11+
among several processes. This combines the memory resources of multiple
12+
machines, allowing use of arrays too large to fit on one machine. Each process
13+
can read and write to the part of the array it owns and has read-only access to
14+
the parts it doesn't own. This provides a ready answer to the question of how a
15+
program should be divided among machines.
1616

1717
Julia distributed arrays are implemented by the `DArray` type. A
1818
`DArray` has an element type and dimensions just like an `Array`.
@@ -241,17 +241,17 @@ Garbage Collection and DArrays
241241
------------------------------
242242

243243
When a DArray is constructed (typically on the master process), the returned DArray objects stores information on how the
244-
array is distributed, which procesor holds which indices and so on. When the DArray object
245-
on the master process is garbage collected, all particpating workers are notified and
244+
array is distributed, which processor holds which indices and so on. When the DArray object
245+
on the master process is garbage collected, all participating workers are notified and
246246
localparts of the DArray freed on each worker.
247247

248248
Since the size of the DArray object itself is small, a problem arises as `gc` on the master faces no memory pressure to
249249
collect the DArray immediately. This results in a delay of the memory being released on the participating workers.
250250

251-
Therefore it is highly recommended to explcitly call `close(d::DArray)` as soon as user code
251+
Therefore it is highly recommended to explicitly call `close(d::DArray)` as soon as user code
252252
has finished working with the distributed array.
253253

254-
It is also important to note that the localparts of the DArray is collected from all particpating workers
254+
It is also important to note that the localparts of the DArray is collected from all participating workers
255255
when the DArray object on the process creating the DArray is collected. It is therefore important to maintain
256256
a reference to a DArray object on the creating process for as long as it is being computed upon.
257257

@@ -326,7 +326,7 @@ Tag `tag` should be used to differentiate between consecutive calls of the same
326326
consecutive `bcast` calls.
327327

328328
`spmd` and spmd related functions are defined in submodule `DistributedArrays.SPMD`. You will need to
329-
import it explcitly, or prefix functions that can can only be used in spmd mode with `SPMD.`, for example,
329+
import it explicitly, or prefix functions that can can only be used in spmd mode with `SPMD.`, for example,
330330
`SPMD.sendto`.
331331

332332

@@ -385,7 +385,7 @@ println(d_out)
385385
SPMD Context
386386
------------
387387

388-
Each SPMD run is implictly executed in a different context. This allows for multiple `spmd` calls to
388+
Each SPMD run is implicitly executed in a different context. This allows for multiple `spmd` calls to
389389
be active at the same time. A SPMD context can be explicitly specified via keyword arg `context` to `spmd`.
390390

391391
`context(pids=procs())` returns a new SPMD context.
@@ -396,7 +396,7 @@ key-value pairs between spmd runs under the same context.
396396
`context_local_storage()` returns the dictionary associated with the context.
397397

398398
NOTE: Implicitly defined contexts, i.e., `spmd` calls without specifying a `context` create a context
399-
which live only for the duration of the call. Explictly created context objects can be released
399+
which live only for the duration of the call. Explicitly created context objects can be released
400400
early by calling `close(ctxt::SPMDContext)`. This will release the local storage dictionaries
401401
on all participating `pids`. Else they will be released when the context object is gc'ed
402402
on the node that created it.
@@ -423,7 +423,7 @@ end
423423

424424
spmd(foo,....)
425425
```
426-
In the above example, `foo`, `bar` and `baz` are all functions wishing to leverage distributed computation. However, they themselves may be currenty part of a `spmd` call. A safe way to handle such a scenario is to only drive parallel computation from the master process.
426+
In the above example, `foo`, `bar` and `baz` are all functions wishing to leverage distributed computation. However, they themselves may be currently part of a `spmd` call. A safe way to handle such a scenario is to only drive parallel computation from the master process.
427427

428428
The correct way (only have the driver process initiate `spmd` calls):
429429
```julia

0 commit comments

Comments
 (0)