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 60 of file parallelization.py.

Referenced by cleanupandexit().

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

Definition at line 107 of file parallelization.py.

References adjust_pset(), edm.print(), and str.

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

Definition at line 50 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(), TrackingMonitor.analyze(), L1Validator.analyze(), MuIsoValidation.analyze(), ZToMuMuGammaAnalyzer.analyze(), PhotonAnalyzer.analyze(), PhotonOfflineClient.book2DHistoVector(), PhotonAnalyzer.book2DHistoVector(), PhotonOfflineClient.book3DHistoVector(), PhotonAnalyzer.book3DHistoVector(), L1Scalers.bookHistograms(), TrackingMonitor.bookHistograms(), PhotonAnalyzer.bookHistogramsEfficiency(), TrackerOfflineValidation.bookSummaryHists(), L1TMuonBarrelKalmanStubProcessor.buildStub(), L1TMuonBarrelKalmanAlgo.calculateEta(), EffectiveAreas.checkConsistency(), L1TMuonBarrelKalmanAlgo.clean(), L1TMuonBarrelKalmanAlgo.cleanAndSort(), L1TMuonBarrelKalmanLUTs.coarseEta(), PFRecoTauDiscriminationByNProngs.discriminate(), CSCOfflineMonitor.doEfficiencies(), HLTMuonCertSummary.dqmEndJob(), EcalDAQTowerStatusXMLTranslator.dumpXML(), EcalDCSTowerStatusXMLTranslator.dumpXML(), L1TStage2InputPatternWriter.endJob(), GlobalHitsProdHistStripper.endRun(), L1TMuonBarrelKalmanAlgo.estimateChiSquare(), VariableNTupler.fill(), StringBasedNTupler.fill(), AdHocNTupler.fill(), SiStripMonitorDigi.FillApvShotsMap(), CTPPSPixelLocalTrackProducer.fillDescriptions(), L1Validator.FindBest(), L1TMuonBarrelKalmanAlgo.getByCode(), EffectiveAreas.getEffectiveArea(), ZElectronsSelector.getEffectiveArea(), TrackerOfflineValidation.getHistStructFromMap(), PixelInactiveAreaFinder.getPhiSpanBarrel(), L1TMuonBarrelKalmanStubProcessor.makeStubs(), L1TMuonBarrelKalmanAlgo.match(), L1MuKBMTrack.operator==(), SiStripTrackerMapCreator.paintTkMapFromAlarm(), EcalDAQTowerStatusXMLTranslator.plot(), EcalDCSTowerStatusXMLTranslator.plot(), TrackerOfflineValidation.prepareSummaryHists(), EffectiveAreas.printEffectiveAreas(), ZElectronsSelector.printEffectiveAreas(), l1t::Stage2Layer2DemuxSumsAlgoFirmwareImp1.processEvent(), L1TMuonBarrelKalmanTrackProducer.produce(), L1TMuonBarrelKalmanStubProducer.produce(), HiEvtPlaneFlatProducer.produce(), EvtPlaneProducer.produce(), L1TMuonBarrelKalmanAlgo.punchThroughVeto(), 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(), L1TMuonBarrelKalmanAlgo.updateLUT(), VariableNTupler.VariableNTupler(), and L1TMuonBarrelKalmanAlgo.vertexConstraintLUT().

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