当前位置: 首页>>代码示例>>Python>>正文


Python StepFactory.getStepTemplate方法代码示例

本文整理汇总了Python中WMCore.WMSpec.Steps.StepFactory.getStepTemplate方法的典型用法代码示例。如果您正苦于以下问题:Python StepFactory.getStepTemplate方法的具体用法?Python StepFactory.getStepTemplate怎么用?Python StepFactory.getStepTemplate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在WMCore.WMSpec.Steps.StepFactory的用法示例。


在下文中一共展示了StepFactory.getStepTemplate方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: testA

# 需要导入模块: from WMCore.WMSpec.Steps import StepFactory [as 别名]
# 或者: from WMCore.WMSpec.Steps.StepFactory import getStepTemplate [as 别名]
 def testA(self):
     """template"""
     try:
         cmssw = StepFactory.getStepTemplate("CMSSW")
     except Exception, ex:
         msg = "Error loading Step Template of Type CMSSW\n"
         msg += str(ex)
         self.fail(msg)
开发者ID:AndrewLevin,项目名称:WMCore,代码行数:10,代码来源:StepFactory_t.py

示例2: testBuild

# 需要导入模块: from WMCore.WMSpec.Steps import StepFactory [as 别名]
# 或者: from WMCore.WMSpec.Steps.StepFactory import getStepTemplate [as 别名]
 def testBuild(self):
     """ build a directory and verify it exists"""
     mytemplate = StepFactory.getStepTemplate("CMSSW")
     mystep = WMStep.makeWMStep("DummyStagingStep")
     mytemplate(mystep.data)
     self.testBuilder(mystep.data, "testTask", self.tempDir)
     self.assertTrue(os.path.exists(self.tempDir))
     self.assertTrue(os.path.exists("%s/DummyStagingStep/__init__.py" % self.tempDir))
开发者ID:dciangot,项目名称:WMCore,代码行数:10,代码来源:CMSSW_t.py

示例3: setupNextSteps

# 需要导入模块: from WMCore.WMSpec.Steps import StepFactory [as 别名]
# 或者: from WMCore.WMSpec.Steps.StepFactory import getStepTemplate [as 别名]
    def setupNextSteps(self, task, origArgs):
        """
        _setupNextSteps_

        Modify the step one task to include N more CMSSW steps and
        chain the output between all three steps.
        """
        configCacheUrl = self.configCacheUrl or self.couchURL
        stepMapping = {}
        stepMapping.setdefault(origArgs['Step1']['StepName'], ('Step1', 'cmsRun1'))

        for i in range(2, self.stepChain + 1):
            currentStepNumber = "Step%d" % i
            currentCmsRun = "cmsRun%d" % i
            stepMapping.setdefault(origArgs[currentStepNumber]['StepName'], (currentStepNumber, currentCmsRun))
            taskConf = {}
            for k, v in origArgs[currentStepNumber].iteritems():
                taskConf[k] = v

            parentStepNumber = stepMapping.get(taskConf['InputStep'])[0]
            parentCmsRun = stepMapping.get(taskConf['InputStep'])[1]
            parentCmsswStep = task.getStep(parentCmsRun)
            parentCmsswStepHelper = parentCmsswStep.getTypeHelper()

            # Set default values for the task parameters
            self.modifyTaskConfiguration(taskConf, False, 'InputDataset' not in taskConf)
            globalTag = taskConf.get("GlobalTag", self.globalTag)
            frameworkVersion = taskConf.get("CMSSWVersion", self.frameworkVersion)
            scramArch = taskConf.get("ScramArch", self.scramArch)

            childCmssw = parentCmsswStep.addTopStep(currentCmsRun)
            childCmssw.setStepType("CMSSW")
            template = StepFactory.getStepTemplate("CMSSW")
            template(childCmssw.data)

            childCmsswStepHelper = childCmssw.getTypeHelper()
            childCmsswStepHelper.setGlobalTag(globalTag)
            childCmsswStepHelper.setupChainedProcessing(parentCmsRun, taskConf['InputFromOutputModule'])
            childCmsswStepHelper.cmsswSetup(frameworkVersion, softwareEnvironment="", scramArch=scramArch)
            childCmsswStepHelper.setConfigCache(configCacheUrl, taskConf['ConfigCacheID'], self.couchDBName)

            # Pileup check
            taskConf["PileupConfig"] = parsePileupConfig(taskConf["MCPileup"], taskConf["DataPileup"])
            if taskConf["PileupConfig"]:
                self.setupPileup(task, taskConf['PileupConfig'])

            # Handling the output modules
            parentKeepOutput = strToBool(origArgs[parentStepNumber].get('KeepOutput', True))
            parentCmsswStepHelper.keepOutput(parentKeepOutput)
            childKeepOutput = strToBool(taskConf.get('KeepOutput', True))
            childCmsswStepHelper.keepOutput(childKeepOutput)
            self.setupOutputModules(task, taskConf["ConfigCacheID"], currentCmsRun, childKeepOutput,
                                    taskConf['StepName'])

        # Closing out the task configuration. The last step output must be saved/merged
        childCmsswStepHelper.keepOutput(True)

        return
