xqute.schedulers.slurm_scheduler
module
xqute.schedulers.slurm_scheduler
The scheduler to run jobs on Slurm
Classes
SlurmScheduler
— The Slurm scheduler</>
class
xqute.schedulers.slurm_scheduler.
SlurmScheduler
(
*args
, **kwargs
)
The Slurm scheduler
Attributes
job_class
— The job classjobcmd_wrapper_init
— The init script for the job command wrapperjobcmd_wrapper_init
(str) — The init script for the job command wrapper</>name
— The name of the scheduler
Parameters
**kwargs
— Other arguments for the scheduler
Methods
create_job
(
index
,cmd
)
(Job) — Create a job</>job_is_running
(
job
)
(bool) — Tell if a job is really running, not only the job.jid_file</>job_is_submitted_or_running
(
job
)
(bool) — Check if a job is already submitted or running</>jobcmd_end
(
job
)
(str) — The job command end</>jobcmd_init
(
job
)
(str) — The job command init</>jobcmd_prep
(
job
)
(str) — The job command preparation</>jobcmd_shebang
(
job
)
(str) — The shebang of the wrapper script</>kill_job
(
job
)
— Kill a job on Slurm</>kill_job_and_update_status
(
job
)
— Kill a job and update its status</>kill_running_jobs
(
jobs
)
— Try to kill all running jobs</>polling_jobs
(
jobs
,on
)
(bool) — Check if all jobs are done or new jobs can submit</>retry_job
(
job
)
— Retry a job</>submit_job
(
job
)
(str) — Submit a job to Slurm</>submit_job_and_update_status
(
job
)
— Submit and update the status</>wrap_job_script
(
job
)
(str) — Wrap the job script</>wrapped_job_script
(
job
,remote
)
(Union) — Get the wrapped job script</>
method
create_job
(
index
, cmd
)
Create a job
Parameters
index
(int) — The index of the jobcmd
(Union) — The command of the job
Returns (Job)
The job
method
submit_job_and_update_status
(
job
)
Submit and update the status
- Check if the job is already submitted or running
- If not, run the hook
- If the hook is not cancelled, clean the job
- Submit the job, raising an exception if it fails
- If the job is submitted successfully, update the status
- If the job fails to submit, update the status and write stderr to the job file
Parameters
job
(Job) — The job
method
kill_job_and_update_status
(
job
)
Kill a job and update its status
Parameters
job
(Job) — The job
method
polling_jobs
(
jobs
, on
)
Check if all jobs are done or new jobs can submit
Parameters
jobs
(List) — The list of jobson
(str) — query on status:submittable
orall_done
Returns (bool)
True if yes otherwise False.
method
kill_running_jobs
(
jobs
)
Try to kill all running jobs
Parameters
jobs
(List) — The list of jobs
method
job_is_submitted_or_running
(
job
)
Check if a job is already submitted or running
Parameters
job
(Job) — The job
Returns (bool)
True if yes otherwise False.
method
jobcmd_init
(
job
)
→ str
The job command init
method
jobcmd_prep
(
job
)
→ str
The job command preparation
method
jobcmd_end
(
job
)
→ str
The job command end
method
wrap_job_script
(
job
)
method
wrapped_job_script
(
job
, remote=False
)
Get the wrapped job script
Parameters
job
(Job) — The job
Returns (Union)
The path of the wrapped job script
method
jobcmd_shebang
(
job
)
→ str
The shebang of the wrapper script