Skip to content

Commit c2ffb33

Browse files
committed
Sch: Fix worker_time_pressure access of dead worker
1 parent 3193400 commit c2ffb33

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Diff for: src/sch/Sch.jl

+3-4
Original file line numberDiff line numberDiff line change
@@ -324,9 +324,6 @@ function init_proc(state, p, log_sink)
324324
gproc = OSProc(p.pid)
325325
lock(state.lock) do
326326
state.worker_time_pressure[p.pid] = Dict{Processor,UInt64}()
327-
for proc in get_processors(gproc)
328-
state.worker_time_pressure[p.pid][proc] = 0
329-
end
330327

331328
state.worker_storage_pressure[p.pid] = Dict{Union{StorageResource,Nothing},UInt64}()
332329
state.worker_storage_capacity[p.pid] = Dict{Union{StorageResource,Nothing},UInt64}()
@@ -769,7 +766,9 @@ function schedule!(ctx, state, procs=procs_to_use(ctx))
769766
Vector{Tuple{Thunk,<:Any,<:Any,UInt64,UInt32}}()
770767
end
771768
push!(proc_tasks, (task, scope, est_time_util, est_alloc_util, est_occupancy))
772-
state.worker_time_pressure[gproc.pid][proc] += est_time_util
769+
state.worker_time_pressure[gproc.pid][proc] =
770+
get(state.worker_time_pressure[gproc.pid], proc, 0) +
771+
est_time_util
773772
@dagdebug task :schedule "Scheduling to $gproc -> $proc"
774773
@goto pop_task
775774
end

Diff for: src/sch/util.jl

+2-1
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,8 @@ function estimate_task_costs(state, procs, task, inputs)
457457
tx_cost = impute_sum(affinity(chunk)[2] for chunk in chunks_filt)
458458

459459
# Estimate total cost to move data and get task running after currently-scheduled tasks
460-
costs[proc] = state.worker_time_pressure[get_parent(proc).pid][proc] + (tx_cost/tx_rate)
460+
est_time_util = get(state.worker_time_pressure[get_parent(proc).pid], proc, 0)
461+
costs[proc] = est_time_util + (tx_cost/tx_rate)
461462
end
462463

463464
# Shuffle procs around, so equally-costly procs are equally considered

0 commit comments

Comments
 (0)