3 from Configuration.PyReleaseValidation.WorkFlow
import WorkFlow
4 from Configuration.PyReleaseValidation.MatrixUtil
import InputInfo
43 'relval_highstats':
'hi-' ,
44 'relval_pileup':
'PU-' ,
45 'relval_generator':
'gen-',
46 'relval_extendedgen':
'genExt-',
47 'relval_production':
'prod-' ,
49 'relval_upgrade':
'upg-',
50 'relval_2017':
'2017-',
51 'relval_2023':
'2023-',
52 'relval_identity':
'id-',
53 'relval_machine':
'mach-',
54 'relval_unsch':
'unsch-',
55 'relval_premix':
'premix-' 58 self.
files = [
'relval_standard' ,
74 'relval_highstats':
True ,
76 'relval_generator':
True,
77 'relval_extendedgen':
True,
78 'relval_production':
True,
80 'relval_upgrade':
False,
83 'relval_identity':
False,
84 'relval_machine':
True,
98 for k,v
in step.items():
99 if 'no_exec' in k :
continue 100 if k.lower() ==
'cfg':
103 if k.lower() ==
'input':
110 cmd +=
' ' + k +
' ' +
str(v)
111 return cfg, input, cmd
115 if len(overrides) > 0:
116 copyStep=
merge([overrides]+[step])
121 def readMatrix(self, fileNameIn, useInput=None, refRel=None, fromScratch=None):
125 print "processing", fileNameIn
128 _tmpMod = __import__(
'Configuration.PyReleaseValidation.'+fileNameIn )
129 self.
relvalModule = sys.modules[
'Configuration.PyReleaseValidation.'+fileNameIn]
130 except Exception
as e:
131 print "ERROR importing file ", fileNameIn,
str(e)
134 if useInput
is not None:
135 print "request for INPUT for ", useInput
145 for k
in self.relvalModule.workflows.keys():
151 for k
in self.relvalModule.workflows.keys():
152 fromInput[
float(k)]=0
154 fromInput[
float(i)]=0
157 fromScratch=
map(float,fromScratch)
158 for num
in fromScratch:
164 self.relvalModule.steps.overwrite(p)
169 refRels=refRel.split(
',')
170 if len(refRels)!=len(self.relvalModule.baseDataSetRelease):
172 self.relvalModule.changeRefRelease(
173 self.relvalModule.steps,
174 list(
zip(self.relvalModule.baseDataSetRelease,refRels))
177 self.relvalModule.changeRefRelease(
178 self.relvalModule.steps,
179 [(x,refRel)
for x
in self.relvalModule.baseDataSetRelease]
183 for num, wfInfo
in self.relvalModule.workflows.items():
187 stepOverrides=wfInfo.overrides
189 if wfName.strip() ==
'': wfName = stepList[0]
195 if not isinstance(addCom, list): addCom=[addCom]
200 while len(addTo)!=len(stepList):
209 ilevel=fromInput[num]
211 for (stepIr,step)
in enumerate(reversed(stepList)):
213 stepI=(len(stepList)-stepIr)-1
219 testName=
'__'.
join(stepList[0:stepI+1])+
'INPUT' 221 testName=step+
'INPUT' 223 if testName
in self.relvalModule.steps.keys():
225 stepList[stepI]=testName
228 for p
in range(stepI):
234 for (stepI,step)
in enumerate(stepList):
240 'RECODFROMRAWRECO',
'SKIMD',
'SKIMCOSD',
'SKIMDreHLT' 246 if len(name) > 0 : name +=
'+' 251 if step+'INPUT' in self.relvalModule.steps.keys(): 252 stepName = step+"INPUT" 253 stepList.remove(step) 254 stepList.insert(stepIndex,stepName) 257 if addCom
and (
not addTo
or addTo[stepIndex]==1):
259 copyStep=
merge(addCom+[self.
makeStep(self.relvalModule.steps[stepName],stepOverrides)])
260 cfg, input, opts = self.
makeCmd(copyStep)
262 cfg, input, opts = self.
makeCmd(self.
makeStep(self.relvalModule.steps[stepName],stepOverrides))
265 msg =
"FATAL ERROR: found both cfg and input for workflow "+
str(num)+
' step '+stepName
274 cmd =
'cmsDriver.py '+cfg+
' '+opts
276 cmd =
'cmsDriver.py step'+
str(stepIndex+1)+
' '+opts
278 cmd+=
' --io %s.io --python %s.py'%(stepName,stepName)
281 if stepIndex
in self.
apply or stepName
in self.
apply:
286 cmd=cmd.replace(
'DQMIO',
'DQM')
287 cmd=cmd.replace(
'--filetype DQM',
'')
289 ranStepList.append(stepName)
292 self.
workFlowSteps[(num,prefix)] = (num, name, commands, ranStepList)
297 def showRaw(self, useInput, refRel=None, fromScratch=None, what='all',step1Only=False,selected=None):
300 selected=
map(float,selected)
301 for matrixFile
in self.
files:
305 if self.
what !=
'all' and self.
what not in matrixFile:
306 print "ignoring non-requested file",matrixFile
310 print "ignoring file not used by default (enable with -w)",matrixFile
314 self.
readMatrix(matrixFile, useInput, refRel, fromScratch)
315 except Exception
as e:
316 print "ERROR reading file:", matrixFile,
str(e)
321 dataFileName = matrixFile.replace(
'relval_',
'cmsDriver_')+
'_hlt.txt' 322 outFile = open(dataFileName,
'w')
324 print "found ", len(self.
workFlowSteps),
' workflows for ', dataFileName
325 ids = sorted(self.workFlowSteps.keys())
330 if selected
and not (key[0]
in selected):
333 if key[0]==203.1
or key[0]==204.1
or key[0]==205.1
or key[0]==4.51
or key[0]==4.52:
continue 336 wfName,stepNames= name.split(
'+',1)
338 stepNames=stepNames.replace(
'+RECODFROMRAWRECO',
'')
339 stepNames=stepNames.replace(
'+SKIMCOSD',
'')
340 stepNames=stepNames.replace(
'+SKIMD',
'')
341 if 'HARVEST' in stepNames:
343 exactb=stepNames.index(
'+HARVEST')
344 exacte=stepNames.index(
'+',exactb+1)
if (
'+' in stepNames[exactb+1:])
else (len(stepNames))
345 stepNames=stepNames.replace(stepNames[exactb:exacte],
'')
348 step1,otherSteps = stepNames.split(
'+',1)
350 line =
str(num) +
' ++ '+ wfName
351 if otherSteps
and not step1Only:
352 line +=
' ++ ' +otherSteps.replace(
'+',
',')
356 if not isinstance(commands[0],str):
357 inputInfo=commands[0]
359 for (i,c)
in enumerate(otherSteps.split(
'+')):
361 for p
in range(len(indexAndSteps),i+2):
362 indexAndSteps.append(set())
363 indexAndSteps[i+1].
add((c,commands[i+1]))
367 if step1Only:
continue 368 line +=
' ++ REALDATA: '+inputInfo.dataSet
369 if inputInfo.run!=[]: line +=
', RUN:'+
'|'.
join(
map(str,inputInfo.run))
370 line +=
', FILES: ' +
str(inputInfo.files)
371 line +=
', EVENTS: '+
str(inputInfo.events)
372 if inputInfo.label!=
'':
373 line +=
', LABEL: ' +inputInfo.label
374 line +=
', LOCATION:'+inputInfo.location
377 line +=
' @@@ '+commands[0]
379 line=line.replace(
'DQMIO',
'DQM')
381 outFile.write(line+
'\n')
384 outFile.write(
'\n'+
'\n')
385 if step1Only:
continue 387 for (index,s)
in enumerate(indexAndSteps):
388 for (stepName,cmd)
in s:
390 if 'dasquery.log' in cmd:
continue 391 line =
'STEP%d ++ '%(stepIndex,) +stepName +
' @@@ '+cmd
393 line=line.replace(
'DQMIO',
'DQM')
394 outFile.write(line+
'\n')
395 outFile.write(
'\n'+
'\n')
397 print "wrote ",writtenWF,
' workflow'+(
's' if (writtenWF!=1)
else ''),
' to ', outFile.name
403 if 'cms/caf/cms' in os.environ[
'CMS_PATH']:
408 if isinstance(workflow.cmds[0], InputInfo):
409 if cafVeto
and (workflow.cmds[0].location ==
'CAF' and not onCAF):
411 workflows.append(workflow)
416 if selected: selected =
map(float,selected)
419 fmt1 =
"%-6s %-35s [1]: %s ..." 420 fmt2 =
" %35s [%d]: %s ..." 421 print "\nfound a total of ", len(wfs),
' workflows:' 423 print " of which the following", len(selected),
'were selected:' 426 fmt1 =
"%-6s %-35s [1]: %s " 427 fmt2 =
" %35s [%d]: %s" 431 if selected
and float(wf.numId)
not in selected:
continue 432 if extended:
print '' 434 for i
in range(len(N),len(wf.cmds)): N.append(0)
436 wfName, stepNames = wf.nameId.split(
'+',1)
437 for i,s
in enumerate(wf.cmds):
440 print fmt1 % (wf.numId, stepNames, (
str(s)+
' ')[:maxLen])
442 print fmt2 % (
' ', i+1, (
str(s)+
' ')[:maxLen])
444 print "%-6s %-35s "% (wf.numId, stepNames)
447 for i,n
in enumerate(N):
448 if n:
print n,
'workflows with',i+1,
'steps' 457 keyList = self.workFlowSteps.keys()
461 if pref != prefixIn :
continue 466 num, name, commands, stepList = val
467 nameId =
str(num)+
'_'+name
469 print "==> duplicate name found for ", nameId
470 print ' keeping : ', self.
nameList[nameId]
471 print ' ignoring : ', val
475 self.workFlows.append(
WorkFlow(num, name, commands=commands))
479 def prepare(self, useInput=None, refRel='', fromScratch=None):
481 for matrixFile
in self.
files:
482 if self.
what !=
'all' and self.
what not in matrixFile:
483 print "ignoring non-requested file",matrixFile
486 print "ignoring",matrixFile,
"from default matrix" 490 self.
readMatrix(matrixFile, useInput, refRel, fromScratch)
491 except Exception
as e:
492 print "ERROR reading file:", matrixFile,
str(e)
497 except Exception
as e:
498 print "ERROR creating workflows :",
str(e)
502 def show(self, selected=None, extended=True, cafVeto=True):
505 print '\n',
'-'*80,
'\n' 511 pickle.dump(self.
workFlows, open(
'theMatrix.pkl',
'w') )
revertDqmio
maybe we want too level deep input
def prepare(self, useInput=None, refRel='', fromScratch=None)
def readMatrix(self, fileNameIn, useInput=None, refRel=None, fromScratch=None)
OutputIterator zip(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp)
def makeStep(self, step, overrides)
def showWorkFlows(self, selected=None, extended=True, cafVeto=True)
def show(self, selected=None, extended=True, cafVeto=True)
def showRaw(self, useInput, refRel=None, fromScratch=None, what='all', step1Only=False, selected=None)
def reset(self, what='all')
void add(std::map< std::string, TH1 * > &h, TH1 *hist)
static std::string join(char **cmd)
def createWorkFlows(self, fileNameIn)
def workFlowsByLocation(self, cafVeto=True)
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run