hpcflow.sdk.submission.shells.base.Shell#
- class hpcflow.sdk.submission.shells.base.Shell(executable=None, os_args=None)#
Bases:
ABC
Class to represent a shell and templates for jobscript composition.
This class represents a combination of a shell and an OS. For example, running bash on a POSIX OS, and provides snippets that are used to compose a jobscript for that combination.
- Parameters:
Methods
Format construction of a shell array.
Format retrieval of a shell array item at a specified index.
Format the commands file.
Format retrieval of a shell environment variable.
Produce code to save a parameter's value into the workflow persistent store.
Format sourcing (i.e.
Format a stream assignment.
Get the command for launching the commands file for a given run.
Get the command for submitting a non-scheduled jobscript.
Get shell and operating system information.
Get the command to wait for a workflow.
Prepare the jobscript path for use.
Prepare the element run directory names for use.
Process the application invocation key in the jobscript header arguments.
Perform any post-processing of an application invocation command name.
Attributes
Arguments to pass to the shell.
Default for executable name.
The executable to use plus any mandatory arguments.
The executable to use in a shebang line.
File extension for jobscripts.
Basic indent.
Indent for environment setup.
Template for the jobscript shebang line.
Template for the jobscript functions file.
Template for the common part of the jobscript header.
Template for the jobscript header when scheduled.
Template for the jobscript header when directly executed.
Template for enabling writing of the app log.
Template for disabling writing of the app log.
Template for the run execution command.
Template for the execution command for multiple combined runs.
Template for setting up run environment variables and executing the run.
Template for the action-run processing loop in a jobscript.
Template for the single-action-run execution in a jobscript.
Template for setting up environment variables and running one or more action-runs.
Template for a jobscript-block header.
Template for single-element execution.
Template for the element processing loop in a jobscript.
Template for the array handling code in a jobscript.
Template for the jobscript block loop in a jobscript.
Template for the jobscript footer.
- JS_MAIN: ClassVar[str]#
Template for setting up environment variables and running one or more action-runs.
- abstract format_array(lst)#
Format construction of a shell array.
- abstract format_array_get_item(arr_name, index)#
Format retrieval of a shell array item at a specified index.
- abstract format_commands_file(app_name, commands)#
Format the commands file.
- abstract format_env_var_get(var)#
Format retrieval of a shell environment variable.
- abstract format_save_parameter(workflow_app_alias, param_name, shell_var_name, cmd_idx, stderr, app_name)#
Produce code to save a parameter’s value into the workflow persistent store.
- abstract format_source_functions_file(app_name, commands)#
Format sourcing (i.e. invocation) of the jobscript functions file.
- abstract format_stream_assignment(shell_var_name, command)#
Format a stream assignment.
- get_command_file_launch_command(cmd_file_path)#
Get the command for launching the commands file for a given run.
- get_direct_submit_command(js_path)#
Get the command for submitting a non-scheduled jobscript.
- abstract get_version_info(exclude_os=False)#
Get shell and operating system information.
- Parameters:
exclude_os (bool) –
- Return type:
VersionInfo
- get_wait_command(workflow_app_alias, sub_idx, deps)#
Get the command to wait for a workflow.
- os_args#
Arguments to pass to the shell.
- prepare_JS_path(js_path)#
Prepare the jobscript path for use.
- Parameters:
js_path (Path) –
- Return type:
- prepare_element_run_dirs(run_dirs)#
Prepare the element run directory names for use.
- process_JS_header_args(header_args)#
Process the application invocation key in the jobscript header arguments.
- Parameters:
header_args (JobscriptHeaderArgs) –
- Return type:
- static process_app_invoc_executable(app_invoc_exe)#
Perform any post-processing of an application invocation command name.