hpcflow.sdk.submission.schedulers.QueuedScheduler#

class hpcflow.sdk.submission.schedulers.QueuedScheduler(submit_cmd=None, show_cmd=None, del_cmd=None, js_cmd=None, login_nodes_cmd=None, array_switch=None, array_item_var=None, *args, **kwargs)#

Bases: Scheduler[str]

Base class for schedulers that use a job submission system.

Parameters:
  • submit_cmd (str) – The submission command, if overridden from default.

  • show_cmd (str) – The show command, if overridden from default.

  • del_cmd (str) – The delete command, if overridden from default.

  • js_cmd (str) – The job script command, if overridden from default.

  • login_nodes_cmd (list[str]) – The login nodes command, if overridden from default.

  • array_switch (str) – The switch to enable array jobs, if overridden from default.

  • array_item_var (str) – The variable for array items, if overridden from default.

Methods

cancel_jobs

Cancel one or more jobscripts.

format_options

Render options in a way that the scheduler can handle.

format_switch

Format a particular switch to use the JS command.

get_job_state_info

Get the state of one or more jobscripts.

get_submit_command

Get a command for submitting a jobscript.

get_version_info

Get the version of the scheduler.

is_jobscript_active

Query if a jobscript is running/pending.

is_num_cores_supported

Test whether particular number of cores is supported in given range of cores.

parse_submission_output

Parse the output from a submission to determine the submission ID.

process_resources

Perform scheduler-specific processing to the element resources.

wait_for_jobscripts

Wait for jobscripts to update their state.

Attributes

DEFAULT_LOGIN_NODES_CMD

Default command for logging into nodes.

DEFAULT_LOGIN_NODE_MATCH

Default pattern for matching the names of login nodes.

DEFAULT_SHEBANG_ARGS

Default value for arguments on the shebang line.

DEFAULT_SHELL_ARGS

Default value for arguments to the shell.

unique_properties

Unique properties, for hashing.

DEFAULT_SUBMIT_CMD

Default command for submitting a job.

DEFAULT_SHOW_CMD

Default command for listing current submitted jobs.

DEFAULT_DEL_CMD

Default command for deleting a job.

DEFAULT_JS_CMD

Default marker for job control metadata in a job script.

DEFAULT_ARRAY_SWITCH

Default switch for enabling array mode.

DEFAULT_ARRAY_ITEM_VAR

Default shell variable containin the current array index.

DEFAULT_ARRAY_ITEM_VAR: ClassVar[str]#

Default shell variable containin the current array index.

DEFAULT_ARRAY_SWITCH: ClassVar[str]#

Default switch for enabling array mode.

DEFAULT_DEL_CMD: ClassVar[str]#

Default command for deleting a job.

DEFAULT_JS_CMD: ClassVar[str]#

Default marker for job control metadata in a job script.

DEFAULT_LOGIN_NODES_CMD: ClassVar[Sequence[str] | None] = None#

Default command for logging into nodes.

DEFAULT_LOGIN_NODE_MATCH: ClassVar[str] = '*login*'#

Default pattern for matching the names of login nodes.

DEFAULT_SHEBANG_ARGS: ClassVar[str] = ''#

Default value for arguments on the shebang line.

DEFAULT_SHELL_ARGS: ClassVar[str] = ''#

Default value for arguments to the shell.

DEFAULT_SHOW_CMD: ClassVar[Sequence[str]]#

Default command for listing current submitted jobs.

DEFAULT_SUBMIT_CMD: ClassVar[str]#

Default command for submitting a job.

abstract cancel_jobs(js_refs, jobscripts=None, num_js_elements=0)#

Cancel one or more jobscripts.

Parameters:
Return type:

None

abstract format_options(resources, num_elements, is_array, sub_idx)#

Render options in a way that the scheduler can handle.

Parameters:
Return type:

str

format_switch(switch)#

Format a particular switch to use the JS command.

Parameters:

switch (str) –

Return type:

str

abstract get_job_state_info(*, js_refs=None, num_js_elements=0)#

Get the state of one or more jobscripts.

Parameters:
  • js_refs (Sequence[JSRefType] | None) –

  • num_js_elements (int) –

Return type:

Mapping[str, Mapping[int | None, JobscriptElementState]]

abstract get_submit_command(shell, js_path, deps)#

Get a command for submitting a jobscript.

Parameters:
Return type:

list[str]

get_version_info()#

Get the version of the scheduler.

Return type:

VersionInfo

is_jobscript_active(job_ID)#

Query if a jobscript is running/pending.

Parameters:

job_ID (str) –

Return type:

bool

static is_num_cores_supported(num_cores, core_range)#

Test whether particular number of cores is supported in given range of cores.

Parameters:
  • num_cores (int | None) –

  • core_range (Sequence[int]) –

Return type:

bool

parse_submission_output(stdout)#

Parse the output from a submission to determine the submission ID.

Parameters:

stdout (str) –

Return type:

str | None

abstract process_resources(resources, scheduler_config)#

Perform scheduler-specific processing to the element resources.

Note

This mutates resources.

Parameters:
Return type:

None

property unique_properties: tuple[str, str, Any, Any]#

Unique properties, for hashing.

wait_for_jobscripts(js_refs)#

Wait for jobscripts to update their state.

Parameters:

js_refs (list[str]) –

Return type:

None