def __init__(self, config, maxCores, maxMemory, maxDisk): super(AbstractGridEngineBatchSystem, self).__init__(config, maxCores, maxMemory, maxDisk) self.resultsFile = self._getResultsFileName(config.jobStore) # Reset the job queue and results (initially, we do this again once we've killed the jobs) self.resultsFileHandle = open(self.resultsFile, 'w') # We lose any previous state in this file, and ensure the files existence self.resultsFileHandle.close() self.currentJobs = set() # NOTE: this may be batch system dependent, maybe move into the worker? # Doing so would effectively make each subclass of AbstractGridEngineBatchSystem # much smaller self.maxCPU, self.maxMEM = self.obtainSystemConstants() self.newJobsQueue = Queue() self.updatedJobsQueue = Queue() self.killQueue = Queue() self.killedJobsQueue = Queue() # get the associated worker class here self.worker = self.Worker(self.newJobsQueue, self.updatedJobsQueue, self.killQueue, self.killedJobsQueue, self) self.worker.start() self.localBatch = registry.batchSystemFactoryFor( registry.defaultBatchSystem())()(config, maxCores, maxMemory, maxDisk) self._getRunningBatchJobIDsTimestamp = None self._getRunningBatchJobIDsCache = {}
def __init__(self, config, maxCores, maxMemory, maxDisk): super(BatchSystemLocalSupport, self).__init__(config, maxCores, maxMemory, maxDisk) self.localBatch = registry.batchSystemFactoryFor( registry.defaultBatchSystem())()( config, config.maxLocalJobs, maxMemory, maxDisk)