CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes
FastTimerService Class Reference

#include <FastTimerService.h>

Classes

struct  LuminosityDescription
 
struct  ModuleInfo
 
struct  PathInfo
 
struct  PathProfilesPerProcess
 
struct  ProcessDescription
 
struct  StreamData
 
struct  SummaryPlots
 
struct  SummaryPlotsPerProcess
 
struct  SummaryProfiles
 
struct  SummaryProfilesPerProcess
 
struct  Timing
 
struct  TimingPerProcess
 

Public Member Functions

double currentEventTime (edm::StreamID) const
 
double currentModuleTime (edm::StreamID) const
 
double currentPathTime (edm::StreamID) const
 
 FastTimerService (const edm::ParameterSet &, edm::ActivityRegistry &)
 
double queryEventTime (edm::StreamID) const
 
double queryModuleTime (edm::StreamID, const edm::ModuleDescription &) const
 
double queryModuleTime (edm::StreamID, unsigned int id) const
 
double queryModuleTimeByLabel (edm::StreamID, const std::string &) const
 
double queryModuleTimeByType (edm::StreamID, const std::string &) const
 
double querySourceTime (edm::StreamID) const
 
unsigned int reserveLuminosityPlots (std::string const &name, std::string const &title, std::string const &label, double range, double resolution)
 
unsigned int reserveLuminosityPlots (std::string &&name, std::string &&title, std::string &&label, double range, double resolution)
 
void setLuminosity (unsigned int stream_id, unsigned int luminosity_id, double value)
 
 ~FastTimerService ()
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Types

template<typename T >
using ModuleMap = std::vector< T >
 
template<typename T >
using PathMap = std::vector< std::unordered_map< std::string, T >>
 

Private Member Functions

void fillPathMap (unsigned int pid, std::string const &name, std::vector< std::string > const &modules)
 
void postEndJob ()
 
void postEvent (edm::StreamContext const &)
 
void postGlobalEndRun (edm::GlobalContext const &)
 
void postModuleEvent (edm::StreamContext const &, edm::ModuleCallingContext const &)
 
void postModuleEventDelayedGet (edm::StreamContext const &, edm::ModuleCallingContext const &)
 
void postPathEvent (edm::StreamContext const &, edm::PathContext const &, edm::HLTPathStatus const &)
 
void postSourceEvent (edm::StreamID)
 
void postStreamBeginLumi (edm::StreamContext const &)
 
void postStreamBeginRun (edm::StreamContext const &)
 
void postStreamEndLumi (edm::StreamContext const &)
 
void postStreamEndRun (edm::StreamContext const &)
 
void preallocate (edm::service::SystemBounds const &)
 
void preEvent (edm::StreamContext const &)
 
void preGlobalBeginRun (edm::GlobalContext const &)
 
void preModuleBeginJob (edm::ModuleDescription const &)
 
void preModuleEvent (edm::StreamContext const &, edm::ModuleCallingContext const &)
 
void preModuleEventDelayedGet (edm::StreamContext const &, edm::ModuleCallingContext const &)
 
void prePathEvent (edm::StreamContext const &, edm::PathContext const &)
 
void preSourceEvent (edm::StreamID)
 
void preStreamBeginRun (edm::StreamContext const &)
 
void printProcessSummary (Timing const &total, TimingPerProcess const &summary, std::string const &label, std::string const &process) const
 
void printSummary (Timing const &summary, std::string const &label) const
 

Static Private Member Functions

static double delta (FastTimer::Clock::time_point const &first, FastTimer::Clock::time_point const &second)
 
static unsigned int processID (edm::ProcessContext const *)
 

Private Attributes

unsigned int m_concurrent_runs
 
unsigned int m_concurrent_streams
 
unsigned int m_concurrent_threads
 
const double m_dqm_eventtime_range
 
const double m_dqm_eventtime_resolution
 
std::vector
< LuminosityDescription
m_dqm_luminosity
 
const double m_dqm_moduletime_range
 
const double m_dqm_moduletime_resolution
 
std::string m_dqm_path
 
const double m_dqm_pathtime_range
 
const double m_dqm_pathtime_resolution
 
bool m_enable_dqm
 
const bool m_enable_dqm_byls
 
const bool m_enable_dqm_bymodule
 
const bool m_enable_dqm_bymoduletype
 
const bool m_enable_dqm_bynproc
 
const bool m_enable_dqm_bypath_active
 
const bool m_enable_dqm_bypath_counters
 
const bool m_enable_dqm_bypath_details
 
const bool m_enable_dqm_bypath_exclusive
 
const bool m_enable_dqm_bypath_overhead
 
const bool m_enable_dqm_bypath_total
 
const bool m_enable_dqm_summary
 
bool m_enable_timing_exclusive
 
bool m_enable_timing_modules
 
bool m_enable_timing_paths
 
const bool m_enable_timing_summary
 
Timing m_job_summary
 
std::vector< TimingPerProcessm_job_summary_perprocess
 
unsigned int m_module_id
 
std::vector< ProcessDescriptionm_process
 
std::vector< Timingm_run_summary
 
std::vector< std::vector
< TimingPerProcess > > 
m_run_summary_perprocess
 
const bool m_skip_first_path
 
std::vector< StreamDatam_stream
 
std::mutex m_summary_mutex
 
bool m_use_realtime
 

Detailed Description

Definition at line 84 of file FastTimerService.h.

Member Typedef Documentation

template<typename T >
using FastTimerService::ModuleMap = std::vector<T>
private

Definition at line 328 of file FastTimerService.h.

template<typename T >
using FastTimerService::PathMap = std::vector<std::unordered_map<std::string, T>>
private

Definition at line 324 of file FastTimerService.h.

Constructor & Destructor Documentation

FastTimerService::FastTimerService ( const edm::ParameterSet config,
edm::ActivityRegistry registry 
)

Definition at line 46 of file FastTimerService.cc.

References edm::ParameterSet::getUntrackedParameter(), m_enable_dqm_byls, m_enable_dqm_bymodule, m_enable_dqm_bymoduletype, m_enable_dqm_bypath_active, m_enable_dqm_bypath_counters, m_enable_dqm_bypath_details, m_enable_dqm_bypath_exclusive, m_enable_dqm_bypath_overhead, m_enable_dqm_bypath_total, m_enable_timing_exclusive, m_enable_timing_modules, m_enable_timing_paths, or, postEndJob(), postEvent(), postGlobalEndRun(), postModuleEvent(), postModuleEventDelayedGet(), postPathEvent(), postSourceEvent(), postStreamBeginLumi(), postStreamBeginRun(), postStreamEndLumi(), postStreamEndRun(), preallocate(), preEvent(), preGlobalBeginRun(), preModuleBeginJob(), preModuleEvent(), preModuleEventDelayedGet(), prePathEvent(), preSourceEvent(), preStreamBeginRun(), reserveLuminosityPlots(), edm::ActivityRegistry::watchPostEndJob(), edm::ActivityRegistry::watchPostEvent(), edm::ActivityRegistry::watchPostGlobalEndRun(), edm::ActivityRegistry::watchPostModuleEvent(), edm::ActivityRegistry::watchPostModuleEventDelayedGet(), edm::ActivityRegistry::watchPostPathEvent(), edm::ActivityRegistry::watchPostSourceEvent(), edm::ActivityRegistry::watchPostStreamBeginLumi(), edm::ActivityRegistry::watchPostStreamBeginRun(), edm::ActivityRegistry::watchPostStreamEndLumi(), edm::ActivityRegistry::watchPostStreamEndRun(), edm::ActivityRegistry::watchPreallocate(), edm::ActivityRegistry::watchPreEvent(), edm::ActivityRegistry::watchPreGlobalBeginRun(), edm::ActivityRegistry::watchPreModuleBeginJob(), edm::ActivityRegistry::watchPreModuleEvent(), edm::ActivityRegistry::watchPreModuleEventDelayedGet(), edm::ActivityRegistry::watchPrePathEvent(), edm::ActivityRegistry::watchPreSourceEvent(), and edm::ActivityRegistry::watchPreStreamBeginRun().

46  :
47  // configuration
48  // FIXME - reimplement support for cpu time vs. real time
49  m_use_realtime( config.getUntrackedParameter<bool>( "useRealTimeClock" ) ),
50  m_enable_timing_paths( config.getUntrackedParameter<bool>( "enableTimingPaths" ) ),
51  m_enable_timing_modules( config.getUntrackedParameter<bool>( "enableTimingModules" ) ),
52  m_enable_timing_exclusive( config.getUntrackedParameter<bool>( "enableTimingExclusive" ) ),
53  m_enable_timing_summary( config.getUntrackedParameter<bool>( "enableTimingSummary" ) ),
54  m_skip_first_path( config.getUntrackedParameter<bool>( "skipFirstPath" ) ),
55  // dqm configuration
56  m_enable_dqm( config.getUntrackedParameter<bool>( "enableDQM" ) ),
57  m_enable_dqm_bypath_active( config.getUntrackedParameter<bool>( "enableDQMbyPathActive" ) ),
58  m_enable_dqm_bypath_total( config.getUntrackedParameter<bool>( "enableDQMbyPathTotal" ) ),
59  m_enable_dqm_bypath_overhead( config.getUntrackedParameter<bool>( "enableDQMbyPathOverhead" ) ),
60  m_enable_dqm_bypath_details( config.getUntrackedParameter<bool>( "enableDQMbyPathDetails" ) ),
61  m_enable_dqm_bypath_counters( config.getUntrackedParameter<bool>( "enableDQMbyPathCounters" ) ),
62  m_enable_dqm_bypath_exclusive( config.getUntrackedParameter<bool>( "enableDQMbyPathExclusive" ) ),
63  m_enable_dqm_bymodule( config.getUntrackedParameter<bool>( "enableDQMbyModule" ) ),
64  m_enable_dqm_bymoduletype( config.getUntrackedParameter<bool>( "enableDQMbyModuleType" ) ),
65  m_enable_dqm_summary( config.getUntrackedParameter<bool>( "enableDQMSummary" ) ),
66  m_enable_dqm_byls( config.getUntrackedParameter<bool>( "enableDQMbyLumiSection" ) ),
67  m_enable_dqm_bynproc( config.getUntrackedParameter<bool>( "enableDQMbyProcesses" ) ),
68  // job configuration
69  m_concurrent_runs( 0 ),
73  m_dqm_eventtime_range( config.getUntrackedParameter<double>( "dqmTimeRange" ) ), // ms
74  m_dqm_eventtime_resolution( config.getUntrackedParameter<double>( "dqmTimeResolution" ) ), // ms
75  m_dqm_pathtime_range( config.getUntrackedParameter<double>( "dqmPathTimeRange" ) ), // ms
76  m_dqm_pathtime_resolution( config.getUntrackedParameter<double>( "dqmPathTimeResolution" ) ), // ms
77  m_dqm_moduletime_range( config.getUntrackedParameter<double>( "dqmModuleTimeRange" ) ), // ms
78  m_dqm_moduletime_resolution( config.getUntrackedParameter<double>( "dqmModuleTimeResolution" ) ), // ms
79  m_dqm_path( config.getUntrackedParameter<std::string>("dqmPath" ) ),
80  // description of the process(es)
81  m_process(),
82  // description of the luminosity axes
84  // DQM - these are initialized at preStreamBeginRun(), to make sure the DQM service has been loaded
85  m_stream(),
86  // summary data
87  m_run_summary(),
88  m_job_summary(),
91 {
92  // enable timers if required by DQM plots
100 
109 
112 
113 
122  registry.watchPostEndJob( this, & FastTimerService::postEndJob );
126  registry.watchPreEvent( this, & FastTimerService::preEvent );
127  registry.watchPostEvent( this, & FastTimerService::postEvent );
128  // watch per-path events
131  // watch per-module events if enabled
137  }
138 
139  // if requested, reserve plots for timing vs. lumisection
140  // there is no need to store the id, as it wil always be 0
141  if (m_enable_dqm_byls)
142  reserveLuminosityPlots("ls", "lumisection", "lumisection", config.getUntrackedParameter<uint32_t>("dqmLumiSectionsRange"), 1.);
143 
144 }
void preGlobalBeginRun(edm::GlobalContext const &)
void preModuleEventDelayedGet(edm::StreamContext const &, edm::ModuleCallingContext const &)
T getUntrackedParameter(std::string const &, T const &) const
void postStreamBeginRun(edm::StreamContext const &)
void watchPreEvent(PreEvent::slot_type const &iSlot)
const double m_dqm_eventtime_resolution
void postStreamEndLumi(edm::StreamContext const &)
void watchPrePathEvent(PrePathEvent::slot_type const &iSlot)
void watchPreallocate(Preallocate::slot_type const &iSlot)
void watchPostEndJob(PostEndJob::slot_type const &iSlot)
unsigned int m_concurrent_streams
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
void postModuleEvent(edm::StreamContext const &, edm::ModuleCallingContext const &)
void watchPreModuleEvent(PreModuleEvent::slot_type const &iSlot)
const bool m_enable_dqm_bypath_counters
const bool m_skip_first_path
void watchPostEvent(PostEvent::slot_type const &iSlot)
const bool m_enable_dqm_bypath_exclusive
std::vector< ProcessDescription > m_process
void watchPostStreamEndLumi(PostStreamEndLumi::slot_type const &iSlot)
const double m_dqm_pathtime_range
void watchPostPathEvent(PostPathEvent::slot_type const &iSlot)
void watchPostModuleEvent(PostModuleEvent::slot_type const &iSlot)
void watchPostSourceEvent(PostSourceEvent::slot_type const &iSlot)
std::vector< TimingPerProcess > m_job_summary_perprocess
void postPathEvent(edm::StreamContext const &, edm::PathContext const &, edm::HLTPathStatus const &)
unsigned int m_concurrent_threads
std::string m_dqm_path
unsigned int m_concurrent_runs
void postStreamBeginLumi(edm::StreamContext const &)
void preModuleBeginJob(edm::ModuleDescription const &)
const bool m_enable_dqm_bynproc
std::vector< LuminosityDescription > m_dqm_luminosity
unsigned int m_module_id
void prePathEvent(edm::StreamContext const &, edm::PathContext const &)
const bool m_enable_dqm_byls
void watchPostStreamBeginLumi(PostStreamBeginLumi::slot_type const &iSlot)
const double m_dqm_moduletime_resolution
void watchPreModuleEventDelayedGet(PreModuleEventDelayedGet::slot_type const &iSlot)
void postEvent(edm::StreamContext const &)
void postGlobalEndRun(edm::GlobalContext const &)
std::vector< std::vector< TimingPerProcess > > m_run_summary_perprocess
void postStreamEndRun(edm::StreamContext const &)
void preModuleEvent(edm::StreamContext const &, edm::ModuleCallingContext const &)
const bool m_enable_dqm_bypath_details
std::vector< Timing > m_run_summary
const bool m_enable_dqm_bypath_overhead
static constexpr unsigned int invalidID()
Returns a value identifying an invalid id (the max unsigned int value)
void watchPreModuleBeginJob(PreModuleBeginJob::slot_type const &iSlot)
void watchPostStreamEndRun(PostStreamEndRun::slot_type const &iSlot)
void watchPreGlobalBeginRun(PreGlobalBeginRun::slot_type const &iSlot)
const bool m_enable_dqm_bymodule
void postModuleEventDelayedGet(edm::StreamContext const &, edm::ModuleCallingContext const &)
const double m_dqm_moduletime_range
void watchPostModuleEventDelayedGet(PostModuleEventDelayedGet::slot_type const &iSlot)
void watchPostGlobalEndRun(PostGlobalEndRun::slot_type const &iSlot)
void preSourceEvent(edm::StreamID)
void preEvent(edm::StreamContext const &)
const bool m_enable_timing_summary
void postSourceEvent(edm::StreamID)
const bool m_enable_dqm_bymoduletype
const bool m_enable_dqm_summary
void watchPostStreamBeginRun(PostStreamBeginRun::slot_type const &iSlot)
const bool m_enable_dqm_bypath_total
void watchPreStreamBeginRun(PreStreamBeginRun::slot_type const &iSlot)
const bool m_enable_dqm_bypath_active
void watchPreSourceEvent(PreSourceEvent::slot_type const &iSlot)
void preStreamBeginRun(edm::StreamContext const &)
std::vector< StreamData > m_stream
unsigned int reserveLuminosityPlots(std::string const &name, std::string const &title, std::string const &label, double range, double resolution)
void preallocate(edm::service::SystemBounds const &)
const double m_dqm_eventtime_range
const double m_dqm_pathtime_resolution
FastTimerService::~FastTimerService ( )

