-
Notifications
You must be signed in to change notification settings - Fork 8
Document mqlog in the README #65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -192,6 +192,50 @@ cl5n013 | 1 threads | 356 GB | |
| ``` | ||
|
|
||
|
|
||
| # mqlog | ||
| `mqlog` prints the stdout and stderr of a finished PBS job, so you don't have to hunt down the `.OU`/`.ER` files yourself. With no arguments it shows the most recently finished job belonging to you, working out the log paths from `qstat` (including the per-job `<jobid>.OU` / `<jobid>.ER` files that `mqsub --segregated-log-files` writes into a directory). If the newest finished job left no log behind, it walks back through your finished jobs until it finds one that did and prints a warning saying which job it is actually showing: | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
For users with more than 400 finished jobs, the fallback does not always walk backward until it finds a log: Useful? React with 👍 / 👎. |
||
| ``` | ||
| mqlog | ||
| ``` | ||
| ``` | ||
| WARNING: Most recent finished job 9524871.aqua has no log file. Showing log from 9524870.aqua. | ||
|
|
||
| ===== STDOUT: /work/microbiome/user/logs/9524870.aqua.OU ===== | ||
| Processing sample 12 of 12 | ||
| ===== STDERR: /work/microbiome/user/logs/9524870.aqua.ER ===== | ||
| ``` | ||
|
|
||
| To look at a specific job rather than the most recent one, pass its job ID. A bare number is fine — `.aqua` is appended automatically — so these are equivalent: | ||
| ``` | ||
| mqlog 9524870 | ||
| mqlog 9524870.aqua | ||
| ``` | ||
|
|
||
| `-f` (`--failed`) skips over jobs that succeeded and shows the most recent job that exited non-zero, which is usually the one you want after a batch of `mqsub`s. It reports which job it picked, and cannot be combined with an explicit job ID: | ||
| ``` | ||
| mqlog -f | ||
| ``` | ||
| ``` | ||
| Showing logs from failed job 9524863.aqua. | ||
|
|
||
| ===== STDOUT: /work/microbiome/user/logs/9524863.aqua.OU ===== | ||
| ... | ||
| ``` | ||
|
|
||
| By default both streams are printed with `===== STDOUT: ... =====` headers separating them. Use `-e` (`--stderr`) to print only stderr, or `-o` (`--stdout`) for only stdout; with a single stream the headers are omitted so the output is clean to pipe or grep. These two options are mutually exclusive, and combine with a job ID or with `-f`: | ||
| ``` | ||
| mqlog -e # stderr of the most recent finished job | ||
| mqlog -e 9524870 # stderr of a particular job | ||
| mqlog -e -f # stderr of the most recent failed job | ||
| ``` | ||
|
|
||
| Output is paged through `less -RF` when writing to a terminal, meaning short logs are printed inline and left on screen while longer ones open in the pager. Set `$PAGER` to use a different pager (or to the empty string for none), pass `--no-pager` to disable it for one invocation, or simply pipe the output — paging is skipped automatically when stdout is not a terminal: | ||
| ``` | ||
| mqlog --no-pager | ||
| mqlog -e 9524870 | grep -i error | ||
| ``` | ||
|
|
||
|
|
||
| # mqwait | ||
| If you are running a batch of jobs, you may wish to be notified once the entire batch has finished processing, as opposed to per-job notifications generated by mqsub. There are three ways to run mqwait: | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When finished jobs complete out of submission order, this does not necessarily show the most recently finished job:
get_finished_job_ids()sorts IDs numerically, so a newer, long-running job can finish after a higher-numbered short job yet lose selection. Describe this as the highest-numbered finished job, or change the implementation to order by an actual completion timestamp.Useful? React with 👍 / 👎.