Required
site| Type: | BaseExecutor |
| Description: | The site this job is to be run at. |
class SalvusJob(salvus.flow.executors.job.Job):
def __init__(
self,
site: BaseExecutor,
input_file: str | pathlib.Path | dict | utils.deep_setters._DeepSetter,
remote_input_file: (
str
| pathlib.PurePosixPath
| dict
| utils.deep_setters._DeepSetter
| None
) = None,
ranks: salvus._core.types.int_ | None = None,
wall_time_in_seconds: salvus._core.types.float_ | None = None,
job_groups: list[db.JobGroup | str] | None = None,
is_debug_job: bool = False,
verbosity: int = 1,
jobname: str | None = None,
initialize_on_site: bool = True,
rundir_root: _RemotePathInputType | None = None,
tmpdir_root: _RemotePathInputType | None = None,
working_dir: _RemotePathInputType | None = None,
skip_schema_validation: bool = False,
db_command_line_call: str | None = None,
allow_uninitialized_site: bool = False,
precomputed_remote_file_hashes: dict | None = None,
parsed_input_file: (
tuple[dict, dict, dict, None | pathlib.Path] | None
) = None,
): ...| Type: | BaseExecutor |
| Description: | The site this job is to be run at. |
| Type: | str | pathlib.Path | dict | utils.deep_setters._DeepSetter |
| Description: | Salvus input file. |
| Type: | str | pathlib.PurePosixPath | dict | utils.deep_setters._DeepSetter | None |
| Default value: | None |
| Description: | The input file as seen by the remote site. |
| Type: | salvus._core.types.int_ | None |
| Default value: | None |
| Description: | Number of ranks to use. |
| Type: | salvus._core.types.float_ | None |
| Default value: | None |
| Description: | Wall time in seconds for the job. Not required for jobs on all sites. |
| Type: | list[db.JobGroup | str] | None |
| Default value: | None |
| Description: | List of job groups names this job should be part of. |
| Type: | bool |
| Default value: | False |
| Description: | True if this job should be executed in the fast/debug queue if the site has one. |
| Type: | int |
| Default value: | 1 |
| Description: | Verbosity level. |
| Type: | str | None |
| Default value: | None |
| Description: | Name of the job. A random one will be created if none is given. |
| Type: | bool |
| Default value: | True |
| Description: | Initialize on site. Should be true in most cases. False is useful for creating a Job object from the database. |
| Type: | _RemotePathInputType | None |
| Default value: | None |
| Description: | Specify what parent folder the run directory will be created in. Defaults to the directory in the site config. |
| Type: | _RemotePathInputType | None |
| Default value: | None |
| Description: | Specify what parent folder the tmp directory will be created in. Defaults to the directory in the site config. |
| Type: | _RemotePathInputType | None |
| Default value: | None |
| Description: | Working directory. If not given it will be set to the job directory. Should only be set if the job is part of a job array. |
| Type: | bool |
| Default value: | False |
| Description: | Optionally skip the schema validation. Only use when reading jobs from the database and for site initialization. |
| Type: | str | None |
| Default value: | None |
| Description: | Command line call of this job for the database. |
| Type: | bool |
| Default value: | False |
| Description: | Allows an uninitialized site - intended to only be used for the job that initializes the site. |
| Type: | dict | None |
| Default value: | None |
| Description: | List of potentially precomputed hashes for remote files. If given they do not need to be computed for files on the remote site. |
| Type: | tuple[dict, dict, dict, None | pathlib.Path] | None |
| Default value: | None |
| Description: | Can pass an already parsed input file (parsed with site_utils.parse_salvus_input) so it does not happen again. Probably only useful for job arrays. |
salvus_flow_db.DB)-The currently used database.str)-Returns the full name of a job as JOB_NAME@SITE_NAME._RemotePathType)-Path of the job's meta JSON file.int)-Return the maximum number of ranks of all the individual commands._RemotePathType)-Path of the job's progress JSON file.str)-Return the stderr of the job as a string._RemotePathType)-The stderr path of the job.str)-Return the stdout of the job as a string._RemotePathType)-The stdout path of the job.def cancel(self, verbosity: int = 1) -> None: ...| Type: | int |
| Default value: | 1 |
| Description: | Verbosity level. |
def copy_output(
self,
destination: pathlib.Path | str,
get_all: bool = False,
verbosity: int = 1,
allow_existing_destination_folder: bool = False,
) -> tuple[dict[pathlib.Path, int], bool]: ...| Type: | pathlib.Path | str |
| Description: | The destination folder. Must not yet exist. |
| Type: | bool |
| Default value: | False |
| Description: | Also get the large output files, if any. |
| Type: | int |
| Default value: | 1 |
| Description: | Verbosity level. |
| Type: | bool |
| Default value: | False |
| Description: | Allow that the destination already exists. Files might be overwritten. |
def create_random_job_name(prefix: str = "job") -> str: ...| Type: | str |
| Default value: | 'job' |
| Description: | Prefix to give some structure to the randomness. |
def delete(
self, verbosity: int = 1, allow_directory_deletion_failure: bool = False
) -> None: ...| Type: | int |
| Default value: | 1 |
| Description: | Verbosity level. |
| Type: | bool |
| Default value: | False |
| Description: | If True this function will still return successfully (but raise a warning) if the deletion of the remote Salvus managed files failed for some reason. This can easily happen on for example networked file systems. |
EventData object.def get_as_event(self) -> EventData: ...def get_current_progress(self) -> dict | None: ...def get_diagnosis_string(self) -> str: ..."stderr", "stdout", or a tuple denoting the
path of the file in the input file. The values the full paths. This
does parse the input.toml file to figure out what is there.>>> j.get_output_files() {'stderr': PurePosixPath('run/job_1905231521_8d3f5/stderr'), 'stdout': PurePosixPath('run/job_1905231521_8d3f5/stdout'), ('output', 'meta_data', 'meta_json_filename'): PurePosixPath('run/job_1905231521_8d3f5/output/meta.json')}
def get_output_files(
self, get_all: bool = False
) -> tuple[dict[str | tuple, _RemotePathType], bool]: ...| Type: | bool |
| Default value: | False |
| Description: | Also get the all outputs designated as large. This will usually be volumetric and/or boundary output. |
def get_status_from_db(self) -> JobStatus: ...def launch(
self, verbosity: int = 1, interactive_tty: bool = False
) -> None: ...| Type: | int |
| Default value: | 1 |
| Description: | Verbosity level. |
| Type: | bool |
| Default value: | False |
| Description: | Launch the job in an interactive terminal. Useful for debugging purposes. Only available for local sites. |
def set_status_in_db(self, status: JobStatus) -> None: ...| Type: | JobStatus |
| Description: | The status to be set. |
tail -f the stdout of the job.tail command and it only suitable for
interactive use.def tail_stdout(self) -> None: ...progress.json
file that is written to during Salvus runs. This is retried up to
20 times in case of some spurious failure like a network issue or
by chance parsing it right when it is being written by Salvus.finished: accept and return.
* If finished: parse meta.json, persist in DB, and return.meta.json file, persist in DB
and return.def update_status(
self,
progress_callback: collections.abc.Callable[[dict], None] | None = None,
force_update: bool = False,
) -> JobStatus: ...| Type: | collections.abc.Callable[[dict], None] | None |
| Default value: | None |
| Description: | Callback function that is called whenever something happens. |
| Type: | bool |
| Default value: | False |
| Description: | Jobs that are not running and not pending will by default only query the local job database and not check the remote site. In most cases this is correct as the jobs are done with and will not change again. Setting this to True will force an update nonetheless. Uses for this are for example if a job update fails for example due to a temporary network problem. |
def wait(
self,
poll_interval_in_seconds: salvus._core.types.float_ | None = None,
timeout_in_seconds: float | None = None,
verbosity: int = 1,
progress_callback: (
collections.abc.Callable[[dict | str], None] | None
) = None,
) -> JobStatus: ...| Type: | salvus._core.types.float_ | None |
| Default value: | None |
| Description: | If given, the site will be queried with this interval. Defaults to the site's default. |
| Type: | float | None |
| Default value: | None |
| Description: | Time in seconds after which this function will return, independent of the status. |
| Type: | int |
| Default value: | 1 |
| Description: | The verbosity level. |
| Type: | collections.abc.Callable[[dict | str], None] | None |
| Default value: | None |
| Description: | Optional progress callback function. Will be called if there are any status updates. Will currently only be called with the Salvus status file contents. |