CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Classes | Functions | Variables
dqm-mbProfile Namespace Reference

Classes

class  Profile
 

Functions

def build_process_list
 
def find_and_write_html
 
def get_children
 
def handle_alarm
 
def read_procfs
 
def run_and_monitor
 

Variables

 ALARM_P_OBJECT = None
 
int ALARM_TIMER = 1
 
tuple args = parser.parse_args()
 
tuple log = logging.getLogger("mbProfile")
 
string LOG_FORMAT = '%(asctime)s: %(name)-20s - %(levelname)-8s - %(message)s'
 
tuple p = os.path.dirname(args.file)
 
tuple parser = argparse.ArgumentParser(description="Profile child processes and produce data for rss and such graphs.")
 

Function Documentation

def dqm-mbProfile.build_process_list ( )

Definition at line 56 of file dqm-mbProfile.py.

References read_procfs().

Referenced by get_children().

56 
57 def build_process_list():
58  lst = os.listdir("/proc/")
59  for f in lst:
60  if not f.isdigit(): continue
61 
62  proc = read_procfs(os.path.join("/proc", f))
63  if proc:
64  yield proc
def build_process_list
def dqm-mbProfile.find_and_write_html (   p,
  args 
)

Definition at line 244 of file dqm-mbProfile.py.

245 def find_and_write_html(p, args):
246  # create the dir if necessary
247  if p and not os.path.exists(p):
248  os.makedirs(p)
249 
250  html_paths = [
251  os.path.join(os.getenv("CMSSW_RELEASE_BASE"), "src/DQMServices/Components/data/html"),
252  os.path.join(os.getenv("CMSSW_BASE"),"src/DQMServices/Components/data/html"),
253  ]
254 
255  def find_file(f):
256  fails = []
257  for p in html_paths:
258  x = os.path.join(p, f)
259  if os.path.exists(x):
260  return x
261  else:
262  fails.append(x)
263 
264  log.warning("Could not find html file: %s (%s)", f, fails)
265 
266  for f in ['mbGraph.js', 'mbGraph.html']:
267  target_fn = os.path.join(p, f)
268  source_fn = find_file(f)
269  if source_fn:
270  log.info("Copying %s to %s", source_fn, target_fn)
271  shutil.copyfile(source_fn, target_fn)
def dqm-mbProfile.get_children (   ppid)
Select all processes which are descendant from ppid (exclusive). 

Definition at line 65 of file dqm-mbProfile.py.

References bitset_utilities.append(), build_process_list(), and list().

Referenced by dqm-mbProfile.Profile.update_proc().

65 
66 def get_children(ppid):
67  """ Select all processes which are descendant from ppid (exclusive). """
68 
69  pid_dct = {}
70  for proc in build_process_list():
71  proc["_children"] = []
72  pid_dct[proc["pid"]] = proc
73 
74  # fill in children array
75  for pid in list(pid_dct.keys()):
76  parent_pid = pid_dct[pid]["parent_pid"]
77 
78  if pid_dct.has_key(parent_pid):
79  pid_dct[parent_pid]["_children"].append(pid)
80 
81  # now just walk down the tree
82  if ppid is None or not pid_dct.has_key(ppid):
83  # process has quit, we exit
84  return []
85 
86  accepted = []
87  to_accept = collections.deque([ppid, ])
88 
89  while to_accept:
90  head = pid_dct[to_accept.popleft()]
91 
92  # do not include the monitoring pid
93  if head["pid"] != ppid:
94  accepted.append(head)
95 
96  to_accept.extend(head.get("_children", []))
97  head["children"] = head["_children"]
98  del head["_children"]
99 
100  # deleting children breaks infinite loops
101  # but Dima, can a process tree contain a loop? yes - via race-condition in reading procfs
102 
103  return accepted
def build_process_list
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 ...
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
def dqm-mbProfile.handle_alarm (   num,
  frame 
)

Definition at line 223 of file dqm-mbProfile.py.

224 def handle_alarm(num, frame):
225  if ALARM_P_OBJECT:
226  ALARM_P_OBJECT.update()
227 
228  signal.alarm(ALARM_TIMER)
def dqm-mbProfile.read_procfs (   ppath,
  only_ppid = True 
)

