Dask-Jobqueue simplifies the deployment of Dask distributed clusters on traditional high-performance computing (HPC) job queuing systems such as PBS, Slurm, LSF, SGE, MOAB, OAR, and HTCondor. It allows users to dynamically launch Dask workers as jobs on a cluster, integrating Dask's parallel computing capabilities with existing HPC infrastructure. The library is actively maintained, with the current version being 0.9.0, and typically follows a regular release cadence aligned with Dask's ecosystem updates. [1, 5, 15, 16]
pip install dask-jobqueueVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to create a Dask SLURMCluster, scale it, connect a Dask client, perform a simple distributed computation, and then shut down the cluster. Users should customize the `cluster_kwargs` dictionary with values appropriate for their specific HPC environment and job scheduler. [4, 9, 10, 16]
Use `cluster.scale(N)` to request N jobs/workers and `cluster.scale(0)` to stop all jobs/workers. [2]
Pass these arguments via the `scheduler_options` dictionary, e.g., `scheduler_options={'dashboard_address': ':12435'}`. [2, 10]Use their replacements: `account` (for `project`), `worker_extra_args` (for `extra`), `job_script_prologue` (for `env_extra`), `job_extra_directives` (for `job_extra`), and `job_directives_skip` (for `header_skip`). [10, 11, 17, 20]
Explicitly set `processes` and `threads_per_process` in your cluster constructor if you require a specific worker configuration. For example, `processes=1` for a purely threaded setup, or `processes=cores` for a purely multiprocess setup. [2, 3]
Always use 'GiB' (Gibibytes) in Dask-Jobqueue memory configuration (e.g., `memory='20GiB'`) to ensure consistent requests across Dask and the scheduler. [3]
Inspect the generated job script with `print(cluster.job_script())` and compare it against your system's job submission requirements. Adjust cluster parameters like `job_extra_directives` or `job_directives_skip` as needed, or verify resource limits with your system administrator. [14, 17, 18]
Ensure the `python` parameter in your cluster constructor points to the correct Python executable on the compute nodes. Use `job_script_prologue` to load necessary environment modules (e.g., `['module load my_conda_env']`) before Dask workers start. [14, 18]
Set `scheduler_options={'dashboard_address': ':YOUR_PORT'}` to specify a free port. For remote access, you may need to set up SSH port forwarding (e.g., `ssh -L YOUR_PORT:localhost:YOUR_PORT user@head_node`) if running on an HPC login node. [9, 10]Increase the `walltime` parameter in your cluster configuration. For long-running or indefinite workloads, consider using the Dask worker options `--lifetime` and `--lifetime-stagger` to gracefully shut down and restart workers before walltime is reached, allowing Dask to rebalance tasks. [17]