From c0fa682d2064fadaf2bc5779e6723a117ad55e5d Mon Sep 17 00:00:00 2001 From: Guillaume Raffy Date: Tue, 3 May 2016 12:19:24 +0000 Subject: [PATCH] =?UTF-8?q?Bug=201322=20-=20l'=C3=A9tat=20des=20machines?= =?UTF-8?q?=20affich=C3=A9e=20par=20la=20page=20clusterstatus=20n'est=20pa?= =?UTF-8?q?s=20fiable?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit désormais, pour éviter toute confusion, pour toutes le machines qui ne répondent pas : - le load n'est plus affiché - le bouton power affiche unknown --- ClusterController/Job.py | 1 + ClusterController/QstatParser.py | 4 ++++ ClusterController/QueueMachine.py | 7 +++++++ 3 files changed, 12 insertions(+) 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 )