Skip to content
This repository has been archived by the owner on May 14, 2024. It is now read-only.

Commit

Permalink
use billing instead of cpu/gpu for TRES limit
Browse files Browse the repository at this point in the history
  • Loading branch information
Comeani committed Feb 28, 2024
1 parent 1c099bf commit a016f80
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions bank/system/slurm.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,7 @@ def set_locked_state(self, lock_state: bool, cluster: str) -> None:
raise ClusterNotFoundError(f'Cluster {cluster} is not configured with Slurm')

lock_state_int = 0 if lock_state else -1
ShellCmd(f'sacctmgr -i modify account where account={self.account_name} cluster={cluster} '
f'set GrpTresRunMins=cpu={lock_state_int}').raise_if_err()
ShellCmd(f'sacctmgr -i modify account where account={self.account_name} cluster={cluster} '
f'set GrpTresRunMins=gres/gpu={lock_state_int}').raise_if_err()
ShellCmd(f'sacctmgr -i modify account where account={self.account_name} cluster={cluster} set GrpTresRunMins=billing={lock_state_int}').raise_if_err()

def get_cluster_usage_per_user(self, cluster: str, start: date, end: date, in_hours: bool = True) -> Dict[str, int]:
"""Return the raw account usage per user on a given cluster
Expand Down

0 comments on commit a016f80

Please sign in to comment.