开发者ID:AndresTanasijczuk,项目名称:WMCore,代码行数:60,代码来源:StepChain.py

示例4: testCustomBuild

# 需要导入模块: from WMCore.WMSpec.Steps import StepFactory [as 别名]
# 或者: from WMCore.WMSpec.Steps.StepFactory import getStepTemplate [as 别名]
 def testCustomBuild(self):
     """ add in a custom directory and verify it gets created"""
     mytemplate = StepFactory.getStepTemplate("CMSSW")
     mystep = WMStep.makeWMStep("DummyStagingStep")
     mytemplate(mystep.data)
     helper = TemplateNS.Template.CoreHelper(mystep.data)
     helper.addDirectory("testdirectory1")
     helper.addDirectory("testdirectory2/testsubdir")
     self.testBuilder(mystep.data, "testTask", self.tempDir)
     self.assertTrue(os.path.exists(self.tempDir))
     self.assertTrue(os.path.exists("%s/DummyStagingStep/__init__.py" % self.tempDir))
     self.assertTrue(os.path.exists("%s/DummyStagingStep/testdirectory1" % self.tempDir))
     self.assertTrue(os.path.exists("%s/%s/testdirectory2/testsubdir" % (self.tempDir, "DummyStagingStep")))
开发者ID:dciangot,项目名称:WMCore,代码行数:15,代码来源:CMSSW_t.py

示例5: createTestStep

# 需要导入模块: from WMCore.WMSpec.Steps import StepFactory [as 别名]
# 或者: from WMCore.WMSpec.Steps.StepFactory import getStepTemplate [as 别名]
    def createTestStep(self):
        """
        _createTestStep_

        Create a test step that can be passed to the setup script.

        """
        newStep = WMStep("cmsRun1")
        newStepHelper = CMSSWStepHelper(newStep)
        newStepHelper.setStepType("CMSSW")
        newStepHelper.setGlobalTag("SomeGlobalTag")
        stepTemplate = StepFactory.getStepTemplate("CMSSW")
        stepTemplate(newStep)
        newStep.application.command.configuration = "PSet.py"
        return newStepHelper
开发者ID:BrunoCoimbra,项目名称:WMCore,代码行数:17,代码来源:SetupCMSSWPset_t.py

示例6: buildWorkload

