qtoolkit.io.slurm module#

class qtoolkit.io.slurm.SlurmIO(get_job_executable: str = 'scontrol', split_separator: str = '<><>')[source]#

Bases: BaseSchedulerIO

CANCEL_CMD: str | None = 'scancel -v'#
SUBMIT_CMD: str | None = 'sbatch'#
header_template: str = '\n#SBATCH --partition=$${partition}\n#SBATCH --job-name=$${job_name}\n#SBATCH --nodes=$${nodes}\n#SBATCH --ntasks=$${ntasks}\n#SBATCH --ntasks-per-node=$${ntasks_per_node}\n#SBATCH --cpus-per-task=$${cpus_per_task}\n#SBATCH --mem=$${mem}\n#SBATCH --mem-per-cpu=$${mem_per_cpu}\n#SBATCH --hint=$${hint}\n#SBATCH --time=$${time}\n#SBATCH\t--exclude=$${exclude_nodes}\n#SBATCH --account=$${account}\n#SBATCH --mail-user=$${mail_user}\n#SBATCH --mail-type=$${mail_type}\n#SBATCH --constraint=$${constraint}\n#SBATCH --gres=$${gres}\n#SBATCH --requeue=$${requeue}\n#SBATCH --nodelist=$${nodelist}\n#SBATCH --propagate=$${propagate}\n#SBATCH --licenses=$${licenses}\n#SBATCH --output=$${qout_path}\n#SBATCH --error=$${qerr_path}\n#SBATCH --qos=$${qos}\n#SBATCH --priority=$${priority}\n#SBATCH --array=$${array}\n#SBATCH --exclusive=$${exclusive}\n$${qverbatim}'#
parse_cancel_output(exit_code, stdout, stderr) CancelResult[source]#

Parse the output of the scancel command.

parse_job_output(exit_code, stdout, stderr) QJob | None[source]#
parse_jobs_list_output(exit_code, stdout, stderr) list[QJob][source]#
parse_submit_output(exit_code, stdout, stderr) SubmissionResult[source]#
squeue_fields = [('%i', 'job_id'), ('%t', 'state_raw'), ('%r', 'annotation'), ('%j', 'job_name'), ('%u', 'username'), ('%P', 'partition'), ('%l', 'time_limit'), ('%D', 'number_nodes'), ('%C', 'number_cpus'), ('%M', 'time_used'), ('%m', 'min_memory')]#
property supported_qresources_keys: list#

List of attributes of QResources that are correctly handled by the _convert_qresources method. It is used to validate that the user does not pass an unsupported value, expecting to have an effect.

class qtoolkit.io.slurm.SlurmState(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#

Bases: QSubState

BOOT_FAIL = 'BOOT_FAIL'#
CANCELLED = 'CANCELLED'#
COMPLETED = 'COMPLETED'#
COMPLETING = 'COMPLETING'#
CONFIGURING = 'CONFIGURING'#
DEADLINE = 'DEADLINE'#
FAILED = 'FAILED'#
NODE_FAIL = 'NODE_FAIL'#
OUT_OF_MEMORY = 'OUT_OF_MEMORY'#
PENDING = 'PENDING'#
PREEMPTED = 'PREEMPTED'#
REQUEUE_FED = 'REQUEUE_FED'#
REQUEUE_HOLD = 'REQUEUE_HOLD'#
RESIZING = 'RESIZING'#
RESV_DEL_HOLD = 'RESV_DEL_HOLD'#
REVOKED = 'REVOKED'#
RUNNING = 'RUNNING'#
SIGNALING = 'SIGNALING'#
SPECIAL_EXIT = 'SPECIAL_EXIT'#
STAGE_OUT = 'STAGE_OUT'#
STOPPED = 'STOPPED'#
SUSPENDED = 'SUSPENDED'#
TIMEOUT = 'TIMEOUT'#
property qstate: QState#