def createNewJob(self): """Create any jobs required for this unit""" j = makeRegisteredJob() j._impl.backend = self._getParent().backend.clone() j._impl.application = self._getParent().application.clone() j.application.run_number = j.application._impl.getNextRunNumber() return j
def createNewJob(self): """Create any jobs required for this unit""" import copy j = makeRegisteredJob() j.backend = self._getParent().backend.clone() j.application = self._getParent().application.clone() if self.inputdata: j.inputdata = self.inputdata.clone() j.inputfiles = copy.deepcopy(self._getParent().inputfiles) trf = self._getParent() task = trf._getParent() j.inputsandbox = self._getParent().inputsandbox j.outputfiles = copy.deepcopy(self._getParent().outputfiles) if len(self._getParent().postprocessors.process_objects) > 0: j.postprocessors = copy.deepcopy( addProxy(self._getParent()).postprocessors) if trf.splitter: j.splitter = trf.splitter.clone() # change the first event for GaussSplitter from GangaLHCb.Lib.Splitters.GaussSplitter import GaussSplitter if isType(trf.splitter, GaussSplitter): events_per_unit = j.splitter.eventsPerJob * \ j.splitter.numberOfJobs j.splitter.firstEventNumber += self.getID() * events_per_unit else: j.splitter = SplitByFiles() return j
def createNewJob(self): """Create any jobs required for this unit""" j = makeRegisteredJob() j.backend = self._getParent().backend.clone() # copy form ourselves or the parent transform depending on what's # specified fields = ['application', 'splitter', 'inputfiles', 'inputdata', 'inputsandbox', 'outputfiles', 'postprocessors'] for f in fields: if (f == "postprocessors" and len(getattr(self, f).process_objects) > 0): j.postprocessors = copy.deepcopy(addProxy(self).postprocessors) elif (f != "postprocessors" and getattr(self, f)): setattr(j, f, copy.deepcopy(getattr(self, f))) elif (f == "postprocessors" and len(getattr(self._getParent(), f).process_objects) > 0): j.postprocessors = copy.deepcopy( addProxy(self._getParent()).postprocessors) elif (f != "postprocessors" and getattr(self._getParent(), f)): setattr(j, f, copy.deepcopy(getattr(self._getParent(), f))) return j