CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes
MatrixInjector.MatrixInjector Class Reference
Inheritance diagram for MatrixInjector.MatrixInjector:

Public Member Functions

def __init__
 
def prepare
 
def submit
 
def upload
 
def uploadConf
 

Public Attributes

 chainDicts
 
 couch
 
 couchCache
 
 count
 
 DbsUrl
 
 defaultChain
 
 defaultHarvest
 
 defaultInput
 
 defaultScratch
 
 defaultTask
 
 dqmgui
 
 group
 
 keep
 
 label
 
 memoryOffset
 
 memPerCore
 
 speciallabel
 
 testMode
 
 user
 
 version
 
 wmagent
 

Detailed Description

Definition at line 36 of file MatrixInjector.py.

Constructor & Destructor Documentation

def MatrixInjector.MatrixInjector.__init__ (   self,
  opt,
  mode = 'init',
  options = '' 
)

Definition at line 38 of file MatrixInjector.py.

38 
39  def __init__(self,opt,mode='init',options=''):
40  self.count=1040
41 
42  self.dqmgui=None
43  self.wmagent=None
44  for k in options.split(','):
45  if k.startswith('dqm:'):
46  self.dqmgui=k.split(':',1)[-1]
47  elif k.startswith('wma:'):
48  self.wmagent=k.split(':',1)[-1]
49 
50  self.testMode=((mode!='submit') and (mode!='force'))
51  self.version =1
52  self.keep = opt.keep
53  self.memoryOffset = opt.memoryOffset
54  self.memPerCore = opt.memPerCore
55 
56  #wagemt stuff
57  if not self.wmagent:
58  self.wmagent=os.getenv('WMAGENT_REQMGR')
59  if not self.wmagent:
60  if not opt.testbed :
61  self.wmagent = 'cmsweb.cern.ch'
62  self.DbsUrl = "https://"+self.wmagent+"/dbs/prod/global/DBSReader"
63  else :
64  self.wmagent = 'cmsweb-testbed.cern.ch'
65  self.DbsUrl = "https://"+self.wmagent+"/dbs/int/global/DBSReader"
66 
67  if not self.dqmgui:
68  self.dqmgui="https://cmsweb.cern.ch/dqm/relval"
69  #couch stuff
70  self.couch = 'https://'+self.wmagent+'/couchdb'
71 # self.couchDB = 'reqmgr_config_cache'
72  self.couchCache={} # so that we do not upload like crazy, and recyle cfgs
73  self.user = os.getenv('USER')
74  self.group = 'ppd'
75  self.label = 'RelValSet_'+os.getenv('CMSSW_VERSION').replace('-','')+'_v'+str(self.version)
76  self.speciallabel=''
77  if opt.label:
78  self.speciallabel= '_'+opt.label
79 
80 
81  if not os.getenv('WMCORE_ROOT'):
82  print '\n\twmclient is not setup properly. Will not be able to upload or submit requests.\n'
83  if not self.testMode:
84  print '\n\t QUIT\n'
85  sys.exit(-18)
86  else:
87  print '\n\tFound wmclient\n'
88 
89  self.defaultChain={
90  "RequestType" : "TaskChain", #this is how we handle relvals
91  "SubRequestType" : "RelVal", #this is how we handle relvals, now that TaskChain is also used for central MC production
92  "RequestPriority": 500000,
93  "Requestor": self.user, #Person responsible
94  "Group": self.group, #group for the request
95  "CMSSWVersion": os.getenv('CMSSW_VERSION'), #CMSSW Version (used for all tasks in chain)
96  "Campaign": os.getenv('CMSSW_VERSION'), # = AcquisitionEra, will be reset later to the one of first task, will both be the CMSSW_VERSION
97  "ScramArch": os.getenv('SCRAM_ARCH'), #Scram Arch (used for all tasks in chain)
98  "ProcessingVersion": self.version, #Processing Version (used for all tasks in chain)
99  "GlobalTag": None, #Global Tag (overridden per task)
100  "CouchURL": self.couch, #URL of CouchDB containing Config Cache
101  "ConfigCacheURL": self.couch, #URL of CouchDB containing Config Cache
102  "DbsUrl": self.DbsUrl,
103  #- Will contain all configs for all Tasks
104  #"SiteWhitelist" : ["T2_CH_CERN", "T1_US_FNAL"], #Site whitelist
105  "TaskChain" : None, #Define number of tasks in chain.
106  "nowmTasklist" : [], #a list of tasks as we put them in
107  "unmergedLFNBase" : "/store/unmerged",
108  "mergedLFNBase" : "/store/relval",
109  "dashboardActivity" : "relval",
110  "Multicore" : 1, # do not set multicore for the whole chain
111  "Memory" : 3000,
112  "SizePerEvent" : 1234,
113  "TimePerEvent" : 0.1
114  }
116  self.defaultHarvest={
117  "EnableHarvesting" : "True",
118  "DQMUploadUrl" : self.dqmgui,
119  "DQMConfigCacheID" : None,
120  "Multicore" : 1 # hardcode Multicore to be 1 for Harvest
121  }
122 
123  self.defaultScratch={
124  "TaskName" : None, #Task Name
125  "ConfigCacheID" : None, #Generator Config id
126  "GlobalTag": None,
127  "SplittingAlgo" : "EventBased", #Splitting Algorithm
128  "EventsPerJob" : None, #Size of jobs in terms of splitting algorithm
129  "RequestNumEvents" : None, #Total number of events to generate
130  "Seeding" : "AutomaticSeeding", #Random seeding method
131  "PrimaryDataset" : None, #Primary Dataset to be created
132  "nowmIO": {},
133  "Multicore" : opt.nThreads, # this is the per-taskchain Multicore; it's the default assigned to a task if it has no value specified
134  "KeepOutput" : False
135  }
136  self.defaultInput={
137  "TaskName" : "DigiHLT", #Task Name
138  "ConfigCacheID" : None, #Processing Config id
139  "GlobalTag": None,
140  "InputDataset" : None, #Input Dataset to be processed
141  "SplittingAlgo" : "LumiBased", #Splitting Algorithm
142  "LumisPerJob" : 10, #Size of jobs in terms of splitting algorithm
143  "nowmIO": {},
144  "Multicore" : opt.nThreads, # this is the per-taskchain Multicore; it's the default assigned to a task if it has no value specified
145  "KeepOutput" : False
146  }
147  self.defaultTask={
148  "TaskName" : None, #Task Name
149  "InputTask" : None, #Input Task Name (Task Name field of a previous Task entry)
150  "InputFromOutputModule" : None, #OutputModule name in the input task that will provide files to process
151  "ConfigCacheID" : None, #Processing Config id
152  "GlobalTag": None,
153  "SplittingAlgo" : "LumiBased", #Splitting Algorithm
154  "LumisPerJob" : 10, #Size of jobs in terms of splitting algorithm
155  "nowmIO": {},
156  "Multicore" : opt.nThreads, # this is the per-taskchain Multicore; it's the default assigned to a task if it has no value specified
157  "KeepOutput" : False
158  }
160  self.chainDicts={}
161 

