OSCusage

Introduction

OSCusage is command developed at OSC for use on OSC's systems.  It allows for a user to see information on their project's current RU balance, including which users and jobs incurred what charges.

Availability

Oakley ruby owens PITZER
X X X X

 

Usage

OSCusage takes the following options and parameters.

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: YESTERDAY format YYYY-MM-DD)
end_date              end date (default: TODAY format YYYY-MM-DD)
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: YOUR USERNAME)
-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: YOUR DEFAULT PROJECT)
-q                    show user data
-H                    show hours
-r                    show raw
-n                    show job ID
-v                    do not summarize
Usage Examples:
Specify start time:
OSCusage.py 2018-01-24
Specify start and end time:
OSCusage.py 2018-01-24 2018-01-25

Today's Usage

Running OSCusage with no options or parameters specified will provide RU usage information for the current day.

$ OSCusage
----------  ------------------------------------
            Usage Statistics for project PZS0712
Time        2018-10-23 to 2018-10-24
PI          Brian Guilfoos <guilfoos@osc.edu>
RU Balance  -1121.356
----------  ------------------------------------
User          Jobs    RUs    Status
------------  ------  -----  --------
dheisterberg  0       0.0    ACTIVE
guilfoos      0       0.0    ACTIVE
hhamblin      0       0.0    ACTIVE
kcahill       0       0.0    ACTIVE
xwang         0       0.0    ACTIVE
--            --      --
TOTAL         0       0.0

RU Usage in Timeframe

If you specify a timeframe you can get RU utilization information specifically for jobs that completed within that period.

$ OSCusage 2018-01-01 2018-10-24
----------  ------------------------------------
            Usage Statistics for project PZS0712
Time        2018-01-01 to 2018-10-24
PI          Brian Guilfoos <guilfoos@osc.edu>
RU Balance  -1121.356
----------  ------------------------------------
User          Jobs    RUs        Status
------------  ------  ---------  --------
dheisterberg  378     1007.0057  ACTIVE
guilfoos      0       0.0        ACTIVE
hhamblin      0       0.0        ACTIVE
kcahill       2       1.5968     ACTIVE
xwang         103     112.7544   ACTIVE
--            --      --
TOTAL         483     1121.3569

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 2018-01-01 2018-10-24
----  -------------------------------
      Usage Statistics for user xwang
Time  2018-01-01 to 2018-10-24
----  -------------------------------
User    Jobs    RUs       Status
------  ------  --------  --------
xwang   1195    422.2984  -
--      --      --
TOTAL   1195    422.2984

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
----------  ------------------------------------
            Usage Statistics for project PZS0200
Time        2018-10-23 to 2018-10-24
PI          David Hudak <dhudak@osc.edu>
RU Balance  -8104.5532
----------  ------------------------------------
User        Jobs    RUs    Status
----------  ------  -----  ----------
adraghi     0       0.0    ARCHIVED
airani      0       0.0    ARCHIVED
alingg      0       0.0    ARCHIVED
arhazzal    0       0.0    ARCHIVED
barnold     0       0.0    ARCHIVED
bart        0       0.0    ARCHIVED
blackaby    0       0.0    ARCHIVED
bridgley    0       0.0    ARCHIVED
bwelding    0       0.0    ARCHIVED
chaves      0       0.0    ARCHIVED
cspiker     0       0.0    RESTRICTED
dredard     0       0.0    ARCHIVED
echong      0       0.0    ARCHIVED
emolina     0       0.0    ARCHIVED
guilfoos    0       0.0    ACTIVE
hjiang      0       0.0    RESTRICTED
icraib      0       0.0    ARCHIVED
jaffourtit  0       0.0    RESTRICTED
jberry      0       0.0    ARCHIVED
jmccance    0       0.0    RESTRICTED
jordan      0       0.0    ARCHIVED
jpu         0       0.0    ARCHIVED
jspencer    0       0.0    ARCHIVED
justinw     0       0.0    ARCHIVED
mfaerman    0       0.0    RESTRICTED
michael     0       0.0    ARCHIVED
msheng      0       0.0    ARCHIVED
mudronja    0       0.0    ARCHIVED
nehrbass    0       0.0    ARCHIVED
ngagnet     0       0.0    ARCHIVED
njustice    0       0.0    ARCHIVED
osc0507     0       0.0    ARCHIVED
osc0772     0       0.0    ARCHIVED
rahmed      0       0.0    ARCHIVED
rmarshal    0       0.0    ARCHIVED
rmonroe     0       0.0    ARCHIVED
sengupta    0       0.0    ARCHIVED
spape       0       0.0    ARCHIVED
tngo        0       0.0    ARCHIVED
watts       0       0.0    ARCHIVED
wroberts    0       0.0    ARCHIVED
--          --      --
TOTAL       0       0.0

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 ruby 2018-01-01 2018-10-24
----------  ------------------------------------
            Usage Statistics for project PZS0712
