Skip to content

Schedule all ready tasks. #99

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/source/changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ releases are available on [PyPI](https://pypi.org/project/pytask-parallel) and
or processes automatically.
- {pull}`96` handles local paths with remote executors. `PathNode`s are not supported as
dependencies or products (except for return annotations).
- {pull}`99` changes that all tasks that are ready are being scheduled. It improves
interactions with adaptive scaling. {issue}`98` does handle the resulting issues: no
strong adherence to priorities, no pending status.

## 0.4.1 - 2024-01-12

Expand Down
8 changes: 1 addition & 7 deletions src/pytask_parallel/execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,7 @@ def pytask_execute_build(session: Session) -> bool | None: # noqa: C901, PLR091
while session.scheduler.is_active():
try:
newly_collected_reports = []
n_new_tasks = session.config["n_workers"] - len(running_tasks)

ready_tasks = (
list(session.scheduler.get_ready(n_new_tasks))
if n_new_tasks >= 1
else []
)
ready_tasks = list(session.scheduler.get_ready(10_000))

for task_name in ready_tasks:
task = session.dag.nodes[task_name]["task"]
Expand Down
2 changes: 2 additions & 0 deletions tests/test_execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ def task_2(path: Annotated[Path, Product] = Path("out_2.txt")):


@pytest.mark.end_to_end()
@pytest.mark.skip(reason="See #98")
@pytest.mark.parametrize("parallel_backend", _IMPLEMENTED_BACKENDS)
def test_stop_execution_when_max_failures_is_reached(tmp_path, parallel_backend):
source = """
Expand Down Expand Up @@ -106,6 +107,7 @@ def task_3(): time.sleep(3)


@pytest.mark.end_to_end()
@pytest.mark.skip(reason="See #98")
@pytest.mark.parametrize("parallel_backend", _IMPLEMENTED_BACKENDS)
def test_task_priorities(tmp_path, parallel_backend):
source = """
Expand Down