Skip to content

Commit

Permalink
Re-export localindexes [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
timholy committed Aug 1, 2015
1 parent 568b3cf commit ea73e58
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
1 change: 1 addition & 0 deletions base/exports.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1243,6 +1243,7 @@ export
# shared arrays
sdata,
indexpids,
localindexes,

# paths and file names
abspath,
Expand Down
4 changes: 2 additions & 2 deletions doc/manual/parallel-computing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ Here's a brief example:
3
4

julia> S = SharedArray(Int, (3,4), init = S -> S[Base.localindexes(S)] = myid())
julia> S = SharedArray(Int, (3,4), init = S -> S[localindexes(S)] = myid())
3x4 SharedArray{Int64,2}:
2 2 3 4
2 3 3 4
Expand All @@ -524,7 +524,7 @@ Here's a brief example:
2 3 3 4
2 7 4 4

:func:`Base.localindexes` provides disjoint one-dimensional ranges of indexes,
:func:`localindexes` provides disjoint one-dimensional ranges of indexes,
and is sometimes convenient for splitting up tasks among processes.
You can, of course, divide the work any way you wish:

Expand Down
15 changes: 13 additions & 2 deletions doc/stdlib/parallel.rst
Original file line number Diff line number Diff line change
Expand Up @@ -383,8 +383,8 @@ General Parallel Computing Support
Execute an expression on all processes. Errors on any of the processes are
collected into a `CompositeException` and thrown.

Shared Arrays (Experimental, UNIX-only feature)
-----------------------------------------------
Shared Arrays
-------------

.. function:: SharedArray(T::Type, dims::NTuple; init=false, pids=Int[])

Expand Down Expand Up @@ -412,6 +412,17 @@ Shared Arrays (Experimental, UNIX-only feature)
Returns the index of the current worker into the ``pids`` vector, i.e., the list of workers mapping
the SharedArray

.. function:: localindexes(S::SharedArray)

A range describing the "default" indexes to be handled by the local
process. This range should be interpreted in the sense of linear
indexing, i.e., as a sub-range of 1:length(S).
Returns an empty range if no local part exists on the calling process.

All indexes should be equally fast for each worker process;
``localindexes`` exists purely as a convenience, and you can
partition work on the array among workers any way you wish.

Cluster Manager Interface
-------------------------
This interface provides a mechanism to launch and manage Julia workers on different cluster environments.
Expand Down

0 comments on commit ea73e58

Please sign in to comment.