Skip to content

Accounts & Fairshare

Exercises

  1. Create a three-level account hierarchy

Create an organizational structure: a top-level account research, a department account structural_biology under it, and a lab account cryo_lab under the department. Add two users (pi_chen and postdoc_kim) to cryo_lab with different fairshare weights.

Hint / Solution
# Create the hierarchy
sacctmgr add account research Description="Research Division"
sacctmgr add account structural_biology parent=research Description="Structural Biology Dept"
sacctmgr add account cryo_lab parent=structural_biology Description="Cryo-EM Lab"

# Add users with different share weights
sacctmgr add user pi_chen account=cryo_lab fairshare=20 qos=normal defaultqos=normal
sacctmgr add user postdoc_kim account=cryo_lab fairshare=10 qos=normal defaultqos=normal

# Verify the tree
sacctmgr show association where account=cryo_lab format=Account,User,Fairshare tree withd
  1. Inspect fairshare values with sshare

Use sshare to view the current fairshare state for an account hierarchy. Identify which account has the best LevelFS (most under-served relative to its share) and which has the worst.

Hint / Solution
# View full fairshare tree
sshare -l -A research

# Key columns to examine:
# - NormShares: the account's share as a fraction of its siblings
# - EffectvUsage: normalized actual usage
# - LevelFS: NormShares / EffectvUsage (higher = more under-served)

# To sort by fairshare factor (most under-served first):
sshare -l | sort -k7 -rn | head -20
  1. Modify share allocation for a department

Change the fairshare allocation so that structural_biology gets 40 shares and a sibling account gets 60 shares. Verify the normalized shares reflect the new 40/60 split.

Hint / Solution
# Set shares
sacctmgr modify account structural_biology set fairshare=40
sacctmgr modify account chemistry set fairshare=60    # sibling account

# Verify normalized shares
sshare -l -A structural_biology,chemistry
# structural_biology NormShares should be ~0.400000
# chemistry NormShares should be ~0.600000
  1. Generate a usage report with sreport

Use sreport to produce a report showing CPU-hour usage by account for the current month. Then generate a second report showing the top 10 users by CPU hours.

Hint / Solution
# Usage by account for the current month
sreport cluster AccountUtilizationByUser start=2026-04-01 --tres=cpu

# Top 10 users by CPU hours
sreport user TopUsage start=2026-04-01 --tres=cpu TopCount=10

# For GPU usage by account:
sreport cluster AccountUtilizationByUser start=2026-04-01 --tres=gres/gpu

References