qtoolkit.manager module#

class qtoolkit.manager.QueueManager(scheduler_io: BaseSchedulerIO, host: BaseHost = None)[source]#

Bases: QTKObject

Base class for job queues.

scheduler_io#

Name of the queue

Type:

str

host#

Host where the command should be executed.

Type:

BaseHost

cancel(job: QJob | int | str) CancelResult[source]#
execute_cmd(cmd: str, workdir: str | Path | None = None)[source]#

Execute a command.

Parameters:
  • cmd (str) – Command to be executed

  • workdir (str or None) – path where the command will be executed.

Returns:

  • stdout (str)

  • stderr (str)

  • exit_code (int)

get_change_dir(dir_path: str | Path | None) str[source]#
get_environment_setup(env_config) str[source]#
get_job(job: QJob | int | str) QJob | None[source]#
get_jobs_list(jobs: list[QJob | int | str] | None = None, user: str | None = None) list[QJob][source]#
get_post_run(post_run) str[source]#
get_pre_run(pre_run) str[source]#
get_run_commands(commands) str[source]#
get_submission_script(commands: str | list[str] | None, options: dict | QResources | None = None, work_dir: str | Path | None = None, pre_run: str | list[str] | None = None, post_run: str | list[str] | None = None, environment=None) str[source]#
submit(commands: str | list[str] | None, options=None, work_dir=None, environment=None, script_fname='submit.script', create_submit_dir=False) SubmissionResult[source]#