sacctmgr
Overview
sacctmgr is the command tool in Slurm for managing accounting data:
- Manage Accounts, Users, resource limits (QOS), etc.
- Configure associations and permissions
- Requires administrator privileges
Common Options
| Option | Description | Example |
|---|---|---|
add | Add entity | sacctmgr add account |
modify | Modify entity | sacctmgr modify user |
delete | Delete entity | sacctmgr delete qos |
show | Show info | sacctmgr show cluster |
-i, --immediate | Take effect immediately | sacctmgr -i add ... |
-p, --parsable | Parsable output | sacctmgr -p show ... |
-Q, --quiet | Quiet mode | sacctmgr -Q delete ... |
Examples
Manage accounts
# Add account
sacctmgr add account myaccount Description="test account" Organization=CS
# Modify account
sacctmgr modify account myaccount set GrpTRES=cpu=100
# Delete account
sacctmgr delete account myaccount
Manage users
# Add user
sacctmgr add user user1 Account=myaccount
# Set default account for user
sacctmgr modify user user1 set DefaultAccount=myaccount
# Delete user
sacctmgr delete user user1
Manage QOS
# Add QoS
sacctmgr add qos high Priority=100
# Add qos: limit high to 10 CPUs, 10 RTX2080 GPUs, and 4 V100 GPUs
sacctmgr add qos high set GrpTRES=cpu=10,gres/gpu:rtx2080=10,gres/gpu:v100=4
# Limit high to 10 CPUs, 10 RTX2080 GPUs, and 4 V100 GPUs
sacctmgr modify qos high set maxtresperuser=cpu=1,gres/gpu:rtx2080=1,gres/gpu:v100=1
# Modify QoS limits
sacctmgr modify qos high set MaxTRESPerJob=cpu=32
# Clear limits; -1 means unlimited
sacctmgr modify qos high set GrpTRES=cpu=-1,gres/gpu:rtx2080=-1,gres/gpu:v100=-1
# Modify group limits
sacctmgr modify qos high set GrpTRES=cpu=-1,gres/gpu:rtx2080=-1,gres/gpu:v100=-1
# Delete QoS
sacctmgr delete qos high
# Add user to qos
sacctmgr modify user <user_name> set qos=<qos_name>
View associations
sacctmgr show Association format=Cluster,Account,User,Partition,QOS,GrpSubmit,GrpWall,GrpTRESMins,MaxJobs,MaxTRES format=GrpTRES%60
View user details
sacctmgr show user user1 format=User,DefaultAccount,AdminLevel
View QOS configuration
sacctmgr show qos format=Name,Priority,MaxTRESPerJob
Key Parameter Details
Resource Types (TRES)
| Type | Description | Example |
|---|---|---|
cpu | CPU cores | cpu=100 |
mem | Memory (MB) | mem=100G |
gres/gpu | GPU count | gres/gpu=2 |
billing | Billing weight | billing=30 |
Common limits
| Limit parameter | Description |
|---|---|
GrpTRES | Group total resource limit |
MaxTRESPerUser | Per-user resource limit |
MaxTRESPerJob | Per-job resource limit |
MaxJobs | Max jobs limit |
Notes
-
All modifications take effect immediately and are irreversible
-
Deleting a parent account will delete all child accounts
-
Resource limits are based on real-time calculation and may affect queued jobs
-
For complex configurations, run simulation tests first
-
Back up configuration before production operations:
sacctmgr -p dump <cluster_name> file=./<file_name>.cfg
📌 Tip: For more advanced features (such as federated cluster configuration), see
man sacctmgror visit Slurm official documentation