tomwer.core.cluster.cluster.SlurmClusterConfiguration#

class tomwer.core.cluster.cluster.SlurmClusterConfiguration(n_cpu_per_task=16, n_tasks=1, memory=128, queue='gpu', n_gpus=1, project_name='tomwer_{scan}_-_{process}_-_{info}', walltime='01:00:00', python_venv=None, n_jobs=1, modules_to_load=('tomotools/stable',), act_as_login_shell=False, sbatch_extra_params={'export': 'ALL'})#

Represents the configuration of a Slurm cluster.

This object stores the configuration settings used for a Slurm cluster, which can be passed to other processing components.

property act_as_login_shell: bool#
property dashboard_port#

Return the dashboard port (if configured).

static from_dict(dict_)#

Create a SlurmClusterConfiguration from a dictionary.

Parameters:

dict – A dictionary with configuration keys.

Return type:

SlurmClusterConfiguration

Returns:

An instance of SlurmClusterConfiguration with the loaded settings.

load_from_dict(dict_)#

Load configuration settings from a dictionary.

Parameters:

dict – A dictionary containing configuration parameters.

Return type:

SlurmClusterConfiguration

Returns:

Self with updated settings.

property memory#

Return the memory allocated per worker (in GB).

property modules_to_load: tuple#

Return the tuple of modules to load.

property n_cpu_per_task#

Return the number of CPUs per task.

property n_gpus#

Return the number of GPUs per worker.

property n_jobs#

Return the number of jobs into which the task is split.

property n_task#

Return the number of tasks (workers).

property port_range: tuple#

Return the port range as a tuple: (start: int, stop: int, step: int).

May be None if not configured.

property project_name#

Return the project name template.

property python_venv#

Return the path to the Python virtual environment activation script.

property queue#

Return the queue or partition to use.

property sbatch_extra_params: dict#

Return the extra parameters for sbatch.

to_dict()#

Convert the configuration to a dictionary.

Return type:

dict

Returns:

A dictionary representation of the configuration.

property walltime#

Return the default walltime (HH:MM:SS).