From 265aac6064fb5b2b87d8fd262caa1a89ad0d0f04 Mon Sep 17 00:00:00 2001 From: Guillaume Raffy Date: Thu, 28 Jun 2012 12:11:21 +0000 Subject: [PATCH] =?UTF-8?q?correction=20d'un=20bug=20introduit=20dans=20le?= =?UTF-8?q?=20commit=202034=20(je=20crois)=20:=20les=20slots=20sont=20d?= =?UTF-8?q?=C3=A9sormais=20par=20queuemachine,=20et=20non=20pas=20machine?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ClusterController/JobsState.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ClusterController/JobsState.py b/ClusterController/JobsState.py index 141586d..c096c51 100644 --- a/ClusterController/JobsState.py +++ b/ClusterController/JobsState.py @@ -27,15 +27,17 @@ class JobsState: def getJobsOnMachine( self, machineName ): jobsOnMachine = {} for jobId, job in self.m_jobs.iteritems(): - if job.getSlots().get(machineName): - jobsOnMachine[ jobId ] = job + for queueMachineName, numSlots in job.getSlots().iteritems(): + jobMachineName = queueMachineName.split('@')[1] + if jobMachineName == machineName: + jobsOnMachine[ jobId ] = job return jobsOnMachine def getNumFreeSlotsOnQueueMachine( self, queueMachine ): #logInfo('getNumFreeSlotsOnQueueMachine : looking for free slots on queuemachine %s' % queueMachine.getName() ) numUsedSlots = 0 for job in self.m_jobs.itervalues(): - numUsedSlotsByThisJob = job.getSlots().get( queueMachine.getMachineName() ) + numUsedSlotsByThisJob = job.getSlots().get( queueMachine.getName() ) if numUsedSlotsByThisJob != None: #logInfo('getNumFreeSlotsOnQueueMachine : job %d uses %d slots' % (job.getId().asStr(), numUsedSlotsByThisJob) ) numUsedSlots += numUsedSlotsByThisJob