Stopping dask-ssh created scheduler from the Client interface

Viewed 1299

I am running Dask on a SLURM-managed cluster.

dask-ssh --nprocs 2 --nthreads 1 --scheduler-port 8786 --log-directory `pwd` --hostfile hostfile.$JOBID &
sleep 10

# We need to tell dask Client (inside python) where the scheduler is running
scheduler="`hostname`:8786"
echo "Scheduler is running at ${scheduler}"
export ARL_DASK_SCHEDULER=${scheduler}

echo "About to execute $CMD"

eval $CMD

# Wait for dash-ssh to be shutdown from the python
wait %1

I create a Client inside my python code and then when finished, I shut it down.

c=Client(scheduler_id)
...
c.shutdown()

My reading of the dask-ssh help is that the shutdown will shutdown all workers and then the scheduler. But it does not stop the background dask-ssh and so eventually the job timeouts.

I've tried this interactively in the shell. I cannot see how to stop the scheduler.

I would appreciate any help.

Thanks, Tim

1 Answers
Related