Skip to content

Commit a07a356

Browse files
committed
Keep task submission count tied to worker availability
1 parent a9439b9 commit a07a356

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

src/pytask_parallel/execute.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,15 +105,10 @@ def pytask_execute_build(session: Session) -> bool | None: # noqa: C901, PLR091
105105
# Unfortunately, all submitted tasks are shown as running although some
106106
# are pending.
107107
#
108-
# For all other backends, at least four more tasks are submitted and
109-
# otherwise 10% more. This is a heuristic to avoid submitting too few
110-
# tasks.
111-
#
112-
# See #98 for more information.
113108
if any_coiled_task:
114109
n_new_tasks = 10_000
115110
else:
116-
n_new_tasks = max(4, int(session.config["n_workers"] * 0.1))
111+
n_new_tasks = session.config["n_workers"] - len(running_tasks)
117112

118113
ready_tasks = (
119114
list(session.scheduler.get_ready(n_new_tasks))

0 commit comments

Comments
 (0)