paidiverpy.utils.parallellisation#
Module for parallelisation utilities.
Functions#
|
Determine the number of jobs based on n_jobs parameter. |
|
Update the Dask configuration. |
Parse the client configuration. |
Module Contents#
- paidiverpy.utils.parallellisation.get_n_jobs(n_jobs: int) int[source]#
Determine the number of jobs based on n_jobs parameter.
Uses SLURM_CPUS_ON_NODE when inside a Slurm allocation so that only the CPUs actually allocated to the job are used, not all CPUs visible on the node.
- paidiverpy.utils.parallellisation.update_dask_config(dask_config_kwargs: dict) None[source]#
Update the Dask configuration.
- Parameters:
dask_config_kwargs (dict) – Dask configuration keyword arguments.
- paidiverpy.utils.parallellisation.parse_parallellisation_params(config: paidiverpy.models.general_config.GeneralConfig | None) dask.distributed.Client | None[source]#
Parse the client configuration.
- Parameters:
config (GeneralConfig | None) – Client configuration.
- Returns:
Dask client or None if no client is configured.
- Return type:
dask.distributed.Client | None