Member Function Documentation

def MatrixInjector.MatrixInjector.prepare (   self,
  mReader,
  directories,
  mode = 'init' 
)

Definition at line 162 of file MatrixInjector.py.

References bitset_utilities.append(), MatrixInjector.MatrixInjector.chainDicts, MatrixInjector.MatrixInjector.defaultChain, MatrixInjector.MatrixInjector.defaultHarvest, MatrixInjector.MatrixInjector.defaultInput, MatrixInjector.MatrixInjector.defaultScratch, MatrixInjector.MatrixInjector.defaultTask, spr.find(), reco.if(), cmsHarvester.index, mps_monitormerge.items, MatrixInjector.MatrixInjector.keep, MatrixInjector.MatrixInjector.memoryOffset, MatrixInjector.MatrixInjector.memPerCore, SiPixelLorentzAngle_cfi.read, python.rootplot.root2matplotlib.replace(), MatrixInjector.MatrixInjector.speciallabel, split, and makeHLTPrescaleTable.values.

163  def prepare(self,mReader, directories, mode='init'):
164  try:
165  #from Configuration.PyReleaseValidation.relval_steps import wmsplit
166  wmsplit = {}
167  wmsplit['DIGIHI']=5
168  wmsplit['RECOHI']=5
169  wmsplit['HLTD']=5
170  wmsplit['RECODreHLT']=2
171  wmsplit['DIGIPU']=4
172  wmsplit['DIGIPU1']=4
173  wmsplit['RECOPU1']=1
174  wmsplit['DIGIUP15_PU50']=1
175  wmsplit['RECOUP15_PU50']=1
176  wmsplit['DIGIUP15_PU25']=1
177  wmsplit['RECOUP15_PU25']=1
178  wmsplit['DIGIUP15_PU25HS']=1
179  wmsplit['RECOUP15_PU25HS']=1
180  wmsplit['DIGIHIMIX']=5
181  wmsplit['RECOHIMIX']=5
182  wmsplit['RECODSplit']=1
183  wmsplit['SingleMuPt10_UP15_ID']=1
184  wmsplit['DIGIUP15_ID']=1
185  wmsplit['RECOUP15_ID']=1
186  wmsplit['TTbar_13_ID']=1
187  wmsplit['SingleMuPt10FS_ID']=1
188  wmsplit['TTbarFS_ID']=1
189  wmsplit['RECODR2_50nsreHLT']=5
190  wmsplit['RECODR2_25nsreHLT']=5
191  wmsplit['RECODR2_2016reHLT']=5
192  wmsplit['RECODR2_50nsreHLT_HIPM']=5
193  wmsplit['RECODR2_25nsreHLT_HIPM']=5
194  wmsplit['RECODR2_2016reHLT_HIPM']=5
195  wmsplit['RECODR2_2016reHLT_skimSingleMu']=5
196  wmsplit['RECODR2_2016reHLT_skimDoubleEG']=5
197  wmsplit['RECODR2_2016reHLT_skimMuonEG']=5
198  wmsplit['RECODR2_2016reHLT_skimJetHT']=5
199  wmsplit['RECODR2_2016reHLT_skimMET']=5
200  wmsplit['RECODR2_2016reHLT_skimSinglePh']=5
201  wmsplit['RECODR2_2016reHLT_skimMuOnia']=5
202  wmsplit['RECODR2_2016reHLT_skimSingleMu_HIPM']=5
203  wmsplit['RECODR2_2016reHLT_skimDoubleEG_HIPM']=5
204  wmsplit['RECODR2_2016reHLT_skimMuonEG_HIPM']=5
205  wmsplit['RECODR2_2016reHLT_skimJetHT_HIPM']=5
206  wmsplit['RECODR2_2016reHLT_skimMET_HIPM']=5
207  wmsplit['RECODR2_2016reHLT_skimSinglePh_HIPM']=5
208  wmsplit['RECODR2_2016reHLT_skimMuOnia_HIPM']=5
209  wmsplit['HLTDR2_50ns']=1
210  wmsplit['HLTDR2_25ns']=1
211  wmsplit['HLTDR2_2016']=1
212  wmsplit['Hadronizer']=1
213  wmsplit['DIGIUP15']=1
214  wmsplit['RECOUP15']=1
215  wmsplit['RECOAODUP15']=5
216  wmsplit['DBLMINIAODMCUP15NODQM']=5
217  wmsplit['DigiFull']=5
218  wmsplit['RecoFull']=5
219  wmsplit['DigiFullPU']=1
220  wmsplit['RecoFullPU']=1
221 
222 
223  #import pprint
224  #pprint.pprint(wmsplit)
225  except:
226  print "Not set up for step splitting"
227  wmsplit={}
228 
229  acqEra=False
230  for (n,dir) in directories.items():
231  chainDict=copy.deepcopy(self.defaultChain)
232  print "inspecting",dir
233  nextHasDSInput=None
234  for (x,s) in mReader.workFlowSteps.items():
235  #x has the format (num, prefix)
236  #s has the format (num, name, commands, stepList)
237  if x[0]==n:
238  #print "found",n,s[3]
239  #chainDict['RequestString']='RV'+chainDict['CMSSWVersion']+s[1].split('+')[0]
240  index=0
241  splitForThisWf=None
242  thisLabel=self.speciallabel
243  #if 'HARVESTGEN' in s[3]:
244  if len( [step for step in s[3] if "HARVESTGEN" in step] )>0:
245  chainDict['TimePerEvent']=0.01
246  thisLabel=thisLabel+"_gen"
247  # for double miniAOD test
248  if len( [step for step in s[3] if "DBLMINIAODMCUP15NODQM" in step] )>0:
249  thisLabel=thisLabel+"_dblMiniAOD"
250  processStrPrefix=''
251  setPrimaryDs=None
252  for step in s[3]:
253 
254  if 'INPUT' in step or (not isinstance(s[2][index],str)):
255  nextHasDSInput=s[2][index]
256 
257  else:
258 
259  if (index==0):
260  #first step and not input -> gen part
261  chainDict['nowmTasklist'].append(copy.deepcopy(self.defaultScratch))
262  try:
263  chainDict['nowmTasklist'][-1]['nowmIO']=json.loads(open('%s/%s.io'%(dir,step)).read())
264  except:
265  print "Failed to find",'%s/%s.io'%(dir,step),".The workflows were probably not run on cfg not created"
266  return -15
267 
268  chainDict['nowmTasklist'][-1]['PrimaryDataset']='RelVal'+s[1].split('+')[0]
269  if not '--relval' in s[2][index]:
270  print 'Impossible to create task from scratch without splitting information with --relval'
271  return -12
272  else:
273  arg=s[2][index].split()
274  ns=map(int,arg[arg.index('--relval')+1].split(','))
275  chainDict['nowmTasklist'][-1]['RequestNumEvents'] = ns[0]
276  chainDict['nowmTasklist'][-1]['EventsPerJob'] = ns[1]
277  if 'FASTSIM' in s[2][index] or '--fast' in s[2][index]:
278  thisLabel+='_FastSim'
279  if 'lhe' in s[2][index] in s[2][index]:
280  chainDict['nowmTasklist'][-1]['LheInputFiles'] =True
281 
282  elif nextHasDSInput:
283  chainDict['nowmTasklist'].append(copy.deepcopy(self.defaultInput))
284  try:
285  chainDict['nowmTasklist'][-1]['nowmIO']=json.loads(open('%s/%s.io'%(dir,step)).read())
286  except:
287  print "Failed to find",'%s/%s.io'%(dir,step),".The workflows were probably not run on cfg not created"
288  return -15
289  chainDict['nowmTasklist'][-1]['InputDataset']=nextHasDSInput.dataSet
290  splitForThisWf=nextHasDSInput.split
291  chainDict['nowmTasklist'][-1]['LumisPerJob']=splitForThisWf
292  if step in wmsplit:
293  chainDict['nowmTasklist'][-1]['LumisPerJob']=wmsplit[step]
294  # get the run numbers or #events
295  if len(nextHasDSInput.run):
296  chainDict['nowmTasklist'][-1]['RunWhitelist']=nextHasDSInput.run
297  if len(nextHasDSInput.ls):
298  chainDict['nowmTasklist'][-1]['LumiList']=nextHasDSInput.ls
299  #print "what is s",s[2][index]
300  if '--data' in s[2][index] and nextHasDSInput.label:
301  thisLabel+='_RelVal_%s'%nextHasDSInput.label
302  if 'filter' in chainDict['nowmTasklist'][-1]['nowmIO']:
303  print "This has an input DS and a filter sequence: very likely to be the PyQuen sample"
304  processStrPrefix='PU_'
305  setPrimaryDs = 'RelVal'+s[1].split('+')[0]
306  if setPrimaryDs:
307  chainDict['nowmTasklist'][-1]['PrimaryDataset']=setPrimaryDs
308  nextHasDSInput=None
309  else:
310  #not first step and no inputDS
311  chainDict['nowmTasklist'].append(copy.deepcopy(self.defaultTask))
312  try:
313  chainDict['nowmTasklist'][-1]['nowmIO']=json.loads(open('%s/%s.io'%(dir,step)).read())
314  except:
315  print "Failed to find",'%s/%s.io'%(dir,step),".The workflows were probably not run on cfg not created"
316  return -15
317  if splitForThisWf:
318  chainDict['nowmTasklist'][-1]['LumisPerJob']=splitForThisWf
319  if step in wmsplit:
320  chainDict['nowmTasklist'][-1]['LumisPerJob']=wmsplit[step]
321 
322  # change LumisPerJob for Hadronizer steps.
323  if 'Hadronizer' in step:
324  chainDict['nowmTasklist'][-1]['LumisPerJob']=wmsplit['Hadronizer']
325 
326  #print step
327  chainDict['nowmTasklist'][-1]['TaskName']=step
328  if setPrimaryDs:
329  chainDict['nowmTasklist'][-1]['PrimaryDataset']=setPrimaryDs
330  chainDict['nowmTasklist'][-1]['ConfigCacheID']='%s/%s.py'%(dir,step)
331  chainDict['nowmTasklist'][-1]['GlobalTag']=chainDict['nowmTasklist'][-1]['nowmIO']['GT'] # copy to the proper parameter name
332  chainDict['GlobalTag']=chainDict['nowmTasklist'][-1]['nowmIO']['GT'] #set in general to the last one of the chain
333  if 'pileup' in chainDict['nowmTasklist'][-1]['nowmIO']:
334  chainDict['nowmTasklist'][-1]['MCPileup']=chainDict['nowmTasklist'][-1]['nowmIO']['pileup']
335  if '--pileup ' in s[2][index]: # catch --pileup (scenarion) and not --pileup_ (dataset to be mixed) => works also making PRE-MIXed dataset
336  processStrPrefix='PU_' # take care of pu overlay done with GEN-SIM mixing
337  if ( s[2][index].split()[ s[2][index].split().index('--pileup')+1 ] ).find('25ns') > 0 :
338  processStrPrefix='PU25ns_'
339  elif ( s[2][index].split()[ s[2][index].split().index('--pileup')+1 ] ).find('50ns') > 0 :
340  processStrPrefix='PU50ns_'
341  if 'DIGIPREMIX_S2' in s[2][index] : # take care of pu overlay done with DIGI mixing of premixed events
342  if s[2][index].split()[ s[2][index].split().index('--pileup_input')+1 ].find('25ns') > 0 :
343  processStrPrefix='PUpmx25ns_'
344  elif s[2][index].split()[ s[2][index].split().index('--pileup_input')+1 ].find('50ns') > 0 :
345  processStrPrefix='PUpmx50ns_'
346 
347  if acqEra:
348  #chainDict['AcquisitionEra'][step]=(chainDict['CMSSWVersion']+'-PU_'+chainDict['nowmTasklist'][-1]['GlobalTag']).replace('::All','')+thisLabel
349  chainDict['AcquisitionEra'][step]=chainDict['CMSSWVersion']
350  chainDict['ProcessingString'][step]=processStrPrefix+chainDict['nowmTasklist'][-1]['GlobalTag'].replace('::All','')+thisLabel
351  else:
352  #chainDict['nowmTasklist'][-1]['AcquisitionEra']=(chainDict['CMSSWVersion']+'-PU_'+chainDict['nowmTasklist'][-1]['GlobalTag']).replace('::All','')+thisLabel
353  chainDict['nowmTasklist'][-1]['AcquisitionEra']=chainDict['CMSSWVersion']
354  chainDict['nowmTasklist'][-1]['ProcessingString']=processStrPrefix+chainDict['nowmTasklist'][-1]['GlobalTag'].replace('::All','')+thisLabel
355 
356  # specify different ProcessingString for double miniAOD dataset
357  if ('DBLMINIAODMCUP15NODQM' in step):
358  chainDict['nowmTasklist'][-1]['ProcessingString']=chainDict['nowmTasklist'][-1]['ProcessingString']+'_miniAOD'
359 
360  if( chainDict['nowmTasklist'][-1]['Multicore'] ):
361  # the scaling factor of 1.2GB / thread is empirical and measured on a SECOND round of tests with PU samples
362  # the number of threads is NO LONGER assumed to be the same for all tasks
363  # https://hypernews.cern.ch/HyperNews/CMS/get/edmFramework/3509/1/1/1.html
364  # now change to 1.5GB / additional thread according to discussion:
365  # https://hypernews.cern.ch/HyperNews/CMS/get/relval/4817/1/1.html
366 # chainDict['nowmTasklist'][-1]['Memory'] = 3000 + int( chainDict['nowmTasklist'][-1]['Multicore'] -1 )*1500
367  chainDict['nowmTasklist'][-1]['Memory'] = self.memoryOffset + int( chainDict['nowmTasklist'][-1]['Multicore'] -1 ) * self.memPerCore
368 
369  index+=1
370  #end of loop through steps
371  chainDict['RequestString']='RV'+chainDict['CMSSWVersion']+s[1].split('+')[0]
372  if processStrPrefix or thisLabel:
373  chainDict['RequestString']+='_'+processStrPrefix+thisLabel
374 
375 
376 
377  #wrap up for this one
378  import pprint
379  #print 'wrapping up'
380  #pprint.pprint(chainDict)
381  #loop on the task list
382  for i_second in reversed(range(len(chainDict['nowmTasklist']))):
383  t_second=chainDict['nowmTasklist'][i_second]
384  #print "t_second taskname", t_second['TaskName']
385  if 'primary' in t_second['nowmIO']:
386  #print t_second['nowmIO']['primary']
387  primary=t_second['nowmIO']['primary'][0].replace('file:','')
388  for i_input in reversed(range(0,i_second)):
389  t_input=chainDict['nowmTasklist'][i_input]
390  for (om,o) in t_input['nowmIO'].items():
391  if primary in o:
392  #print "found",primary,"procuced by",om,"of",t_input['TaskName']
393  t_second['InputTask'] = t_input['TaskName']
394  t_second['InputFromOutputModule'] = om
395  #print 't_second',pprint.pformat(t_second)
396  if t_second['TaskName'].startswith('HARVEST'):
397  chainDict.update(copy.deepcopy(self.defaultHarvest))
398  chainDict['DQMConfigCacheID']=t_second['ConfigCacheID']
399  ## the info are not in the task specific dict but in the general dict
400  #t_input.update(copy.deepcopy(self.defaultHarvest))
401  #t_input['DQMConfigCacheID']=t_second['ConfigCacheID']
402  break
403 
404  # agreed changes for wm injection:
405  # - Campaign: *optional* string during creation. It will default to AcqEra value if possible.
406  # Otherwise it will be empty.
407  # - AcquisitionEra: *mandatory* string at request level during creation. *optional* string
408  # at task level during creation. "optional" during assignment.
409  # - ProcessingString: *mandatory* string at request level during creation. *optional* string
410  # at task level during creation. "optional" during assignment.
411  # - ProcessingVersion: *optional* during creation (default 1). *optional* during assignment.
412  #
413  # Which requires following changes here:
414  # - reset Global AcuisitionEra, ProcessingString to be the one in the first task
415  # - and also Campaign to be always the same as the AcquisitionEra
416 
417  if acqEra:
418  chainDict['AcquisitionEra'] = chainDict['AcquisitionEra'].values()[0]
419  chainDict['ProcessingString'] = chainDict['ProcessingString'].values()[0]
420  else:
421  chainDict['AcquisitionEra'] = chainDict['nowmTasklist'][0]['AcquisitionEra']
422  chainDict['ProcessingString'] = chainDict['nowmTasklist'][0]['ProcessingString']
423 
424  chainDict['Campaign'] = chainDict['AcquisitionEra']
425 
426  ## clean things up now
427  itask=0
428  if self.keep:
429  for i in self.keep:
430  if type(i)==int and i < len(chainDict['nowmTasklist']):
431  chainDict['nowmTasklist'][i]['KeepOutput']=True
432  for (i,t) in enumerate(chainDict['nowmTasklist']):
433  if t['TaskName'].startswith('HARVEST'):
434  continue
435  if not self.keep:
436  t['KeepOutput']=True
437  elif t['TaskName'] in self.keep:
438  t['KeepOutput']=True
439  t.pop('nowmIO')
440  itask+=1
441  chainDict['Task%d'%(itask)]=t
442 
443 
444  ##
445 
446 
447  ## provide the number of tasks
448  chainDict['TaskChain']=itask#len(chainDict['nowmTasklist'])
449 
450  chainDict.pop('nowmTasklist')
451  self.chainDicts[n]=chainDict
452 
453 
454  return 0
boost::dynamic_bitset append(const boost::dynamic_bitset<> &bs1, const boost::dynamic_bitset<> &bs2)
this method takes two bitsets bs1 and bs2 and returns result of bs2 appended to the end of bs1 ...
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
if(dp >Float(M_PI)) dp-
double split
Definition: MVATrainer.cc:139
def MatrixInjector.MatrixInjector.submit (   self)

