Dask jobqueue
Dask Jobqueue Executors.
These are essentially wrappers around the dask_jobqueue classes. We use them to provide a consistent interface for all the different jobqueue implementations and get access to their executors.
Documentation from dask_jobqueue
See the dask jobqueue documentation specifically:
class DaskJobqueueExecutor(cluster, *, n_workers, adaptive=False, submit_command=None, cancel_command=None)
#
Bases: Executor, Generic[_JQC]
A concurrent.futures Executor that executes tasks on a dask_jobqueue cluster.
Implementations
Prefer to use the class methods to create an instance of this class.
| PARAMETER | DESCRIPTION |
|---|---|
cluster |
The implementation of a dask_jobqueue.JobQueueCluster.
TYPE:
|
n_workers |
The number of workers to maximally adapt to on the cluster.
TYPE:
|
adaptive |
Whether to use the adaptive scaling of the cluster or fixed allocate all workers. This will specifically use the dask_jobqueue.SLURMCluster.adapt method to dynamically scale the cluster to the number of workers specified.
TYPE:
|
submit_command |
To overwrite the submission command if necessary.
TYPE:
|
cancel_command |
To overwrite the cancel command if necessary.
TYPE:
|
Source code in src/amltk/scheduling/executors/dask_jobqueue.py
def submit(fn, /, *args, **kwargs)
#
See concurrent.futures.Executor.submit.
Source code in src/amltk/scheduling/executors/dask_jobqueue.py
def map(fn, *iterables, timeout=None, chunksize=1)
#
See concurrent.futures.Executor.map.
Source code in src/amltk/scheduling/executors/dask_jobqueue.py
def shutdown(wait=True, **kwargs)
#
def SLURM(*, n_workers, adaptive=False, submit_command=None, cancel_command=None, **kwargs)
classmethod
#
Create a DaskJobqueueExecutor for a SLURM cluster.
See the dask_jobqueue.SLURMCluster documentation for more information on the available keyword arguments.
Source code in src/amltk/scheduling/executors/dask_jobqueue.py
def HTCondor(*, n_workers, adaptive=False, submit_command=None, cancel_command=None, **kwargs)
classmethod
#
Create a DaskJobqueueExecutor for a HTCondor cluster.
See the dask_jobqueue.HTCondorCluster documentation for more information on the available keyword arguments.
Source code in src/amltk/scheduling/executors/dask_jobqueue.py
def LSF(*, n_workers, adaptive=False, submit_command=None, cancel_command=None, **kwargs)
classmethod
#
Create a DaskJobqueueExecutor for a LSF cluster.
See the dask_jobqueue.LSFCluster documentation for more information on the available keyword arguments.
Source code in src/amltk/scheduling/executors/dask_jobqueue.py
def OAR(*, n_workers, adaptive=False, submit_command=None, cancel_command=None, **kwargs)
classmethod
#
Create a DaskJobqueueExecutor for a OAR cluster.
See the dask_jobqueue.OARCluster documentation for more information on the available keyword arguments.
Source code in src/amltk/scheduling/executors/dask_jobqueue.py
def PBS(*, n_workers, adaptive=False, submit_command=None, cancel_command=None, **kwargs)
classmethod
#
Create a DaskJobqueueExecutor for a PBS cluster.
See the dask_jobqueue.PBSCluster documentation for more information on the available keyword arguments.
Source code in src/amltk/scheduling/executors/dask_jobqueue.py
def SGE(*, n_workers, adaptive=False, submit_command=None, cancel_command=None, **kwargs)
classmethod
#
Create a DaskJobqueueExecutor for a SGE cluster.
See the dask_jobqueue.SGECluster documentation for more information on the available keyword arguments.
Source code in src/amltk/scheduling/executors/dask_jobqueue.py
def Moab(*, n_workers, adaptive=False, submit_command=None, cancel_command=None, **kwargs)
classmethod
#
Create a DaskJobqueueExecutor for a Moab cluster.
See the dask_jobqueue.MoabCluster documentation for more information on the available keyword arguments.
Source code in src/amltk/scheduling/executors/dask_jobqueue.py
def from_str(name, *, n_workers, adaptive=False, submit_command=None, cancel_command=None, **kwargs)
classmethod
#
Create a DaskJobqueueExecutor using a string lookup.
| PARAMETER | DESCRIPTION |
|---|---|
name |
The name of cluster to create, must be one of ["slurm", "htcondor", "lsf", "oar", "pbs", "sge", "moab"].
TYPE:
|
n_workers |
The number of workers to maximally adapt to on the cluster.
TYPE:
|
adaptive |
Whether to use the adaptive scaling of the cluster or fixed allocate all workers. This will specifically use the dask_jobqueue.SLURMCluster.adapt method to dynamically scale the cluster to the number of workers specified.
TYPE:
|
submit_command |
Overwrite the submit command of workers if necessary.
TYPE:
|
cancel_command |
Overwrite the cancel command of workers if necessary.
TYPE:
|
kwargs |
The keyword arguments to pass to the cluster constructor.
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
KeyError
|
If |
| RETURNS | DESCRIPTION |
|---|---|
DaskJobqueueExecutor
|
A DaskJobqueueExecutor for the requested cluster type. |