CMS 3D CMS Logo

Functions
parallelization Namespace Reference

Functions

def adjust_pset (cmsrunfilename, savefilename, par_list)
 
def cleanupandexit (filelist)
 
def uint (string)
 

Function Documentation

def parallelization.adjust_pset (   cmsrunfilename,
  savefilename,
  par_list 
)
Takes the cmsRun filem, removes all occurences of runMode, jobs,
   maxJobs and integrationList parameters in the process.generator
   part.
   The the parameters in par_list are set instead and saved.

Definition at line 59 of file parallelization.py.

Referenced by cleanupandexit().

59 def adjust_pset(cmsrunfilename, savefilename, par_list):
60  """Takes the cmsRun filem, removes all occurences of runMode, jobs,
61  maxJobs and integrationList parameters in the process.generator
62  part.
63  The the parameters in par_list are set instead and saved.
64  """
65 
66  with open(cmsrunfilename, 'r') as readfile:
67  parsestring = readfile.read()
68 
69  # get first opening bracket after process.generator
70  begin_gen_step = parsestring.find('(', parsestring.find('process.generator'))
71 
72  # find matching bracket
73  end_gen_step = begin_gen_step
74  bracket_counter = 1
75  for position in range(begin_gen_step+1, len(parsestring)):
76  if parsestring[position] == '(':
77  bracket_counter += 1
78  if parsestring[position] == ')':
79  bracket_counter -= 1
80  if not bracket_counter:
81  end_gen_step = position
82  break
83 
84  # get string between brackets
85  gen_string = parsestring[begin_gen_step+1:end_gen_step]
86 
87  # remove all parameters that would interfere
88  gen_string = re.sub(r',\s*runModeList\s*=\s*cms.untracked.string\((.*?)\)', '', gen_string)
89  gen_string = re.sub(r',\s*jobs\s*=\s*cms.untracked.int32\((.*?)\)', '', gen_string)
90  gen_string = re.sub(r',\s*integrationList\s*=\s*cms.untracked.string\((.*?)\)', '', gen_string)
91  gen_string = re.sub(r',\s*maxJobs\s*=\s*cms.untracked.uint32\((.*?)\)', '', gen_string)
92  gen_string = re.sub(r',\s*seed\s*=\s*cms.untracked.int32\((.*?)\)', '', gen_string)
93 
94 
95  # write the savefile with all parameters given in par_list
96  with open(savefilename,'w') as savefile:
97  savefile.write(parsestring[:begin_gen_step+1])
98  savefile.write(gen_string)
99  for item in par_list:
100  savefile.write(',\n')
101  savefile.write(item)
102  savefile.write(parsestring[end_gen_step:])
103 
104 
105 
def adjust_pset(cmsrunfilename, savefilename, par_list)
def parallelization.cleanupandexit (   filelist)
Delete the files in filelist and exit

Definition at line 106 of file parallelization.py.

References adjust_pset(), and harvestTrackValidationPlots.str.

106 def cleanupandexit(filelist):
107  """Delete the files in filelist and exit"""
108  for filename in filelist:
109  os.remove(filename)
110  sys.exit(0)
111 
112 
113 
114 
def cleanupandexit(filelist)
def parallelization.uint (   string)
Unsigned int type

Definition at line 49 of file parallelization.py.

References createfilelist.int.

Referenced by SiStripMonitorDigi.AddApvShotsToSubDet(), L1Scalers.analyze(), SiStripMonitorHLT.analyze(), SiStripMonitorDigi.analyze(), MonitorTrackResidualsBase< pixel_or_strip >.analyze(), SiStripMonitorCluster.analyze(), SiPixelHitEfficiencySource.analyze(), SiPixelTrackResidualSource.analyze(), TkConvValidator.analyze(), MuIsoValidation.analyze(), L1Validator.analyze(), TrackingMonitor.analyze(), ZToMuMuGammaAnalyzer.analyze(), PhotonAnalyzer.analyze(), PhotonOfflineClient.book2DHistoVector(), PhotonAnalyzer.book2DHistoVector(), PhotonOfflineClient.book3DHistoVector(), PhotonAnalyzer.book3DHistoVector(), L1Scalers.bookHistograms(), TrackingMonitor.bookHistograms(), PhotonAnalyzer.bookHistogramsEfficiency(), TrackerOfflineValidation.bookSummaryHists(), EffectiveAreas.checkConsistency(), PFRecoTauDiscriminationByNProngs.discriminate(), CSCOfflineMonitor.doEfficiencies(), HLTMuonCertSummary.dqmEndJob(), EcalDAQTowerStatusXMLTranslator.dumpXML(), EcalDCSTowerStatusXMLTranslator.dumpXML(), L1TStage2InputPatternWriter.endJob(), GlobalHitsProdHistStripper.endRun(), VariableNTupler.fill(), StringBasedNTupler.fill(), AdHocNTupler.fill(), SiStripMonitorDigi.FillApvShotsMap(), CTPPSPixelLocalTrackProducer.fillDescriptions(), L1Validator.FindBest(), EffectiveAreas.getEffectiveArea(), ZElectronsSelector.getEffectiveArea(), TrackerOfflineValidation.getHistStructFromMap(), PixelInactiveAreaFinder.getPhiSpanBarrel(), SiStripTrackerMapCreator.paintTkMapFromAlarm(), PhotonMVAEstimatorRun2Spring16NonTrig.PhotonMVAEstimatorRun2Spring16NonTrig(), EcalDCSTowerStatusXMLTranslator.plot(), EcalDAQTowerStatusXMLTranslator.plot(), TrackerOfflineValidation.prepareSummaryHists(), EffectiveAreas.printEffectiveAreas(), ZElectronsSelector.printEffectiveAreas(), HiEvtPlaneFlatProducer.produce(), EvtPlaneProducer.produce(), L1TCaloParamsOnlineProd.readCaloLayer2OnlineSettings(), CompleteNTupler.registerleaves(), VariableNTupler.registerleaves(), AdHocNTupler.registerleaves(), StringBasedNTupler.registerleaves(), MuonTestSummary.ResidualCheck(), PhotonOfflineClient.retrieveHisto(), RPixPlaneCombinatoryTracking.RPixPlaneCombinatoryTracking(), PhotonOfflineClient.runClient(), StringCutEventSelector< Object, any >.select(), StringCutsEventSelector< Object, existenceMatter >.select(), TrackingMonitor.setMaxMinBin(), TrackingMonitor.setNclus(), StringBasedNTupler.StringBasedNTupler(), StringBranchHelper< Object, Collection >.StringBranchHelper(), TkConvValidator.TkConvValidator(), l1t::stage1.unpack_em(), l1t::stage1.unpack_region(), RctRawToDigi.unpackCTP7(), and VariableNTupler.VariableNTupler().

49 def uint(string):
50  """Unsigned int type"""
51  value = int(string)
52  if value < 0:
53  msg = '{0} is negative'.format(string)
54  raise argparse.ArgumentTypeError(msg)
55  return value
56 
57 
58 
def uint(string)