Definition at line 502 of file MatrixInjector.py.

References MatrixInjector.MatrixInjector.testMode, and MatrixInjector.MatrixInjector.wmagent.

503  def submit(self):
504  try:
505  from modules.wma import makeRequest,approveRequest
506  from wmcontrol import random_sleep
507  print '\n\tFound wmcontrol\n'
508  except:
509  print '\n\tUnable to find wmcontrol modules. Please include it in your python path\n'
510  if not self.testMode:
511  print '\n\t QUIT\n'
512  sys.exit(-17)
513 
514  import pprint
515  for (n,d) in self.chainDicts.items():
516  if self.testMode:
517  print "Only viewing request",n
518  print pprint.pprint(d)
519  else:
520  #submit to wmagent each dict
521  print "For eyes before submitting",n
522  print pprint.pprint(d)
523  print "Submitting",n,"..........."
524  workFlow=makeRequest(self.wmagent,d,encodeDict=True)
525  approveRequest(self.wmagent,workFlow)
526  print "...........",n,"submitted"
527  random_sleep()
528 
529 
530 
def MatrixInjector.MatrixInjector.upload (   self)

Definition at line 482 of file MatrixInjector.py.

References MatrixInjector.MatrixInjector.uploadConf().

483  def upload(self):
484  for (n,d) in self.chainDicts.items():
485  for it in d:
486  if it.startswith("Task") and it!='TaskChain':
487  #upload
488  couchID=self.uploadConf(d[it]['ConfigCacheID'],
489  str(n)+d[it]['TaskName'],
490  d['CouchURL']
491  )
492  print d[it]['ConfigCacheID']," uploaded to couchDB for",str(n),"with ID",couchID
493  d[it]['ConfigCacheID']=couchID
494  if it =='DQMConfigCacheID':
495  couchID=self.uploadConf(d['DQMConfigCacheID'],
496  str(n)+'harvesting',
497  d['CouchURL']
498  )
499  print d['DQMConfigCacheID'],"uploaded to couchDB for",str(n),"with ID",couchID
500  d['DQMConfigCacheID']=couchID
501 
def MatrixInjector.MatrixInjector.uploadConf (   self,
  filePath,
  label,
  where 
)

