CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
FastTimerService::PlotsPerElement Class Reference

Public Member Functions

void book (DQMStore::IBooker &, std::string const &name, std::string const &title, PlotRanges const &ranges, unsigned int lumisections, bool byls)
 
void fill (Resources const &, unsigned int lumisection)
 
void fill_fraction (Resources const &, Resources const &, unsigned int lumisection)
 
 PlotsPerElement ()
 
void reset ()
 

Private Attributes

TH1F * allocated_
 
TProfile * allocated_byls_
 
TH1F * deallocated_
 
TProfile * deallocated_byls_
 
TH1F * time_real_
 
TProfile * time_real_byls_
 
TH1F * time_thread_
 
TProfile * time_thread_byls_
 

Detailed Description

Definition at line 327 of file FastTimerService.h.

Constructor & Destructor Documentation

FastTimerService::PlotsPerElement::PlotsPerElement ( )

Definition at line 289 of file FastTimerService.cc.

Member Function Documentation

void FastTimerService::PlotsPerElement::book ( DQMStore::IBooker booker,
std::string const &  name,
std::string const &  title,
PlotRanges const &  ranges,
unsigned int  lumisections,
bool  byls 
)

Definition at line 316 of file FastTimerService.cc.

References allocated_, allocated_byls_, DQMStore::IBooker::book1D(), DQMStore::IBooker::bookProfile(), deallocated_, deallocated_byls_, cmsPerfStripChart::format, MonitorElement::getTH1F(), MonitorElement::getTProfile(), infinity, createfilelist::int, memory_usage::is_available(), FastTimerService::PlotRanges::memory_range, FastTimerService::PlotRanges::memory_resolution, harvestTrackValidationPlots::str, AlCaHLTBitMon_QueryRunRegistry::string, FastTimerService::PlotRanges::time_range, time_real_, time_real_byls_, FastTimerService::PlotRanges::time_resolution, time_thread_, and time_thread_byls_.

Referenced by FastTimerService::PlotsPerPath::book(), FastTimerService::PlotsPerProcess::book(), and FastTimerService::PlotsPerJob::book().

323 {
324  int time_bins = (int) std::ceil(ranges.time_range / ranges.time_resolution);
325  int mem_bins = (int) std::ceil(ranges.memory_range / ranges.memory_resolution);
326  std::string y_title_ms = (boost::format("events / %.1f ms") % ranges.time_resolution).str();
327  std::string y_title_kB = (boost::format("events / %.1f kB") % ranges.memory_resolution).str();
328 
329  time_thread_ = booker.book1D(
330  name + " time_thread",
331  title + " processing time (cpu)",
332  time_bins, 0., ranges.time_range
333  )->getTH1F();
334  time_thread_->StatOverflows(true);
335  time_thread_->SetXTitle("processing time [ms]");
336  time_thread_->SetYTitle(y_title_ms.c_str());
337 
338  time_real_ = booker.book1D(
339  name + " time_real",
340  title + " processing time (real)",
341  time_bins, 0., ranges.time_range
342  )->getTH1F();
343  time_real_->StatOverflows(true);
344  time_real_->SetXTitle("processing time [ms]");
345  time_real_->SetYTitle(y_title_ms.c_str());
346 
348  {
349  allocated_ = booker.book1D(
350  name + " allocated",
351  title + " allocated memory",
352  mem_bins, 0., ranges.memory_range
353  )->getTH1F();
354  allocated_->StatOverflows(true);
355  allocated_->SetXTitle("memory [kB]");
356  allocated_->SetYTitle(y_title_kB.c_str());
357 
358  deallocated_ = booker.book1D(
359  name + " deallocated",
360  title + " deallocated memory",
361  mem_bins, 0., ranges.memory_range
362  )->getTH1F();
363  deallocated_->StatOverflows(true);
364  deallocated_->SetXTitle("memory [kB]");
365  deallocated_->SetYTitle(y_title_kB.c_str());
366  }
367 
368  if (not byls)
369  return;
370 
372  name + " time_thread_byls",
373  title + " processing time (cpu) vs. lumisection",
374  lumisections, 0.5, lumisections + 0.5,
375  time_bins, 0., std::numeric_limits<double>::infinity(),
376  " ")->getTProfile();
377  time_thread_byls_->StatOverflows(true);
378  time_thread_byls_->SetXTitle("lumisection");
379  time_thread_byls_->SetYTitle("processing time [ms]");
380 
381  time_real_byls_ = booker.bookProfile(
382  name + " time_real_byls",
383  title + " processing time (real) vs. lumisection",
384  lumisections, 0.5, lumisections + 0.5,
385  time_bins, 0., std::numeric_limits<double>::infinity(),
386  " ")->getTProfile();
387  time_real_byls_->StatOverflows(true);
388  time_real_byls_->SetXTitle("lumisection");
389  time_real_byls_->SetYTitle("processing time [ms]");
390 
392  {
393  allocated_byls_ = booker.bookProfile(
394  name + " allocated_byls",
395  title + " allocated memory vs. lumisection",
396  lumisections, 0.5, lumisections + 0.5,
398  " ")->getTProfile();
399  allocated_byls_->StatOverflows(true);
400  allocated_byls_->SetXTitle("lumisection");
401  allocated_byls_->SetYTitle("memory [kB]");
402 
404  name + " deallocated_byls",
405  title + " deallocated memory vs. lumisection",
406  lumisections, 0.5, lumisections + 0.5,
408  " ")->getTProfile();
409  deallocated_byls_->StatOverflows(true);
410  deallocated_byls_->SetXTitle("lumisection");
411  deallocated_byls_->SetYTitle("memory [kB]");
412  }
413 }
MonitorElement * bookProfile(Args &&...args)
Definition: DQMStore.h:157
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
const double infinity
format
Some error handling for the usage.
string ranges
Definition: diffTwoXMLs.py:78
static bool is_available()
Definition: memory_usage.cc:65
TH1F * getTH1F(void) const
TProfile * getTProfile(void) const
void FastTimerService::PlotsPerElement::fill ( Resources const &  data,
unsigned int  lumisection 
)

Definition at line 416 of file FastTimerService.cc.

References FastTimerService::Resources::allocated, allocated_, allocated_byls_, FastTimerService::Resources::deallocated, deallocated_, deallocated_byls_, AnalysisDataFormats_SUSYBSMObjects::ms, FastTimerService::Resources::time_real, time_real_, time_real_byls_, FastTimerService::Resources::time_thread, time_thread_, and time_thread_byls_.

Referenced by FastTimerService::PlotsPerPath::fill(), FastTimerService::PlotsPerProcess::fill(), and FastTimerService::PlotsPerJob::fill().

417 {
418  if (time_thread_)
419  time_thread_->Fill(ms(data.time_thread));
420 
421  if (time_thread_byls_)
422  time_thread_byls_->Fill(lumisection, ms(data.time_thread));
423 
424  if (time_real_)
425  time_real_->Fill(ms(data.time_real));
426 
427  if (time_real_byls_)
428  time_real_byls_->Fill(lumisection, ms(data.time_real));
429 
430  if (allocated_)
431  allocated_->Fill(kB(data.allocated));
432 
433  if (allocated_byls_)
434  allocated_byls_->Fill(lumisection, kB(data.allocated));
435 
436  if (deallocated_)
437  deallocated_->Fill(kB(data.deallocated));
438 
439  if (deallocated_byls_)
440  deallocated_byls_->Fill(lumisection, kB(data.deallocated));
441 }
susybsm::MuonSegment ms
Definition: classes.h:31
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
void FastTimerService::PlotsPerElement::fill_fraction ( Resources const &  data,
Resources const &  part,
unsigned int  lumisection 
)

Definition at line 444 of file FastTimerService.cc.

References FastTimerService::Resources::allocated, allocated_, allocated_byls_, FastTimerService::Resources::deallocated, deallocated_, deallocated_byls_, dedxEstimators_cff::fraction, AnalysisDataFormats_SUSYBSMObjects::ms, FastTimerService::Resources::time_real, time_real_, time_real_byls_, FastTimerService::Resources::time_thread, time_thread_, time_thread_byls_, and pileupDistInMC::total.

445 {
446  float total;
447  float fraction;
448 
449  total = ms(data.time_thread);
450  fraction = (total > 0.) ? (ms(part.time_thread) / total) : 0.;
451  if (time_thread_)
452  time_thread_->Fill(total, fraction);
453 
454  if (time_thread_byls_)
455  time_thread_byls_->Fill(lumisection, total, fraction);
456 
457  total = ms(data.time_real);
458  fraction = (total > 0.) ? (ms(part.time_real) / total) : 0.;
459  if (time_real_)
460  time_real_->Fill(total, fraction);
461 
462  if (time_real_byls_)
463  time_real_byls_->Fill(lumisection, total, fraction);
464 
465  total = kB(data.allocated);
466  fraction = (total > 0.) ? (kB(part.allocated) / total) : 0.;
467  if (allocated_)
468  allocated_->Fill(total, fraction);
469 
470  if (allocated_byls_)
471  allocated_byls_->Fill(lumisection, total, fraction);
472 
473  total = kB(data.deallocated);
474  fraction = (total > 0.) ? (kB(part.deallocated) / total) : 0.;
475  if (deallocated_)
476  deallocated_->Fill(total, fraction);
477 
478  if (deallocated_byls_)
479  deallocated_byls_->Fill(lumisection, total, fraction);
480 }
part
Definition: HCALResponse.h:20
susybsm::MuonSegment ms
Definition: classes.h:31
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
void FastTimerService::PlotsPerElement::reset ( void  )

Member Data Documentation

TH1F* FastTimerService::PlotsPerElement::allocated_
private

Definition at line 341 of file FastTimerService.h.

Referenced by book(), fill(), fill_fraction(), and reset().

TProfile* FastTimerService::PlotsPerElement::allocated_byls_
private

Definition at line 342 of file FastTimerService.h.

Referenced by book(), fill(), fill_fraction(), and reset().

TH1F* FastTimerService::PlotsPerElement::deallocated_
private

Definition at line 343 of file FastTimerService.h.

Referenced by book(), fill(), fill_fraction(), and reset().

TProfile* FastTimerService::PlotsPerElement::deallocated_byls_
private

Definition at line 344 of file FastTimerService.h.

Referenced by book(), fill(), fill_fraction(), and reset().

TH1F* FastTimerService::PlotsPerElement::time_real_
private

Definition at line 339 of file FastTimerService.h.

Referenced by book(), fill(), fill_fraction(), and reset().

TProfile* FastTimerService::PlotsPerElement::time_real_byls_
private

Definition at line 340 of file FastTimerService.h.

Referenced by book(), fill(), fill_fraction(), and reset().

TH1F* FastTimerService::PlotsPerElement::time_thread_
private

Definition at line 337 of file FastTimerService.h.

Referenced by book(), fill(), fill_fraction(), and reset().

TProfile* FastTimerService::PlotsPerElement::time_thread_byls_
private

Definition at line 338 of file FastTimerService.h.

Referenced by book(), fill(), fill_fraction(), and reset().