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.
  • Make sure you have TRES resources enabled and GrpTRESMins billing set.
  • Optionally gres/gpu enabled and configured.

Usage

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

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


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

Checking balance for all users

[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
-------------------- | --------------- | --------------- | --------------- | ------------------------------
test_account         |                 |                 |                 |
                     | test_user       | 0               | 0.0%            | 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/1.0.1/

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.1.2.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

scredits-1.1.2-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for scredits-1.1.2.tar.gz
Algorithm Hash digest
SHA256 08094119e446cd092b7d9b65a1d81caa49b385db2bcc15e8fadfd211763688aa
MD5 3a6f8e9ca47f3705bada18f84941ba8b
BLAKE2b-256 3369039ae344cd36fabbfdb1cb51a1ded0549e4fc78aea570f4eaf2f243b49bf

See more details on using hashes here.

File details

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

File metadata

  • Download URL: scredits-1.1.2-py3-none-any.whl
  • Upload date:
  • Size: 6.9 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.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 54c6b6f4a7166d75663839235fa7485efdb02c28d556da6c7d3d9c24605a3067
MD5 51572b3fe9dfcb41e0c340762948af15
BLAKE2b-256 b31c018335f4c4980474c59337982e5ab7c081f5696e354fa6f476097b16a370

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