Definition at line 455 of file MatrixInjector.py.

References MatrixInjector.MatrixInjector.couchCache, TmCcu.count, TmModule.count, TmApvPair.count, TmPsu.count, MatrixInjector.MatrixInjector.count, ValidationMisalignedTracker.count, SiStripDetSummary::Values.count, MatrixInjector.MatrixInjector.group, ElectronLikelihoodCategoryData.label, entry< T >.label, SiPixelFedFillerWordEventNumber.label, classes.PlotData.label, TtEvent::HypoClassKeyStringToEnum.label, HcalLutSet.label, DTDQMHarvesting.DTDQMHarvesting.label, DTVDriftMeanTimerCalibration.DTVDriftMeanTimerCalibration.label, DTVDriftSegmentCalibration.DTVDriftSegmentCalibration.label, DTAnalysisResiduals.DTAnalysisResiduals.label, DTDQMValidation.DTDQMValidation.label, L1GtBoardTypeStringToEnum.label, DTResidualCalibration.DTResidualCalibration.label, DTTTrigValid.DTTTrigValid.label, DTTTrigResidualCorr.DTTTrigResidualCorr.label, MatrixInjector.MatrixInjector.label, L1GtPsbQuadStringToEnum.label, ValidationMisalignedTracker.label, L1GtConditionTypeStringToEnum.label, L1GtConditionCategoryStringToEnum.label, PhysicsTools::Calibration::Comparator.label, MatrixInjector.MatrixInjector.testMode, EcalTPGParamReaderFromDB.user, popcon::RpcDataT.user, popcon::RPCObPVSSmapData.user, popcon::RpcDataV.user, popcon::RpcObGasData.user, popcon::RpcDataGasMix.user, popcon::RpcDataS.user, popcon::RpcDataUXC.user, popcon::RpcDataFebmap.user, popcon::RpcDataI.user, MatrixInjector.MatrixInjector.user, and conddblib.TimeType.user.

