Skip to content

Commit 4c67b0b

Browse files
committed
10ms penalty per transfer
I'd like to incorporate measured latency somehow too instead of a magic 10ms, but it's a start.
1 parent 05677bb commit 4c67b0b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

distributed/scheduler.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3416,13 +3416,15 @@ def worker_objective(self, ts: TaskState, ws: WorkerState) -> tuple:
34163416
dts: TaskState
34173417
nbytes: Py_ssize_t
34183418
comm_bytes: Py_ssize_t = 0
3419+
xfers: Py_ssize_t = 0
34193420
for dts in ts._dependencies:
34203421
if ws not in dts._who_has:
34213422
nbytes = dts.get_nbytes()
34223423
comm_bytes += nbytes
3424+
xfers += 1
34233425

34243426
stack_time: double = ws._occupancy / ws._nthreads
3425-
start_time: double = stack_time + comm_bytes / self._bandwidth
3427+
start_time: double = stack_time + comm_bytes / self._bandwidth + xfers * 0.01
34263428

34273429
if ts._actor:
34283430
return (len(ws._actors), start_time, ws._nbytes)

0 commit comments

Comments
 (0)