Definition at line 20 of file dqm-mbProfile.py.

References SiPixelLorentzAngle_cfi.read, and python.rootplot.root2matplotlib.replace().

Referenced by build_process_list().

20 
21 def read_procfs(ppath, only_ppid=True):
22  def read(f):
23  fp = os.path.join(ppath, f)
24  with open(fp) as fd:
25  return fd.read()
26 
27  def read_status():
28  st = {}
29 
30  fp = os.path.join(ppath, "status")
31  with open(fp) as fd:
32  for line in fd.readlines():
33  if not line: continue
34 
35  key, value = line.split(":", 1)
36  st[key] = value.strip()
37 
38  return st
39 
40  try:
41  dct = {}
42 
43  dct["statm"] = read("statm").strip()
44  dct["stat"] = read("stat").strip()
45  dct["cmdline"] = read("cmdline").strip().replace("\0", " ")
46 
47  status = read_status()
48  dct["status"] = status
49  dct["pid"] = int(status["Pid"])
50  dct["parent_pid"] = int(status["PPid"])
51 
52  return dct
53  except:
54  log.warning("Exception in read_procfs.", exc_info=True)
55  pass
def dqm-mbProfile.run_and_monitor (   args)

Definition at line 229 of file dqm-mbProfile.py.

230 def run_and_monitor(args):
231  profile = Profile(args)
232 
233  proc = subprocess.Popen(args.pargs)
234  profile.pid = proc.pid
235 
236  global ALARM_P_OBJECT
237  ALARM_P_OBJECT = profile
238 
239  signal.signal(signal.SIGALRM, handle_alarm)
240  signal.alarm(ALARM_TIMER)
241 
242  proc.wait()
243  profile.finish()

Variable Documentation

dqm-mbProfile.ALARM_P_OBJECT = None

Definition at line 221 of file dqm-mbProfile.py.

dqm-mbProfile.ALARM_TIMER = 1

Definition at line 220 of file dqm-mbProfile.py.

tuple dqm-mbProfile.args = parser.parse_args()

Definition at line 280 of file dqm-mbProfile.py.

tuple dqm-mbProfile.log = logging.getLogger("mbProfile")

Definition at line 17 of file dqm-mbProfile.py.