Definition at line 146 of file FastTimerService.cc.

147 {
148 }

Member Function Documentation

double FastTimerService::currentEventTime ( edm::StreamID  sid) const

Definition at line 1279 of file FastTimerService.cc.

References m_stream.

1279  {
1280  return m_stream[sid].timer_event.secondsUntilNow();
1281 }
std::vector< StreamData > m_stream
double FastTimerService::currentModuleTime ( edm::StreamID  sid) const

Definition at line 1269 of file FastTimerService.cc.

References m_stream.

1269  {
1270  return m_stream[sid].current_module->timer.secondsUntilNow();
1271 }
std::vector< StreamData > m_stream
double FastTimerService::currentPathTime ( edm::StreamID  sid) const

Definition at line 1274 of file FastTimerService.cc.

References m_stream.

1274  {
1275  return m_stream[sid].current_path->timer.secondsUntilNow();
1276 }
std::vector< StreamData > m_stream
static double FastTimerService::delta ( FastTimer::Clock::time_point const &  first,
FastTimer::Clock::time_point const &  second 
)
inlinestaticprivate

Definition at line 754 of file FastTimerService.h.

References prof2calltree::count, and first.

Referenced by postEvent(), postPathEvent(), preEvent(), prePathEvent(), and preSourceEvent().

755  {
756  return std::chrono::duration_cast<std::chrono::duration<double>>(second - first).count();
757  }
U second(std::pair< T, U > const &p)
bool first
Definition: L1TdeRCT.cc:75
void FastTimerService::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 1385 of file FastTimerService.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::addUntracked(), and AlCaHLTBitMon_QueryRunRegistry::string.

1385  {
1387  desc.addUntracked<bool>( "useRealTimeClock", true);
1388  desc.addUntracked<bool>( "enableTimingPaths", true);
1389  desc.addUntracked<bool>( "enableTimingModules", true);
1390  desc.addUntracked<bool>( "enableTimingExclusive", false);
1391  desc.addUntracked<bool>( "enableTimingSummary", false);
1392  desc.addUntracked<bool>( "skipFirstPath", false),
1393  desc.addUntracked<bool>( "enableDQM", true);
1394  desc.addUntracked<bool>( "enableDQMbyPathActive", false);
1395  desc.addUntracked<bool>( "enableDQMbyPathTotal", true);
1396  desc.addUntracked<bool>( "enableDQMbyPathOverhead", false);
1397  desc.addUntracked<bool>( "enableDQMbyPathDetails", false);
1398  desc.addUntracked<bool>( "enableDQMbyPathCounters", true);
1399  desc.addUntracked<bool>( "enableDQMbyPathExclusive", false);
1400  desc.addUntracked<bool>( "enableDQMbyModule", false);
1401  desc.addUntracked<bool>( "enableDQMbyModuleType", false);
1402  desc.addUntracked<bool>( "enableDQMSummary", false);
1403  desc.addUntracked<bool>( "enableDQMbyLuminosity", false)->setComment("deprecated: this parameter is ignored");
1404  desc.addUntracked<bool>( "enableDQMbyLumiSection", false);
1405  desc.addUntracked<bool>( "enableDQMbyProcesses", false);
1406  desc.addUntracked<double>( "dqmTimeRange", 1000. ); // ms
1407  desc.addUntracked<double>( "dqmTimeResolution", 5. ); // ms
1408  desc.addUntracked<double>( "dqmPathTimeRange", 100. ); // ms
1409  desc.addUntracked<double>( "dqmPathTimeResolution", 0.5); // ms
1410  desc.addUntracked<double>( "dqmModuleTimeRange", 40. ); // ms
1411  desc.addUntracked<double>( "dqmModuleTimeResolution", 0.2); // ms
1412  desc.addUntracked<double>( "dqmLuminosityRange", 1.e34 )->setComment("deprecated: this parameter is ignored");
1413  desc.addUntracked<double>( "dqmLuminosityResolution", 1.e31 )->setComment("deprecated: this parameter is ignored");
1414  desc.addUntracked<uint32_t>( "dqmLumiSectionsRange", 2500 ); // ~ 16 hours
1415  desc.addUntracked<std::string>( "dqmPath", "HLT/TimerService");
1416  desc.addUntracked<edm::InputTag>( "luminosityProduct", edm::InputTag("hltScalersRawToDigi"))->setComment("deprecated: this parameter is ignored");
1417  desc.addUntracked<std::vector<unsigned int> >("supportedProcesses", std::vector<unsigned int> { })->setComment("deprecated: this parameter is ignored");
1418  descriptions.add("FastTimerService", desc);
1419 }
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void FastTimerService::fillPathMap ( unsigned int  pid,
std::string const &  name,
std::vector< std::string > const &  modules 
)
private

Definition at line 1237 of file FastTimerService.cc.

References diffTwoXMLs::label, m_stream, python.rootplot.argparse::module, mergeVDriftHistosByStation::name, or, sysUtil::pid, fetchall_from_DQM_v2::pool, edmStreamStallGrapher::stream, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by preGlobalBeginRun().

1237  {
1238  for (auto & stream: m_stream) {
1239 
1240  std::vector<ModuleInfo *> & pathmap = stream.paths[pid][name].modules;
1241  pathmap.clear();
1242  pathmap.reserve( modules.size() );
1243  std::unordered_set<ModuleInfo const *> pool; // keep track of inserted modules
1244  for (auto const & module: modules) {
1245  // fix the name of negated or ignored modules
1246  std::string const & label = (module[0] == '!' or module[0] == '-') ? module.substr(1) : module;
1247 
1248  auto const & it = stream.modules.find(label);
1249  if (it == stream.modules.end()) {
1250  // no matching module was found
1251  pathmap.push_back( 0 );
1252  } else if (pool.insert(& it->second).second) {
1253  // new module
1254  pathmap.push_back(& it->second);
1255  } else {
1256  // duplicate module
1257  pathmap.push_back( 0 );
1258  }
1259  }
1260 
1261  }
1262 }
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
tuple pid
Definition: sysUtil.py:22
std::vector< StreamData > m_stream
Definition: vlib.h:208
void FastTimerService::postEndJob ( )
private

Definition at line 615 of file FastTimerService.cc.

References diffTwoXMLs::label, m_enable_timing_summary, m_job_summary, m_job_summary_perprocess, m_process, mergeVDriftHistosByStation::name, sysUtil::pid, printProcessSummary(), printSummary(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by FastTimerService().

616 {
618  const std::string label = "the whole job";
619  for (unsigned int pid = 0; pid < m_process.size(); ++pid)
621 
622  printSummary(m_job_summary, label);
623  }
624 }
void printSummary(Timing const &summary, std::string const &label) const
std::vector< ProcessDescription > m_process
std::vector< TimingPerProcess > m_job_summary_perprocess
tuple pid
Definition: sysUtil.py:22
const bool m_enable_timing_summary
void printProcessSummary(Timing const &total, TimingPerProcess const &summary, std::string const &label, std::string const &process) const
void FastTimerService::postEvent ( edm::StreamContext const &  sc)
private

Definition at line 773 of file FastTimerService.cc.

References FastTimerService::PathInfo::accept, FastTimerService::ModuleInfo::counter, delta(), FastTimerService::ModuleInfo::dqm_active, FastTimerService::PathInfo::dqm_active, FastTimerService::PathInfo::dqm_exclusive, FastTimerService::PathInfo::dqm_intermodules, FastTimerService::PathInfo::dqm_module_active, FastTimerService::PathInfo::dqm_module_counter, FastTimerService::PathInfo::dqm_module_total, FastTimerService::PathInfo::dqm_overhead, FastTimerService::PathInfo::dqm_postmodules, FastTimerService::PathInfo::dqm_premodules, FastTimerService::PathInfo::dqm_total, i, FastTimerService::PathInfo::index, FastTimerService::PathInfo::last_run, m_dqm_luminosity, m_enable_dqm, m_enable_dqm_bymodule, m_enable_dqm_bymoduletype, m_enable_dqm_bypath_active, m_enable_dqm_bypath_counters, m_enable_dqm_bypath_details, m_enable_dqm_bypath_exclusive, m_enable_dqm_bypath_overhead, m_enable_dqm_bypath_total, m_enable_dqm_summary, m_enable_timing_exclusive, m_enable_timing_modules, m_enable_timing_paths, m_job_summary, m_job_summary_perprocess, m_process, m_run_summary, m_run_summary_perprocess, m_stream, m_summary_mutex, FastTimerService::PathInfo::modules, sysUtil::pid, edm::StreamContext::processContext(), processID(), FastTimerService::ModuleInfo::run_in_path, edm::StreamContext::runIndex(), edmStreamStallGrapher::stream, edm::StreamContext::streamID(), FastTimerService::ModuleInfo::summary_active, FastTimerService::ModuleInfo::time_active, FastTimerService::PathInfo::time_active, FastTimerService::PathInfo::time_exclusive, FastTimerService::PathInfo::time_intermodules, FastTimerService::PathInfo::time_overhead, FastTimerService::PathInfo::time_postmodules, FastTimerService::PathInfo::time_premodules, and FastTimerService::PathInfo::time_total.

Referenced by FastTimerService().