# 需要导入模块: from WMCore.WMSpec.Steps import StepFactory [as 别名]
# 或者: from WMCore.WMSpec.Steps.StepFactory import getStepTemplate [as 别名]
    def buildWorkload(self):
        """
        _buildWorkload_

        Build the workload given all of the input parameters.

        Not that there will be LogCollect tasks created for each processing
        task and Cleanup tasks created for each merge task.

        """
        workload = self.createWorkload()
        workload.setDashboardActivity("tier0")
        self.reportWorkflowToDashboard(workload.getDashboardActivity())

        cmsswStepType = "CMSSW"
        taskType = "Processing"

        # complete output configuration
        for output in self.outputs:
            output['moduleLabel'] = "write_%s_%s" % (output['primaryDataset'],
                                                     output['dataTier'])

        # finalize splitting parameters
        mySplitArgs = self.expressSplitArgs.copy()
        mySplitArgs['algo_package'] = "T0.JobSplitting"

        expressTask = workload.newTask("Express")

        #
        # need to split this up into two separate code paths
        # one is direct reco from the streamer files
        # the other is conversion and then reco
        #
        if self.recoFrameworkVersion == None or self.recoFrameworkVersion == self.frameworkVersion:

            expressRecoStepName = "cmsRun1"

            scenarioArgs = { 'globalTag' : self.globalTag,
                             'globalTagTransaction' : self.globalTagTransaction,
                             'skims' : self.alcaSkims,
                             'dqmSeq' : self.dqmSequences,
                             'outputs' : self.outputs,
                             'inputSource' : "DAT" }

            if self.globalTagConnect:
                scenarioArgs['globalTagConnect'] = self.globalTagConnect

            expressOutMods = self.setupProcessingTask(expressTask, taskType,
                                                      scenarioName = self.procScenario,
                                                      scenarioFunc = "expressProcessing",
                                                      scenarioArgs = scenarioArgs,
                                                      splitAlgo = "Express",
                                                      splitArgs = mySplitArgs,
                                                      stepType = cmsswStepType,
                                                      forceUnmerged = True)
        else:

            expressRecoStepName = "cmsRun2"

            conversionOutMods = self.setupProcessingTask(expressTask, taskType,
                                                         scenarioName = self.procScenario,
                                                         scenarioFunc = "repack",
                                                         scenarioArgs = { 'outputs' : [ { 'dataTier' : "RAW",
                                                                                          'eventContent' : "ALL",
                                                                                          'primaryDataset' : self.specialDataset,
                                                                                          'moduleLabel' : "write_RAW" } ] },
                                                         splitAlgo = "Express",
                                                         splitArgs = mySplitArgs,
                                                         stepType = cmsswStepType,
                                                         forceUnmerged = True)

            # there is only one
            conversionOutLabel = conversionOutMods.keys()[0]

            # everything coming after should use the reco CMSSW version and Scram Arch
            self.frameworkVersion = self.recoFrameworkVersion
            self.scramArch = self.recoScramArch
            
            # add a second step doing the reconstruction
            parentCmsswStep = expressTask.getStep("cmsRun1")
            parentCmsswStepHelper = parentCmsswStep.getTypeHelper()
            parentCmsswStepHelper.keepOutput(False)
            stepTwoCmssw = parentCmsswStep.addTopStep("cmsRun2")
            stepTwoCmssw.setStepType(cmsswStepType)

            template = StepFactory.getStepTemplate(cmsswStepType)
            template(stepTwoCmssw.data)

            stepTwoCmsswHelper = stepTwoCmssw.getTypeHelper()

            if self.multicore:
                # if multicore, poke in the number of cores setting
                stepTwoCmsswHelper.setNumberOfCores(self.multicoreNCores)

            stepTwoCmsswHelper.setGlobalTag(self.globalTag)
            stepTwoCmsswHelper.setupChainedProcessing("cmsRun1", conversionOutLabel)
            stepTwoCmsswHelper.cmsswSetup(self.frameworkVersion, softwareEnvironment = "",
                                          scramArch = self.scramArch)

            scenarioFunc = "expressProcessing"
#.........这里部分代码省略.........
开发者ID:ericvaandering,项目名称:T0,代码行数:103,代码来源:Express.py

示例7: setupNextSteps

# 需要导入模块: from WMCore.WMSpec.Steps import StepFactory [as 别名]
# 或者: from WMCore.WMSpec.Steps.StepFactory import getStepTemplate [as 别名]
    def setupNextSteps(self, task, origArgs):
        """
        _setupNextSteps_

        Modify the step one task to include N more CMSSW steps and
        chain the output between all three steps.
        """
        configCacheUrl = self.configCacheUrl or self.couchURL

        for i in range(2, self.stepChain + 1):
            inputStepName = "cmsRun%d" % (i-1)
            parentCmsswStep = task.getStep(inputStepName)
            parentCmsswStepHelper = parentCmsswStep.getTypeHelper()
            parentCmsswStepHelper.keepOutput(False)

            currentStepName = "cmsRun%d" % i
            taskConf = {}
            for k, v in origArgs["Step%d" % i].iteritems():
                taskConf[k] = v
            # Set default values to task parameters
            self.modifyTaskConfiguration(taskConf, False, 'InputDataset' not in taskConf)
            globalTag = taskConf.get("GlobalTag", self.globalTag)

            childCmssw = parentCmsswStep.addTopStep(currentStepName)
            childCmssw.setStepType("CMSSW")
            template = StepFactory.getStepTemplate("CMSSW")
            template(childCmssw.data)

            childCmsswHelper = childCmssw.getTypeHelper()
            childCmsswHelper.setGlobalTag(globalTag)
            childCmsswHelper.setupChainedProcessing(inputStepName, taskConf['InputFromOutputModule'])
            # Assuming we cannot change the CMSSW version inside the same job
            childCmsswHelper.cmsswSetup(self.frameworkVersion, softwareEnvironment="",
                                        scramArch=self.scramArch)
            childCmsswHelper.setConfigCache(configCacheUrl, taskConf['ConfigCacheID'],
                                            self.couchDBName)
            childCmsswHelper.keepOutput(False)

            # Pileup check
            taskConf["PileupConfig"] = parsePileupConfig(taskConf["MCPileup"], taskConf["DataPileup"])
            if taskConf["PileupConfig"]:
                self.setupPileup(task, taskConf['PileupConfig'])

            # Handling the output modules
            outputMods = {}
            configOutput = self.determineOutputModules(configDoc=taskConf['ConfigCacheID'],
                                                       couchURL=configCacheUrl,
                                                       couchDBName=self.couchDBName)
            for outputModuleName in configOutput.keys():
                outputModule = self.addOutputModule(task, outputModuleName,
                                                    self.inputPrimaryDataset,
                                                    configOutput[outputModuleName]["dataTier"],
                                                    configOutput[outputModuleName]["filterName"],
                                                    stepName=currentStepName)
                outputMods[outputModuleName] = outputModule

        # Closing out the task configuration
        # Only the last step output is important :-)
        childCmsswHelper.keepOutput(True)
        self.addMergeTasks(task, currentStepName, outputMods)

        # Override task parameters by the workload ones in case of their absence
        self.updateCommonParams(task, taskConf)
        return
