Skip to content

Commit 8db30c6

Browse files
committed
give a warning instead of removing process 1 in rmprocs
update doc description of workers closes #4317
1 parent ae7215b commit 8db30c6

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

base/multi.jl

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -252,9 +252,13 @@ function rmprocs(args...; waitfor = 0.0)
252252
empty!(rmprocset)
253253

254254
for i in [args...]
255-
if haskey(map_pid_wrkr, i)
256-
push!(rmprocset, i)
257-
remote_do(i, exit)
255+
if i == 1
256+
warn("rmprocs: process 1 not removed")
257+
else
258+
if haskey(map_pid_wrkr, i)
259+
push!(rmprocset, i)
260+
remote_do(i, exit)
261+
end
258262
end
259263
end
260264

doc/manual/parallel-computing.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,10 @@ A file can also be preloaded on multiple processes at startup, and a driver scri
157157
158158
Each process has an associated identifier. The process providing the interactive julia prompt
159159
always has an id equal to 1, as would the julia process running the driver script in the
160-
example above. All other processes (also known as worker processes, or just workers) have their
161-
own unique ids. Workers are defined as all processes other than the driving process (id of 1). When
162-
no additional processes are started, the driving process is also deemed to be a worker.
160+
example above.
161+
The processors used by default for parallel operations are referred to as ``workers``.
162+
When there is only one process, process 1 is considered a worker. Otherwise, workers are
163+
considered to be all processes other than process 1.
163164

164165
The base Julia installation has in-built support for two types of clusters:
165166

doc/stdlib/base.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -533,11 +533,12 @@ Iterable Collections
533533

534534
.. function:: first(coll)
535535

536-
Get the first element of an ordered collection.
536+
Get the first element of an iterable collection.
537537

538538
.. function:: last(coll)
539539

540-
Get the last element of an ordered collection.
540+
Get the last element of an ordered collection, if it can be computed in O(1) time.
541+
This is accomplished by calling ``endof`` to get the last index.
541542

542543
.. function:: step(r)
543544

0 commit comments

Comments
 (0)