xqute.scheduler
abstract class
xqute.scheduler.
Scheduler
(
forks
, prescript=''
, postscript=''
, **kwargs
)
The abstract class for scheduler
Attributes
job_class
— The job class
Parameters
forks
(int) — Max number of job forksprescript
(str, optional) — The script to run before the commandpostscript
(str, optional) — The script to run after the command**kwargs
— Other arguments for the scheduler
Methods
job_is_running
(
job
)
(bool) — Check if a job is really running</>job_is_submitted_or_running
(
job
)
(bool) — Check if a job is already submitted or running</>kill_job
(
job
)
— Kill a job</>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
,halt_on_error
)
(bool) — Check if all jobs are done or new jobs can submit</>retry_job
(
job
)
— Retry a job</>submit_job
(
job
)
(int | str) — Submit a job</>submit_job_and_update_status
(
job
)
— Submit and update the status</>
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
polling_jobs
(
jobs
, on
, halt_on_error
)
Check if all jobs are done or new jobs can submit
Parameters
jobs
(List) — The list of jobson
(str) — query on status:can_submit
orall_done
halt_on_error
(bool) — Whether we should halt the whole pipeline on error
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