DaskPBSBackend

class propertyestimator.backends.dask.DaskPBSBackend(minimum_number_of_workers=1, maximum_number_of_workers=1, resources_per_worker=<propertyestimator.backends.backends.QueueWorkerResources object>, queue_name='default', setup_script_commands=None, extra_script_options=None, adaptive_interval='10000ms', disable_nanny_process=False, resource_line=None, adaptive_class=None)[source]

A property estimator backend which uses a dask_jobqueue.PBSCluster object to run calculations within an existing PBS queue.

See also

dask_jobqueue.LSFCluster, DaskLSFBackend

__init__(minimum_number_of_workers=1, maximum_number_of_workers=1, resources_per_worker=<propertyestimator.backends.backends.QueueWorkerResources object>, queue_name='default', setup_script_commands=None, extra_script_options=None, adaptive_interval='10000ms', disable_nanny_process=False, resource_line=None, adaptive_class=None)[source]

Constructs a new DaskLSFBackend object

Parameters

resource_line (str) – The string to pass to the #PBS -l line.

Examples

To create a PBS queueing compute backend which will attempt to spin up workers which have access to a single GPU.

>>> # Create a resource object which will request a worker with
>>> # one gpu which will stay alive for five hours.
>>> from propertyestimator.backends import QueueWorkerResources
>>>
>>> resources = QueueWorkerResources(number_of_threads=1,
>>>                                  number_of_gpus=1,
>>>                                  preferred_gpu_toolkit=QueueWorkerResources.GPUToolkit.CUDA,
>>>                                  wallclock_time_limit='05:00')
>>>
>>> # Define the set of commands which will set up the correct environment
>>> # for each of the workers.
>>> setup_script_commands = [
>>>     'module load cuda/9.2',
>>> ]
>>>
>>> # Create the backend which will adaptively try to spin up between one and
>>> # ten workers with the requested resources depending on the calculation load.
>>> from propertyestimator.backends import DaskPBSBackend
>>>
>>> pbs_backend = DaskPBSBackend(minimum_number_of_workers=1,
>>>                              maximum_number_of_workers=10,
>>>                              resources_per_worker=resources,
>>>                              queue_name='gpuqueue',
>>>                              setup_script_commands=setup_script_commands)

Methods

__init__([minimum_number_of_workers, …])

Constructs a new DaskLSFBackend object

job_script()

Returns the job script that dask will use to submit workers.

start()

Start the calculation backend.

stop()

Stop the calculation backend.

submit_task(function, *args, **kwargs)

Submit a task to the compute resources managed by this backend.

Attributes

started

Returns whether this backend has been started yet.

job_script()

Returns the job script that dask will use to submit workers. The backend must be started before calling this function.

Returns

Return type

str

start()

Start the calculation backend.

property started

Returns whether this backend has been started yet.

Type

bool

stop()

Stop the calculation backend.

submit_task(function, *args, **kwargs)

Submit a task to the compute resources managed by this backend.

Parameters

function (function) – The function to run.

Returns

Returns a future object which will eventually point to the results of the submitted task.

Return type

Future