Skip to content

Instantly share code, notes, and snippets.

@rainwoodman
rainwoodman / dask-cluster.sh
Last active April 1, 2021 04:22
Launch a transient dask cluster (scheduler + workers) for a client in a SLURM job
OPTS=`getopt -o p:P:T:M:s:m:h --long port:nprocs:,nthreads:,memory-limit:,socks:,monitor:,help -- "$@"`
usage () {
echo "usage : bash dask-cluster.sh -M memory-limit -P nprocs -T nthreads -s SOCKSPORT -m MONITORHOST -p MONITORPORT [ clientcommand ... ] "
echo
echo launch a transient dask cluster via SLURM. The purpose of the cluster is to run a single dask
echo client.
echo
echo The script will setup a SOCKS proxy at localhost:SOCKSPORT on MONITORHOST to access the cluster.
echo via the ssh service at MONITORHOST:MONITORPORT