Referenced by WeakEffectsWeightProducer.alphaQED(), heppy::FSRWeightAlgo.alphaRatio(), FSRWeightProducer.alphaRatio(), DQMHOAlCaRecoStream.analyze(), evf::ExceptionGenerator.analyze(), HcalNoiseMonitor.analyze(), ESTimingTask.analyze(), MCPhotonAnalyzer.analyze(), DQMSourceExample.analyze(), TrackerHitAnalyzer.analyze(), ValidationMisalignedTracker.analyze(), ZMuMuEfficiency.analyze(), L1CondDBIOVWriter.analyze(), EcalPreshowerSimHitsValidation.analyze(), L1O2OTestAnalyzer.analyze(), EcalSimHitsValidation.analyze(), EcalRecHitsValidation.analyze(), EcalDigisValidation.analyze(), L1MuonRecoTreeProducer.analyze(), HcalDeterministicFit.apply(), PhotonFix.asinh(), DAClusterizerInZ.beta0(), DAClusterizerInZ_vect.beta0(), RapReweightUserHook.biasSelectionBy(), PtHatRapReweightUserHook.biasSelectionBy(), CastorRecHitMonitor.bookHistograms(), TopDiLeptonDQM.bookHistograms(), BremsstrahlungSimulator.brem(), HcalParametersFromDD.build(), FWPFEcalRecHitLegoProxyBuilder.build(), l1t.calc_eta_from_theta_rad(), CSCSectorReceiverMiniLUT.calcGlobalEtaMEMini(), LRHelpFunctions.calcLRval(), EnergyResolutionVsLumi.calcmuTot(), ClusterShapeAlgo.Calculate_Covariances(), PFEGammaAlgo.calculate_ele_mva(), ClusterShapeAlgo.Calculate_EnergyDepTopology(), PositionCalc.Calculate_Location(), l1t::EmtfPtAssignment.calculateAddress(), TBPositionCalc.CalculateCMSPos(), calculateEta(), MuonNavigationSchool.calculateEta(), DirectTrackerNavigation.calculateEta(), ConversionLikelihoodCalculator.calculateLikelihood(), CalculatePt_FullPrecision(), EcalClusterToolsT< noZS >.cluster2ndMoments(), GsfMultipleScatteringUpdator.compute(), MultipleScatteringSimulator.compute(), PairProductionSimulator.compute(), EnergyLossSimulator.compute(), BremsstrahlungSimulator.compute(), NuclearInteractionSimulator.compute(), VolumeEnergyLossEstimator.computeBetheBloch(), EnergyLossUpdator.computeBetheBloch(), TMarkov.computeChain(), PileupJetIdAlgo.computeCutIDflag(), VolumeEnergyLossEstimator.computeElectrons(), EnergyLossUpdator.computeElectrons(), HDRShower.computeShower(), EcalSelectiveReadoutValidation.configFirWeights(), DDHCalBarrelAlgo.constructMidLayer(), DDHCalBarrelAlgo.constructSideLayer(), CordicXilinx.CordicXilinx(), EGEnergyCorrector.CorrectedEnergyWithError(), HFRecoEcalCandidateAlgo.correctEPosition(), MuonMETAlgo.correctMETforMuon(), VVIObjDetails.cosint(), sistripvvi::VVIObjDetails.cosint(), PFClusterShapeAlgo.covariances(), EcalClusterToolsT< noZS >.covariances(), cond::RelationalAuthenticationService::RelationalAuthenticationService.credentials(), BTagLikeDeDxDiscriminator.dedx(), EvolutionECAL.DegradationMeanEM50GeV(), CastorTimeSlew.delay(), HcalTimeSlew.delay(), PFRecoTauDiscriminationByMVAIsolationRun2.discriminate(), PFRecoTauDiscriminationByIsolation.discriminate(), TemplatedSimpleSecondaryVertexComputer< IPTI, VTX >.discriminator(), TemplatedJetBProbabilityComputer< Container, Base >.discriminator(), PF_PU_AssoMapAlgos.dR(), ChargeDrifterFP420.drift(), DAClusterizerInZ.dump(), DAClusterizerInZ_vect.dump(), MuScleFit.duringFastLoop(), Pi0FixedMassWindowCalibration.duringLoop(), ECALPositionCalculator.ecalEta(), ContainmentCorrectionAnalyzer.ecalEta(), EgammaSuperClusters.ecalEta(), EgammaObjects.ecalEta(), EcalUncalibRecHitRecChi2Algo< C >.EcalUncalibRecHitRecChi2Algo(), Conv.elec(), EMShower.EMShower(), CalorimetryManager.EMShowerSimulation(), CaloTowersCreationAlgo.emShwrLogWeightPos(), TtSemiLepJetCombMVATrainer.endJob(), GsfElectronDataAnalyzer.endJob(), GsfElectronMCFakeAnalyzer.endJob(), GsfElectronFakeAnalyzer.endJob(), GsfElectronMCAnalyzer.endJob(), HLTExoticaSubAnalysis.endRun(), npstat::EquidistantInLogSpace.EquidistantInLogSpace(), hf_egamma.eSeLCorrected(), VolumeMultipleScatteringEstimator.estimate(), kinem.eta(), Geom::OnePiRange< T >.eta(), reco::GhostTrackPrediction.eta(), RawParticle.eta(), cscdqm::Detector.Eta(), fastmath.etaphi(), reco::btau.etaRel(), PhotonsWithConversionsAnalyzer.etaTransformation(), SimpleConvertedPhotonAnalyzer.etaTransformation(), MCElectronAnalyzer.etaTransformation(), MCPhotonAnalyzer.etaTransformation(), MCPizeroAnalyzer.etaTransformation(), SimplePhotonAnalyzer.etaTransformation(), TkConvValidator.etaTransformation(), PhotonValidator.etaTransformation(), ConversionProducer.etaTransformation(), VariablePower.eval(), ESRecHitAnalyticAlgo.EvalAmplitude(), ESRecHitSimAlgo.evalAmplitude(), PFPhotonAlgo.EvaluateLCorrMVA(), DDHCalFibreBundle.execute(), VVIObjDetails.expint(), sistripvvi::VVIObjDetails.expint(), sistripvvi::VVIObjDetails.f1(), sistripvvi::VVIObjDetails.f2(), FFTGenericScaleCalculator.f_safeLog(), fcnbg(), fcnsg(), HcalTestAnalysis.fill(), SimG4HcalValidation.fill(), HcalTB04Analysis.fillBuffer(), DaqFakeReader.fillFEDs(), TrackerHitProducer.fillG4MC(), EnergyScaleAnalyzer.fillTree(), ZeePlots.fillZMCInfo(), PythiaFilterMultiMother.filter(), PythiaFilter.filter(), DJpsiFilter.filter(), ElectronMcFakePostValidator.finalize(), ElectronMcSignalPostValidator.finalize(), TFParams.fitpj(), GflashHadronShowerProfile.fLnE1(), GflashHadronShowerProfile.fTanh(), FWExpressionValidator.FWExpressionValidator(), FWLegoCandidate.FWLegoCandidate(), GammaFunctionGenerator.gammaFrac(), GammaFunctionGenerator.gammaInt(), GammaLn(), Vx3DHLTAnalyzer.Gauss3DFunc(), PairProductionSimulator.gbteth(), BremsstrahlungSimulator.gbteth(), MuonBremsstrahlungSimulator.gbteth(), GaussianTailNoiseGenerator.generate_gaussian_tail(), EcalTestDevDB.generateEcalLaserAPDPNRatios(), CSCGasCollisions.generateEnergyLoss(), BaseNumericalRandomGenerator.generateExp(), TrackerMap.getAutomaticRange(), ECalSD.getBirkL3(), TrackerMap.getcolor(), SteppingHelixPropagator.getDeDx(), reco::PFCluster.getDepthCorrection(), DetIdAssociator.getDetIdsCloseToAPoint(), ZdcSD.getEnergyDeposit(), CastorSD.getEnergyDeposit(), EcalClusterToolsT< noZS >.getEnergyDepTopology(), HcalGeomParameters.getEta(), HcalDDDSimConstants.getEta(), TopologyWorker.getetaphi(), PythiaFilterIsolatedTrack.GetEtaPhiAtEcal(), IsolatedPixelTrackCandidateProducer.GetEtaPhiAtEcal(), IsolatedPixelTrackCandidateL1TProducer.GetEtaPhiAtEcal(), IsoTrig.GetEtaPhiAtEcal(), HCALResponse.getHCALEnergyResponse(), EcalTrivialConditionRetriever.getIntercalibConstantsFromConfiguration(), npstat::GridAxis.getInterval(), CastorShowerLibraryMaker.GetKinematics(), HcalTB06BeamSD.getNames(), MaterialBudgetHcalHistos.getNames(), HCalSD.getNames(), popcon::EcalLaser_weekly_Linearization_Check.getNewObjects(), GflashHadronShowerProfile.getNumberOfSpots(), CastorShowerLibrary.getShowerHits(), HcalTB02HcalNumberingScheme.getUnitID(), EcalClusterLocalContCorrection.getValue(), EcalBasicClusterLocalContCorrection.getValue(), EcalClusterCrackCorrection.getValue(), JetCharge.getWeight(), HFGflash.gfParameterization(), GflashHadronShowerProfile.hadronicParameterization(), HCalSD.HCalSD(), HcalTB06BeamSD.HcalTB06BeamSD(), HDShower.HDShower(), HcalHF_S9S1algorithm.HFSetFlagFromS9S1(), HFShower.HFShower(), gen::Cascade2Hadronizer.imposeProperTime(), gen::Pythia6Hadronizer.imposeProperTime(), cond::XMLAuthenticationService::XMLAuthenticationService.initialize(), npstat::GridAxis.initialize(), ParticlePropagator.initProperDecayTime(), heppy::IsolationComputer.isoSumNeutralsWeighted(), reco::TrackProbabilityTagInfo.jetProbability(), TemplatedJetProbabilityComputer< Container, Base >.jetProbability(), TemplatedJetBProbabilityComputer< Container, Base >.jetProbability(), EMECALShowerParametrization.k4(), LandauFP420.LandauFP420(), CSCTFPtMethods.Likelihood(), likelihood(), CSCTFPtMethods.Likelihood2(), CSCTFPtMethods.Likelihood2011(), CSCTFPtMethods.Likelihood2_2011(), npstat::GridAxis.linearInterval(), IncompleteGammaComplement.ln(), GaussianSumUtilities1D.lnPdf(), CaloTPGTranscoderULUT.loadHCALCompress(), GflashKaonPlusShowerProfile.loadParameters(), GflashPiKShowerProfile.loadParameters(), GflashKaonMinusShowerProfile.loadParameters(), GflashProtonShowerProfile.loadParameters(), GflashAntiProtonShowerProfile.loadParameters(), EcalClusterLocal.localCoordsEB(), EcalClusterLocal.localCoordsEE(), EcalClusterToolsT< noZS >.localCovariances(), fit::Likelihood< Sample, PDF, Yield >.log(), fit::Likelihood< Sample, PDF, NoExtendedLikelihood >.log(), logarithm(), CSCCrossGap.logGamma(), fit::Likelihood< Sample, PDF, Yield >.logNFactorial(), SteppingHelixPropagator.makeAtomStep(), HFClusterAlgo.makeCluster(), FFTEtaLogPtConeRadiusMapper< MyJet, Adjustable >.map(), FFTGenericScaleCalculator.mapFFTJet(), L2AbsScaleCalculator.mapFFTJet(), EMECALShowerParametrization.meanLnAlphaHom(), EMECALShowerParametrization.meanLnAlphaSam(), EMECALShowerParametrization.meanLnTHom(), EMECALShowerParametrization.meanLnTSam(), GflashHadronShowerProfile.medianLateralArm(), MuonResidualsFitter_compute_log_convolution(), MuonResidualsFitter_logGaussPowerTails(), MuonResidualsFitter_logPowerLawTails(), MuonResidualsFitter_logPureGaussian(), MuonResidualsFitter_logPureGaussian2D(), MuonResidualsFitter_logROOTVoigt(), SoftElectronMVAEstimator.mva(), AntiElectronIDMVA5.MVAValue(), AntiElectronIDMVA6.MVAValue(), L1CaloHcalScaleConfigOnlineProd.newObject(), GoldenPattern.normalise(), EMECALShowerParametrization.nSpotsHom(), oldComputeBetheBloch(), oldComputeElectrons(), ESRecHitSimAlgo.oldEvalAmplitude(), oldMUcompute(), LowPassFilterTiming.operator()(), funct::LogStruct< T >.operator()(), TtDecayChannelSelector.operator()(), reco::parser::log_f.operator()(), fit::HistoPoissonLikelihoodRatio< T >.operator()(), fftjetcms::EtaAndPtDependentPeakSelector.operator()(), TtHadLRSignalSelObservables.operator()(), FcnBeamSpotFitPV.operator()(), BSpdfsFcn.operator()(), TtSemiLRSignalSelObservables.operator()(), fftjetcms::EtaAndPtLookupPeakSelector.operator()(), SimG4HcalHitCluster.operator+=(), EMECALShowerParametrization.p3(), logintpack.pack8log(), logintpack.pack8logCeil(), logintpack.pack8logClosed(), SiPixelRecHitQuality::Packing.Packing(), GflashEMShowerProfile.parameterization(), reco::PFCandidateEGammaExtra.PFCandidateEGammaExtra(), reco::PFCandidateElectronExtra.PFCandidateElectronExtra(), PFPhotonClusters.PFCrystalCoor(), PFSCEnergyCalibration.PFSCEnergyCalibration(), SiPixelTemplateSplit.PixelTempSplit(), JetPartonMatching.print(), TKinFitter.print(), TtSemiLeptonicEvent.print(), TtFullLeptonicEvent.print(), TtFullHadronicEvent.print(), TopGenEvent.print(), print_rates(), EcalSelectiveReadoutValidation.printAvailableHists(), TKinFitter.printMatrix(), l1t::Stage2TowerCompressAlgorithmFirmwareImp1.processEvent(), HcalBeamMonitor.processEvent(), cond::XMLAuthenticationService::XMLAuthenticationService.processFile(), edm::FlatRandomOneOverPtGunProducer.produce(), QGTagger.produce(), CastorFastTowerProducer.produce(), CastorFastClusterProducer.produce(), DeltaBetaWeights.produce(), SoftPFMuonTagInfoProducer.produce(), SoftPFElectronTagInfoProducer.produce(), MuonSimHitProducer.produce(), EcalTrivialConditionRetriever.produceEcalLaserAPDPNRatios(), ecaldqm::RawDataClient.producePlots(), RPCpg.rate(), PixelCPEBase.rawQualityWord(), heppy::Hemisphere.Reconstruct(), heppy::Hemisphere.RejectISR(), SoftLepton.relativeEta(), EvolutionECAL.ResolutionConstantTermEM50GeV(), ElectronLikelihood.resultLog(), EcalClusterToolsT< noZS >.roundnessSelectedBarrelRecHits(), RecoTracktoTP.s_eta(), TPtoRecoTrack.s_eta(), LandauFP420.SampleFluctuations(), TrackerMap.save(), TrackerMap.save_as_fectrackermap(), TrackerMap.save_as_fedtrackermap(), TrackerMap.save_as_HVtrackermap(), TrackerMap.save_as_psutrackermap(), BSFitter.scanPDF(), EcalClusterToolsT< noZS >.scLocalCovariances(), HDRShower.setFuncParam(), PFElectronAlgo.SetIDOutputs(), SiPixelRecHitQuality::Packing.setProbabilityQ(), SiPixelRecHitQuality::Packing.setProbabilityXY(), HBHEPulseShapeFlagSetter.SetPulseShapeFlags(), GaussianTail.shoot(), SiG4UniversalFluctuation.SiG4UniversalFluctuation(), WeakEffectsWeightProducer.sigma0_qqbarll(), cscdqm::Utility.SignificanceLevelHigh(), cscdqm::Utility.SignificanceLevelLow(), RPCSimParam.simulate(), GflashShowino.simulateFirstInteractionPoint(), GEMSimpleModel.simulateSignal(), VVIObjDetails.sincosint(), sistripvvi::VVIObjDetails.sincosint(), smearFunctionBase.smearEta(), HepMCValidationHelper.sortByRapidity(), TBposition(), hitfit.theta_to_eta(), MuonNavigableLayer.trackingRange(), muon.trackProbability(), TtFullHadSignalSel.TtFullHadSignalSel(), HcalNumberingFromDDD.unitID(), PrintGeomMatInfo.update(), PrintGeomInfoAction.update(), EcalSimHitsValidProducer.update(), TrackingVerboseAction.update(), HcalTestAnalysis.update(), HcalTB02Analysis.update(), DoCastorAnalysis.update(), ZdcTestAnalysis.update(), CastorTestAnalysis.update(), FP420Test.update(), BscTest.update(), FWPFLegoRecHit.updateScale(), IncompleteGammaComplement.value(), PuppiContainer.var_within_R(), cond::XMLAuthenticationService::XMLAuthenticationService.verifyFileName(), VVIObj.VVIObj(), sistripvvi::VVIObj.VVIObj(), kinem.y(), and EMECALShowerParametrization.z1().

string dqm-mbProfile.LOG_FORMAT = '%(asctime)s: %(name)-20s - %(levelname)-8s - %(message)s'

Definition at line 15 of file dqm-mbProfile.py.

tuple dqm-mbProfile.p = os.path.dirname(args.file)

Definition at line 295 of file dqm-mbProfile.py.

tuple dqm-mbProfile.parser = argparse.ArgumentParser(description="Profile child processes and produce data for rss and such graphs.")

Definition at line 273 of file dqm-mbProfile.py.