Introduction
OSCusage is a command developed at OSC for use on OSC's systems. It allows a user to see information on their project's usage, including different users and their jobs.
Availability
| Pitzer | Cardinal | Ascend |
|---|---|---|
| X | X | X |
Usage
OSCusage takes the following options and parameters.
$ OSCusage --help
usage: OSCusage.py [-h] [-u USER]
[-s {opt,pitzer,glenn,bale,oak,oakley,owens,ruby}] [-A]
[-P PROJECT] [-q] [-H] [-r] [-n] [-v]
[start_date] [end_date]
positional arguments:
start_date start date (default: 2021-03-16)
end_date end date (default: 2021-03-17)
optional arguments:
-h, --help show this help message and exit
-u USER, --user USER username to run as. Be sure to include -P or -A.
(default: amarcum)
-s {opt,pitzer,glenn,bale,oak,oakley,owens,ruby}, --system {opt,pitzer,glenn,bale,oak,oakley,owens,ruby}
-A Show all
-P PROJECT, --project PROJECT
project to query (default: PZS0712)
-q show user data
-H show hours
-r show raw
-n show job ID
-v do not summarize
-J, --json Print data as JSON
-C, --current-unbilled show current unbilled usage
-p {month,quarter,annual}, --period {month,quarter,annual} Period used when showing unbilled usage (default: month)
-N JOB_NAME, --job-name JOB_NAME
Filter jobs by job name, supports substring match and
regex (does not apply to JSON output)
Usage Examples:
Specify start time:
OSCusage 2018-01-24
Specify start and end time:
OSCusage 2018-01-24 2018-01-25
View current unbilled usage:
OSCusage -C -p month
Today's Usage
Running OSCusage with no options or parameters specified will provide the usage information in Dollars for the current day.
$ OSCusage
---------------- ------------------------------------
Usage Statistics for project PZS0712
Time 2021-03-16 to 2021-03-17
PI guilfoos@osc.edu
Remaining Budget -1.15
---------------- ------------------------------------
User Jobs Dollars Status
------------ ------ --------- --------
amarcum 0 0.0 ACTIVE
amarcumtest 0 0.0 ACTIVE
amarcumtest2 0 0.0 ACTIVE
guilfoos 0 0.0 ACTIVE
hhamblin 0 0.0 ACTIVE
kcahill 0 0.0 ACTIVE
wouma 0 0.0 ACTIVE
xwang 12 0.0 ACTIVE
-- -- --
TOTAL 12 0.0
Usage in Timeframe
If you specify a timeframe you can get utilization information specifically for jobs that completed within that period.
$ OSCusage 2020-01-01 2020-07-01 -H
---------------- ------------------------------------
Usage Statistics for project PZS0712
Time 2020-01-01 to 2020-07-01
PI Brian Guilfoos <guilfoos@osc.edu>
Remaining Budget -1.15
---------------- ------------------------------------
User Jobs core-hours Status
------------ ------ ------------ ----------
amarcum 86 260.3887 ACTIVE
amarcumtest 0 0.0 ACTIVE
amarcumtest2 0 0.0 RESTRICTED
guilfoos 9 29.187 ACTIVE
hhamblin 1 1.01 ACTIVE
kcahill 7 40.5812 ACTIVE
wouma 63 841.2503 ACTIVE
xwang 253 8148.2638 ACTIVE
-- -- --
TOTAL 419 9320.681
Show only a single user's usage
Specify -q to show only the current user's usage. This stacks with -u to specify which user you want to see.
$ OSCusage -u xwang -q 2020-01-01 2020-07-01 -H
---- -------------------------------
Usage Statistics for user xwang
Time 2020-01-01 to 2020-07-01
---- -------------------------------
User Jobs core-hours Status
------ ------ ------------ --------
xwang 253 8148.2638 -
-- -- --
TOTAL 253 8148.2638
Show a particular project
By default, the tool shows your default (first) project. You can use -P to specify which charge code to report on.
$ OSCusage -P PZS0200 -H
---------------- ------------------------------------
Usage Statistics for project PZS0200
Time 2020-09-13 to 2020-09-14
PI David Hudak <dhudak@osc.edu>
Remaining Budget 0
---------------- ------------------------------------
User Jobs core-hours Status
---------- ------ ------------ ----------
adraghi 0 0.0 ARCHIVED
airani 0 0.0 ARCHIVED
alingg 0 0.0 ARCHIVED
You can show all of your charge codes/projects at once, by using -A .
Select a particular cluster
By default, all charges are shown in the output. However, you can filter to show a particular system with -s .
$ OSCusage -s pitzer -H
---------------- ------------------------------------
Usage Statistics for project PZS0712
Time 2021-03-16 to 2021-03-17
PI guilfoos@osc.edu
Remaining Budget -1.15
---------------- ------------------------------------
User Jobs core-hours Status
------------ ------ ------------ --------
amarcum 0 0.0 ACTIVE
amarcumtest 0 0.0 ACTIVE
amarcumtest2 0 0.0 ACTIVE
guilfoos 0 0.0 ACTIVE
hhamblin 0 0.0 ACTIVE
kcahill 0 0.0 ACTIVE
wouma 0 0.0 ACTIVE
xwang 0 0.0 ACTIVE
-- -- --
TOTAL 0 0.0
Changing the units reported
The report can show usage dollars. You can elect to get usage in core-hours using -H or raw seconds using -r
$ OSCusage 2020-01-01 2020-07-01 -r
---------------- ------------------------------------
Usage Statistics for project PZS0712
Time 2020-01-01 to 2020-07-01
PI Brian Guilfoos <guilfoos@osc.edu>
Remaining Budget -1.15
---------------- ------------------------------------
User Jobs raw_used Status
------------ ------ ---------- ----------
amarcum 86 937397.0 ACTIVE
amarcumtest 0 0.0 ACTIVE
amarcumtest2 0 0.0 RESTRICTED
guilfoos 9 105073.0 ACTIVE
hhamblin 1 3636.0 ACTIVE
kcahill 7 146092.0 ACTIVE
wouma 63 3028500.0 ACTIVE
xwang 253 29333749.0 ACTIVE
-- -- --
TOTAL 419 33554447.0
Detailed Charges Breakdown
Specify -v to get detailed information jobs.
You can add the -n option to the -v option to add the job ID to the report output. OSCHelp will need the job ID to answer any questions about a particular job record.
Please contact OSC Help with questions.