Skip to content

xqute.scheduler

module

xqute.scheduler

The scheduler to schedule jobs

Classes
  • Scheduler(forks, prescript, postscript, **kwargs) The abstract class for 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 forks
  • prescript (str, optional) The script to run before the command
  • postscript (str, optional) The script to run after the command
  • **kwargs Other arguments for the scheduler
Methods
method

submit_job_and_update_status(job)

Submit and update the status

  1. Check if the job is already submitted or running
  2. If not, run the hook
  3. If the hook is not cancelled, clean the job
  4. Submit the job, raising an exception if it fails
  5. If the job is submitted successfully, update the status
  6. If the job fails to submit, update the status and write stderr to the job file
Parameters
  • job (Job) The job
method

retry_job(job)

Retry a job

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, halt_on_error)

Check if all jobs are done or new jobs can submit

Parameters
  • jobs (List) The list of jobs
  • on (str) query on status: can_submit or all_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
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.

abstract method

submit_job(job)

Submit a job

Parameters
  • job (Job) The job
Returns (int | str)

The unique id in the scheduler system

abstract method

kill_job(job)

Kill a job

Parameters
  • job (Job) The job
abstract method

job_is_running(job)

Check if a job is really running

Parameters
  • job (Job) The job
Returns (bool)

True if yes otherwise False.