Skip to content

Commit

Permalink
LSF submit_time for the jobs and image for the docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mberacochea committed Mar 14, 2022
1 parent 9740aa4 commit 7746238
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
A little tool to make it easier to inspect LSF jobs.

```shell
usage: mjobs [-h] [-q QUEUE] [-u USER] [-r] [-a] [-d] [-G USER_GROUP] [-g GROUP] [-m HOSTS] [-p] [-e] [-f FILTER] [job_id ...]
usage: mjobs [-h] [-q QUEUE] [-u USER] [-r] [-a] [-d] [-G USER_GROUP] [-g GROUP] [-m HOSTS] [-p] [-e] [-f FILTER] [-t] [job_id ...]

bjobs but a bit nicer

Expand All @@ -23,8 +23,13 @@ optional arguments:
-p Displays pending jobs, together with the pending reasons that caused each job not to be dispatched during the last dispatch turn.
-e Add the output file and error file to the table.
-f FILTER Filter the jobs using the specified regex on the job name or pending reason.
-t No fancy table, a good ol' tsv
```
## Example
![Alt text](images/mjobs-example.png?raw=true "mjobs example")
# Installation - bundle the app
Create an executable with [pyinstaller](https://pyinstaller.readthedocs.io).
Expand Down
1 change: 1 addition & 0 deletions mjobs/lsf.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ def get_jobs(job_ids: Optional[list[int]] = None, lsf_args: Optional[List[str]]
"job_group",
"user",
"queue",
"submit_time",
"start_time",
"finish_time",
"exec_host",
Expand Down
8 changes: 5 additions & 3 deletions mjobs/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def _get_args():
"-e",
dest="extended",
action="store_true",
help=("Add the output file and error file to the table."),
help="Add the output file and error file to the table.",
)
parser.add_argument(
"-f",
Expand Down Expand Up @@ -175,6 +175,7 @@ def _get_args():
{"header": "JobGroup"},
{"header": "User"},
{"header": "Queue"},
{"header": "Submit Time"},
{"header": "Start Time"},
{"header": "Finish Time"},
{"header": "Exec. Host"},
Expand All @@ -191,8 +192,8 @@ def _get_args():
job_name = Text(job["JOB_NAME"])
pending_reason = Text(job["PEND_REASON"]) or Text("----", justify="center")
if args.filter:
job_name.highlight_regex(fr"{args.filter}", "bold red")
pending_reason.highlight_regex(fr"{args.filter}", "bold red")
job_name.highlight_regex(rf"{args.filter}", "bold red")
pending_reason.highlight_regex(rf"{args.filter}", "bold red")

row = [
job["JOBID"],
Expand All @@ -201,6 +202,7 @@ def _get_args():
job["JOB_GROUP"] or Text("----", justify="center"),
job["USER"],
job["QUEUE"],
job["SUBMIT_TIME"],
job["START_TIME"],
job["FINISH_TIME"],
Text(job["EXEC_HOST"], overflow="fold"),
Expand Down

0 comments on commit 7746238

Please sign in to comment.