Attention

This project is still in an early phase of development.

The python API is not yet stable, and some aspects of the schema for the blueprint and workplan will likely evolve. Therefore whilst you are welcome to try out using the package, we cannot yet guarantee backwards compatibility. We expect to reach a more stable version in 2026.

Scheduler#

class cstar.system.scheduler.Scheduler(queues: list[Queue], primary_queue_name: str, other_scheduler_directives: dict[str, str] | None = None, requires_task_distribution: bool | None = True, documentation: str | None = None, max_cpus_per_node: int | None = None)#

Bases: ABC, LoggingMixin

Abstract base class for representing a job scheduler.

This class defines the structure and common behavior for managing queues and job scheduling directives. Subclasses should implement specific scheduler-related functionality.

queues#

A list of queues managed by the scheduler.

Type:

List[Queue]

queue_names#

The names of all queues managed by the scheduler.

Type:

List[str]

primary_queue_name#

The name of the primary queue used for scheduling jobs.

Type:

str

other_scheduler_directives#

Additional directives or settings used for job submission

Type:

dict of str, optional

requires_task_distribution#

Whether the scheduler requires explicit specification of required nodes and cpus for a job, or will calculate it based on the number of CPUs alone. Defaults to True.

Type:

bool, optional

global_max_cpus_per_node#

The maximum number of CPUs available per node across all queues.

Type:

int

global_max_mem_per_node_gb#

The maximum amount of memory (in GB) available per node across all queues.

Type:

float

get_queue(name: str) Queue#

Retrieve a queue by name.

Methods

Scheduler.get_queue(name)

Retrieve a queue by name.

Attributes

Scheduler.global_max_cpus_per_node

Abstract method to retrieve the maximum number of CPUs available per node across all queues.

Scheduler.global_max_mem_per_node_gb

Abstract method to retrieve the maximum memory available per node across all queues.

Scheduler.in_active_allocation

Return True if the current process is running in an active allocation.

Scheduler.log

Return the logger instance for this class.