DaskLocalCluster ================ Purpose ------- The ``DaskLocalCluster`` is a wrapper function around a :py:class:`distributed.LocalCluster` configured with batchlet's dask parameters. Its purpose is to keep the :ref:`worker-configuration resolution logic ` consistent with :py:class:`DaskSlurmCluster`. This keeps behavior consistent between local and SLURM execution modes. Working ------- The function maps batchlet parameters to :py:class:`distributed.LocalCluster` arguments: * ``workers_per_node`` -> ``n_workers`` * ``threads_per_worker`` -> ``threads_per_worker`` * ``memory_per_worker`` -> ``memory_limit`` * ``worker_scratch_directory`` -> ``local_directory`` * ``resources_per_worker`` -> worker ``resources`` The parameters ``nodes`` and ``use_entry_node`` are ignored for local mode. Usage ----- .. code-block:: python from ska_sdp_batchlet.utils.dask_cluster.local_cluster import DaskLocalCluster with DaskLocalCluster( workers_per_node=4, threads_per_worker=2, memory_per_worker="2GB", resources_per_worker={"CPU": 2}, worker_scratch_directory="/tmp/dask-workers", name="BatchletLocal", ) as cluster: client = cluster.get_client() # submit dask tasks with client API --- .. autofunction:: ska_sdp_batchlet.utils.dask_cluster.local_cluster.DaskLocalCluster :no-index: