qml.concurrency.executors.external.dask.DaskExec¶
- class DaskExec(max_workers=None, persist=False, client_provider=None, **kwargs)[source]¶
Bases:
ExtExec
Dask distributed executor wrapper.
This executor relies on Dask’s distributed interface to offload task execution to either a local or configured remote cluster backend.
- Parameters:
max_workers – the maximum number of concurrent units (threads, processes) to use. The serial backend defaults to 1 and will return a
RuntimeError
if more are requested.persist – allow the executor backend to persist between executions. This is ignored for the serial backend.
client_provider (str, dask.distributed.deploy.Cluster) – provide an existing dask distributed cluster via a URL (str) or object to be used for job submission. When
None
, creates an internalLocalCluster
object using processes for job submission. Defaults toNone
. Cluster backend documentation available at Dask Distrubuted - Deploy Dask Clusters.**kwargs – Keyword arguments to pass-through to the executor backend. This is ignored for the serial backend.
Attributes
Indicates whether the executor will maintain its configured state between calls.
The size of the worker pool for the given executor.
- persist¶
Indicates whether the executor will maintain its configured state between calls.
- size¶
Methods
map
(fn, *args, **kwargs)Single iterable map for batching execution of fn over data entries.
shutdown
()Disconnect from executor backend and release acquired resources.
starmap
(fn, args, **kwargs)Single iterable map for batching execution of fn over data entries, with each entry being a tuple of arguments to fn.
submit
(fn, *args, **kwargs)Single function submission for remote execution with provided args.
- map(fn, *args, **kwargs)[source]¶
Single iterable map for batching execution of fn over data entries. Length of every entry in
*args
must be consistent. kwargs are assumed as broadcastable to each function call.