773  {
774  unsigned int pid = processID(sc.processContext());
775  unsigned int sid = sc.streamID();
776  unsigned int rid = sc.runIndex();
777  auto & stream = m_stream[sid];
778 
779  // stop the per-event timer, and account event time
780  stream.timer_event.stop();
781  stream.timer_last_transition = stream.timer_event.getStopTime();
782  stream.timing_perprocess[pid].event = stream.timer_event.seconds();
783 
784  // the last part of inter-path overhead is the time between the end of the last (end)path and the end of the event processing
785  double interpaths = delta(stream.timer_last_path, stream.timer_event.getStopTime());
786  stream.timing_perprocess[pid].interpaths += interpaths;
787  stream.timing_perprocess[pid].paths_interpaths.back() = interpaths;
788 
789  {
790  // prevent different threads from updating the summary information at the same time
791  std::lock_guard<std::mutex> lock_summary(m_summary_mutex);
792 
793  // keep track of the total number of events and add this event's time to the per-run and per-job summary
794  m_run_summary_perprocess[rid][pid] += stream.timing_perprocess[pid];
795  m_job_summary_perprocess[pid] += stream.timing_perprocess[pid];
796 
797  // account the whole event timing details
798  if (pid+1 == m_process.size()) {
799  stream.timing.count = 1;
800  stream.timing.preevent = stream.timing_perprocess[0].preevent;
801  stream.timing.event = stream.timing_perprocess[0].event;
802  for (unsigned int i = 1; i < m_process.size(); ++i) {
803  stream.timing.event += stream.timing_perprocess[i].preevent;
804  stream.timing.event += stream.timing_perprocess[i].event;
805  }
806  m_run_summary[rid] += stream.timing;
807  m_job_summary += stream.timing;
808  }
809  }
810 
811  // elaborate "exclusive" modules
813  for (auto & keyval: stream.paths[pid]) {
814  PathInfo & pathinfo = keyval.second;
815  pathinfo.time_exclusive = pathinfo.time_overhead;
816 
817  for (uint32_t i = 0; i < pathinfo.last_run; ++i) {
818  ModuleInfo * module = pathinfo.modules[i];
819  if (module == 0)
820  // this is a module occurring more than once in the same path, skip it after the first occurrence
821  continue;
822  if ((module->run_in_path == & pathinfo) and (module->counter == 1))
823  pathinfo.time_exclusive += module->time_active;
824  }
825  }
826  }
827 
828  // fill the information per module type
829  // note: this is done here because during event processing two theads could try to update the same module type at the same time
830  // note: this is done only for the last subprocess, to avoid double conuting the modules' contributions
831  if ((m_enable_timing_modules) and (pid+1 == m_process.size())) {
832  for (unsigned int i = 0; i < stream.fast_modules.size(); ++i)
833  // check for null pointers - there is no guarantee that all module ids are valid and used
834  if (stream.fast_modules[i]) {
835  double active = stream.fast_modules[i]->time_active;
836  ModuleInfo & moduletype = * stream.fast_moduletypes[i];
837  moduletype.time_active += active;
838  moduletype.summary_active += active;
839  }
840  }
841 
842  // fill the DQM plots from the internal buffers
843  if (not m_enable_dqm)
844  return;
845 
846  // fill plots for per-event time by path
847  if (m_enable_timing_paths) {
848 
849  for (auto & keyval: stream.paths[pid]) {
850  PathInfo & pathinfo = keyval.second;
851 
852  stream.dqm_paths[pid].active_time->Fill(pathinfo.index, pathinfo.time_active * 1000.);
854  pathinfo.dqm_active->Fill(pathinfo.time_active * 1000.);
855 
856  stream.dqm_paths[pid].exclusive_time->Fill(pathinfo.index, pathinfo.time_exclusive * 1000.);
858  pathinfo.dqm_exclusive->Fill(pathinfo.time_exclusive * 1000.);
859 
860  stream.dqm_paths[pid].total_time->Fill(pathinfo.index, pathinfo.time_total * 1000.);
862  pathinfo.dqm_total->Fill(pathinfo.time_total * 1000.);
863 
864  // fill path overhead histograms
866  pathinfo.dqm_premodules ->Fill(pathinfo.time_premodules * 1000.);
867  pathinfo.dqm_intermodules->Fill(pathinfo.time_intermodules * 1000.);
868  pathinfo.dqm_postmodules ->Fill(pathinfo.time_postmodules * 1000.);
869  pathinfo.dqm_overhead ->Fill(pathinfo.time_overhead * 1000.);
870  }
871 
872  // fill detailed timing histograms
874  for (uint32_t i = 0; i < pathinfo.last_run; ++i) {
875  ModuleInfo * module = pathinfo.modules[i];
876  // skip duplicate modules
877  if (module == nullptr)
878  continue;
879  // fill the total time for all non-duplicate modules
880  pathinfo.dqm_module_total->Fill(i, module->time_active * 1000.);
881  // fill the active time only for module that have actually run in this path
882  if (module->run_in_path == & pathinfo)
883  pathinfo.dqm_module_active->Fill(i, module->time_active * 1000.);
884  }
885  }
886 
887  // fill path counter histograms
888  // - also for duplicate modules, to properly extract rejection information
889  // - fill the N+1th bin for paths accepting the event, so the FastTimerServiceClient can properly measure the last filter efficiency
891  for (uint32_t i = 0; i < pathinfo.last_run; ++i)
892  pathinfo.dqm_module_counter->Fill(i);
893  if (pathinfo.accept)
894  pathinfo.dqm_module_counter->Fill(pathinfo.modules.size());
895  }
896 
897  }
898  }
899 
900  // fill plots for per-event time by module
901  // note: this is done only for the last subprocess, to avoid filling the same plots multiple times
902  if ((m_enable_dqm_bymodule) and (pid+1 == m_process.size())) {
903  for (auto & keyval : stream.modules) {
904  ModuleInfo & module = keyval.second;
905  module.dqm_active->Fill(module.time_active * 1000.);
906  }
907  }
908 
909  // fill plots for per-event time by module type
910  // note: this is done only for the last subprocess, to avoid filling the same plots multiple times
911  if ((m_enable_dqm_bymoduletype) and (pid+1 == m_process.size())) {
912  for (auto & keyval : stream.moduletypes) {
913  ModuleInfo & module = keyval.second;
914  module.dqm_active->Fill(module.time_active * 1000.);
915  }
916  }
917 
918  // fill the interpath overhead plot
920  for (unsigned int i = 0; i <= stream.paths[pid].size(); ++i)
921  stream.dqm_paths[pid].interpaths->Fill(i, stream.timing_perprocess[pid].paths_interpaths[i] * 1000.);
922 
923  if (m_enable_dqm_summary) {
924  if (pid+1 == m_process.size())
925  stream.dqm.fill(stream.timing);
926  stream.dqm_perprocess[pid].fill(stream.timing_perprocess[pid]);
927  }
928 
929  if (not m_dqm_luminosity.empty()) {
930  if (pid+1 == m_process.size())
931  for (unsigned int i = 0; i < m_dqm_luminosity.size(); ++i)
932  stream.dqm_byluminosity[i].fill(stream.luminosity[i], stream.timing);
933  for (unsigned int i = 0; i < m_dqm_luminosity.size(); ++i)
934  stream.dqm_perprocess_byluminosity[pid][i].fill(stream.luminosity[i], stream.timing_perprocess[pid]);
935  }
936 
937 }
int i
Definition: DBlmapReader.cc:9
static double delta(FastTimer::Clock::time_point const &first, FastTimer::Clock::time_point const &second)
const bool m_enable_dqm_bypath_counters
const bool m_enable_dqm_bypath_exclusive
std::vector< ProcessDescription > m_process
std::vector< TimingPerProcess > m_job_summary_perprocess
std::vector< LuminosityDescription > m_dqm_luminosity
std::mutex m_summary_mutex
std::vector< std::vector< TimingPerProcess > > m_run_summary_perprocess
const bool m_enable_dqm_bypath_details
std::vector< Timing > m_run_summary
const bool m_enable_dqm_bypath_overhead
const bool m_enable_dqm_bymodule
tuple pid
Definition: sysUtil.py:22
const bool m_enable_dqm_bymoduletype
const bool m_enable_dqm_summary
const bool m_enable_dqm_bypath_total
const bool m_enable_dqm_bypath_active
static unsigned int processID(edm::ProcessContext const *)
std::vector< StreamData > m_stream
Definition: vlib.h:208
void FastTimerService::postGlobalEndRun ( edm::GlobalContext const &  gc)
private

Definition at line 599 of file FastTimerService.cc.

References cmsPerfStripChart::format, diffTwoXMLs::label, edm::GlobalContext::luminosityBlockID(), m_enable_timing_summary, m_process, m_run_summary, m_run_summary_perprocess, mergeVDriftHistosByStation::name, sysUtil::pid, printProcessSummary(), printSummary(), edm::GlobalContext::processContext(), processID(), edm::LuminosityBlockID::run(), DTTTrigCorrFirst::run, edm::GlobalContext::runIndex(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by FastTimerService().

600 {
602  unsigned int pid = processID(gc.processContext());
603  unsigned int rid = gc.runIndex();
604  unsigned int run = gc.luminosityBlockID().run();
605  const std::string label = (boost::format("run %d") % run).str();
606 
608 
609  if (pid+1 == m_process.size())
610  printSummary(m_run_summary[rid], label);
611  }
612 }
void printSummary(Timing const &summary, std::string const &label) const
std::vector< ProcessDescription > m_process
string format
Some error handling for the usage.
std::vector< std::vector< TimingPerProcess > > m_run_summary_perprocess
std::vector< Timing > m_run_summary
tuple pid
Definition: sysUtil.py:22
const bool m_enable_timing_summary
static unsigned int processID(edm::ProcessContext const *)
void printProcessSummary(Timing const &total, TimingPerProcess const &summary, std::string const &label, std::string const &process) const
void FastTimerService::postModuleEvent ( edm::StreamContext const &  sc,
edm::ModuleCallingContext const &  mcc 
)
private

Definition at line 1146 of file FastTimerService.cc.

References edm::ModuleDescription::id(), m_enable_timing_modules, m_stream, edm::ModuleCallingContext::moduleDescription(), edm::ModuleDescription::moduleLabel(), FastTimer::seconds(), FastTimer::stop(), edmStreamStallGrapher::stream, edm::StreamContext::streamID(), FastTimerService::ModuleInfo::summary_active, FastTimerService::ModuleInfo::time_active, FastTimerService::ModuleInfo::timer, and edm::StreamID::value().

Referenced by FastTimerService().

1146  {
1147  // this is ever called only if m_enable_timing_modules = true
1148  assert(m_enable_timing_modules);
1149 
1150  if (mcc.moduleDescription() == nullptr) {
1151  edm::LogError("FastTimerService") << "FastTimerService::postModuleEventDelayedGet: invalid module";
1152  return;
1153  }
1154 
1155  edm::ModuleDescription const & md = * mcc.moduleDescription();
1156  unsigned int sid = sc.streamID().value();
1157  auto & stream = m_stream[sid];
1158 
1159  double active = 0.;
1160 
1161  // time and account each module
1162  if (md.id() < stream.fast_modules.size()) {
1163  ModuleInfo & module = * stream.fast_modules[md.id()];
1164  module.timer.stop();
1165  active = module.timer.seconds();
1166  module.time_active = active;
1167  module.summary_active += active;
1168  // plots are filled post event processing
1169  } else {
1170  // should never get here
1171  edm::LogError("FastTimerService") << "FastTimerService::postModuleEvent: unexpected module " << md.moduleLabel();
1172  }
1173 }
std::string const & moduleLabel() const
std::vector< StreamData > m_stream
Definition: vlib.h:208
unsigned int id() const
void FastTimerService::postModuleEventDelayedGet ( edm::StreamContext const &  sc,
edm::ModuleCallingContext const &  mcc 
)
private

Definition at line 1210 of file FastTimerService.cc.

References edm::ModuleDescription::id(), edm::ModuleCallingContext::kRunning, m_enable_timing_modules, m_stream, edm::ModuleCallingContext::moduleDescription(), edm::ModuleDescription::moduleLabel(), FastTimer::resume(), edm::ModuleCallingContext::state(), edmStreamStallGrapher::stream, edm::StreamContext::streamID(), FastTimerService::ModuleInfo::timer, and edm::StreamID::value().

Referenced by FastTimerService().

1210  {
1211  // this is ever called only if m_enable_timing_modules = true
1212  assert(m_enable_timing_modules);
1213 
1214  if (mcc.moduleDescription() == nullptr) {
1215  edm::LogError("FastTimerService") << "FastTimerService::postModuleEventDelayedGet: invalid module";
1216  return;
1217  }
1218 
1219  edm::ModuleDescription const & md = * mcc.moduleDescription();
1220  unsigned int sid = sc.streamID().value();
1221  auto & stream = m_stream[sid];
1222 
1223  // see the description of the possible ModuleCallingContext states in preModuleEventDelayedGet, above.
1224  if (mcc.state() == edm::ModuleCallingContext::State::kRunning) {
1225  if (md.id() < stream.fast_modules.size()) {
1226  ModuleInfo & module = * stream.fast_modules[md.id()];
1227  module.timer.resume();
1228  } else {
1229  // should never get here
1230  edm::LogError("FastTimerService") << "FastTimerService::postModuleEventDelayedGet: unexpected module " << md.moduleLabel();
1231  }
1232  }
1233 
1234 }
std::string const & moduleLabel() const
std::vector< StreamData > m_stream
Definition: vlib.h:208
unsigned int id() const
void FastTimerService::postPathEvent ( edm::StreamContext const &  sc,
edm::PathContext const &  pc,
edm::HLTPathStatus const &  status 
)
private

Definition at line 1013 of file FastTimerService.cc.

