Skip to main content

A tool to retrieve and display Slurm usage data

Project description

slurm-scredits

scredits is a Slurm utility for checking account balance. The utility calculates the remaining service units or SU left in the account. The utility shows SU as an aggregate of cpu+gpu+mem usage.

Prerequisites

  • Slurm with Accounting enabled.
  • TRES resources enabled and GrpTRESMins billing set.
  • Optionally gres/gpu enabled and configured.

Usage

usage: scredits [-h] [-v] [-V] [-d] [-a ACCOUNT]

Retrieve and display Slurm usage data.

options:
  -h, --help            show this help message and exit
  -v, --verbose         Print debug messages
  -V, --version         Print program version
  -d, --detailed        Show detailed account and user association
  -a ACCOUNT, --account ACCOUNT
                        Account name to filter results

Installation

pip install scredits

Setting up Slurm

scredits currently support the following setup.

  • Balance is limited per account
  • Account limit is set through GrpTRESMins using billing parameter.

Following is an example setup

Creating account test_account with billing balance of 1000

sacctmgr add account test_account set GrpTRESMins=billing=1000

Add test_user user to account test_account

sacctmgr add user test_user set Account=test_account
sacctmgr add user test_user2 set Account=test_account

Checking balance for all the Accounts

[test@localhost ~]$ scredits
Account         | Allocation(SU)  | Remaining(SU)   | Used(SU)   | Used(%) |
-----------------------------------------------------------------------------
test_account    | 1000.0          | 1000.0          | 0          | 0.0

If you want more details use the -d flag.

[test@localhost ~]$ scredits -d
------------------------------------------------------------------------------------------
Account              | User            | Consumed (SU)   | % SU Usage      | Used Resources
------------------------------------------------------------------------------------------
root                 |                 |                 |                 |
                     | root            | 0               | 0.00%           | cpu=0, mem=0, gpu=0
                     |                 |                 |                 |
                     | Total:          | 0/0             | 0.00%           | cpu=0, mem=0, gpu=0
------------------------------------------------------------------------------------------
test_account         |                 |                 |                 |
                     | test_account    | 0               | 0.00%           | cpu=0, mem=0, gpu=0
                     | test_account2   | 0               | 0.00%           | cpu=0, mem=0, gpu=0
                     |                 |                 |                 |
                     | Total:          | 0/1000          | 0.00%           | cpu=0, mem=0, gpu=0
------------------------------------------------------------------------------------------

You can filter for Account with the -a flag

[test@localhost ~]$ scredits -d -a test_account
------------------------------------------------------------------------------------------
Account              | User            | Consumed (SU)   | % SU Usage      | Used Resources
------------------------------------------------------------------------------------------
test_account         |                 |                 |                 |
                     | test_account    | 0               | 0.00%           | cpu=0, mem=0, gpu=0
                     | test_account2   | 0               | 0.00%           | cpu=0, mem=0, gpu=0
                     |                 |                 |                 |
                     | Total:          | 0/1000          | 0.00%           | cpu=0, mem=0, gpu=0
------------------------------------------------------------------------------------------

Build yourself

Clone the repo

git clone https://github.com/giuliolibrando/slurm-scredits.git

enter into the folder

cd slurm-scredits

install via pip

pip install .

https://pypi.org/project/scredits

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

scredits-1.3.0.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

scredits-1.3.0-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file scredits-1.3.0.tar.gz.

File metadata

  • Download URL: scredits-1.3.0.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for scredits-1.3.0.tar.gz
Algorithm Hash digest
SHA256 b77d8388a006fb411de98d8e2d8b04dac9dd8b8570fc3a18f10d3a8a3c8ef846
MD5 dc75a8b76fabd0fb49df93d72aee6ddb
BLAKE2b-256 a56887ce7d1c536b6972df7aad3cf44a2e57ae6cac91f6ac2a269dcd880d2525

See more details on using hashes here.

File details

Details for the file scredits-1.3.0-py3-none-any.whl.

File metadata

  • Download URL: scredits-1.3.0-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for scredits-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5408263386331d77a54184e59776147132a7ed1e2e692b5a988d362d3fdff740
MD5 4c28d215dce7ea4deaaa8c1ec8efcb1c
BLAKE2b-256 c5108f2d6e1925a788b4f88c9f52cf24e612962c7bb821f82a165b9daf230451

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page