Time        2018-01-01 to 2018-10-24
PI          Brian Guilfoos <guilfoos@osc.edu>
RU Balance  -1318.8122
----------  ------------------------------------
User          Jobs    RUs     Status
------------  ------  ------  --------
dheisterberg  4       3.8081  ACTIVE
guilfoos      0       0.0     ACTIVE
hhamblin      0       0.0     ACTIVE
kcahill       0       0.0     ACTIVE
xwang         2       1.8482  ACTIVE
--            --      --
TOTAL         6       5.6563

Changing the units reported

The report shows usage in RU. You can elect to get usage in corehours, or "raw". Please note that converting from raw to corehours to RU may not be a consistent formula when looking at the aggregate data, since the calculation depends on the specific resources used in a job.

$ OSCusage -H 2018-01-01 2018-10-24
----------  ------------------------------------
            Usage Statistics for project PZS0712
Time        2018-01-01 to 2018-10-24
PI          Brian Guilfoos <guilfoos@osc.edu>
RU Balance  -1318.8122
----------  ------------------------------------
User          Jobs    core-hours    Status
------------  ------  ------------  --------
dheisterberg  403     12478.0448    ACTIVE
guilfoos      0       0.0           ACTIVE
hhamblin      0       0.0           ACTIVE
kcahill       2       15.9677       ACTIVE
xwang         107     1167.468      ACTIVE
--            --      --
TOTAL         512     13661.4805

Detailed Charges Breakdown

Specify -v to get detailed information on what job's incurred what charges.


$ OSCusage -v 2018-10-20 2018-10-24
----------  ------------------------------------
            Usage Statistics for project PZS0712
Time        2018-10-20 to 2018-10-24
PI          Brian Guilfoos <guilfoos@osc.edu>
RU Balance  -1318.8122
----------  ------------------------------------
Job name      Project    User          Start date           End date             System    Charge type    Queue        RUs
------------  ---------  ------------  -------------------  -------------------  --------  -------------  -------  -------
-             -          kcahill       -                    -                    -         -              -         0
-             -          guilfoos      -                    -                    -         -              -         0
-             -          hhamblin      -                    -                    -         -              -         0
starccm_test  PZS0712    xwang         2018-10-22 09:38:52  2018-10-22 09:38:54  owens     cpu            serial    0.0016
mmseqs-perf   PZS0712    dheisterberg  2018-10-22 11:20:08  2018-10-22 12:50:38  owens     cpu            serial    4.2179
mmseqs-perf   PZS0712    dheisterberg  2018-10-22 10:18:10  2018-10-22 11:36:30  owens     hugemem        hugemem   6.2453
mmseqs-prof   PZS0712    dheisterberg  2018-10-22 09:02:18  2018-10-22 10:51:30  owens     hugemem        hugemem   8.716
STDIN         PZS0712    dheisterberg  2018-10-22 07:42:07  2018-10-22 07:44:34  owens     gpu            serial    0.1143
mmseqs-perf   PZS0712    dheisterberg  2018-10-22 10:17:06  2018-10-22 11:42:43  owens     cpu            serial    3.99
mmseqs-perf   PZS0712    dheisterberg  2018-10-22 15:51:29  2018-10-22 16:35:48  owens     hugemem        hugemem   3.5267
starccm_test  PZS0712    xwang         2018-10-22 09:32:28  2018-10-22 09:33:23  owens     cpu            serial    0.042
starccm_test  PZS0712    xwang         2018-10-22 09:29:14  2018-10-22 09:29:17  owens     cpu            serial    0.0016
mmseqs-perf   PZS0712    dheisterberg  2018-10-22 12:53:08  2018-10-22 15:04:04  owens     hugemem        hugemem  10.4573
mmseqs-perf   PZS0712    dheisterberg  2018-10-22 11:22:20  2018-10-22 13:36:59  owens     hugemem        hugemem  10.7533
mmseqs-perf   PZS0712    dheisterberg  2018-10-22 13:38:36  2018-10-22 14:30:58  owens     hugemem        hugemem   4.1693
mmseqs-prof   PZS0712    dheisterberg  2018-10-22 09:01:15  2018-10-22 10:56:46  owens     cpu            serial    5.3853
mmseqs-perf   PZS0712    dheisterberg  2018-10-22 15:04:43  2018-10-22 15:51:56  owens     hugemem        hugemem   3.7547
------
Total Jobs    14
Total RUs     61.3753

You can add the -n 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. 

Supercomputer: 
Service: