2 from __future__
import print_function
5 from Configuration.PyReleaseValidation.MatrixReader
import MatrixReader
6 from Configuration.PyReleaseValidation.MatrixRunner
import MatrixRunner
7 from Configuration.PyReleaseValidation.MatrixInjector
import MatrixInjector,performInjectionOptionTest
14 mrd.showRaw(opt.useInput, opt.refRel, opt.fromScratch, opt.raw, opt.step1Only, selected=opt.testList)
23 mrd.prepare(opt.useInput, opt.refRel, opt.fromScratch)
27 definedSet = set([dwf.numId
for dwf
in mrd.workFlows])
28 testSet = set(opt.testList)
29 undefSet = testSet - definedSet
30 if len(undefSet)>0:
raise ValueError(
'Undefined workflows: '+
', '.
join(
map(str,
list(undefSet))))
34 mrd.show(opt.testList, opt.extended, opt.cafVeto)
35 if opt.testList :
print(
'testListected items:', opt.testList)
37 mRunnerHi =
MatrixRunner(mrd.workFlows, opt.nProcs, opt.nThreads)
38 ret = mRunnerHi.runTests(opt)
42 print(
'Cannot go on with wmagent injection with failing workflows')
44 wfInjector =
MatrixInjector(opt,mode=opt.wmcontrol,options=opt.wmoptions)
45 ret= wfInjector.prepare(mrd,
54 if __name__ ==
'__main__':
93 'jetmc': [5.1, 13, 15, 25, 38, 39],
94 'metmc' : [5.1, 15, 25, 37, 38, 39],
95 'muonmc' : [5.1, 124.4, 124.5, 20, 21, 22, 23, 25, 30],
100 usage =
'usage: runTheMatrix.py --show -s ' 102 parser = optparse.OptionParser(usage)
104 parser.add_option(
'-b',
'--batchName',
105 help=
'relval batch: suffix to be appended to Campaign name',
110 parser.add_option(
'-m',
'--memoryOffset',
111 help=
'memory of the wf for single core',
115 parser.add_option(
'--addMemPerCore',
116 help=
'increase of memory per each n > 1 core: memory(n_core) = memoryOffset + (n_core-1) * memPerCore',
120 parser.add_option(
'-j',
'--nproc',
121 help=
'number of processes. 0 Will use 4 processes, not execute anything but create the wfs',
125 parser.add_option(
'-t',
'--nThreads',
126 help=
'number of threads per process to use in cmsRun.',
131 parser.add_option(
'-n',
'--showMatrix',
132 help=
'Only show the worflows. Use --ext to show more',
137 parser.add_option(
'-e',
'--extended',
138 help=
'Show details of workflows, used with --show',
143 parser.add_option(
'-s',
'--selected',
144 help=
'Run a pre-defined selected matrix of wf. Deprecated, please use -l limited',
149 parser.add_option(
'-l',
'--list',
150 help=
'Coma separated list of workflow to be shown or ran. Possible keys are also '+
str(predefinedSet.keys())+
'. and wild card like muon, or mc',
154 parser.add_option(
'-r',
'--raw',
155 help=
'Temporary dump the .txt needed for prodAgent interface. To be discontinued soon. Argument must be the name of the set (standard, pileup,...)',
158 parser.add_option(
'-i',
'--useInput',
159 help=
'Use recyling where available. Either all, or a coma separated list of wf number.',
163 parser.add_option(
'-w',
'--what',
164 help=
'Specify the set to be used. Argument must be the name of the set (standard, pileup,...)',
168 parser.add_option(
'--step1',
169 help=
'Used with --raw. Limit the production to step1',
173 parser.add_option(
'--maxSteps',
174 help=
'Only run maximum on maxSteps. Used when we are only interested in first n steps.',
179 parser.add_option(
'--fromScratch',
180 help=
'Coma separated list of wf to be run without recycling. all is not supported as default.',
184 parser.add_option(
'--refRelease',
185 help=
'Allow to modify the recycling dataset version',
189 parser.add_option(
'--wmcontrol',
190 help=
'Create the workflows for injection to WMAgent. In the WORKING. -wmcontrol init will create the the workflows, -wmcontrol test will dryRun a test, -wmcontrol submit will submit to wmagent',
191 choices=[
'init',
'test',
'submit',
'force'],
195 parser.add_option(
'--revertDqmio',
196 help=
'When submitting workflows to wmcontrol, force DQM outout to use pool and not DQMIO',
197 choices=[
'yes',
'no'],
201 parser.add_option(
'--optionswm',
202 help=
'Specify a few things for wm injection',
205 parser.add_option(
'--keep',
206 help=
'allow to specify for which coma separated steps the output is needed',
208 parser.add_option(
'--label',
209 help=
'allow to give a special label to the output dataset name',
211 parser.add_option(
'--command',
212 help=
'provide a way to add additional command to all of the cmsDriver commands in the matrix',
216 parser.add_option(
'--apply',
217 help=
'allow to use the --command only for 1 coma separeated',
220 parser.add_option(
'--workflow',
221 help=
'define a workflow to be created or altered from the matrix',
226 parser.add_option(
'--dryRun',
227 help=
'do not run the wf at all',
232 parser.add_option(
'--testbed',
233 help=
'workflow injection to cmswebtest (you need dedicated rqmgr account)',
238 parser.add_option(
'--noCafVeto',
239 help=
'Run from any source, ignoring the CAF label',
244 parser.add_option(
'--overWrite',
245 help=
'Change the content of a step for another. List of pairs.',
249 parser.add_option(
'--noRun',
250 help=
'Remove all run list selection from wfs',
255 parser.add_option(
'--das-options',
256 help=
'Options to be passed to dasgoclient.',
261 parser.add_option(
'--job-reports',
262 help=
'Dump framework job reports',
267 parser.add_option(
'--ibeos',
268 help=
'Use IB EOS site configuration',
273 opt,args = parser.parse_args()
276 try:
from commands
import getstatusoutput
as run_cmd
277 except:
from subprocess
import getstatusoutput
as run_cmd
279 ibeos_cache = os.path.join(os.getenv(
"LOCALRT"),
"ibeos_cache.txt")
280 if not os.path.exists(ibeos_cache):
281 err, out = run_cmd(
"curl -L -s -o %s https://raw.githubusercontent.com/cms-sw/cms-sw.github.io/master/das_queries/ibeos.txt" % ibeos_cache)
283 run_cmd(
"rm -f %s" % ibeos_cache)
284 print(
"Error: Unable to download ibeos cache information")
288 for cmssw_env
in [
"CMSSW_BASE",
"CMSSW_RELEASE_BASE" ]:
289 cmssw_base = os.getenv(cmssw_env,
None)
290 if not cmssw_base:
continue 291 cmssw_base = os.path.join(cmssw_base,
"src/Utilities/General/ibeos")
292 if os.path.exists(cmssw_base):
293 os.environ[
"PATH"]=cmssw_base+
":"+os.getenv(
"PATH")
294 os.environ[
"CMS_PATH"]=
"/cvmfs/cms-ib.cern.ch" 295 os.environ[
"CMSSW_USE_IBEOS"]=
"true" 296 print(
">> WARNING: You are using SITECONF from /cvmfs/cms-ib.cern.ch")
299 print(
'Deprecated, please use -l limited')
300 if opt.testList: opt.testList+=
',limited' 301 else: opt.testList=
'limited' 309 opt.apply=
map(stepOrIndex,opt.apply.split(
','))
311 opt.keep=
map(stepOrIndex,opt.keep.split(
','))
317 for entry
in opt.testList.split(
','):
318 if not entry:
continue 320 for k
in predefinedSet:
321 if k.lower().startswith(entry.lower())
or k.lower().endswith(entry.lower()):
322 testList.extend(predefinedSet[k])
327 testList.append(
float(entry))
329 print(entry,
'is not a possible selected entry')
331 opt.testList =
list(set(testList))
334 if opt.useInput: opt.useInput = opt.useInput.split(
',')
335 if opt.fromScratch: opt.fromScratch = opt.fromScratch.split(
',')
336 if opt.nProcs: opt.nProcs=
int(opt.nProcs)
337 if opt.nThreads: opt.nThreads=
int(opt.nThreads)
338 if (opt.memoryOffset): opt.memoryOffset=
int(opt.memoryOffset)
339 if (opt.memPerCore): opt.memPerCore=
int(opt.memPerCore)
344 opt.overWrite=eval(opt.overWrite)
346 if opt.raw
and opt.show:
def performInjectionOptionTest(opt)
S & print(S &os, JobReport::InputFile const &f)
static std::string join(char **cmd)
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