2011-10-07 17:43:45 +02:00
|
|
|
|
|
|
|
class QueueMachine:
|
|
|
|
"""
|
|
|
|
a QueueMachine instance represents a given SGE queue on a given machine (eg allintel.q@simpatix10)
|
|
|
|
"""
|
|
|
|
def __init__( self, queueName, machineName ):
|
|
|
|
self.m_queueName = queueName
|
|
|
|
self.m_machineName = machineName
|
|
|
|
self.m_numSlots = None
|
2012-05-29 16:05:18 +02:00
|
|
|
self.m_numUsedSlots = None
|
|
|
|
self.m_fCpuLoad = None
|
2011-10-07 17:43:45 +02:00
|
|
|
def getName( self ):
|
|
|
|
"""
|
|
|
|
returns the name of the machine queue (such as allintel.q@simpatix10)
|
|
|
|
"""
|
|
|
|
return self.m_queueName + '@' + self.m_machineName
|
|
|
|
|
|
|
|
def getQueueName( self ):
|
|
|
|
return self.m_queueName
|
|
|
|
def getMachineName( self ):
|
|
|
|
return self.m_machineName
|
|
|
|
def setNumSlots( self, numSlots ):
|
|
|
|
self.m_numSlots = numSlots
|
2012-05-29 16:05:18 +02:00
|
|
|
def setNumUsedSlots( self, numSlots ):
|
|
|
|
self.m_numUsedSlots = numSlots
|
2011-10-07 17:43:45 +02:00
|
|
|
def getNumSlots( self ):
|
|
|
|
assert( self.m_numSlots != None )
|
|
|
|
return self.m_numSlots
|
2012-05-29 16:05:18 +02:00
|
|
|
def getNumUsedSlots( self ):
|
|
|
|
assert( self.m_numUsedSlots != None )
|
|
|
|
return self.m_numUsedSlots
|
|
|
|
def setCpuLoad( self, fCpuLoad ):
|
|
|
|
self.m_fCpuLoad = fCpuLoad
|
|
|
|
def cpuLoadIsAvailable( self ):
|
|
|
|
return self.m_fCpuLoad != None
|
|
|
|
def getCpuLoad( self ):
|
|
|
|
assert( self.m_fCpuLoad != None )
|
|
|
|
return self.m_fCpuLoad
|
2011-10-07 17:43:45 +02:00
|
|
|
|