SchedulerManager#

class pyedb.workflows.job_manager.backend.service.SchedulerManager(scheduler_type: pyedb.workflows.job_manager.backend.job_submission.SchedulerType)#

Thin async wrapper around cluster scheduler commands.

Provides live introspection of SLURM and LSF clusters including:

  • List of partitions / queues with resource information

  • Per-partition: total & free cores, total & free memory

  • Global job table (running, pending, etc.)

All methods are coroutines so they can be awaited from the REST layer without blocking the event-loop.

Parameters:
scheduler_typeSchedulerType

Type of scheduler (SLURM or LSF only)

Raises:
ValueError

If scheduler_type is not SLURM or LSF

Overview#

get_partitions

Get list of scheduler partitions/queues with resource information.

get_jobs

Get global job table (all users).

Import detail#

from pyedb.workflows.job_manager.backend.service import SchedulerManager

Attribute detail#

SchedulerManager.scheduler_type#

Method detail#

async SchedulerManager.get_partitions() List[Dict[str, Any]]#

Get list of scheduler partitions/queues with resource information.

Returns:
List[Dict[str, Any]]

List of partition dictionaries with keys: - name: Partition/queue name - cores_total: Total available cores - cores_used: Currently used cores - memory_total_gb: Total memory in GB - memory_used_gb: Currently used memory in GB

Raises:
RuntimeError

If scheduler command execution fails

async SchedulerManager.get_jobs() List[Dict[str, Any]]#

Get global job table (all users).

Returns:
List[Dict[str, Any]]

List of job dictionaries with keys: - job_id: Scheduler job ID - partition: Partition/queue name - user: Job owner username - state: Job state (RUNNING, PENDING, etc.) - nodes: Number of nodes allocated - cpus: Number of CPUs allocated - memory_gb: Memory allocated in GB

Raises:
RuntimeError

If scheduler command execution fails