Referenced by MatrixInjector.MatrixInjector.upload().

456  def uploadConf(self,filePath,label,where):
457  labelInCouch=self.label+'_'+label
458  cacheName=filePath.split('/')[-1]
459  if self.testMode:
460  self.count+=1
461  print '\tFake upload of',filePath,'to couch with label',labelInCouch
462  return self.count
463  else:
464  try:
465  from modules.wma import upload_to_couch,DATABASE_NAME
466  except:
467  print '\n\tUnable to find wmcontrol modules. Please include it in your python path\n'
468  print '\n\t QUIT\n'
469  sys.exit(-16)
470 
471  if cacheName in self.couchCache:
472  print "Not re-uploading",filePath,"to",where,"for",label
473  cacheId=self.couchCache[cacheName]
474  else:
475  print "Loading",filePath,"to",where,"for",label
476  ## totally fork the upload to couch to prevent cross loading of process configurations
477  pool = multiprocessing.Pool(1)
478  cacheIds = pool.map( upload_to_couch_oneArg, [(filePath,labelInCouch,self.user,self.group,where)] )
479  cacheId = cacheIds[0]
480  self.couchCache[cacheName]=cacheId
481  return cacheId

Member Data Documentation

MatrixInjector.MatrixInjector.chainDicts

Definition at line 159 of file MatrixInjector.py.

