Skip to content

Commit

Permalink
Add GPU stats to allocation wrapper API. (#1016)
Browse files Browse the repository at this point in the history
  • Loading branch information
splhack committed Sep 12, 2021
1 parent e743be1 commit 341a6d1
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions pycue/opencue/wrappers/allocation.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,46 @@ def totalLockedCores(self):
"""
return self.data.stats.locked_cores

def totalGpus(self):
"""Returns the total number of gpus in the allocation.
:rtype: float
:return: total number of gpus in the allocation
"""
return self.data.stats.gpus

def totalAvailableGpus(self):
"""Returns the total number of gpus available for booking in the allocation.
:rtype: float
:return: total number of gpus in the allocation
"""
return self.data.stats.available_gpus

def totalIdleGpus(self):
"""Returns the total number of idle gpus in the allocation.
:rtype: float
:return: total number of idle gpus in the allocation
"""
return self.data.stats.idle_gpus

def totalRunningGpus(self):
"""Returns the total number of running gpus in the allocation.
:rtype: float
:return: total number of running gpus in the allocation
"""
return self.data.stats.running_gpus

def totalLockedGpus(self):
"""Returns the total number of locked gpus in the allocation.
:rtype: float
:return: total number of locked gpus in the allocation
"""
return self.data.stats.locked_gpus

def totalHosts(self):
"""Returns the total number of hosts in the allocation.
Expand Down

0 comments on commit 341a6d1

Please sign in to comment.