References funct::abs(), edm::HLTPathStatus::accept(), FastTimerService::PathInfo::accept, FastTimerService::ModuleInfo::counter, cond::rpcobimon::current, delta(), alignCSCRings::e, i, edm::HLTPathStatus::index(), FastTimerService::PathInfo::last_run, m_enable_timing_modules, m_enable_timing_paths, m_process, m_stream, FastTimerService::PathInfo::modules, cmsHarvester::path, edm::PathContext::pathName(), sysUtil::pid, edm::StreamContext::processContext(), processID(), FastTimerService::ModuleInfo::run_in_path, edmStreamStallGrapher::stream, edm::StreamContext::streamID(), AlCaHLTBitMon_QueryRunRegistry::string, FastTimerService::PathInfo::summary_active, FastTimerService::PathInfo::summary_intermodules, FastTimerService::PathInfo::summary_overhead, FastTimerService::PathInfo::summary_postmodules, FastTimerService::PathInfo::summary_premodules, FastTimerService::PathInfo::summary_total, FastTimerService::ModuleInfo::time_active, FastTimerService::PathInfo::time_intermodules, FastTimerService::PathInfo::time_overhead, FastTimerService::PathInfo::time_postmodules, FastTimerService::PathInfo::time_premodules, FastTimerService::PathInfo::time_total, pileupDistInMC::total, edm::StreamID::value(), and edm::HLTPathStatus::wasrun().

Referenced by FastTimerService().

1013  {
1014  std::string const & path = pc.pathName();
1015  unsigned int pid = processID(sc.processContext());
1016  unsigned int sid = sc.streamID().value();
1017  auto & stream = m_stream[sid];
1018 
1019  if (stream.current_path == nullptr) {
1020  edm::LogError("FastTimerService") << "FastTimerService::postPathEvent: unexpected path " << path;
1021  return;
1022  }
1023 
1024  // time each (end)path
1025  stream.current_path->timer.stop();
1026  stream.current_path->time_active = stream.current_path->timer.seconds();
1027  stream.timer_last_path = stream.current_path->timer.getStopTime();
1028 
1029  double active = stream.current_path->time_active;
1030 
1031  // if enabled, account each (end)path
1032  if (m_enable_timing_paths) {
1033 
1034  PathInfo & pathinfo = * stream.current_path;
1035  pathinfo.summary_active += active;
1036 
1037  // measure the time spent between the execution of the last module and the end of the path
1039  double pre = 0.; // time spent before the first active module
1040  double inter = 0.; // time spent between active modules
1041  double post = 0.; // time spent after the last active module
1042  double overhead = 0.; // time spent before, between, or after modules
1043  double current = 0.; // time spent in modules active in the current path
1044  double total = active; // total per-path time, including modules already run as part of other paths
1045 
1046  // implementation note:
1047  // "active" has already measured all the time spent in this path
1048  // "current" will be the sum of the time spent inside each module while running this path, so that
1049  // "overhead" will be active - current
1050  // "total" will be active + the sum of the time spent in non-active modules
1051 
1052  uint32_t last_run = 0; // index of the last module run in this path, plus one
1053  if (status.wasrun() and not pathinfo.modules.empty())
1054  last_run = status.index() + 1; // index of the last module run in this path, plus one
1055  for (uint32_t i = 0; i < last_run; ++i) {
1056  ModuleInfo * module = pathinfo.modules[i];
1057 
1058  if (module == 0)
1059  // this is a module occurring more than once in the same path, skip it after the first occurrence
1060  continue;
1061 
1062  ++module->counter;
1063  if (module->run_in_path == & pathinfo) {
1064  current += module->time_active;
1065  } else {
1066  total += module->time_active;
1067  }
1068 
1069  }
1070 
1071  if (stream.current_path->first_module == nullptr) {
1072  // no modules were active during this path, account all the time as overhead
1073  pre = 0.;
1074  inter = 0.;
1075  post = active;
1076  overhead = active;
1077  } else {
1078  // extract overhead information
1079  pre = delta(stream.current_path->timer.getStartTime(), stream.current_path->first_module->timer.getStartTime());
1080  post = delta(stream.current_module->timer.getStopTime(), stream.current_path->timer.getStopTime());
1081  inter = active - pre - current - post;
1082  // take care of numeric precision and rounding errors - the timer is less precise than nanosecond resolution
1083  if (std::abs(inter) < 1e-9)
1084  inter = 0.;
1085  overhead = active - current;
1086  // take care of numeric precision and rounding errors - the timer is less precise than nanosecond resolution
1087  if (std::abs(overhead) < 1e-9)
1088  overhead = 0.;
1089  }
1090 
1091  pathinfo.time_premodules = pre;
1092  pathinfo.time_intermodules = inter;
1093  pathinfo.time_postmodules = post;
1094  pathinfo.time_overhead = overhead;
1095  pathinfo.time_total = total;
1096  pathinfo.summary_premodules += pre;
1097  pathinfo.summary_intermodules += inter;
1098  pathinfo.summary_postmodules += post;
1099  pathinfo.summary_overhead += overhead;
1100  pathinfo.summary_total += total;
1101  pathinfo.last_run = last_run;
1102  pathinfo.accept = status.accept();
1103  }
1104  }
1105 
1106  if (path == m_process[pid].last_path) {
1107  // this is the last path, stop and account the "all paths" counter
1108  stream.timer_paths.setStopTime(stream.current_path->timer.getStopTime());
1109  stream.timing_perprocess[pid].all_paths = stream.timer_paths.seconds();
1110  } else if (path == m_process[pid].last_endpath) {
1111  // this is the last endpath, stop and account the "all endpaths" counter
1112  stream.timer_endpaths.setStopTime(stream.current_path->timer.getStopTime());
1113  stream.timing_perprocess[pid].all_endpaths = stream.timer_endpaths.seconds();
1114  }
1115 
1116 }
int i
Definition: DBlmapReader.cc:9
static double delta(FastTimer::Clock::time_point const &first, FastTimer::Clock::time_point const &second)
std::vector< ProcessDescription > m_process
tuple path
else: Piece not in the list, fine.
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
tuple pid
Definition: sysUtil.py:22
tuple status
Definition: ntuplemaker.py:245
static unsigned int processID(edm::ProcessContext const *)
std::vector< StreamData > m_stream
Definition: vlib.h:208
void FastTimerService::postSourceEvent ( edm::StreamID  sid)
private

Definition at line 965 of file FastTimerService.cc.

References m_stream, and edmStreamStallGrapher::stream.

Referenced by FastTimerService().

965  {
966  auto & stream = m_stream[sid];
967  stream.timer_source.stop();
968  stream.timer_last_transition = stream.timer_source.getStopTime();
969 
970  // account the time spent in the source
971  stream.timing.source = stream.timer_source.seconds();
972 }
std::vector< StreamData > m_stream
void FastTimerService::postStreamBeginLumi ( edm::StreamContext const &  sc)
private

Definition at line 585 of file FastTimerService.cc.

References m_stream, fileCollector::now, edmStreamStallGrapher::stream, edm::StreamContext::streamID(), and edm::StreamID::value().

Referenced by FastTimerService().

585  {
586  unsigned int sid = sc.streamID().value();
587  auto & stream = m_stream[sid];
588  stream.timer_last_transition = FastTimer::Clock::now();
589 }
std::vector< StreamData > m_stream
void FastTimerService::postStreamBeginRun ( edm::StreamContext const &  sc)
private

Definition at line 562 of file FastTimerService.cc.

References m_stream, fileCollector::now, edmStreamStallGrapher::stream, edm::StreamContext::streamID(), and edm::StreamID::value().

Referenced by FastTimerService().

562  {
563  unsigned int sid = sc.streamID().value();
564  auto & stream = m_stream[sid];
565  stream.timer_last_transition = FastTimer::Clock::now();
566 }
std::vector< StreamData > m_stream
void FastTimerService::postStreamEndLumi ( edm::StreamContext const &  sc)
private

Definition at line 592 of file FastTimerService.cc.

References m_stream, fileCollector::now, edmStreamStallGrapher::stream, edm::StreamContext::streamID(), and edm::StreamID::value().

Referenced by FastTimerService().

592  {
593  unsigned int sid = sc.streamID().value();
594  auto & stream = m_stream[sid];
595  stream.timer_last_transition = FastTimer::Clock::now();
596 }
std::vector< StreamData > m_stream
void FastTimerService::postStreamEndRun ( edm::StreamContext const &  sc)
private

Definition at line 569 of file FastTimerService.cc.

References edm::StreamContext::eventID(), m_enable_dqm, m_module_id, m_stream, DQMStore::mergeAndResetMEsRunSummaryCache(), fileCollector::now, cppFunctionSkipper::operator, edm::EventID::run(), edmStreamStallGrapher::stream, edm::StreamContext::streamID(), and edm::StreamID::value().

Referenced by FastTimerService().

570 {
571  unsigned int sid = sc.streamID().value();
572  auto & stream = m_stream[sid];
573 
574  if (m_enable_dqm) {
575  DQMStore * store = edm::Service<DQMStore>().operator->();
576  assert(store);
577  store->mergeAndResetMEsRunSummaryCache(sc.eventID().run(), sid, m_module_id);
578  }
579 
580  stream.reset();
581  stream.timer_last_transition = FastTimer::Clock::now();
582 }
unsigned int m_module_id
std::vector< StreamData > m_stream
void FastTimerService::preallocate ( edm::service::SystemBounds const &  bounds)
private

Definition at line 535 of file FastTimerService.cc.

References cmsPerfStripChart::format, edm::ModuleDescription::getUniqueID(), m_concurrent_runs, m_concurrent_streams, m_concurrent_threads, m_dqm_luminosity, m_dqm_path, m_enable_dqm_bynproc, m_module_id, m_run_summary, m_run_summary_perprocess, m_stream, edm::service::SystemBounds::maxNumberOfConcurrentRuns(), edm::service::SystemBounds::maxNumberOfStreams(), edm::service::SystemBounds::maxNumberOfThreads(), and edmStreamStallGrapher::stream.

Referenced by FastTimerService().

536 {
537  m_concurrent_runs = bounds.maxNumberOfConcurrentRuns();
538  m_concurrent_streams = bounds.maxNumberOfStreams();
539  m_concurrent_threads = bounds.maxNumberOfThreads();
540 
542  m_dqm_path += (boost::format("/Running %d processes") % m_concurrent_threads).str();
543 
547 
548  // assign a pseudo module id to the FastTimerService
550  for (auto & stream: m_stream) {
551  stream.fast_modules.resize( m_module_id, nullptr);
552  stream.fast_moduletypes.resize(m_module_id, nullptr);
553  }
554 
555  // resize the luminosity per event buffer
556  for (auto & stream: m_stream)
557  stream.luminosity.resize(m_dqm_luminosity.size(), 0);
558 }
unsigned int m_concurrent_streams
string format
Some error handling for the usage.
unsigned int m_concurrent_threads
static unsigned int getUniqueID()
Returns a unique id each time called. Intended to be passed to ModuleDescription&#39;s constructor&#39;s modI...
std::string m_dqm_path
unsigned int m_concurrent_runs
const bool m_enable_dqm_bynproc
std::vector< LuminosityDescription > m_dqm_luminosity
unsigned int m_module_id
std::vector< std::vector< TimingPerProcess > > m_run_summary_perprocess
std::vector< Timing > m_run_summary
std::vector< StreamData > m_stream
void FastTimerService::preEvent ( edm::StreamContext const &  sc)
private

Definition at line 737 of file FastTimerService.cc.

References delta(), edm::StreamContext::eventID(), edm::EventID::luminosityBlock(), m_enable_dqm_byls, m_stream, sysUtil::pid, edm::StreamContext::processContext(), processID(), setLuminosity(), edmStreamStallGrapher::stream, edm::StreamContext::streamID(), and edm::StreamID::value().

Referenced by FastTimerService().

737  {
738  unsigned int pid = processID(sc.processContext());
739  unsigned int sid = sc.streamID().value();
740  auto & stream = m_stream[sid];
741 
742  // new event, reset the per-event counter
743  stream.timer_event.start();
744 
745  // account the time spent between the last transition and the beginning of the event
746  stream.timing_perprocess[pid].preevent = delta(stream.timer_last_transition, stream.timer_event.getStartTime());
747 
748  // clear the event counters
749  stream.timing_perprocess[pid].event = 0;
750  stream.timing_perprocess[pid].all_paths = 0;
751  stream.timing_perprocess[pid].all_endpaths = 0;
752  stream.timing_perprocess[pid].interpaths = 0;
753  stream.timing_perprocess[pid].paths_interpaths.assign(stream.paths[pid].size() + 1, 0);
754  for (auto & keyval : stream.paths[pid]) {
755  keyval.second.timer.reset();
756  keyval.second.time_active = 0.;
757  keyval.second.time_exclusive = 0.;
758  keyval.second.time_premodules = 0.;
759  keyval.second.time_intermodules = 0.;
760  keyval.second.time_postmodules = 0.;
761  keyval.second.time_total = 0.;
762  }
763 
764  // copy the start event timestamp as the end of the previous path
765  // used by the inter-path overhead measurement
766  stream.timer_last_path = stream.timer_event.getStartTime();
767 
768  // if requested, set the lumisection for timing vs. lumisection plots
769  if (m_enable_dqm_byls and pid == 0)
770  setLuminosity(sid, 0, sc.eventID().luminosityBlock());
771 }
static double delta(FastTimer::Clock::time_point const &first, FastTimer::Clock::time_point const &second)
const bool m_enable_dqm_byls
void setLuminosity(unsigned int stream_id, unsigned int luminosity_id, double value)
tuple pid
Definition: sysUtil.py:22
static unsigned int processID(edm::ProcessContext const *)
std::vector< StreamData > m_stream
void FastTimerService::preGlobalBeginRun ( edm::GlobalContext const &  gc)
private