Referenced by MatrixInjector.MatrixInjector.prepare().

MatrixInjector.MatrixInjector.couch

Definition at line 69 of file MatrixInjector.py.

MatrixInjector.MatrixInjector.couchCache

Definition at line 71 of file MatrixInjector.py.

Referenced by MatrixInjector.MatrixInjector.uploadConf().

MatrixInjector.MatrixInjector.count

Definition at line 39 of file MatrixInjector.py.

Referenced by MatrixInjector.MatrixInjector.uploadConf().

MatrixInjector.MatrixInjector.DbsUrl

Definition at line 61 of file MatrixInjector.py.

MatrixInjector.MatrixInjector.defaultChain

Definition at line 88 of file MatrixInjector.py.

Referenced by MatrixInjector.MatrixInjector.prepare().

MatrixInjector.MatrixInjector.defaultHarvest

Definition at line 115 of file MatrixInjector.py.

Referenced by MatrixInjector.MatrixInjector.prepare().

MatrixInjector.MatrixInjector.defaultInput

Definition at line 135 of file MatrixInjector.py.

Referenced by MatrixInjector.MatrixInjector.prepare().

MatrixInjector.MatrixInjector.defaultScratch

Definition at line 122 of file MatrixInjector.py.

Referenced by MatrixInjector.MatrixInjector.prepare().

MatrixInjector.MatrixInjector.defaultTask

Definition at line 146 of file MatrixInjector.py.

Referenced by MatrixInjector.MatrixInjector.prepare().

MatrixInjector.MatrixInjector.dqmgui

Definition at line 41 of file MatrixInjector.py.

MatrixInjector.MatrixInjector.group

Definition at line 73 of file MatrixInjector.py.

Referenced by MatrixInjector.MatrixInjector.uploadConf().

MatrixInjector.MatrixInjector.keep

Definition at line 51 of file MatrixInjector.py.

Referenced by MatrixInjector.MatrixInjector.prepare().

MatrixInjector.MatrixInjector.label

Definition at line 74 of file MatrixInjector.py.

Referenced by Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor._sort_list(), python.rootplot.root2matplotlib.Hist.bar(), python.rootplot.root2matplotlib.Hist.barh(), python.rootplot.root2matplotlib.Hist.errorbar(), python.rootplot.root2matplotlib.Hist.errorbarh(), Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor.foundIn(), Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor.fullFilename(), Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor.inputEventContent(), Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor.outputEventContent(), core.TriggerMatchAnalyzer.TriggerMatchAnalyzer.process(), Vispa.Plugins.ConfigEditor.ToolDataAccessor.ToolDataAccessor.properties(), Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.properties(), Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor.properties(), Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor.readConnections(), core.AutoHandle.AutoHandle.ReallyLoad(), Vispa.Plugins.ConfigEditor.ToolDataAccessor.ToolDataAccessor.updateProcess(), MatrixInjector.MatrixInjector.uploadConf(), and Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor.usedBy().

