Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Override specific workflows #7030

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 12 additions & 4 deletions Configuration/PyReleaseValidation/python/MatrixReader.py
@@ -1,4 +1,4 @@

import sys

from Configuration.PyReleaseValidation.WorkFlow import WorkFlow
Expand Down Expand Up @@ -91,6 +91,14 @@ def makeCmd(self, step):
cmd += ' ' + k + ' ' + str(v)
return cfg, input, cmd

def makeStep(self,step,overrides):
from Configuration.PyReleaseValidation.relval_steps import merge
if len(overrides.keys()) > 0:
copyStep=merge([overrides]+[step])
return copyStep
else:
return step

def readMatrix(self, fileNameIn, useInput=None, refRel=None, fromScratch=None):

prefix = self.filesPrefMap[fileNameIn]
Expand Down Expand Up @@ -156,6 +164,7 @@ def readMatrix(self, fileNameIn, useInput=None, refRel=None, fromScratch=None):
commands=[]
wfName = wfInfo[0]
stepList = wfInfo[1]
stepOverrides=wfInfo.overrides
# if no explicit name given for the workflow, use the name of step1
if wfName.strip() == '': wfName = stepList[0]
# option to specialize the wf as the third item in the WF list
Expand Down Expand Up @@ -225,13 +234,12 @@ def readMatrix(self, fileNameIn, useInput=None, refRel=None, fromScratch=None):
stepList.insert(stepIndex,stepName)
"""
name += stepName

if addCom and (not addTo or addTo[stepIndex]==1):
from Configuration.PyReleaseValidation.relval_steps import merge
copyStep=merge(addCom+[self.relvalModule.steps[stepName]])
copyStep=merge(addCom+[self.makeStep(self.relvalModule.steps[stepName],stepOverrides)])
cfg, input, opts = self.makeCmd(copyStep)
else:
cfg, input, opts = self.makeCmd(self.relvalModule.steps[stepName])
cfg, input, opts = self.makeCmd(self.makeStep(self.relvalModule.steps[stepName],stepOverrides))

if input and cfg :
msg = "FATAL ERROR: found both cfg and input for workflow "+str(num)+' step '+stepName
Expand Down
7 changes: 7 additions & 0 deletions Configuration/PyReleaseValidation/python/relval_standard.py
Expand Up @@ -4,6 +4,9 @@
# here only define the workflows as a combination of the steps defined above:
workflows = Matrix()


overridesEv5={'-n':'5'}

# each workflow defines a name and a list of steps to be done.
# if no explicit name/label given for the workflow (first arg),
# the name of step1 will be used
Expand All @@ -12,9 +15,11 @@
workflows[1] = ['', ['ProdMinBias','DIGIPROD1','RECOPROD1']]
workflows[2] = ['', ['ProdTTbar','DIGIPROD1','RECOPROD1']]
workflows[3] = ['', ['ProdQCD_Pt_3000_3500','DIGIPROD1','RECOPROD1']]
workflows.addOverride(3,overridesEv5)
workflows[1301] = ['', ['ProdMinBias_13','DIGIUP15PROD1','RECOPRODUP15','MINIAODMCUP15']]
workflows[1302] = ['', ['ProdTTbar_13','DIGIUP15PROD1','RECOPRODUP15','MINIAODMCUP15']]
workflows[1303] = ['', ['ProdQCD_Pt_3000_3500_13','DIGIUP15PROD1','RECOPRODUP15','MINIAODMCUP15']]
workflows.addOverride(1303,overridesEv5)

### data ###
workflows[4.5] = ['', ['RunCosmicsA','RECOCOSD','ALCACOSD','HARVESTDC']]
Expand Down Expand Up @@ -154,6 +159,7 @@

workflows[9] = ['', ['Higgs200ChargedTaus','DIGI','RECO','HARVEST']]
workflows[13] = ['', ['QCD_Pt_3000_3500','DIGI','RECO','HARVEST']]
workflows.addOverride(13,overridesEv5)
workflows[39] = ['', ['QCD_Pt_600_800','DIGI','RECO','HARVEST']]
workflows[23] = ['', ['JpsiMM','DIGI','RECO','HARVEST']]
workflows[25] = ['', ['TTbar','DIGI','RECO','HARVEST','ALCATT']]
Expand Down Expand Up @@ -189,6 +195,7 @@

workflows[1309] = ['', ['Higgs200ChargedTaus_13','DIGIUP15','RECOUP15','HARVESTUP15','MINIAODMCUP15']]
workflows[1313] = ['', ['QCD_Pt_3000_3500_13','DIGIUP15','RECOUP15','HARVESTUP15','MINIAODMCUP15']]
workflows.addOverride(1313,overridesEv5)
workflows[1339] = ['', ['QCD_Pt_600_800_13','DIGIUP15','RECOUP15','HARVESTUP15','MINIAODMCUP15']]

workflows[1347] = ['', ['Upsilon1SToMuMu_13','DIGIUP15','RECOUP15','HARVESTUP15','MINIAODMCUP15']]
Expand Down
9 changes: 7 additions & 2 deletions Configuration/PyReleaseValidation/python/relval_steps.py
Expand Up @@ -6,6 +6,8 @@ def __setitem__(self,key,value):
else:
self.update({float(key):WF(float(key),value)})

def addOverride(self,key,override):
self[key].addOverride(override)

#the class to collect all possible steps
class Steps(dict):
Expand All @@ -22,7 +24,6 @@ def __setitem__(self,key,value):

def overwrite(self,keypair):
value=self[keypair[1]]
print "overwritting step",keypair[0],"with",keypair[1],str(value)
self.update({keypair[0]:value})

class WF(list):
Expand All @@ -31,11 +32,15 @@ def __init__(self,n,l):
self.num=n
#the actual steps of this WF
self.steps=[]

self.overrides={}
def addOverride(self,overrides):
self.overrides=overrides

def interpret(self,stepsDict):
for s in self:
print 'steps',s,stepsDict[s]
steps.append(stepsDict[s])


InputInfoNDefault=2000000
class InputInfo(object):
Expand Down