Skip to content

Commit

Permalink
Merge pull request #397 from necaris/fix-cudaworker-init-and-schedule…
Browse files Browse the repository at this point in the history
…r-address-parsing

Improve CUDAWorker scheduler-address parsing and __init__
  • Loading branch information
quasiben authored Sep 10, 2020
2 parents 3811951 + d536ad5 commit 2fa52fe
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions dask_cuda/cuda_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
from toolz import valmap
from tornado.ioloop import IOLoop

import dask
from distributed import Nanny
from distributed.config import config
from distributed.proctitle import (
enable_proctitle_on_children,
enable_proctitle_on_current,
Expand Down Expand Up @@ -47,7 +47,7 @@ def _get_interface(interface, host, cuda_device_index, ucx_net_devices):
class CUDAWorker:
def __init__(
self,
scheduler,
scheduler=None,
host=None,
nthreads=0,
name=None,
Expand Down Expand Up @@ -127,7 +127,11 @@ def del_pid_file():
kwargs = {"worker_port": None, "listen_address": None}
t = Nanny

if not scheduler and not scheduler_file and "scheduler-address" not in config:
if (
not scheduler
and not scheduler_file
and dask.config.get("scheduler-address", None) is None
):
raise ValueError(
"Need to provide scheduler address like\n"
"dask-worker SCHEDULER_ADDRESS:8786"
Expand Down

0 comments on commit 2fa52fe

Please sign in to comment.