Skip to content
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

[DNM] Use ProcessPool workers #818

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
11 changes: 11 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import threading
import time
import uuid
from concurrent.futures import ProcessPoolExecutor
from functools import lru_cache

import dask
Expand Down Expand Up @@ -93,6 +94,7 @@ def get_coiled_runtime_version():
{
"coiled.account": "dask-benchmarks",
"distributed.admin.system-monitor.gil.enabled": True,
"distributed.worker.daemon": False,
}
)

Expand Down Expand Up @@ -514,6 +516,15 @@ def small_client(
small_cluster.scale(n_workers)
client.wait_for_workers(n_workers)

# Swap out the default threadpool for a processpool on workers
class ProcessPoolWorkers(WorkerPlugin):
def setup(self, worker):
worker.executors["default"] = ProcessPoolExecutor(
max_workers=worker.state.nthreads
)

client.register_worker_plugin(ProcessPoolWorkers())

with upload_cluster_dump(client):
log_on_scheduler(client, "Finished client setup of %s", test_label)

Expand Down