@@ -58,6 +58,7 @@ Fields:
58
58
- `running_on::Dict{Thunk,OSProc}` - Map from `Thunk` to the OS process executing it
59
59
- `thunk_dict::Dict{Int, WeakThunk}` - Maps from thunk IDs to a `Thunk`
60
60
- `node_order::Any` - Function that returns the order of a thunk
61
+ - `equiv_chunks::WeakKeyDict{DRef,Chunk}` - Cache mapping from `DRef` to a `Chunk` which contains it
61
62
- `worker_time_pressure::Dict{Int,Dict{Processor,UInt64}}` - Maps from worker ID to processor pressure
62
63
- `worker_storage_pressure::Dict{Int,Dict{Union{StorageResource,Nothing},UInt64}}` - Maps from worker ID to storage resource pressure
63
64
- `worker_storage_capacity::Dict{Int,Dict{Union{StorageResource,Nothing},UInt64}}` - Maps from worker ID to storage resource capacity
@@ -84,6 +85,7 @@ struct ComputeState
84
85
running_on:: Dict{Thunk,OSProc}
85
86
thunk_dict:: Dict{Int, WeakThunk}
86
87
node_order:: Any
88
+ equiv_chunks:: WeakKeyDict{DRef,Chunk}
87
89
worker_time_pressure:: Dict{Int,Dict{Processor,UInt64}}
88
90
worker_storage_pressure:: Dict{Int,Dict{Union{StorageResource,Nothing},UInt64}}
89
91
worker_storage_capacity:: Dict{Int,Dict{Union{StorageResource,Nothing},UInt64}}
@@ -113,6 +115,7 @@ function start_state(deps::Dict, node_order, chan)
113
115
Dict {Thunk,OSProc} (),
114
116
Dict {Int, WeakThunk} (),
115
117
node_order,
118
+ WeakKeyDict {DRef,Chunk} (),
116
119
Dict {Int,Dict{Processor,UInt64}} (),
117
120
Dict {Int,Dict{Union{StorageResource,Nothing},UInt64}} (),
118
121
Dict {Int,Dict{Union{StorageResource,Nothing},UInt64}} (),
@@ -428,6 +431,11 @@ function scheduler_run(ctx, state::ComputeState, d::Thunk, options::SchedulerOpt
428
431
state. transfer_rate[] = (state. transfer_rate[] + metadata. transfer_rate) ÷ 2
429
432
end
430
433
end
434
+ if res isa Chunk
435
+ if ! haskey (state. equiv_chunks, res)
436
+ state. equiv_chunks[res. handle:: DRef ] = res
437
+ end
438
+ end
431
439
store_result! (state, node, res; error= thunk_failed)
432
440
if node. options != = nothing && node. options. checkpoint != = nothing
433
441
try
0 commit comments