qlauncher.workflow.pilotjob_scheduler#
Summary#
Classes:
Reference#
- class qlauncher.workflow.pilotjob_scheduler.JobManager(manager: Manager | None = None)[source]#
Bases:
object
- submit(problem: Problem, algorithm: Algorithm, backend: Backend, output_path: str, cores: int | None = None) str [source]#
Submits QLauncher job to the scheduler
- Parameters:
- Returns:
Job Id.
- Return type:
str
- submit_many(problem: Problem, algorithm: Algorithm, backend: Backend, output_path: str, cores_per_job: int = 1, n_jobs: int | None = None) list[str] [source]#
Submits as many jobs as there are currently available cores.
- Parameters:
problem (Problem) – Problem.
algorithm (Algorithm) – Algorithm.
backend (Backend) – Backend.
output_path (str) – Path of output file.
cores_per_job (int, optional) – Number of cores per job. Defaults to 1.
n_jobs (int | None) – number of jobs to submit. If None, submit as many as possible (free_cores//cores_per_job). Defaults to None.
- Returns:
List with Job Id’s.
- Return type:
list[str]
- wait_for_a_job(job_id: str | None = None, timeout: int | float | None = None) tuple[str, str] [source]#
Waits for a job to finish and returns it’s id and status.
- Parameters:
job_id (str | None, optional) – Id of selected job, if None waiting for any job. Defaults to None.
timeout (int | float | None, optional) – Timeout in seconds. Defaults to None.
- Raises:
ValueError – Raises if job_id not found or there are no jobs left.
- Returns:
job_id, job’s status
- Return type:
tuple[str, str]
- read_results(job_id: str) Result [source]#
Reads the result of given job_id.
- Parameters:
job_id (str) – Job Id.
- Returns:
Result of selected Job.
- Return type: