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