Definition at line 184 of file FastTimerService.cc.

References fillPathMap(), edm::service::TriggerNamesService::getEndPath(), edm::service::TriggerNamesService::getEndPathModules(), edm::service::TriggerNamesService::getEndPaths(), edm::service::TriggerNamesService::getTrigPath(), edm::service::TriggerNamesService::getTrigPathModules(), edm::service::TriggerNamesService::getTrigPaths(), i, diffTwoXMLs::label, m_job_summary_perprocess, m_process, m_run_summary, m_run_summary_perprocess, m_skip_first_path, m_stream, sysUtil::pid, edm::GlobalContext::processContext(), processID(), edm::ProcessContext::processName(), edm::GlobalContext::runIndex(), findQualityFiles::size, edmStreamStallGrapher::stream, AlCaHLTBitMon_QueryRunRegistry::string, and edmLumisInFiles::summary.

Referenced by FastTimerService().

185 {
186  unsigned int pid = processID(gc.processContext());
187  unsigned int rid = gc.runIndex();
188 
190 
191  // cache the names of the first and last path and endpath
192  if (m_process.size() <= pid)
193  m_process.resize(pid+1);
194  m_process[pid].name = gc.processContext()->processName();
195  if (m_skip_first_path and pid == 0) {
196  // skip the first path
197  if (tns.getTrigPaths().size() > 1) {
198  m_process[pid].first_path = tns.getTrigPaths().at(1);
199  m_process[pid].last_path = tns.getTrigPaths().back();
200  }
201  } else {
202  if (not tns.getTrigPaths().empty()) {
203  m_process[pid].first_path = tns.getTrigPaths().front();
204  m_process[pid].last_path = tns.getTrigPaths().back();
205  }
206  }
207  if (not tns.getEndPaths().empty()) {
208  m_process[pid].first_endpath = tns.getEndPaths().front();
209  m_process[pid].last_endpath = tns.getEndPaths().back();
210  }
211 
212  uint32_t size_p = tns.getTrigPaths().size();
213  uint32_t size_e = tns.getEndPaths().size();
214  uint32_t size = size_p + size_e;
215  // resize the path maps
216  for (auto & stream: m_stream)
217  if (stream.paths.size() <= pid)
218  stream.paths.resize(pid+1);
219  for (uint32_t i = 0; i < size_p; ++i) {
220  std::string const & label = tns.getTrigPath(i);
221  for (auto & stream: m_stream)
222  stream.paths[pid][label].index = i;
223  }
224  for (uint32_t i = 0; i < size_e; ++i) {
225  std::string const & label = tns.getEndPath(i);
226  for (auto & stream: m_stream)
227  stream.paths[pid][label].index = size_p + i;
228  }
229  for (auto & stream: m_stream) {
230  // resize the stream buffers to account the number of subprocesses
231  if (stream.timing_perprocess.size() <= pid)
232  stream.timing_perprocess.resize(pid+1);
233  stream.timing_perprocess[pid].paths_interpaths.assign(size + 1, 0.);
234  // resize the stream plots to account the number of subprocesses
235  if (stream.dqm_perprocess.size() <= pid)
236  stream.dqm_perprocess.resize(pid+1);
237  if (stream.dqm_perprocess_byluminosity.size() <= pid)
238  stream.dqm_perprocess_byluminosity.resize(pid+1);
239  if (stream.dqm_paths.size() <= pid)
240  stream.dqm_paths.resize(pid+1);
241  }
242  for (auto & summary: m_run_summary_perprocess) {
243  if (summary.size() <= pid)
244  summary.resize(pid+1);
245  summary[pid].paths_interpaths.assign(size + 1, 0);
246  }
247  if (m_job_summary_perprocess.size() <= pid)
248  m_job_summary_perprocess.resize(pid+1);
249  m_job_summary_perprocess[pid].paths_interpaths.assign(size + 1, 0.);
250 
251  // reset the run summaries
252  if (pid == 0)
253  m_run_summary[rid].reset();
254  m_run_summary_perprocess[rid][pid].reset();
255 
256  // associate to each path all the modules it contains
257  for (uint32_t i = 0; i < tns.getTrigPaths().size(); ++i)
258  fillPathMap( pid, tns.getTrigPath(i), tns.getTrigPathModules(i) );
259  for (uint32_t i = 0; i < tns.getEndPaths().size(); ++i)
260  fillPathMap( pid, tns.getEndPath(i), tns.getEndPathModules(i) );
261 }
int i
Definition: DBlmapReader.cc:9
Strings const & getTrigPathModules(std::string const &name) const
std::string const & getTrigPath(size_type const i) const
Strings const & getEndPaths() const
const bool m_skip_first_path
std::vector< ProcessDescription > m_process
std::vector< TimingPerProcess > m_job_summary_perprocess
Strings const & getEndPathModules(std::string const &name) const
std::vector< std::vector< TimingPerProcess > > m_run_summary_perprocess
std::vector< Timing > m_run_summary
void fillPathMap(unsigned int pid, std::string const &name, std::vector< std::string > const &modules)
tuple pid
Definition: sysUtil.py:22
std::string const & getEndPath(size_type const i) const
Strings const & getTrigPaths() const
static unsigned int processID(edm::ProcessContext const *)
std::vector< StreamData > m_stream
tuple size
Write out results.
void FastTimerService::preModuleBeginJob ( edm::ModuleDescription const &  module)
private

Definition at line 724 of file FastTimerService.cc.

References edm::ModuleDescription::id(), m_stream, edm::ModuleDescription::moduleLabel(), edm::ModuleDescription::moduleName(), and edmStreamStallGrapher::stream.

Referenced by FastTimerService().

724  {
725  // allocate a counter for each module and module type
726  for (auto & stream: m_stream) {
727  if (module.id() >= stream.fast_modules.size())
728  stream.fast_modules.resize(module.id() + 1, nullptr);
729  if (module.id() >= stream.fast_moduletypes.size())
730  stream.fast_moduletypes.resize(module.id() + 1, nullptr);
731 
732  stream.fast_modules[module.id()] = & stream.modules[module.moduleLabel()];;
733  stream.fast_moduletypes[module.id()] = & stream.moduletypes[module.moduleName()];
734  }
735 }
std::vector< StreamData > m_stream
Definition: vlib.h:208
void FastTimerService::preModuleEvent ( edm::StreamContext const &  sc,
edm::ModuleCallingContext const &  mcc 
)
private

Definition at line 1118 of file FastTimerService.cc.

References edm::ModuleDescription::id(), m_enable_timing_modules, m_stream, python.rootplot.argparse::module, edm::ModuleCallingContext::moduleDescription(), edm::ModuleDescription::moduleLabel(), FastTimerService::ModuleInfo::run_in_path, FastTimer::start(), edmStreamStallGrapher::stream, edm::StreamContext::streamID(), FastTimerService::ModuleInfo::timer, and edm::StreamID::value().

Referenced by FastTimerService().

1118  {
1119  // this is ever called only if m_enable_timing_modules = true
1120  assert(m_enable_timing_modules);
1121 
1122  if (mcc.moduleDescription() == nullptr) {
1123  edm::LogError("FastTimerService") << "FastTimerService::postModuleEventDelayedGet: invalid module";
1124  return;
1125  }
1126 
1127  edm::ModuleDescription const & md = * mcc.moduleDescription();
1128  unsigned int sid = sc.streamID().value();
1129  auto & stream = m_stream[sid];
1130 
1131  // time each module
1132  if (md.id() < stream.fast_modules.size()) {
1133  ModuleInfo & module = * stream.fast_modules[md.id()];
1134  module.run_in_path = stream.current_path;
1135  module.timer.start();
1136  stream.current_module = & module;
1137  // used to measure the time spent between the beginning of the path and the execution of the first module
1138  if (stream.current_path->first_module == nullptr)
1139  stream.current_path->first_module = & module;
1140  } else {
1141  // should never get here
1142  edm::LogError("FastTimerService") << "FastTimerService::preModuleEvent: unexpected module " << md.moduleLabel();
1143  }
1144 }
std::string const & moduleLabel() const
std::vector< StreamData > m_stream
Definition: vlib.h:208
unsigned int id() const
void FastTimerService::preModuleEventDelayedGet ( edm::StreamContext const &  sc,
edm::ModuleCallingContext const &  mcc 
)
private

Definition at line 1175 of file FastTimerService.cc.

References edm::ModuleDescription::id(), edm::ModuleCallingContext::kRunning, m_enable_timing_modules, m_stream, edm::ModuleCallingContext::moduleDescription(), edm::ModuleDescription::moduleLabel(), FastTimer::pause(), edm::ModuleCallingContext::state(), edmStreamStallGrapher::stream, edm::StreamContext::streamID(), FastTimerService::ModuleInfo::timer, and edm::StreamID::value().

Referenced by FastTimerService().

1175  {
1176  // this is ever called only if m_enable_timing_modules = true
1177  assert(m_enable_timing_modules);
1178 
1179  if (mcc.moduleDescription() == nullptr) {
1180  edm::LogError("FastTimerService") << "FastTimerService::postModuleEventDelayedGet: invalid module";
1181  return;
1182  }
1183 
1184  edm::ModuleDescription const & md = * mcc.moduleDescription();
1185  unsigned int sid = sc.streamID().value();
1186  auto & stream = m_stream[sid];
1187 
1188  // if the ModuleCallingContext state is "Pefetching", the module is not running,
1189  // and is asking for its dependencies due to a "consumes" declaration.
1190  // we can ignore this signal.
1191 
1192  // if the ModuleCallingContext state is "Running", the module was running:
1193  // it declared its dependencies as "mayConsume", and is now calling getByToken/getByLabel.
1194  // we pause the timer for this module, and resume it later in the postModuleEventDelayedGet signal.
1195 
1196  // if the ModuleCallingContext state is "Invalid", we ignore the signal.
1197 
1198  if (mcc.state() == edm::ModuleCallingContext::State::kRunning) {
1199  if (md.id() < stream.fast_modules.size()) {
1200  ModuleInfo & module = * stream.fast_modules[md.id()];
1201  module.timer.pause();
1202  } else {
1203  // should never get here
1204  edm::LogError("FastTimerService") << "FastTimerService::preModuleEventDelayedGet: unexpected module " << md.moduleLabel();
1205  }
1206  }
1207 
1208 }
std::string const & moduleLabel() const
std::vector< StreamData > m_stream
Definition: vlib.h:208
unsigned int id() const
void FastTimerService::prePathEvent ( edm::StreamContext const &  sc,
edm::PathContext const &  pc 
)
private

Definition at line 975 of file FastTimerService.cc.

