arc.job.local¶
A module for running jobs on the local machine. When transitioning to Python 3, use subprocess.run()
- arc.job.local.check_job_status(job_id)[source]¶
Possible statuses: before_submission, running, errored on node xx, done Status line formats:
OGE:
540420 0.45326 xq1340b user_name r 10/26/2018 11:08:30 long1@node18.cluster
Slurm:
14428 debug xq1371m2 user_name R 50-04:04:46 1 node06
PBS (taken from zeldo.dow.com):
Req'd Req'd Elap Job ID Username Queue Jobname SessID NDS TSK Memory Time S Time ----------------------- ----------- -------- ---------------- ------ ----- ------ --------- --------- - --------- 2016614.zeldo.local u780444 workq scan.pbs 75380 1 10 -- 730:00:00 R 00:00:20 2016616.zeldo.local u780444 workq scan.pbs 75380 1 10 -- 730:00:00 R 00:00:20
- arc.job.local.check_running_jobs_ids()[source]¶
Return a list of
int
representing job IDs of all jobs submitted by the user on a server
- arc.job.local.delete_all_local_arc_jobs(jobs: Optional[List[Union[str, int]]] = None)[source]¶
Delete all ARC-spawned jobs (with job name starting with a and a digit) from the local server. Make sure you know what you’re doing, so unrelated jobs won’t be deleted… Useful when terminating ARC while some (ghost) jobs are still running.
- Parameters
jobs (List[Union[str, int]], optional) – Specific ARC job IDs to delete.
- arc.job.local.execute_command(command, shell=True, no_fail=False)[source]¶
Execute a command.
Notes
If no_fail == True, then a warning is logged and False is returned so that the calling function can debug the situation.
- Parameters
command – An array of string commands to send.
shell (bool) – Specifies whether the command should be executed using bash instead of Python
no_fail (bool) – If True then ARC will not crash if an error is encountered.
- Returns: list
lists of stdin, stdout, stderr corresponding to the commands sent
- arc.job.local.get_last_modified_time(file_path_1: str, file_path_2: Optional[str] = None) Optional[datetime.datetime] [source]¶
Returns the last modified time of
file_path_1
if the file exists, else returns the last modified time offile_path_2
if the file exists.- Parameters
file_path_1 (str) – The path to file 1.
file_path_2 (str, optional) – The path to file 2.
- arc.job.local.rename_output(local_file_path, software)[source]¶
Rename the output file to “output.out” for consistency between software local_file_path is the full path to the output.out file, software is the software used for the job by which the original output file name is determined