Skip to content

Slurm report

Automatic usage report

You can generate accounting statistics from Slurm using the slurmreport script, located in /ceph/hpc/bin/.

Usage:

/ceph/hpc/bin/slurmreport [-m] [-c | -w] [-a accountlist] [-s startdate -e enddate] [-r report-directory]

where:

-m: Send report by E-mail to root@localhost

-a: Select an account (or list of accounts)

-s -e: Select Start and End dates of the report

-c: Select current month from the 1st until today

-w: Select the last week

-r: Copy the report to a specified directory as well
./slurmreport -a $USER -s 2021-08-18 -e 2021-08-01

Date format could be either YYYY-MM-DD or MMDD

If you run the script without specifying additional features, the report will be generated for the last month and placed into your home directory.

Manual usage report

Create an accounting report manually using sreport command:

Usage report in CPU Hours

Report cluster account utilization by filing specified fields for the desired period of time start/end:

sreport cluster AccountUtilizationByUser user=$USER -t Hours start=2021-01-01 end=2021-05-25 format=Proper%20,Login%20,Accounts,Used

Example:

sreport cluster AccountUtilizationByUser user=user -t Hours start=2021-01-01 end=2021-10-25 format=Proper%20,Login%20,Accounts,Used
--------------------------------------------------------------------------------
Cluster/Account/User Utilization 2021-01-01T00:00:00 - 2021-10-07T14:59:59 (24156000 secs)

Usage reported in CPU Hours
--------------------------------------------------------------------------------
         Proper Name                Login         Account        Used
-------------------- -------------------- --------------- -----------
          User User                 user        vega-users     5009241

Used=5009241 is in Thread Hours.

To get result in Core Hours divided with 2.

Usage report in TRES Hours

Fill specified fields for the desired period of time start/end:

account=$(sacctmgr show assoc cluster=vega user=$USER format=account -n) | sreport --tres billing cluster AccountUtilizationByAccount account=$account -t Hours start=2021-01-01 end=2021-05-25 format=Proper%20,Login%20,Accounts,Used