References delta(), m_process, m_stream, cmsHarvester::path, edm::PathContext::pathName(), sysUtil::pid, edm::StreamContext::processContext(), processID(), edmStreamStallGrapher::stream, edm::StreamContext::streamID(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by FastTimerService().

975  {
976  std::string const & path = pc.pathName();
977  unsigned int pid = processID(sc.processContext());
978  unsigned int sid = sc.streamID();
979  auto & stream = m_stream[sid];
980 
981  auto keyval = stream.paths[pid].find(path);
982  if (keyval != stream.paths[pid].end()) {
983  stream.current_path = & keyval->second;
984  } else {
985  // should never get here
986  stream.current_path = nullptr;
987  edm::LogError("FastTimerService") << "FastTimerService::prePathEvent: unexpected path " << path;
988  return;
989  }
990 
991  // prepare to measure the time spent between the beginning of the path and the execution of the first module
992  stream.current_path->first_module = nullptr;
993 
994  // time each (end)path
995  stream.current_path->timer.start();
996 
997  if (path == m_process[pid].first_path) {
998  // this is the first path, start the "all paths" counter
999  stream.timer_paths.setStartTime(stream.current_path->timer.getStartTime());
1000  } else if (path == m_process[pid].first_endpath) {
1001  // this is the first endpath, start the "all paths" counter
1002  stream.timer_endpaths.setStartTime(stream.current_path->timer.getStartTime());
1003  }
1004 
1005  // measure the inter-path overhead as the time elapsed since the end of preiovus path
1006  // (or the beginning of the event, if this is the first path - see preEvent)
1007  double interpaths = delta(stream.timer_last_path, stream.current_path->timer.getStartTime());
1008  stream.timing_perprocess[pid].interpaths += interpaths;
1009  stream.timing_perprocess[pid].paths_interpaths[stream.current_path->index] = interpaths;
1010 }
static double delta(FastTimer::Clock::time_point const &first, FastTimer::Clock::time_point const &second)
std::vector< ProcessDescription > m_process
tuple path
else: Piece not in the list, fine.
tuple pid
Definition: sysUtil.py:22
static unsigned int processID(edm::ProcessContext const *)
std::vector< StreamData > m_stream
void FastTimerService::preSourceEvent ( edm::StreamID  sid)
private

Definition at line 939 of file FastTimerService.cc.

References delta(), m_stream, and edmStreamStallGrapher::stream.

Referenced by FastTimerService().

939  {
940  auto & stream = m_stream[sid];
941 
942  // clear the event counters
943  stream.timing.reset();
944  stream.timer_source.start();
945 
946  // clear the event counters
947  // note: this is done here and not in preEvent to avoid clearing the counter before each subprocess
948  for (auto & keyval : stream.modules) {
949  keyval.second.timer.reset();
950  keyval.second.time_active = 0.;
951  keyval.second.run_in_path = nullptr;
952  keyval.second.counter = 0;
953  }
954  for (auto & keyval : stream.moduletypes) {
955  keyval.second.timer.reset();
956  keyval.second.time_active = 0.;
957  keyval.second.run_in_path = nullptr;
958  keyval.second.counter = 0;
959  }
960 
961  // account the time spent before the source
962  stream.timing.presource = delta(stream.timer_last_transition, stream.timer_source.getStartTime());
963 }
static double delta(FastTimer::Clock::time_point const &first, FastTimer::Clock::time_point const &second)
std::vector< StreamData > m_stream
void FastTimerService::preStreamBeginRun ( edm::StreamContext const &  sc)
private

Definition at line 263 of file FastTimerService.cc.

References FastTimerService::ModuleInfo::dqm_active, FastTimerService::PathInfo::dqm_active, FastTimerService::PathInfo::dqm_exclusive, FastTimerService::PathInfo::dqm_intermodules, FastTimerService::PathInfo::dqm_module_active, FastTimerService::PathInfo::dqm_module_counter, FastTimerService::PathInfo::dqm_module_total, FastTimerService::PathInfo::dqm_overhead, FastTimerService::PathInfo::dqm_postmodules, FastTimerService::PathInfo::dqm_premodules, FastTimerService::PathInfo::dqm_total, edm::StreamContext::eventID(), fill_dups(), edm::service::TriggerNamesService::findEndPath(), edm::service::TriggerNamesService::findTrigPath(), edm::service::TriggerNamesService::getEndPath(), edm::service::TriggerNamesService::getEndPathModules(), edm::service::TriggerNamesService::getEndPaths(), edm::service::TriggerNamesService::getTrigPath(), edm::service::TriggerNamesService::getTrigPathModules(), edm::service::TriggerNamesService::getTrigPaths(), i, infinity, diffTwoXMLs::label, tablePrinter::labels, m_dqm_eventtime_range, m_dqm_eventtime_resolution, m_dqm_luminosity, m_dqm_moduletime_range, m_dqm_moduletime_resolution, m_dqm_path, m_dqm_pathtime_range, m_dqm_pathtime_resolution, m_enable_dqm, m_enable_dqm_bymodule, m_enable_dqm_bymoduletype, m_enable_dqm_bypath_active, m_enable_dqm_bypath_counters, m_enable_dqm_bypath_details, m_enable_dqm_bypath_exclusive, m_enable_dqm_bypath_overhead, m_enable_dqm_bypath_total, m_enable_dqm_summary, m_enable_timing_paths, m_module_id, m_stream, server-conf-devtest-v6::modules, FastTimerService::PathInfo::modules, mergeVDriftHistosByStation::name, or, timingPdfMaker::pathname, sysUtil::pid, RecoTauValidation_cfi::plots, relval_parameters_module::process_name, edm::StreamContext::processContext(), processID(), edm::ProcessContext::processName(), dtDQMClient_cfg::resolution, edm::EventID::run(), findQualityFiles::size, edmStreamStallGrapher::stream, edm::StreamContext::streamID(), AlCaHLTBitMon_QueryRunRegistry::string, indexGen::title, and edm::StreamID::value().

Referenced by FastTimerService().

264 {
265  std::string const & process_name = sc.processContext()->processName();
266  unsigned int pid = processID(sc.processContext());
267  unsigned int sid = sc.streamID().value();
268  auto & stream = m_stream[sid];
269 
270  if (not m_enable_dqm)
271  return;
272 
273  if (not edm::Service<DQMStore>().isAvailable()) {
274  // the DQMStore is not available, disable all DQM plots
275  m_enable_dqm = false;
276  return;
277  }
278 
280  uint32_t size_p = tns.getTrigPaths().size();
281  uint32_t size_e = tns.getEndPaths().size();
282  uint32_t size = size_p + size_e;
283 
284  int eventbins = (int) std::ceil(m_dqm_eventtime_range / m_dqm_eventtime_resolution);
285  int pathbins = (int) std::ceil(m_dqm_pathtime_range / m_dqm_pathtime_resolution);
286  int modulebins = (int) std::ceil(m_dqm_moduletime_range / m_dqm_moduletime_resolution);
287 
288  // define a callback that can book the histograms
289  auto bookTransactionCallback = [&, this] (DQMStore::IBooker & booker) {
290 
291  // event summary plots
292  if (m_enable_dqm_summary) {
293  // whole event
294  if (pid == 0) {
295  booker.setCurrentFolder(m_dqm_path);
296  stream.dqm.presource = booker.book1D("presource", "Pre-Source processing time", modulebins, 0., m_dqm_moduletime_range)->getTH1F();
297  stream.dqm.presource ->StatOverflows(true);
298  stream.dqm.presource ->SetXTitle("processing time [ms]");
299  stream.dqm.source = booker.book1D("source", "Source processing time", modulebins, 0., m_dqm_moduletime_range)->getTH1F();
300  stream.dqm.source ->StatOverflows(true);
301  stream.dqm.source ->SetXTitle("processing time [ms]");
302  stream.dqm.preevent = booker.book1D("preevent", "Pre-Event processing time", modulebins, 0., m_dqm_moduletime_range)->getTH1F();
303  stream.dqm.preevent ->StatOverflows(true);
304  stream.dqm.preevent ->SetXTitle("processing time [ms]");
305  stream.dqm.event = booker.book1D("event", "Event processing time", eventbins, 0., m_dqm_eventtime_range)->getTH1F();
306  stream.dqm.event ->StatOverflows(true);
307  stream.dqm.event ->SetXTitle("processing time [ms]");
308  }
309 
310  // per subprocess
311  booker.setCurrentFolder(m_dqm_path + "/process " + process_name);
312  stream.dqm_perprocess[pid].preevent = booker.book1D("preevent", "Pre-Event processing time", modulebins, 0., m_dqm_moduletime_range)->getTH1F();
313  stream.dqm_perprocess[pid].preevent ->StatOverflows(true);
314  stream.dqm_perprocess[pid].preevent ->SetXTitle("processing time [ms]");
315  stream.dqm_perprocess[pid].event = booker.book1D("event", "Event processing time", eventbins, 0., m_dqm_eventtime_range)->getTH1F();
316  stream.dqm_perprocess[pid].event ->StatOverflows(true);
317  stream.dqm_perprocess[pid].event ->SetXTitle("processing time [ms]");
318  stream.dqm_perprocess[pid].all_paths = booker.book1D("all_paths", "Paths processing time", eventbins, 0., m_dqm_eventtime_range)->getTH1F();
319  stream.dqm_perprocess[pid].all_paths ->StatOverflows(true);
320  stream.dqm_perprocess[pid].all_paths ->SetXTitle("processing time [ms]");
321  stream.dqm_perprocess[pid].all_endpaths = booker.book1D("all_endpaths", "EndPaths processing time", pathbins, 0., m_dqm_pathtime_range)->getTH1F();
322  stream.dqm_perprocess[pid].all_endpaths ->StatOverflows(true);
323  stream.dqm_perprocess[pid].all_endpaths ->SetXTitle("processing time [ms]");
324  stream.dqm_perprocess[pid].interpaths = booker.book1D("interpaths", "Time spent between paths", pathbins, 0., m_dqm_eventtime_range)->getTH1F();
325  stream.dqm_perprocess[pid].interpaths ->StatOverflows(true);
326  stream.dqm_perprocess[pid].interpaths ->SetXTitle("processing time [ms]");
327  }
328 
329  // plots by path
330  if (m_enable_timing_paths) {
331  booker.setCurrentFolder(m_dqm_path + "/process " + process_name);
332  stream.dqm_paths[pid].active_time = booker.bookProfile("paths_active_time", "Additional time spent in each path", size, -0.5, size-0.5, pathbins, 0., std::numeric_limits<double>::infinity(), " ")->getTProfile();
333  stream.dqm_paths[pid].active_time ->StatOverflows(true);
334  stream.dqm_paths[pid].active_time ->SetYTitle("processing time [ms]");
335  stream.dqm_paths[pid].total_time = booker.bookProfile("paths_total_time", "Total time spent in each path", size, -0.5, size-0.5, pathbins, 0., std::numeric_limits<double>::infinity(), " ")->getTProfile();
336  stream.dqm_paths[pid].total_time ->StatOverflows(true);
337  stream.dqm_paths[pid].total_time ->SetYTitle("processing time [ms]");
338  stream.dqm_paths[pid].exclusive_time = booker.bookProfile("paths_exclusive_time", "Exclusive time spent in each path", size, -0.5, size-0.5, pathbins, 0., std::numeric_limits<double>::infinity(), " ")->getTProfile();
339  stream.dqm_paths[pid].exclusive_time ->StatOverflows(true);
340  stream.dqm_paths[pid].exclusive_time ->SetYTitle("processing time [ms]");
341  stream.dqm_paths[pid].interpaths = booker.bookProfile("paths_interpaths", "Time spent between each path", size+1, -0.5, size+0.5, pathbins, 0., std::numeric_limits<double>::infinity(), " ")->getTProfile();
342  stream.dqm_paths[pid].interpaths ->StatOverflows(true);
343  stream.dqm_paths[pid].interpaths ->SetYTitle("processing time [ms]");
344 
345  for (uint32_t i = 0; i < size_p; ++i) {
346  std::string const & label = tns.getTrigPath(i);
347  stream.dqm_paths[pid].active_time ->GetXaxis()->SetBinLabel(i + 1, label.c_str());
348  stream.dqm_paths[pid].total_time ->GetXaxis()->SetBinLabel(i + 1, label.c_str());
349  stream.dqm_paths[pid].exclusive_time ->GetXaxis()->SetBinLabel(i + 1, label.c_str());
350  stream.dqm_paths[pid].interpaths ->GetXaxis()->SetBinLabel(i + 1, label.c_str());
351  }
352  for (uint32_t i = 0; i < size_e; ++i) {
353  std::string const & label = tns.getEndPath(i);
354  stream.dqm_paths[pid].active_time ->GetXaxis()->SetBinLabel(i + size_p + 1, label.c_str());
355  stream.dqm_paths[pid].total_time ->GetXaxis()->SetBinLabel(i + size_p + 1, label.c_str());
356  stream.dqm_paths[pid].exclusive_time ->GetXaxis()->SetBinLabel(i + size_p + 1, label.c_str());
357  stream.dqm_paths[pid].interpaths ->GetXaxis()->SetBinLabel(i + size_p + 1, label.c_str());
358  }
359  }
360 
361  // plots vs. instantaneous luminosity
362  if (not m_dqm_luminosity.empty()) {
363  if (pid == 0) {
364  // resize the plots vs. luminosity
365  stream.dqm_byluminosity.resize(m_dqm_luminosity.size());
366 
367  // whole event
368  booker.setCurrentFolder(m_dqm_path);
369  for (unsigned int i = 0; i < m_dqm_luminosity.size(); ++i) {
370  auto & plots = stream.dqm_byluminosity[i];
371  int lumibins = (int) std::ceil(m_dqm_luminosity[i].range / m_dqm_luminosity[i].resolution);
372  plots.presource = booker.bookProfile("presource_by" + m_dqm_luminosity[i].name, "Pre-Source processing time vs. " + m_dqm_luminosity[i].title, lumibins, 0., m_dqm_luminosity[i].range, pathbins, 0., std::numeric_limits<double>::infinity(), " ")->getTProfile();
373  plots.presource ->StatOverflows(true);
374  plots.presource ->SetXTitle(m_dqm_luminosity[i].label.c_str());
375  plots.presource ->SetYTitle("processing time [ms]");
376  plots.source = booker.bookProfile("source_by" + m_dqm_luminosity[i].name, "Source processing time vs. " + m_dqm_luminosity[i].title, lumibins, 0., m_dqm_luminosity[i].range, pathbins, 0., std::numeric_limits<double>::infinity(), " ")->getTProfile();
377  plots.source ->StatOverflows(true);
378  plots.source ->SetXTitle(m_dqm_luminosity[i].label.c_str());
379  plots.source ->SetYTitle("processing time [ms]");
380  plots.preevent = booker.bookProfile("preevent_by" + m_dqm_luminosity[i].name, "Pre-Event processing time vs. " + m_dqm_luminosity[i].title, lumibins, 0., m_dqm_luminosity[i].range, pathbins, 0., std::numeric_limits<double>::infinity(), " ")->getTProfile();
381  plots.preevent ->StatOverflows(true);
382  plots.preevent ->SetXTitle(m_dqm_luminosity[i].label.c_str());
383  plots.preevent ->SetYTitle("processing time [ms]");
384  plots.event = booker.bookProfile("event_by" + m_dqm_luminosity[i].name, "Event processing time vs. " + m_dqm_luminosity[i].title, lumibins, 0., m_dqm_luminosity[i].range, eventbins, 0., std::numeric_limits<double>::infinity(), " ")->getTProfile();
385  plots.event ->StatOverflows(true);
386  plots.event ->SetXTitle(m_dqm_luminosity[i].label.c_str());
387  plots.event ->SetYTitle("processing time [ms]");
388  }
389  }
390 
391  // resize the plots vs. luminosity
392  stream.dqm_perprocess_byluminosity[pid].resize(m_dqm_luminosity.size());
393 
394  // per subprocess
395  booker.setCurrentFolder(m_dqm_path + "/process " + process_name);
396  for (unsigned int i = 0; i < m_dqm_luminosity.size(); ++i) {
397  auto & plots = stream.dqm_perprocess_byluminosity[pid][i];
398  int lumibins = (int) std::ceil(m_dqm_luminosity[i].range / m_dqm_luminosity[i].resolution);
399  plots.preevent = booker.bookProfile("preevent_by" + m_dqm_luminosity[i].name, "Pre-Event processing time vs. " + m_dqm_luminosity[i].title, lumibins, 0., m_dqm_luminosity[i].range, pathbins, 0., std::numeric_limits<double>::infinity(), " ")->getTProfile();
400  plots.preevent ->StatOverflows(true);
401  plots.preevent ->SetXTitle(m_dqm_luminosity[i].label.c_str());
402  plots.preevent ->SetYTitle("processing time [ms]");
403  plots.event = booker.bookProfile("event_by" + m_dqm_luminosity[i].name, "Event processing time vs. " + m_dqm_luminosity[i].title, lumibins, 0., m_dqm_luminosity[i].range, eventbins, 0., std::numeric_limits<double>::infinity(), " ")->getTProfile();
404  plots.event ->StatOverflows(true);
405  plots.event ->SetXTitle(m_dqm_luminosity[i].label.c_str());
406  plots.event ->SetYTitle("processing time [ms]");
407  plots.all_paths = booker.bookProfile("all_paths_by" + m_dqm_luminosity[i].name, "Paths processing time vs. " + m_dqm_luminosity[i].title, lumibins, 0., m_dqm_luminosity[i].range, eventbins, 0., std::numeric_limits<double>::infinity(), " ")->getTProfile();
408  plots.all_paths ->StatOverflows(true);
409  plots.all_paths ->SetXTitle(m_dqm_luminosity[i].label.c_str());
410  plots.all_paths ->SetYTitle("processing time [ms]");
411  plots.all_endpaths = booker.bookProfile("all_endpaths_by" + m_dqm_luminosity[i].name, "EndPaths processing time vs. " + m_dqm_luminosity[i].title, lumibins, 0., m_dqm_luminosity[i].range, pathbins, 0., std::numeric_limits<double>::infinity(), " ")->getTProfile();
412  plots.all_endpaths ->StatOverflows(true);
413  plots.all_endpaths ->SetXTitle(m_dqm_luminosity[i].label.c_str());
414  plots.all_endpaths ->SetYTitle("processing time [ms]");
415  plots.interpaths = booker.bookProfile("interpaths_by" + m_dqm_luminosity[i].name, "Time spent between paths vs. " + m_dqm_luminosity[i].title, lumibins, 0., m_dqm_luminosity[i].range, pathbins, 0., std::numeric_limits<double>::infinity(), " ")->getTProfile();
416  plots.interpaths ->StatOverflows(true);
417  plots.interpaths ->SetXTitle(m_dqm_luminosity[i].label.c_str());
418  plots.interpaths ->SetYTitle("processing time [ms]");
419  }
420  }
421 
422  // per-path and per-module accounting
423  if (m_enable_timing_paths) {
424  booker.setCurrentFolder(m_dqm_path + "/process " + process_name + "/Paths");
425  for (auto & keyval: stream.paths[pid]) {
426  std::string const & pathname = keyval.first;
427  PathInfo & pathinfo = keyval.second;
428 
430  pathinfo.dqm_active = booker.book1D(pathname + "_active", pathname + " active time", pathbins, 0., m_dqm_pathtime_range)->getTH1F();
431  pathinfo.dqm_active ->StatOverflows(true);
432  pathinfo.dqm_active ->SetXTitle("processing time [ms]");
433  }
434 
436  pathinfo.dqm_total = booker.book1D(pathname + "_total", pathname + " total time", pathbins, 0., m_dqm_pathtime_range)->getTH1F();
437  pathinfo.dqm_total ->StatOverflows(true);
438  pathinfo.dqm_total ->SetXTitle("processing time [ms]");
439  }
440 
442  pathinfo.dqm_premodules = booker.book1D(pathname + "_premodules", pathname + " pre-modules overhead", modulebins, 0., m_dqm_moduletime_range)->getTH1F();
443  pathinfo.dqm_premodules ->StatOverflows(true);
444  pathinfo.dqm_premodules ->SetXTitle("processing time [ms]");
445  pathinfo.dqm_intermodules = booker.book1D(pathname + "_intermodules", pathname + " inter-modules overhead", modulebins, 0., m_dqm_moduletime_range)->getTH1F();
446  pathinfo.dqm_intermodules ->StatOverflows(true);
447  pathinfo.dqm_intermodules ->SetXTitle("processing time [ms]");
448  pathinfo.dqm_postmodules = booker.book1D(pathname + "_postmodules", pathname + " post-modules overhead", modulebins, 0., m_dqm_moduletime_range)->getTH1F();
449  pathinfo.dqm_postmodules ->StatOverflows(true);
450  pathinfo.dqm_postmodules ->SetXTitle("processing time [ms]");
451  pathinfo.dqm_overhead = booker.book1D(pathname + "_overhead", pathname + " overhead time", modulebins, 0., m_dqm_moduletime_range)->getTH1F();
452  pathinfo.dqm_overhead ->StatOverflows(true);
453  pathinfo.dqm_overhead ->SetXTitle("processing time [ms]");
454  }
455 
457  // book histograms for modules-in-paths statistics
458 
459  // find histograms X-axis labels
460  uint32_t id;
461  std::vector<std::string> const & modules = ((id = tns.findTrigPath(pathname)) != tns.getTrigPaths().size()) ? tns.getTrigPathModules(id) :
462  ((id = tns.findEndPath(pathname)) != tns.getEndPaths().size()) ? tns.getEndPathModules(id) :
463  std::vector<std::string>();
464 
465  static std::vector<std::string> dup;
466  if (modules.size() > dup.size())
467  fill_dups(dup, modules.size());
468 
469  std::vector<const char *> labels(modules.size(), nullptr);
470  for (uint32_t i = 0; i < modules.size(); ++i)
471  labels[i] = (pathinfo.modules[i]) ? modules[i].c_str() : dup[i].c_str();
472 
473  // book counter histograms
474  if (m_enable_dqm_bypath_counters) {
475  pathinfo.dqm_module_counter = booker.book1D(pathname + "_module_counter", pathname + " module counter", modules.size(), -0.5, modules.size() - 0.5)->getTH1F();
476  // find module labels
477  for (uint32_t i = 0; i < modules.size(); ++i) {
478  pathinfo.dqm_module_counter->GetXaxis()->SetBinLabel( i+1, labels[i] );
479  }
480  }
481  // book detailed timing histograms
483  pathinfo.dqm_module_active = booker.book1D(pathname + "_module_active", pathname + " module active", modules.size(), -0.5, modules.size() - 0.5)->getTH1F();
484  pathinfo.dqm_module_active ->SetYTitle("cumulative processing time [ms]");
485  pathinfo.dqm_module_total = booker.book1D(pathname + "_module_total", pathname + " module total", modules.size(), -0.5, modules.size() - 0.5)->getTH1F();
486  pathinfo.dqm_module_total ->SetYTitle("cumulative processing time [ms]");
487  // find module labels
488  for (uint32_t i = 0; i < modules.size(); ++i) {
489  pathinfo.dqm_module_active ->GetXaxis()->SetBinLabel( i+1, labels[i] );
490  pathinfo.dqm_module_total ->GetXaxis()->SetBinLabel( i+1, labels[i] );
491  }
492  }
493  }
494 
495  // book exclusive path time histograms
497  pathinfo.dqm_exclusive = booker.book1D(pathname + "_exclusive", pathname + " exclusive time", pathbins, 0., m_dqm_pathtime_range)->getTH1F();
498  pathinfo.dqm_exclusive ->StatOverflows(true);
499  pathinfo.dqm_exclusive ->SetXTitle("processing time [ms]");
500  }
501 
502  }
503  }
504 
505  if (m_enable_dqm_bymodule) {
506  booker.setCurrentFolder(m_dqm_path + "/Modules");
507  for (auto & keyval: stream.modules) {
508  std::string const & label = keyval.first;
509  ModuleInfo & module = keyval.second;
510  module.dqm_active = booker.book1D(label, label, modulebins, 0., m_dqm_moduletime_range)->getTH1F();
511  module.dqm_active->StatOverflows(true);
512  module.dqm_active->SetXTitle("processing time [ms]");
513  }
514  }
515 
517  booker.setCurrentFolder(m_dqm_path + "/ModuleTypes");
518  for (auto & keyval: stream.moduletypes) {
519  std::string const & label = keyval.first;
520  ModuleInfo & module = keyval.second;
521  module.dqm_active = booker.book1D(label, label, modulebins, 0., m_dqm_moduletime_range)->getTH1F();
522  module.dqm_active->StatOverflows(true);
523  module.dqm_active->SetXTitle("processing time [ms]");
524  }
525  }
526 
527  };
528 
529  // book MonitorElement's for this stream
530  edm::Service<DQMStore>()->bookTransaction(bookTransactionCallback, sc.eventID().run(), sid, m_module_id);
531 }
int i
Definition: DBlmapReader.cc:9
const double m_dqm_eventtime_resolution
Strings const & getTrigPathModules(std::string const &name) const
std::string const & getTrigPath(size_type const i) const
static void fill_dups(std::vector< std::string > &dups, unsigned int size)
Strings const & getEndPaths() const
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
const bool m_enable_dqm_bypath_counters
const bool m_enable_dqm_bypath_exclusive
const double m_dqm_pathtime_range
std::string m_dqm_path
Strings const & getEndPathModules(std::string const &name) const
size_type findTrigPath(std::string const &name) const
std::vector< LuminosityDescription > m_dqm_luminosity
unsigned int m_module_id
const double m_dqm_moduletime_resolution
const double infinity
const bool m_enable_dqm_bypath_details
const bool m_enable_dqm_bypath_overhead
size_type findEndPath(std::string const &name) const
const bool m_enable_dqm_bymodule
const double m_dqm_moduletime_range
tuple pid
Definition: sysUtil.py:22
const bool m_enable_dqm_bymoduletype
const bool m_enable_dqm_summary
std::string const & getEndPath(size_type const i) const
const bool m_enable_dqm_bypath_total
Strings const & getTrigPaths() const
const bool m_enable_dqm_bypath_active
static unsigned int processID(edm::ProcessContext const *)
std::vector< StreamData > m_stream
Definition: vlib.h:208
tuple size
Write out results.
const double m_dqm_eventtime_range
const double m_dqm_pathtime_resolution
void FastTimerService::printProcessSummary ( Timing const &  total,
TimingPerProcess const &  summary,
std::string const &  label,
std::string const &  process 
) const
private

