hpcflow.app.Submission#
- class hpcflow.app.Submission(index, jobscripts, workflow=None, submission_parts=None, JS_parallelism=None, environments=None)#
Bases:
Submission
A collection of jobscripts to be submitted to a scheduler.
- Parameters:
index (int) – The index of this submission.
jobscripts (list[Jobscript]) – The jobscripts in the submission.
workflow (Workflow) – The workflow this is part of.
submission_parts (dict) – Description of submission parts.
JS_parallelism (bool) – Whether to exploit jobscript parallelism.
environments (EnvironmentsList) – The execution environments to use.
Methods
Cancel the active jobs for this submission's jobscripts.
Make an instance of this class from JSON (or YAML) data.
Get jobscripts that are active on this machine, and their active states.
Get the end time of a given submission part.
Get the start time of a given submission part.
Get unique schedulers and which of this submission's jobscripts they correspond to.
Get unique schedulers and which of the passed jobscripts they correspond to.
Get unique shells and which jobscripts they correspond to.
Generate and submit the jobscripts of this submission.
Serialize this object as a dictionary.
Serialize this object as an object structure that can be trivially converted to JSON.
Attributes
All EARs in this submission, grouped by element.
Whether to exploit jobscript parallelism.
The name of a file describing what EARs have aborted.
The path to the file describing what EARs have aborted in this submission.
The IDs of all EARs in this submission.
All EARs in this this submission.
Get the final non-None end time over all submission parts.
The execution environments to use.
The index of this submission.
All associated jobscript indices.
The jobscripts in this submission.
Whether this submission needs a submit to be done.
Jobscript indices that have not yet been successfully submitted.
The path to files associated with this submission.
Get the first non-None start time over all submission parts.
The status of this submission.
Description of the parts of this submission.
Jobscript indices that have been successfully submitted.
The workflow this is part of.
- property EARs_by_elements: Mapping[int, Mapping[int, Sequence[ElementActionRun]]]#
All EARs in this submission, grouped by element.
- property abort_EARs_file_path: Path#
The path to the file describing what EARs have aborted in this submission.
- property all_EARs: Iterable[ElementActionRun]#
All EARs in this this submission.
- cancel()#
Cancel the active jobs for this submission’s jobscripts.
- Return type:
None
- property environments: EnvironmentsList#
The execution environments to use.
- classmethod from_json_like(json_like, shared_data=None)#
Make an instance of this class from JSON (or YAML) data.
- Parameters:
json_like (str | Mapping[str, JSONed] | Sequence[Mapping[str, JSONed]] | None) – The data to deserialise.
shared_data (Mapping[str, ObjectList[JSONable]] | None) – Shared context data.
- Return type:
The deserialised object.
- get_active_jobscripts(as_json=False)#
Get jobscripts that are active on this machine, and their active states.
- get_end_time(submit_time)#
Get the end time of a given submission part.
- Parameters:
submit_time (str) –
- Return type:
datetime | None
- get_start_time(submit_time)#
Get the start time of a given submission part.
- Parameters:
submit_time (str) –
- Return type:
datetime | None
- get_unique_schedulers()#
Get unique schedulers and which of this submission’s jobscripts they correspond to.
- Returns:
Mapping where keys are a sequence of jobscript index descriptors and the values are the scheduler to use for that jobscript. A jobscript index descriptor is a pair of the submission index and the main jobscript index.
- Return type:
scheduler_mapping
- static get_unique_schedulers_of_jobscripts(jobscripts)#
Get unique schedulers and which of the passed jobscripts they correspond to.
Uniqueness is determines only by the QueuedScheduler.unique_properties tuple.
- Parameters:
- Returns:
Mapping where keys are a sequence of jobscript index descriptors and the values are the scheduler to use for that jobscript. A jobscript index descriptor is a pair of the submission index and the main jobscript index.
- Return type:
scheduler_mapping
- get_unique_shells()#
Get unique shells and which jobscripts they correspond to.
- property outstanding_jobscripts: tuple[int, ...]#
Jobscript indices that have not yet been successfully submitted.
- property status: SubmissionStatus#
The status of this submission.
- property submission_parts: list[SubmissionPart]#
Description of the parts of this submission.
- submit(status, ignore_errors=False, print_stdout=False, add_to_known=True)#
Generate and submit the jobscripts of this submission.
- property submitted_jobscripts: tuple[int, ...]#
Jobscript indices that have been successfully submitted.
- to_json_like(dct=None, shared_data=None, exclude=(), path=None)#
Serialize this object as an object structure that can be trivially converted to JSON. Note that YAML can also be produced from the result of this method; it just requires a different final serialization step.