def merge(self, *inputFiles, **options): """ _merge_ builds a merge configuration """ msg = "Scenario Implementation %s\n" % self.__class__.__name__ return mergeProcess(*inputFiles, **options)
def create_process(args, func_args): if args.funcname == "merge": if args.useErrorDataset: func_args['outputmod_label'] = "MergedError" try: from Configuration.DataProcessing.Merge import mergeProcess process = mergeProcess(**func_args) except Exception as ex: msg = "Failed to create a merge process." print(msg) raise ex elif args.funcname == "repack": try: from Configuration.DataProcessing.Repack import repackProcess process = repackProcess(**func_args) except Exception as ex: msg = "Failed to create a repack process." print(msg) raise ex else: try: from Configuration.DataProcessing.GetScenario import getScenario scenario = func_args['scenario'] scenarioInst = getScenario(scenario) except Exception as ex: msg = "Failed to retrieve the Scenario named " msg += str(scenario) msg += "\nWith Error:" msg += str(ex) print(msg) raise ex try: my_func = getattr(scenarioInst, args.funcname) arg_names = my_func.__code__.co_varnames[1:1 + my_func.__code__. co_argcount] #the last arg should be **args - get the others from the dictionary passed in arg_names = arg_names[:-1] call_func_args = [] for name in arg_names: call_func_args.append(func_args[name]) del func_args[name] process = my_func(*call_func_args, **func_args) except Exception as ex: msg = "Failed to load process from Scenario %s (%s)." % ( scenario, scenarioInst) print(msg) raise ex return process
def __call__(self): if self.inputFiles == []: msg = "No Input Files provided" raise RuntimeError, msg try: process = mergeProcess(self.inputFiles, process_name=self.processName, output_file=self.outputFile, output_lfn=self.outputLFN) except Exception, ex: msg = "Error creating process for Merge:\n" msg += str(ex) raise RuntimeError, msg
def createProcess(self, scenario, funcName, funcArgs): """ _createProcess_ Create a Configuration.DataProcessing PSet. """ if funcName == "merge": baggage = self.job.getBaggage() if getattr(baggage, "useErrorDataset", False): funcArgs["outputmod_label"] = "MergedError" try: from Configuration.DataProcessing.Merge import mergeProcess self.process = mergeProcess(**funcArgs) except Exception as ex: msg = "Failed to create a merge process." print(msg) raise ex elif funcName == "repack": try: from Configuration.DataProcessing.Repack import repackProcess self.process = repackProcess(**funcArgs) except Exception as ex: msg = "Failed to create a repack process." print(msg) raise ex else: try: from Configuration.DataProcessing.GetScenario import getScenario scenarioInst = getScenario(scenario) except Exception as ex: msg = "Failed to retrieve the Scenario named " msg += str(scenario) msg += "\nWith Error:" msg += str(ex) print(msg) raise ex try: self.process = getattr(scenarioInst, funcName)(**funcArgs) except Exception as ex: msg = "Failed to load process from Scenario %s (%s)." % (scenario, scenarioInst) print(msg) raise ex return
def __call__(self): if self.inputFiles == []: msg = "No Input Files provided" raise RuntimeError, msg try: process = mergeProcess( self.inputFiles, process_name = self.processName, output_file = self.outputFile, output_lfn = self.outputLFN) except Exception, ex: msg = "Error creating process for Merge:\n" msg += str(ex) raise RuntimeError, msg
def createProcess(self, scenario, funcName, funcArgs): """ _createProcess_ Create a Configuration.DataProcessing PSet. """ if funcName == "merge": try: from Configuration.DataProcessing.Merge import mergeProcess self.process = mergeProcess([]) except Exception, ex: msg = "Failed to create a merge process." print msg return None
def createProcess(self, scenario, funcName, funcArgs): """ _createProcess_ Create a Configuration.DataProcessing PSet. """ if funcName == "merge": baggage = self.job.getBaggage() if getattr(baggage, "useErrorDataset", False): funcArgs['outputmod_label'] = "MergedError" try: from Configuration.DataProcessing.Merge import mergeProcess self.process = mergeProcess(**funcArgs) except Exception as ex: msg = "Failed to create a merge process." print(msg) raise ex elif funcName == "repack": try: from Configuration.DataProcessing.Repack import repackProcess self.process = repackProcess(**funcArgs) except Exception as ex: msg = "Failed to create a repack process." print(msg) raise ex else: try: from Configuration.DataProcessing.GetScenario import getScenario scenarioInst = getScenario(scenario) except Exception as ex: msg = "Failed to retrieve the Scenario named " msg += str(scenario) msg += "\nWith Error:" msg += str(ex) print(msg) raise ex try: self.process = getattr(scenarioInst, funcName)(**funcArgs) except Exception as ex: msg = "Failed to load process from Scenario %s (%s)." % ( scenario, scenarioInst) print(msg) raise ex return
def testA(self): """ test addMonitoring call""" # test with a nice simple merge process config process = mergeProcess( ["/store/dummyinput.root"], process_name = "unittest", output_file = "dummy.root", output_lfn = "/store/dummy.root") try: addMonitoring(process) except Exception, ex: msg = "Failed to call addMonitoring on a cms.Process:\n" msg += str(ex) self.fail(msg)
def testA(self): """ test addMonitoring call""" # test with a nice simple merge process config process = mergeProcess( ["/store/dummyinput.root"], process_name="unittest", output_file="dummy.root", output_lfn="/store/dummy.root", ) try: addMonitoring(process) except Exception, ex: msg = "Failed to call addMonitoring on a cms.Process:\n" msg += str(ex) self.fail(msg)
def createProcess(self, scenario, funcName, funcArgs): """ _createProcess_ Create a Configuration.DataProcessing PSet. """ if funcName == "merge": baggage = self.job.getBaggage() if getattr(baggage, "useErrorDataset", False): funcArgs['outputmod_label'] = "MergedError" try: from Configuration.DataProcessing.Merge import mergeProcess self.process = mergeProcess(**funcArgs) except Exception, ex: msg = "Failed to create a merge process." print msg return None
def testA(self): """ test addMonitoring call""" # test with a nice simple merge process config process = mergeProcess( ["/store/dummyinput.root"], process_name = "unittest", output_file = "dummy.root", output_lfn = "/store/dummy.root") try: addMonitoring(process) except Exception as ex: msg = "Failed to call addMonitoring on a cms.Process:\n" msg += str(ex) self.fail(msg) servicelist = process.services.keys() self.failUnless("SimpleMemoryCheck" in servicelist, "SimpleMemoryCheck not in list of services") self.failUnless("Timing" in servicelist, "Timing not in list of services")
def __call__(self): if self.inputFiles == []: msg = "No Input Files provided" raise RuntimeError(msg) try: process = mergeProcess(self.inputFiles, process_name=self.processName, output_file=self.outputFile, output_lfn=self.outputLFN, newDQMIO=self.newDQMIO) except Exception as ex: msg = "Error creating process for Merge:\n" msg += str(ex) raise RuntimeError(msg) psetFile = open("RunMergeCfg.py", "w") psetFile.write(process.dumpPython()) psetFile.close() cmsRun = "cmsRun -j FrameworkJobReport.xml RunMergeCfg.py" print "Now do:\n%s" % cmsRun
def __call__(self): if self.inputFiles == []: msg = "No Input Files provided" raise RuntimeError(msg) try: process = mergeProcess( self.inputFiles, process_name = self.processName, output_file = self.outputFile, output_lfn = self.outputLFN, newDQMIO = self.newDQMIO) except Exception as ex: msg = "Error creating process for Merge:\n" msg += str(ex) raise RuntimeError(msg) psetFile = open("RunMergeCfg.py", "w") psetFile.write(process.dumpPython()) psetFile.close() cmsRun = "cmsRun -j FrameworkJobReport.xml RunMergeCfg.py" print "Now do:\n%s" % cmsRun