937937
938938Return a list of all process identifiers, including pid 1 (which is not included by [`workers()`](@ref)).
939939
940+ See also [`other_procs()`](@ref).
941+
940942# Examples
941943```julia-repl
942944\$ julia -p 2
@@ -957,6 +959,14 @@ function procs()
957959 end
958960end
959961
962+ """
963+ other_procs([pid::Integer])
964+
965+ Identical to [`procs()`](@ref) and [`procs(::Integer)`](@ref), except that the
966+ current worker is filtered out.
967+ """
968+ other_procs () = filter (!= (myid ()), procs ())
969+
960970function id_in_procs (id) # faster version of `id in procs()`
961971 if myid () == 1 || (PGRP. topology === :all_to_all && ! isclusterlazy ())
962972 for x in PGRP. workers
979989
980990Return a list of all process identifiers on the same physical node.
981991Specifically all workers bound to the same ip-address as `pid` are returned.
992+
993+ See also [`other_procs()`](@ref).
982994"""
983995function procs (pid:: Integer )
984996 if myid () == 1
@@ -994,11 +1006,15 @@ function procs(pid::Integer)
9941006 end
9951007end
9961008
1009+ other_procs (pid:: Integer ) = filter (!= (myid ()), procs (pid))
1010+
9971011"""
9981012 workers()
9991013
10001014Return a list of all worker process identifiers.
10011015
1016+ See also [`other_workers()`](@ref).
1017+
10021018# Examples
10031019```julia-repl
10041020\$ julia -p 2
@@ -1018,6 +1034,13 @@ function workers()
10181034 end
10191035end
10201036
1037+ """
1038+ other_workers()
1039+
1040+ Identical to [`workers()`](@ref) except that the current worker is filtered out.
1041+ """
1042+ other_workers () = filter (!= (myid ()), workers ())
1043+
10211044function cluster_mgmt_from_master_check ()
10221045 if myid () != 1
10231046 throw (ErrorException (" Only process 1 can add and remove workers" ))
0 commit comments