Skip to content

Commit

Permalink
Use config variables
Browse files Browse the repository at this point in the history
  • Loading branch information
phofl committed Sep 18, 2024
1 parent 927d36a commit 2ce050d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 2 additions & 0 deletions distributed/distributed.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ distributed:
# tornado.application: error

scheduler:
rootish-tg: 100
rootish-tg-dependencies: 500
allowed-failures: 3 # number of retries before a task is considered bad
bandwidth: 100000000 # 100 MB/s estimated worker-worker bandwidth
blocked-handlers: []
Expand Down
9 changes: 7 additions & 2 deletions distributed/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -1840,6 +1840,11 @@ def __init__(
+ repr(self.WORKER_SATURATION)
)

self.rootish_tg_threshold = dask.config.get("distributed.scheduler.rootish-tg")
self.rootish_tg_dependencies_threshold = dask.config.get(
"distributed.scheduler.rootish-tg-dependencies"
)

@abstractmethod
def log_event(self, topic: str | Collection[str], msg: Any) -> None: ...

Expand Down Expand Up @@ -3090,8 +3095,8 @@ def is_rootish(self, ts: TaskState) -> bool:
# TODO short-circuit to True if `not ts.dependencies`?
return (
len(tg) > self.total_nthreads * 2
and len(tg.dependencies) < 100
and sum(map(len, tg.dependencies)) < 500
and len(tg.dependencies) < self.rootish_tg_threshold
and sum(map(len, tg.dependencies)) < self.rootish_tg_dependencies_threshold
)

def check_idle_saturated(self, ws: WorkerState, occ: float = -1.0) -> None:
Expand Down

0 comments on commit 2ce050d

Please sign in to comment.