clusterjob.backends.slurm module¶
-
class
clusterjob.backends.slurm.SlurmBackend[source]¶ Bases:
clusterjob.backends.ClusterjobBackendSLURM Backend
Attributes: - name (str) – Name of the backend
- extension (str) – Extension for job scripts
- prefix (str) – The prefix for every line in the resource header
- status_mapping (dict) – mapping of Slurm string status codes to clusterjob integer status codes
- resource_replacements (dict) – mapping of the common clusterjob resource keys to command line options of the qsub command.
- job_vars (dict) – mapping of core environment variables to Slurm-specific environment variables.
-
name= 'slurm'¶
-
extension= 'slr'¶
-
prefix= '#SBATCH'¶
-
cmd_submit(jobscript)[source]¶ Given a
JobScriptinstance, return asbatchcommand that submits the job to the scheduler, as a list of program arguments.
-
get_job_id(response)[source]¶ Given the stdout from the command returned by
cmd_submit(), return a job ID
-
cmd_status(run, finished=False)[source]¶ Given a
AsyncResultinstance, return a command that queries the scheduler for the job status, as a list of command arguments. Iffinished=True, the scheduler is queried viasacct. Otherwise,squeueis used.
-
get_status(response, finished=False)[source]¶ Given the stdout from the command returned by
cmd_status(), return one of the status code defined inclusterjob.status
-
cmd_cancel(run)[source]¶ Given a
AsyncResultinstance, return anscancelcommand that cancels the run, as a list of command arguments.