matflow.Jobscript#

class matflow.Jobscript(task_insert_IDs, task_actions, task_elements, EAR_ID, resources, task_loop_idx, dependencies, submit_time=None, submit_hostname=None, submit_machine=None, submit_cmdline=None, scheduler_job_ID=None, process_ID=None, version_info=None, os_name=None, shell_name=None, scheduler_name=None, running=None)#

Bases: Jobscript

Methods

cancel

compose_jobscript

Prepare the jobscript file string.

from_json_like

get_active_states

If this jobscript is active on this machine, return the state information from the scheduler.

get_commands_file_name

get_task_loop_idx_array

make_artifact_dirs

submit

to_dict

to_json_like

write_EAR_ID_file

Write a text file with num_elements lines and num_actions delimited tokens per line, representing whether a given EAR must be executed.

write_element_run_dir_file

Write a text file with num_elements lines and num_actions delimited tokens per line, representing the working directory for each EAR.

write_jobscript

Attributes

EAR_ID

EAR_ID_file_name

EAR_ID_file_path

all_EAR_IDs

all_EARs

app

dependencies

direct_stderr_file_name

For direct execution stderr.

direct_stderr_path

direct_stdout_file_name

For direct execution stdout.

direct_stdout_path

direct_win_pid_file_name

direct_win_pid_file_path

element_run_dir_file_name

element_run_dir_file_path

end_time

Get the last end time from all EARs.

index

is_array

is_submitted

Return True if this jobscript has been submitted.

jobscript_name

jobscript_path

num_actions

num_elements

os_name

process_ID

resources

scheduler

Retrieve the scheduler object for submission.

scheduler_job_ID

scheduler_js_ref

scheduler_name

scheduler_ref

shell

Retrieve the shell object for submission.

shell_name

start_time

Get the first start time from all EARs.

submission

submit_cmdline

submit_hostname

submit_machine

submit_time

task_actions

task_elements

task_insert_IDs

task_loop_idx

version_info

workflow

workflow_app_alias

Parameters:
  • task_insert_IDs (List[int]) –

  • task_actions (List[Tuple]) –

  • task_elements (Dict[int, List[int]]) –

  • EAR_ID (NDArray) –

  • resources (app.ElementResources) –

  • task_loop_idx (List[Dict]) –

  • dependencies (Dict[int:Dict]) –

  • submit_time (Optional[datetime]) –

  • submit_hostname (Optional[str]) –

  • submit_machine (Optional[str]) –

  • submit_cmdline (Optional[str]) –

  • scheduler_job_ID (Optional[str]) –

  • process_ID (Optional[int]) –

  • version_info (Optional[Tuple[str]]) –

  • os_name (Optional[str]) –

  • shell_name (Optional[str]) –

  • scheduler_name (Optional[str]) –

  • running (Optional[bool]) –

property EAR_ID#
property EAR_ID_file_name#
property EAR_ID_file_path#
property all_EAR_IDs: List[int]#
property all_EARs: List#
app = App(name='MatFlow', version='0.3.0a129')#
cancel()#
compose_jobscript(deps=None, os_name=None, shell_name=None, os_args=None, shell_args=None, scheduler_name=None, scheduler_args=None)#

Prepare the jobscript file string.

Parameters:
  • deps (Dict | None) –

  • os_name (str) –

  • shell_name (str) –

  • os_args (Dict | None) –

  • shell_args (Dict | None) –

  • scheduler_name (str | None) –

  • scheduler_args (Dict | None) –

Return type:

str

property dependencies#
property direct_stderr_file_name#

For direct execution stderr.

property direct_stderr_path#
property direct_stdout_file_name#

For direct execution stdout.

property direct_stdout_path#
property direct_win_pid_file_name#
property direct_win_pid_file_path#
property element_run_dir_file_name#
property element_run_dir_file_path#
property end_time#

Get the last end time from all EARs.

classmethod from_json_like(json_like, shared_data=None)#
get_active_states(as_json=False)#

If this jobscript is active on this machine, return the state information from the scheduler.

Parameters:

as_json (bool) –

Return type:

Dict[int, JobscriptElementState]

get_commands_file_name(js_action_idx, shell=None)#
get_task_loop_idx_array()#
property index#
property is_array#
property is_submitted#

Return True if this jobscript has been submitted.

property jobscript_name#
property jobscript_path#
make_artifact_dirs()#
property num_actions#
property num_elements#
property os_name: str | None#
property process_ID#
property resources#
property scheduler#

Retrieve the scheduler object for submission.

property scheduler_job_ID#
property scheduler_js_ref#
property scheduler_name: str | None#
property scheduler_ref#
property shell#

Retrieve the shell object for submission.

property shell_name: str | None#
property start_time#

Get the first start time from all EARs.

property submission#
submit(scheduler_refs, print_stdout=False)#
Parameters:
  • scheduler_refs (Dict[int, (str, bool)]) –

  • print_stdout (Optional[bool]) –

Return type:

str

property submit_cmdline#
property submit_hostname#
property submit_machine#
property submit_time#
property task_actions#
property task_elements#
property task_insert_IDs#
property task_loop_idx#
to_dict()#
to_json_like(dct=None, shared_data=None, exclude=None, path=None)#
property version_info#
property workflow#
property workflow_app_alias#
write_EAR_ID_file()#

Write a text file with num_elements lines and num_actions delimited tokens per line, representing whether a given EAR must be executed.

write_element_run_dir_file(run_dirs)#

Write a text file with num_elements lines and num_actions delimited tokens per line, representing the working directory for each EAR.

We assume a given task element’s actions all run in the same directory, but in general a jobscript “element” may cross task boundaries, so we need to provide the directory for each jobscript-element/jobscript-action combination.

Parameters:

run_dirs (List[List[Path]]) –

write_jobscript(os_name=None, shell_name=None, deps=None, os_args=None, shell_args=None, scheduler_name=None, scheduler_args=None)#
Parameters:
  • os_name (str) –

  • shell_name (str) –

  • deps (Dict | None) –

  • os_args (Dict | None) –

  • shell_args (Dict | None) –

  • scheduler_name (str | None) –

  • scheduler_args (Dict | None) –