scmd¶
Module containing functions wrapping Slurm commands
-
pyssub.scmd.
failed
(jobs: Dict[str, int]) → Dict[str, int]¶ Failed jobs
Check which of the given jobs have failed, meaning that their states are not equal to
COMPLETED
.Parameters: jobs (dict(str, int)) – Mapping of job names to job IDs Returns: Mapping of names to IDs of the jobs that have failed Return type: dict(str, int) Raises: RuntimeError
– If job ID cannot be matched from sacct’s output.
-
pyssub.scmd.
numjobs
(user: str, partition: Optional[str] = None) → int¶ Number of queuing jobs
Check the number of queuing jobs for the given user and partition.
Parameters: - user (str) – User name or ID
- partition (str, optional) – Partition name
Returns: Number of queuing jobs
Return type: int
-
pyssub.scmd.
submit
(script: pyssub.sbatch.SBatchScript, partition: Optional[str] = None) → int¶ Submit Slurm batch script.
Parameters: - script (SBatchScript) – Slurm batch script
- partition (str, optional) – Partition for resource allocation
Returns: Job ID
Return type: int
Raises: RuntimeError
– If job ID cannot be matched from sbatch’s output.