Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GPU stats to allocation wrapper API #1016

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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