hpcflow.sdk.submission.schedulers.Scheduler#

class hpcflow.sdk.submission.schedulers.Scheduler(shell_args=None, shebang_args=None, options=None)#

Bases: ABC, Generic[JSRefType], AppAware

Abstract base class for schedulers.

Parameters:
  • shell_args (str) – Arguments to pass to the shell. Pre-quoted.

  • shebang_args (str) – Arguments to set on the shebang line. Pre-quoted.

  • options (dict) – Options to the scheduler.

Methods

cancel_jobs

Cancel one or more jobscripts.

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_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 one or more jobscripts to complete.

Attributes

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_SHEBANG_ARGS: ClassVar[str] = ''#

Default value for arguments on the shebang line.

DEFAULT_SHELL_ARGS: ClassVar[str] = ''#

Default value for arguments to the shell.

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

Cancel one or more jobscripts.

Parameters:
Return type:

None

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

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, ...]#

Unique properties, for hashing.

abstract wait_for_jobscripts(js_refs)#

Wait for one or more jobscripts to complete.

Parameters:

js_refs (list[~JSRefType]) –

Return type:

None