开发者ID:sofian86,项目名称:WMCore,代码行数:66,代码来源:StepChain.py

示例8: setupNextSteps

# 需要导入模块: from WMCore.WMSpec.Steps import StepFactory [as 别名]
# 或者: from WMCore.WMSpec.Steps.StepFactory import getStepTemplate [as 别名]
    def setupNextSteps(self, task, origArgs):
        """
        _setupNextSteps_

        Modify the step one task to include N more CMSSW steps and
        chain the output between all three steps.
        """
        self.stepParentageMapping.setdefault(origArgs['Step1']['StepName'], {})

        for i in range(2, self.stepChain + 1):
            currentStepNumber = "Step%d" % i
            currentCmsRun = "cmsRun%d" % i
            taskConf = {}
            for k, v in origArgs[currentStepNumber].items():
                taskConf[k] = v

            parentStepNumber = self.stepMapping.get(taskConf['InputStep'])[0]
            parentCmsRun = self.stepMapping.get(taskConf['InputStep'])[1]
            parentCmsswStep = task.getStep(parentCmsRun)
            parentCmsswStepHelper = parentCmsswStep.getTypeHelper()

            # Set default values for the task parameters
            self.modifyTaskConfiguration(taskConf, False, 'InputDataset' not in taskConf)
            globalTag = self.getStepValue('GlobalTag', taskConf, self.globalTag)
            frameworkVersion = self.getStepValue('CMSSWVersion', taskConf, self.frameworkVersion)
            scramArch = self.getStepValue('ScramArch', taskConf, self.scramArch)

            currentCmssw = parentCmsswStep.addTopStep(currentCmsRun)
            currentCmssw.setStepType("CMSSW")
            template = StepFactory.getStepTemplate("CMSSW")
            template(currentCmssw.data)

            currentCmsswStepHelper = currentCmssw.getTypeHelper()
            currentCmsswStepHelper.setGlobalTag(globalTag)
            currentCmsswStepHelper.setupChainedProcessing(parentCmsRun, taskConf['InputFromOutputModule'])
            currentCmsswStepHelper.cmsswSetup(frameworkVersion, softwareEnvironment="", scramArch=scramArch)
            currentCmsswStepHelper.setConfigCache(self.configCacheUrl, taskConf['ConfigCacheID'], self.couchDBName)

            # multicore settings
            multicore = self.multicore
            eventStreams = self.eventStreams
            if taskConf['Multicore'] > 0:
                multicore = taskConf['Multicore']
            if taskConf.get('EventStreams') >= 0:
                eventStreams = taskConf['EventStreams']

            currentCmsswStepHelper.setNumberOfCores(multicore, eventStreams)

            # Pileup check
            taskConf["PileupConfig"] = parsePileupConfig(taskConf["MCPileup"], taskConf["DataPileup"])
            if taskConf["PileupConfig"]:
                self.setupPileup(task, taskConf['PileupConfig'], stepName=currentCmsRun)

            # Handling the output modules in order to decide whether we should
            # stage them out and report them in the Report.pkl file
            parentKeepOutput = strToBool(origArgs[parentStepNumber].get('KeepOutput', True))
            parentCmsswStepHelper.keepOutput(parentKeepOutput)
            childKeepOutput = strToBool(taskConf.get('KeepOutput', True))
            currentCmsswStepHelper.keepOutput(childKeepOutput)
            self.setupOutputModules(task, taskConf, currentCmsRun, childKeepOutput)

        # Closing out the task configuration. The last step output must be saved/merged
        currentCmsswStepHelper.keepOutput(True)

        return
开发者ID:dmwm,项目名称:WMCore,代码行数:67,代码来源:StepChain.py


注:本文中的WMCore.WMSpec.Steps.StepFactory.getStepTemplate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。