Bug 521 - le cluster ne prend plus de jobs et qstat ne marche pas : correction qui fait que le code est beaucoup plus performant quand il y a des gros job array (alexandra a des job array de 1400 éléments)

This commit is contained in:
Guillaume Raffy 2014-01-17 14:49:37 +00:00
parent 5d10b89ee8
commit d23c25ba06
1 changed files with 14 additions and 2 deletions

View File

@ -6,18 +6,30 @@ class JobsState:
"""
def __init__( self ):
self.m_jobs = {} # list of jobs
self.m_jobArrayJobs = {} # a dictionary of jobs for each job array, indexed by job array id
self.m_queueMachines = {} # list of queue machines such as allintel.q@simpatix10
self.m_stateTime = None # the time at which the state was snapshot
def deleteAllJobs( self ):
self.m_jobs = {}
self.m_jobArrayJobs = {}
def addJob( self, job ):
self.m_jobs[ job.getId() ] = job
jobId = job.getId()
self.m_jobs[ jobId ] = job
if jobId.isJobArrayElement():
tasks = self.m_jobArrayJobs.get(jobId.m_iJobId)
if tasks == None:
tasks = {}
self.m_jobArrayJobs[ jobId.m_iJobId ] = tasks
tasks[jobId] = job
def getJob( self, jobId ):
return self.m_jobs.get( jobId )
def getJobArrayJobs( self, iJobArrayId ):
return self.m_jobArrayJobs.get( iJobArrayId )
def setTime( self, stateTime ):
self.m_stateTime = stateTime