MatrixInjector.MatrixInjector.memoryOffset

Definition at line 52 of file MatrixInjector.py.

Referenced by MatrixInjector.MatrixInjector.prepare().

MatrixInjector.MatrixInjector.memPerCore

Definition at line 53 of file MatrixInjector.py.

Referenced by MatrixInjector.MatrixInjector.prepare().

MatrixInjector.MatrixInjector.speciallabel

Definition at line 75 of file MatrixInjector.py.

Referenced by MatrixInjector.MatrixInjector.prepare().

MatrixInjector.MatrixInjector.testMode

Definition at line 49 of file MatrixInjector.py.

Referenced by MatrixInjector.MatrixInjector.submit(), and MatrixInjector.MatrixInjector.uploadConf().

MatrixInjector.MatrixInjector.user

Definition at line 72 of file MatrixInjector.py.

Referenced by cmsPerfSuite.PerfSuite.optionParse(), dataset.BaseDataset.printInfo(), production_tasks.CheckDatasetExists.run(), production_tasks.GenerateMask.run(), production_tasks.SourceCFG.run(), production_tasks.FullCFG.run(), production_tasks.MonitorJobs.run(), production_tasks.CleanJobFiles.run(), and MatrixInjector.MatrixInjector.uploadConf().

MatrixInjector.MatrixInjector.version

Definition at line 50 of file MatrixInjector.py.

Referenced by python.rootplot.argparse._VersionAction.__call__(), validation.Sample.datasetpattern(), validation.Sample.filename(), argparse.ArgumentParser.format_version(), and python.rootplot.argparse.ArgumentParser.format_version().

MatrixInjector.MatrixInjector.wmagent

Definition at line 42 of file MatrixInjector.py.

Referenced by MatrixInjector.MatrixInjector.submit().