937
937
938
938
Return a list of all process identifiers, including pid 1 (which is not included by [`workers()`](@ref)).
939
939
940
+ See also [`other_procs()`](@ref).
941
+
940
942
# Examples
941
943
```julia-repl
942
944
\$ julia -p 2
@@ -957,6 +959,14 @@ function procs()
957
959
end
958
960
end
959
961
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
+
960
970
function id_in_procs (id) # faster version of `id in procs()`
961
971
if myid () == 1 || (PGRP. topology === :all_to_all && ! isclusterlazy ())
962
972
for x in PGRP. workers
979
989
980
990
Return a list of all process identifiers on the same physical node.
981
991
Specifically all workers bound to the same ip-address as `pid` are returned.
992
+
993
+ See also [`other_procs()`](@ref).
982
994
"""
983
995
function procs (pid:: Integer )
984
996
if myid () == 1
@@ -994,11 +1006,15 @@ function procs(pid::Integer)
994
1006
end
995
1007
end
996
1008
1009
+ other_procs (pid:: Integer ) = filter (!= (myid ()), procs (pid))
1010
+
997
1011
"""
998
1012
workers()
999
1013
1000
1014
Return a list of all worker process identifiers.
1001
1015
1016
+ See also [`other_workers()`](@ref).
1017
+
1002
1018
# Examples
1003
1019
```julia-repl
1004
1020
\$ julia -p 2
@@ -1018,6 +1034,13 @@ function workers()
1018
1034
end
1019
1035
end
1020
1036
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
+
1021
1044
function cluster_mgmt_from_master_check ()
1022
1045
if myid () != 1
1023
1046
throw (ErrorException (" Only process 1 can add and remove workers" ))
0 commit comments