Definition at line 627 of file FastTimerService.cc.

References FastTimerService::TimingPerProcess::all_endpaths, FastTimerService::TimingPerProcess::all_paths, FastTimerService::Timing::count, FastTimerService::TimingPerProcess::event, FastTimerService::TimingPerProcess::interpaths, dbtoconf::out, and FastTimerService::TimingPerProcess::preevent.

Referenced by postEndJob(), and postGlobalEndRun().

628 {
629  // print a timing summary for the run or job, for each subprocess
630  std::ostringstream out;
631  out << std::fixed << std::setprecision(6);
632  out << "FastReport for " << label << ", process " << process << '\n';
633  //out << "FastReport " << (m_use_realtime ? "(real time) " : "(CPU time) ") << '\n';
634  out << "FastReport " << std::right << std::setw(10) << summary.preevent / (double) total.count << " Pre-Event" << '\n';
635  out << "FastReport " << std::right << std::setw(10) << summary.event / (double) total.count << " Event" << '\n';
636  out << "FastReport " << std::right << std::setw(10) << summary.all_paths / (double) total.count << " all Paths" << '\n';
637  out << "FastReport " << std::right << std::setw(10) << summary.all_endpaths / (double) total.count << " all EndPaths" << '\n';
638  out << "FastReport " << std::right << std::setw(10) << summary.interpaths / (double) total.count << " between paths" << '\n';
639  edm::LogVerbatim("FastReport") << out.str();
640 }
tuple out
Definition: dbtoconf.py:99
tuple process
Definition: LaserDQM_cfg.py:3
void FastTimerService::printSummary ( Timing const &  summary,
std::string const &  label 
) const
private

