diff --git a/ClusterController/Job.py b/ClusterController/Job.py index 9fd3f17..6cb2bb8 100644 --- a/ClusterController/Job.py +++ b/ClusterController/Job.py @@ -7,6 +7,7 @@ class JobStateFlags: DELETED=16 HOLD=32 ERROR=64 + SUSPENDED=128 class ParallelEnvironment: MPI=1 diff --git a/ClusterController/QstatParser.py b/ClusterController/QstatParser.py index c45b9db..db6b2a4 100644 --- a/ClusterController/QstatParser.py +++ b/ClusterController/QstatParser.py @@ -23,6 +23,8 @@ class QstatParser: jobState += JobStateFlags.DELETED elif c == 'h': jobState += JobStateFlags.HOLD + elif c == 's': + jobState += JobStateFlags.SUSPENDED elif c == 'E': jobState += JobStateFlags.ERROR else: @@ -42,6 +44,8 @@ class QstatParser: queueMachineState += QueueMachineStateFlags.ERROR elif c == 'o': queueMachineState += QueueMachineStateFlags.OBSOLETE + elif c == 's': + queueMachineState += QueueMachineStateFlags.SUSPENDED else: assert False, 'unhandled queue machine state flag :"' + c + '"' return queueMachineState diff --git a/ClusterController/QueueMachine.py b/ClusterController/QueueMachine.py index 6b02292..1b521ab 100644 --- a/ClusterController/QueueMachine.py +++ b/ClusterController/QueueMachine.py @@ -5,6 +5,7 @@ class QueueMachineStateFlags: # UNKNOWN=4 # the queue machine is in unknown state because sge_execd cannot be contected (see man qstat) ERROR=8 # the queue is in error state OBSOLETE=16 # the queue no longer exists but it is still visible because it still contains running jobs + SUSPENDED=32 # the queue machine is suspended class QueueMachine: """ @@ -49,6 +50,12 @@ class QueueMachine: return self.m_stateFlags & QueueMachineStateFlags.DISABLED def isInErrorState( self ): return self.m_stateFlags & QueueMachineStateFlags.ERROR + def isResponding( self ): + return not (self.m_stateFlags & QueueMachineStateFlags.UNKNOWN) + def isInAlarmState( self ): + return self.m_stateFlags & QueueMachineStateFlags.ALARM + def isSuspended( self ): + return self.m_stateFlags & QueueMachineStateFlags.SUSPENDED """ def getStateAsString( self ): assert( self.m_strState != None )