@@ -148,7 +148,7 @@ function set_worker_state(w, state)
148
148
end
149
149
150
150
function check_worker_state (w:: Worker )
151
- if w. state == W_CREATED
151
+ if w. state === W_CREATED
152
152
if ! isclusterlazy ()
153
153
if PGRP. topology === :all_to_all
154
154
# Since higher pids connect with lower pids, the remote worker
@@ -185,13 +185,13 @@ function exec_conn_func(w::Worker)
185
185
end
186
186
187
187
function wait_for_conn (w)
188
- if w. state == W_CREATED
188
+ if w. state === W_CREATED
189
189
timeout = worker_timeout () - (time () - w. ct_time)
190
190
timeout <= 0 && error (" peer $(w. id) has not connected to $(myid ()) " )
191
191
192
192
@async (sleep (timeout); notify (w. c_state; all= true ))
193
193
wait (w. c_state)
194
- w. state == W_CREATED && error (" peer $(w. id) didn't connect to $(myid ()) within $timeout seconds" )
194
+ w. state === W_CREATED && error (" peer $(w. id) didn't connect to $(myid ()) within $timeout seconds" )
195
195
end
196
196
nothing
197
197
end
@@ -626,7 +626,7 @@ function create_worker(manager, wconfig)
626
626
# require the value of config.connect_at which is set only upon connection completion
627
627
for jw in PGRP. workers
628
628
if (jw. id != 1 ) && (jw. id < w. id)
629
- (jw. state == W_CREATED) && wait (jw. c_state)
629
+ (jw. state === W_CREATED) && wait (jw. c_state)
630
630
push! (join_list, jw)
631
631
end
632
632
end
@@ -649,7 +649,7 @@ function create_worker(manager, wconfig)
649
649
end
650
650
651
651
for wl in wlist
652
- (wl. state == W_CREATED) && wait (wl. c_state)
652
+ (wl. state === W_CREATED) && wait (wl. c_state)
653
653
push! (join_list, wl)
654
654
end
655
655
end
767
767
mutable struct ProcessGroup
768
768
name:: AbstractString
769
769
workers:: Array{Any,1}
770
- refs:: Dict # global references
770
+ refs:: Dict{RRID,Any} # global references
771
771
topology:: Symbol
772
772
lazy:: Union{Bool, Nothing}
773
773
@@ -851,7 +851,7 @@ function nprocs()
851
851
n = length (PGRP. workers)
852
852
# filter out workers in the process of being setup/shutdown.
853
853
for jw in PGRP. workers
854
- if ! isa (jw, LocalProcess) && (jw. state != W_CONNECTED)
854
+ if ! isa (jw, LocalProcess) && (jw. state != = W_CONNECTED)
855
855
n = n - 1
856
856
end
857
857
end
@@ -902,7 +902,7 @@ julia> procs()
902
902
function procs ()
903
903
if myid () == 1 || (PGRP. topology === :all_to_all && ! isclusterlazy ())
904
904
# filter out workers in the process of being setup/shutdown.
905
- return Int[x. id for x in PGRP. workers if isa (x, LocalProcess) || (x. state == W_CONNECTED)]
905
+ return Int[x. id for x in PGRP. workers if isa (x, LocalProcess) || (x. state === W_CONNECTED)]
906
906
else
907
907
return Int[x. id for x in PGRP. workers]
908
908
end
911
911
function id_in_procs (id) # faster version of `id in procs()`
912
912
if myid () == 1 || (PGRP. topology === :all_to_all && ! isclusterlazy ())
913
913
for x in PGRP. workers
914
- if (x. id:: Int ) == id && (isa (x, LocalProcess) || (x:: Worker ). state == W_CONNECTED)
914
+ if (x. id:: Int ) == id && (isa (x, LocalProcess) || (x:: Worker ). state === W_CONNECTED)
915
915
return true
916
916
end
917
917
end
@@ -933,7 +933,7 @@ Specifically all workers bound to the same ip-address as `pid` are returned.
933
933
"""
934
934
function procs (pid:: Integer )
935
935
if myid () == 1
936
- all_workers = [x for x in PGRP. workers if isa (x, LocalProcess) || (x. state == W_CONNECTED)]
936
+ all_workers = [x for x in PGRP. workers if isa (x, LocalProcess) || (x. state === W_CONNECTED)]
937
937
if (pid == 1 ) || (isa (map_pid_wrkr[pid]. manager, LocalManager))
938
938
Int[x. id for x in filter (w -> (w. id== 1 ) || (isa (w. manager, LocalManager)), all_workers)]
939
939
else
@@ -1040,11 +1040,11 @@ function _rmprocs(pids, waitfor)
1040
1040
1041
1041
start = time_ns ()
1042
1042
while (time_ns () - start) < waitfor* 1e9
1043
- all (w -> w. state == W_TERMINATED, rmprocset) && break
1043
+ all (w -> w. state === W_TERMINATED, rmprocset) && break
1044
1044
sleep (min (0.1 , waitfor - (time_ns () - start)/ 1e9 ))
1045
1045
end
1046
1046
1047
- unremoved = [wrkr. id for wrkr in filter (w -> w. state != W_TERMINATED, rmprocset)]
1047
+ unremoved = [wrkr. id for wrkr in filter (w -> w. state != = W_TERMINATED, rmprocset)]
1048
1048
if length (unremoved) > 0
1049
1049
estr = string (" rmprocs: pids " , unremoved, " not terminated after " , waitfor, " seconds." )
1050
1050
throw (ErrorException (estr))
0 commit comments