Definition at line 643 of file FastTimerService.cc.

References FastTimerService::Timing::count, FastTimerService::Timing::event, dbtoconf::out, FastTimerService::Timing::preevent, FastTimerService::Timing::presource, and FastTimerService::Timing::source.

Referenced by postEndJob(), and postGlobalEndRun().

644 {
645  // print a timing summary for the run or job
646  //edm::service::TriggerNamesService & tns = * edm::Service<edm::service::TriggerNamesService>();
647 
648  std::ostringstream out;
649  out << std::fixed << std::setprecision(6);
650  out << "FastReport for " << label << ", over all subprocesses" << '\n';
651  //out << "FastReport " << (m_use_realtime ? "(real time) " : "(CPU time) ") << '\n';
652  out << "FastReport " << std::right << std::setw(10) << summary.presource / (double) summary.count << " Pre-Source" << '\n';
653  out << "FastReport " << std::right << std::setw(10) << summary.source / (double) summary.count << " Source" << '\n';
654  out << "FastReport " << std::right << std::setw(10) << summary.preevent / (double) summary.count << " Pre-Event" << '\n';
655  out << "FastReport " << std::right << std::setw(10) << summary.event / (double) summary.count << " Event" << '\n';
656  edm::LogVerbatim("FastReport") << out.str();
657 }
tuple out
Definition: dbtoconf.py:99
unsigned int FastTimerService::processID ( edm::ProcessContext const *  context)
staticprivate

Definition at line 1422 of file FastTimerService.cc.

References edm::ProcessContext::isSubProcess(), edm::ProcessContext::parentProcessContext(), and sysUtil::pid.

Referenced by postEvent(), postGlobalEndRun(), postPathEvent(), preEvent(), preGlobalBeginRun(), prePathEvent(), and preStreamBeginRun().

1423 {
1424  unsigned int pid = 0;
1425 
1426  // iterate through the chain of ProcessContext until we reach the topmost process
1427  while (context->isSubProcess()) {
1428  context = & context->parentProcessContext();
1429  ++pid;
1430  }
1431  return pid;
1432 }
tuple pid
Definition: sysUtil.py:22
double FastTimerService::queryEventTime ( edm::StreamID  sid) const

Definition at line 1368 of file FastTimerService.cc.

References m_stream.

1368  {
1369  return m_stream[sid].timing.event;
1370 }
std::vector< StreamData > m_stream
double FastTimerService::queryModuleTime ( edm::StreamID  sid,
const edm::ModuleDescription module 
) const

Definition at line 1284 of file FastTimerService.cc.

References edm::ModuleDescription::id(), m_stream, and edm::ModuleDescription::moduleLabel().

1284  {
1285  if (module.id() < m_stream[sid].fast_modules.size()) {
1286  return m_stream[sid].fast_modules[module.id()]->time_active;
1287  } else {
1288  edm::LogError("FastTimerService") << "FastTimerService::queryModuleTime: unexpected module " << module.moduleLabel();
1289  return 0.;
1290  }
1291 }
std::string const & moduleLabel() const
std::vector< StreamData > m_stream
unsigned int id() const
double FastTimerService::queryModuleTime ( edm::StreamID  sid,
unsigned int  id 
) const

Definition at line 1294 of file FastTimerService.cc.

References m_stream.

1294  {
1295  if (id < m_stream[sid].fast_modules.size()) {
1296  return m_stream[sid].fast_modules[id]->time_active;
1297  } else {
1298  edm::LogError("FastTimerService") << "FastTimerService::queryModuleTime: unexpected module id " << id;
1299  return 0.;
1300  }
1301 }
std::vector< StreamData > m_stream
double FastTimerService::queryModuleTimeByLabel ( edm::StreamID  sid,
const std::string &  label 
) const

Definition at line 1304 of file FastTimerService.cc.

References diffTwoXMLs::label, m_stream, and server-conf-devtest-v6::modules.

1304  {
1305  auto const & keyval = m_stream[sid].modules.find(label);
1306  if (keyval != m_stream[sid].modules.end()) {
1307  return keyval->second.time_active;
1308  } else {
1309  // module not found
1310  edm::LogError("FastTimerService") << "FastTimerService::queryModuleTimeByLabel: unexpected module " << label;
1311  return 0.;
1312  }
1313 }
std::vector< StreamData > m_stream
double FastTimerService::queryModuleTimeByType ( edm::StreamID  sid,
const std::string &  type 
) const

Definition at line 1316 of file FastTimerService.cc.

References m_stream.

1316  {
1317  auto const & keyval = m_stream[sid].moduletypes.find(type);
1318  if (keyval != m_stream[sid].moduletypes.end()) {
1319  return keyval->second.time_active;
1320  } else {
1321  // module not found
1322  edm::LogError("FastTimerService") << "FastTimerService::queryModuleTimeByType: unexpected module type " << type;
1323  return 0.;
1324  }
1325 }
type
Definition: HCALResponse.h:21
std::vector< StreamData > m_stream
double FastTimerService::querySourceTime ( edm::StreamID  sid) const

Definition at line 1363 of file FastTimerService.cc.

References m_stream.

1363  {
1364  return m_stream[sid].timing.source;
1365 }
std::vector< StreamData > m_stream
unsigned int FastTimerService::reserveLuminosityPlots ( std::string const &  name,
std::string const &  title,
std::string const &  label,
double  range,
double  resolution 
)

Definition at line 151 of file FastTimerService.cc.

References m_dqm_luminosity, m_stream, and edmStreamStallGrapher::stream.

Referenced by FastTimerService().

152 {
153  // FIXME check that this is only called before any preStreamBeginRun
154  // FIXME check that this is not called with the same "name" twice
155  m_dqm_luminosity.push_back(LuminosityDescription(name, title, label, range, resolution));
156 
157  // resize the luminosity per event buffer
158  for (auto & stream: m_stream)
159  stream.luminosity.resize(m_dqm_luminosity.size(), 0);
160 
161  return m_dqm_luminosity.size() - 1;
162 }
std::vector< LuminosityDescription > m_dqm_luminosity
std::vector< StreamData > m_stream
unsigned int FastTimerService::reserveLuminosityPlots ( std::string &&  name,
std::string &&  title,
std::string &&  label,
double  range,
double  resolution 
)

Definition at line 164 of file FastTimerService.cc.

References diffTwoXMLs::label, m_dqm_luminosity, m_stream, mergeVDriftHistosByStation::name, edmStreamStallGrapher::stream, and indexGen::title.

165 {
166  // FIXME check that this is only called before any preStreamBeginRun
167  // FIXME check that this is not called with the same "name" twice
168  m_dqm_luminosity.push_back(LuminosityDescription(name, title, label, range, resolution));
169 
170  // resize the luminosity per event buffer
171  for (auto & stream: m_stream)
172  stream.luminosity.resize(m_dqm_luminosity.size(), 0);
173 
174  return m_dqm_luminosity.size() - 1;
175 }
std::vector< LuminosityDescription > m_dqm_luminosity
std::vector< StreamData > m_stream
void FastTimerService::setLuminosity ( unsigned int  stream_id,
unsigned int  luminosity_id,
double  value 
)

Definition at line 178 of file FastTimerService.cc.

References m_stream, and relativeConstraints::value.

Referenced by preEvent().

179 {
180  // FIXME check that the luminosity id is valid ?
181  m_stream[stream_id].luminosity[luminosity_id] = value;
182 }
std::vector< StreamData > m_stream

Member Data Documentation

unsigned int FastTimerService::m_concurrent_runs
private

Definition at line 352 of file FastTimerService.h.

Referenced by preallocate().

unsigned int FastTimerService::m_concurrent_streams
private

Definition at line 353 of file FastTimerService.h.

Referenced by preallocate().

unsigned int FastTimerService::m_concurrent_threads
private

Definition at line 354 of file FastTimerService.h.

Referenced by preallocate().

const double FastTimerService::m_dqm_eventtime_range
private

Definition at line 357 of file FastTimerService.h.

Referenced by preStreamBeginRun().

const double FastTimerService::m_dqm_eventtime_resolution
private

Definition at line 358 of file FastTimerService.h.

Referenced by preStreamBeginRun().

std::vector<LuminosityDescription> FastTimerService::m_dqm_luminosity
private
const double FastTimerService::m_dqm_moduletime_range
private

Definition at line 361 of file FastTimerService.h.

Referenced by preStreamBeginRun().

const double FastTimerService::m_dqm_moduletime_resolution
private

Definition at line 362 of file FastTimerService.h.

Referenced by preStreamBeginRun().

std::string FastTimerService::m_dqm_path
private

Definition at line 363 of file FastTimerService.h.

Referenced by preallocate(), and preStreamBeginRun().

const double FastTimerService::m_dqm_pathtime_range
private

Definition at line 359 of file FastTimerService.h.

Referenced by preStreamBeginRun().

const double FastTimerService::m_dqm_pathtime_resolution
private

Definition at line 360 of file FastTimerService.h.

Referenced by preStreamBeginRun().

bool FastTimerService::m_enable_dqm
private

Definition at line 339 of file FastTimerService.h.

Referenced by postEvent(), postStreamEndRun(), and preStreamBeginRun().

const bool FastTimerService::m_enable_dqm_byls
private

Definition at line 349 of file FastTimerService.h.

Referenced by FastTimerService(), and preEvent().

const bool FastTimerService::m_enable_dqm_bymodule
private

Definition at line 346 of file FastTimerService.h.

Referenced by FastTimerService(), postEvent(), and preStreamBeginRun().

const bool FastTimerService::m_enable_dqm_bymoduletype
private

Definition at line 347 of file FastTimerService.h.

Referenced by FastTimerService(), postEvent(), and preStreamBeginRun().

const bool FastTimerService::m_enable_dqm_bynproc
private

Definition at line 350 of file FastTimerService.h.

Referenced by preallocate().

const bool FastTimerService::m_enable_dqm_bypath_active
private

Definition at line 340 of file FastTimerService.h.

Referenced by FastTimerService(), postEvent(), and preStreamBeginRun().

const bool FastTimerService::m_enable_dqm_bypath_counters
private

Definition at line 344 of file FastTimerService.h.

Referenced by FastTimerService(), postEvent(), and preStreamBeginRun().

const bool FastTimerService::m_enable_dqm_bypath_details
private

Definition at line 343 of file FastTimerService.h.

Referenced by FastTimerService(), postEvent(), and preStreamBeginRun().

const bool FastTimerService::m_enable_dqm_bypath_exclusive
private

Definition at line 345 of file FastTimerService.h.

Referenced by FastTimerService(), postEvent(), and preStreamBeginRun().

const bool FastTimerService::m_enable_dqm_bypath_overhead
private

Definition at line 342 of file FastTimerService.h.

Referenced by FastTimerService(), postEvent(), and preStreamBeginRun().

const bool FastTimerService::m_enable_dqm_bypath_total
private

Definition at line 341 of file FastTimerService.h.

Referenced by FastTimerService(), postEvent(), and preStreamBeginRun().

const bool FastTimerService::m_enable_dqm_summary
private

Definition at line 348 of file FastTimerService.h.

Referenced by postEvent(), and preStreamBeginRun().

bool FastTimerService::m_enable_timing_exclusive
private

Definition at line 334 of file FastTimerService.h.

Referenced by FastTimerService(), and postEvent().

bool FastTimerService::m_enable_timing_modules
private
bool FastTimerService::m_enable_timing_paths
private

Definition at line 332 of file FastTimerService.h.

Referenced by FastTimerService(), postEvent(), postPathEvent(), and preStreamBeginRun().

const bool FastTimerService::m_enable_timing_summary
private

Definition at line 335 of file FastTimerService.h.

Referenced by postEndJob(), and postGlobalEndRun().

Timing FastTimerService::m_job_summary
private

Definition at line 748 of file FastTimerService.h.

Referenced by postEndJob(), and postEvent().

std::vector<TimingPerProcess> FastTimerService::m_job_summary_perprocess
private

Definition at line 750 of file FastTimerService.h.

Referenced by postEndJob(), postEvent(), and preGlobalBeginRun().

unsigned int FastTimerService::m_module_id
private

Definition at line 355 of file FastTimerService.h.

Referenced by postStreamEndRun(), preallocate(), and preStreamBeginRun().

std::vector<ProcessDescription> FastTimerService::m_process
private
std::vector<Timing> FastTimerService::m_run_summary
private

Definition at line 747 of file FastTimerService.h.

Referenced by postEvent(), postGlobalEndRun(), preallocate(), and preGlobalBeginRun().

std::vector<std::vector<TimingPerProcess> > FastTimerService::m_run_summary_perprocess
private

Definition at line 749 of file FastTimerService.h.

Referenced by postEvent(), postGlobalEndRun(), preallocate(), and preGlobalBeginRun().

const bool FastTimerService::m_skip_first_path
private

Definition at line 336 of file FastTimerService.h.

Referenced by preGlobalBeginRun().

std::vector<StreamData> FastTimerService::m_stream
private
std::mutex FastTimerService::m_summary_mutex
private

Definition at line 751 of file FastTimerService.h.

Referenced by postEvent().

bool FastTimerService::m_use_realtime
private

Definition at line 331 of file FastTimerService.h.