phenotypic.sdk_.slurm.get_slurm_max_submit_jobs#
- phenotypic.sdk_.slurm.get_slurm_max_submit_jobs() int | None[source]#
Query a conservative SLURM MaxSubmitJobs limit per user.
Uses
sacctmgrto retrieve the maximum number of jobs a user can have in the queue simultaneously. This is typically set by QoS (Quality of Service) policies.- Returns:
Smallest configured positive QoS or user-association limit, or
Noneif no limit is configured or available. Taking the smallest value is conservative when the cluster exposes several QoS or association records and the caller cannot reliably infer which one the submitted job will use.- Return type:
int | None
Examples
>>> limit = get_slurm_max_submit_jobs() >>> limit is None or limit > 0 True
Notes
Result is cached for the session
Returns None if sacctmgr is not available
Returns None if no limit is configured (unlimited)
QoS and association records can carry different limits; returning the largest value can oversize an array for the active policy.