示例#1
0
    def merge(self, *inputFiles, **options):
        """
        _merge_

        builds a merge configuration

        """
        msg = "Scenario Implementation %s\n" % self.__class__.__name__
        return mergeProcess(*inputFiles, **options)
示例#2
0
    def merge(self, *inputFiles, **options):
        """
        _merge_

        builds a merge configuration

        """
        msg = "Scenario Implementation %s\n" % self.__class__.__name__
        return mergeProcess(*inputFiles, **options)
示例#3
0
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
示例#4
0
    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
示例#5
0
    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
示例#6
0
文件: RunMerge.py 项目: tuos/cmssw
    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
示例#7
0
    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
示例#8
0
    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
示例#9
0
 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)
示例#10
0
    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)
示例#11
0
    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
示例#12
0
    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
示例#13
0
 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")
示例#14
0
    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
示例#15
0
    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