def __init__(self, context, cq, recurse, num_processes): Manager.__init__(self, context=context, cq=cq, recurse=recurse) self.num_processes = num_processes check_sge_environment() storage = os.path.abspath(self.db.basepath) timestamp = isodate_with_secs().replace(':', '-') spool = os.path.join(storage, 'sge', timestamp) if not os.path.exists(spool): os.makedirs(spool) self.sub_available = set() self.sub_processing = set() # available + processing = subs.keys self.subs = {} # name -> sub for i in range(self.num_processes): name = 'w%02d' % i self.subs[name] = SGESub(name, db=self.db, spool=spool) self.job2subname = {} # all are available self.sub_available.update(self.subs)
def __init__(self, context, cq, num_processes, recurse): Manager.__init__(self, context=context, cq=cq, recurse=recurse) self.num_processes = num_processes self.last_accepted = 0