jobflow_remote.remote.queue module#

class jobflow_remote.remote.queue.QueueManager(scheduler_io: BaseSchedulerIO, host: BaseHost, timeout_exec: int | None = None)[source]#

Bases: object

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, timeout: int | None = None) CancelResult[source]#
execute_cmd(cmd: str, workdir: str | Path | None = None, timeout: int | 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_export(exports: dict | None) str | None[source]#
get_job(job: QJob | int | str, timeout: int | None = None) QJob | None[source]#
get_jobs_list(jobs: Sequence[QJob | int | str] | None = None, user: str | None = None, timeout: int | None = None) list[QJob][source]#
get_modules(modules: list[str] | None) str | None[source]#
get_post_run(post_run: str | list[str] | None) str[source]#
get_pre_run(pre_run: str | list[str] | None) str[source]#
get_run_commands(commands) str[source]#
get_shell_manager()[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, export: dict | None = None, modules: list[str] | None = None) str[source]#
submit(commands: str | list[str] | None, options=None, work_dir=None, pre_run: str | list[str] | None = None, post_run: str | list[str] | None = None, export: dict | None = None, modules: list[str] | None = None, script_fname='submit.sh', create_submit_dir: bool = False, timeout: int | None = None) SubmissionResult[source]#
write_submission_script(commands: str | list[str] | None, options=None, work_dir=None, pre_run: str | list[str] | None = None, post_run: str | list[str] | None = None, export: dict | None = None, modules: list[str] | None = None, script_fname='submit.sh', create_submit_dir: bool = False)[source]#
jobflow_remote.remote.queue.set_name_out(resources: dict | QResources, name: str, out_fpath: str | Path = 'queue.out', err_fpath: str | Path = 'queue.err') None[source]#