test
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)
 
std::pair< std::string,
std::string > 
findFirstLast (unsigned int pid, std::vector< std::string > const &paths, bool skip=false)
 
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 41 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(), postSourceEvent(), postStreamBeginLumi(), postStreamBeginRun(), postStreamEndLumi(), postStreamEndRun(), preallocate(), preEvent(), preGlobalBeginRun(), preModuleBeginJob(), preSourceEvent(), preStreamBeginRun(), reserveLuminosityPlots(), edm::ActivityRegistry::watchPostEndJob(), edm::ActivityRegistry::watchPostEvent(), edm::ActivityRegistry::watchPostGlobalEndRun(), 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::watchPreSourceEvent(), and edm::ActivityRegistry::watchPreStreamBeginRun().

41  :
42  // configuration
43  // FIXME - reimplement support for cpu time vs. real time
44  m_use_realtime( config.getUntrackedParameter<bool>( "useRealTimeClock" ) ),
45  m_enable_timing_paths( config.getUntrackedParameter<bool>( "enableTimingPaths" ) ),
46  m_enable_timing_modules( config.getUntrackedParameter<bool>( "enableTimingModules" ) ),
47  m_enable_timing_exclusive( config.getUntrackedParameter<bool>( "enableTimingExclusive" ) ),
48  m_enable_timing_summary( config.getUntrackedParameter<bool>( "enableTimingSummary" ) ),
49  m_skip_first_path( config.getUntrackedParameter<bool>( "skipFirstPath" ) ),
50  // dqm configuration
51  m_enable_dqm( config.getUntrackedParameter<bool>( "enableDQM" ) ),
52  m_enable_dqm_bypath_active( config.getUntrackedParameter<bool>( "enableDQMbyPathActive" ) ),
53  m_enable_dqm_bypath_total( config.getUntrackedParameter<bool>( "enableDQMbyPathTotal" ) ),
54  m_enable_dqm_bypath_overhead( config.getUntrackedParameter<bool>( "enableDQMbyPathOverhead" ) ),
55  m_enable_dqm_bypath_details( config.getUntrackedParameter<bool>( "enableDQMbyPathDetails" ) ),
56  m_enable_dqm_bypath_counters( config.getUntrackedParameter<bool>( "enableDQMbyPathCounters" ) ),
57  m_enable_dqm_bypath_exclusive( config.getUntrackedParameter<bool>( "enableDQMbyPathExclusive" ) ),
58  m_enable_dqm_bymodule( config.getUntrackedParameter<bool>( "enableDQMbyModule" ) ),
59  m_enable_dqm_bymoduletype( config.getUntrackedParameter<bool>( "enableDQMbyModuleType" ) ),
60  m_enable_dqm_summary( config.getUntrackedParameter<bool>( "enableDQMSummary" ) ),
61  m_enable_dqm_byls( config.getUntrackedParameter<bool>( "enableDQMbyLumiSection" ) ),
62  m_enable_dqm_bynproc( config.getUntrackedParameter<bool>( "enableDQMbyProcesses" ) ),
63  // job configuration
64  m_concurrent_runs( 0 ),
68  m_dqm_eventtime_range( config.getUntrackedParameter<double>( "dqmTimeRange" ) ), // ms
69  m_dqm_eventtime_resolution( config.getUntrackedParameter<double>( "dqmTimeResolution" ) ), // ms
70  m_dqm_pathtime_range( config.getUntrackedParameter<double>( "dqmPathTimeRange" ) ), // ms
71  m_dqm_pathtime_resolution( config.getUntrackedParameter<double>( "dqmPathTimeResolution" ) ), // ms
72  m_dqm_moduletime_range( config.getUntrackedParameter<double>( "dqmModuleTimeRange" ) ), // ms
73  m_dqm_moduletime_resolution( config.getUntrackedParameter<double>( "dqmModuleTimeResolution" ) ), // ms
74  m_dqm_path( config.getUntrackedParameter<std::string>("dqmPath" ) ),
75  // description of the process(es)
76  m_process(),
77  // description of the luminosity axes
79  // DQM - these are initialized at preStreamBeginRun(), to make sure the DQM service has been loaded
80  m_stream(),
81  // summary data
82  m_run_summary(),
83  m_job_summary(),
86 {
87  // enable timers if required by DQM plots
95 
104 
107 
108 
117  registry.watchPostEndJob( this, & FastTimerService::postEndJob );
121  registry.watchPreEvent( this, & FastTimerService::preEvent );
122  registry.watchPostEvent( this, & FastTimerService::postEvent );
123  /* Disable until can handle more than one thread per event
124  // watch per-path events
125  registry.watchPrePathEvent( this, & FastTimerService::prePathEvent );
126  registry.watchPostPathEvent( this, & FastTimerService::postPathEvent );
127  // watch per-module events if enabled
128  if (m_enable_timing_modules) {
129  registry.watchPreModuleEvent( this, & FastTimerService::preModuleEvent );
130  registry.watchPostModuleEvent( this, & FastTimerService::postModuleEvent );
131  registry.watchPreModuleEventDelayedGet( this, & FastTimerService::preModuleEventDelayedGet );
132  registry.watchPostModuleEventDelayedGet( this, & FastTimerService::postModuleEventDelayedGet );
133  }
134  */
135 
136  // if requested, reserve plots for timing vs. lumisection
137  // there is no need to store the id, as it wil always be 0
138  if (m_enable_dqm_byls)
139  reserveLuminosityPlots("ls", "lumisection", "lumisection", config.getUntrackedParameter<uint32_t>("dqmLumiSectionsRange"), 1.);
140 
141 }
void preGlobalBeginRun(edm::GlobalContext 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 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
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 watchPostSourceEvent(PostSourceEvent::slot_type const &iSlot)
std::vector< TimingPerProcess > m_job_summary_perprocess
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
const bool m_enable_dqm_byls
void watchPostStreamBeginLumi(PostStreamBeginLumi::slot_type const &iSlot)
const double m_dqm_moduletime_resolution
void postEvent(edm::StreamContext const &)
void postGlobalEndRun(edm::GlobalContext const &)
std::vector< std::vector< TimingPerProcess > > m_run_summary_perprocess
void postStreamEndRun(edm::StreamContext 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
const double m_dqm_moduletime_range
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 143 of file FastTimerService.cc.

144 {
145 }

Member Function Documentation

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

Definition at line 1314 of file FastTimerService.cc.

References m_stream.

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

Definition at line 1304 of file FastTimerService.cc.

References m_stream.

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

Definition at line 1309 of file FastTimerService.cc.

References m_stream.

1309  {
1310  return m_stream[sid].current_path->timer.secondsUntilNow();
1311 }
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 KineDebug3::count(), and plotBeamSpotDB::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)
void FastTimerService::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 1420 of file FastTimerService.cc.

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

1420  {
1422  desc.addUntracked<bool>( "useRealTimeClock", true);
1423  desc.addUntracked<bool>( "enableTimingPaths", true);
1424  desc.addUntracked<bool>( "enableTimingModules", true);
1425  desc.addUntracked<bool>( "enableTimingExclusive", false);
1426  desc.addUntracked<bool>( "enableTimingSummary", false);
1427  desc.addUntracked<bool>( "skipFirstPath", false),
1428  desc.addUntracked<bool>( "enableDQM", true);
1429  desc.addUntracked<bool>( "enableDQMbyPathActive", false);
1430  desc.addUntracked<bool>( "enableDQMbyPathTotal", true);
1431  desc.addUntracked<bool>( "enableDQMbyPathOverhead", false);
1432  desc.addUntracked<bool>( "enableDQMbyPathDetails", false);
1433  desc.addUntracked<bool>( "enableDQMbyPathCounters", true);
1434  desc.addUntracked<bool>( "enableDQMbyPathExclusive", false);
1435  desc.addUntracked<bool>( "enableDQMbyModule", false);
1436  desc.addUntracked<bool>( "enableDQMbyModuleType", false);
1437  desc.addUntracked<bool>( "enableDQMSummary", false);
1438  desc.addUntracked<bool>( "enableDQMbyLumiSection", false);
1439  desc.addUntracked<bool>( "enableDQMbyProcesses", false);
1440  desc.addUntracked<double>( "dqmTimeRange", 1000. ); // ms
1441  desc.addUntracked<double>( "dqmTimeResolution", 5. ); // ms
1442  desc.addUntracked<double>( "dqmPathTimeRange", 100. ); // ms
1443  desc.addUntracked<double>( "dqmPathTimeResolution", 0.5); // ms
1444  desc.addUntracked<double>( "dqmModuleTimeRange", 40. ); // ms
1445  desc.addUntracked<double>( "dqmModuleTimeResolution", 0.2); // ms
1446  desc.addUntracked<uint32_t>( "dqmLumiSectionsRange", 2500 ); // ~ 16 hours
1447  desc.addUntracked<std::string>( "dqmPath", "HLT/TimerService");
1448  descriptions.add("FastTimerService", desc);
1449 }
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 1249 of file FastTimerService.cc.

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

Referenced by preGlobalBeginRun().

1249  {
1250  for (auto & stream: m_stream) {
1251 
1252  std::vector<ModuleInfo *> & pathmap = stream.paths[pid][name].modules;
1253  pathmap.clear();
1254  pathmap.reserve( modules.size() );
1255  std::unordered_set<ModuleInfo const *> pool; // keep track of inserted modules
1256  for (auto const & module: modules) {
1257  // fix the name of negated or ignored modules
1258  std::string const & label = (module[0] == '!' or module[0] == '-') ? module.substr(1) : module;
1259 
1260  auto const & it = stream.modules.find(label);
1261  if (it == stream.modules.end()) {
1262  // no matching module was found
1263  pathmap.push_back( 0 );
1264  } else if (pool.insert(& it->second).second) {
1265  // new module
1266  pathmap.push_back(& it->second);
1267  } else {
1268  // duplicate module
1269  pathmap.push_back( 0 );
1270  }
1271  }
1272 
1273  }
1274 }
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
std::pair< std::string, std::string > FastTimerService::findFirstLast ( unsigned int  pid,
std::vector< std::string > const &  paths,
bool  skip = false 
)
private

Definition at line 1277 of file FastTimerService.cc.

References m_stream, mergeVDriftHistosByStation::name, AlCaHLTBitMon_ParallelJobs::p, sysUtil::pid, MatrixUtil::remove(), AlCaHLTBitMon_QueryRunRegistry::string, and create_public_lumi_plots::transform.

Referenced by preGlobalBeginRun().

1277  {
1278  std::vector<std::string const *> p(paths.size(), nullptr);
1279 
1280  // mark the empty paths
1281  auto address_if_non_empty = [&](std::string const & name){
1282  return m_stream.front().paths[pid][name].modules.empty() ? nullptr : & name;
1283  };
1284  std::transform(paths.begin(), paths.end(), p.begin(), address_if_non_empty);
1285 
1286  // optionally, skip the first path
1287  if (skip and not p.empty())
1288  p.erase(p.begin());
1289 
1290  // remove the empty paths
1291  p.erase(std::remove(p.begin(), p.end(), nullptr), p.end());
1292 
1293  // return the first and last non-empty paths, if there are any
1294  if (not p.empty())
1295  return std::make_pair(* p.front(), * p.back());
1296  else
1297  return std::make_pair(std::string(), std::string());
1298 }
tuple pid
Definition: sysUtil.py:22
std::vector< StreamData > m_stream
void FastTimerService::postEndJob ( )
private

Definition at line 627 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().

628 {
630  const std::string label = "the whole job";
631  for (unsigned int pid = 0; pid < m_process.size(); ++pid)
633 
634  printSummary(m_job_summary, label);
635  }
636 }
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 785 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(), bril_dqm_clientPB-live_cfg::rid, FastTimerService::ModuleInfo::run_in_path, edm::StreamContext::runIndex(), 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().

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

Referenced by FastTimerService().

612 {
614  unsigned int pid = processID(gc.processContext());
615  unsigned int rid = gc.runIndex();
616  unsigned int run = gc.luminosityBlockID().run();
617  const std::string label = (boost::format("run %d") % run).str();
618 
620 
621  if (pid+1 == m_process.size())
622  printSummary(m_run_summary[rid], label);
623  }
624 }
tuple rid
Histograms Source for live online DQM in P5
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 1158 of file FastTimerService.cc.

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

1158  {
1159  // this is ever called only if m_enable_timing_modules = true
1161 
1162  if (mcc.moduleDescription() == nullptr) {
1163  edm::LogError("FastTimerService") << "FastTimerService::postModuleEventDelayedGet: invalid module";
1164  return;
1165  }
1166 
1167  edm::ModuleDescription const & md = * mcc.moduleDescription();
1168  unsigned int sid = sc.streamID().value();
1169  auto & stream = m_stream[sid];
1170 
1171  double active = 0.;
1172 
1173  // time and account each module
1174  if (md.id() < stream.fast_modules.size()) {
1175  ModuleInfo & module = * stream.fast_modules[md.id()];
1176  module.timer.stop();
1177  active = module.timer.seconds();
1178  module.time_active = active;
1179  module.summary_active += active;
1180  // plots are filled post event processing
1181  } else {
1182  // should never get here
1183  edm::LogError("FastTimerService") << "FastTimerService::postModuleEvent: unexpected module " << md.moduleLabel();
1184  }
1185 }
assert(m_qm.get())
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 1222 of file FastTimerService.cc.

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

1222  {
1223  // this is ever called only if m_enable_timing_modules = true
1225 
1226  if (mcc.moduleDescription() == nullptr) {
1227  edm::LogError("FastTimerService") << "FastTimerService::postModuleEventDelayedGet: invalid module";
1228  return;
1229  }
1230 
1231  edm::ModuleDescription const & md = * mcc.moduleDescription();
1232  unsigned int sid = sc.streamID().value();
1233  auto & stream = m_stream[sid];
1234 
1235  // see the description of the possible ModuleCallingContext states in preModuleEventDelayedGet, above.
1236  if (mcc.state() == edm::ModuleCallingContext::State::kRunning) {
1237  if (md.id() < stream.fast_modules.size()) {
1238  ModuleInfo & module = * stream.fast_modules[md.id()];
1239  module.timer.resume();
1240  } else {
1241  // should never get here
1242  edm::LogError("FastTimerService") << "FastTimerService::postModuleEventDelayedGet: unexpected module " << md.moduleLabel();
1243  }
1244  }
1245 
1246 }
assert(m_qm.get())
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 1025 of file FastTimerService.cc.

References funct::abs(), edm::HLTPathStatus::accept(), FastTimerService::PathInfo::accept, FastTimerService::ModuleInfo::counter, delta(), alignCSCRings::e, i, edm::HLTPathStatus::index(), inter, FastTimerService::PathInfo::last_run, m_enable_timing_modules, m_enable_timing_paths, m_process, m_stream, FastTimerService::PathInfo::modules, fed_dqm_sourceclient-live_cfg::path, edm::PathContext::pathName(), sysUtil::pid, edm::StreamContext::processContext(), processID(), FastTimerService::ModuleInfo::run_in_path, 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().

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

Definition at line 977 of file FastTimerService.cc.

References m_stream.

Referenced by FastTimerService().

977  {
978  auto & stream = m_stream[sid];
979  stream.timer_source.stop();
980  stream.timer_last_transition = stream.timer_source.getStopTime();
981 
982  // account the time spent in the source
983  stream.timing.source = stream.timer_source.seconds();
984 }
std::vector< StreamData > m_stream
void FastTimerService::postStreamBeginLumi ( edm::StreamContext const &  sc)
private

Definition at line 590 of file FastTimerService.cc.

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

Referenced by FastTimerService().

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

Definition at line 567 of file FastTimerService.cc.

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

Referenced by FastTimerService().

567  {
568  unsigned int sid = sc.streamID().value();
569  auto & stream = m_stream[sid];
570  stream.timer_last_transition = FastTimer::Clock::now();
571 }
std::vector< StreamData > m_stream
void FastTimerService::postStreamEndLumi ( edm::StreamContext const &  sc)
private

Definition at line 597 of file FastTimerService.cc.

References assert(), edm::StreamContext::eventID(), edm::EventID::luminosityBlock(), m_enable_dqm, m_module_id, m_stream, DQMStore::mergeAndResetMEsLuminositySummaryCache(), fileCollector::now, cppFunctionSkipper::operator, edm::EventID::run(), edm::StreamContext::streamID(), and edm::StreamID::value().

Referenced by FastTimerService().

597  {
598  unsigned int sid = sc.streamID().value();
599  auto & stream = m_stream[sid];
600 
601  if (m_enable_dqm) {
602  DQMStore * store = edm::Service<DQMStore>().operator->();
603  assert(store);
604  store->mergeAndResetMEsLuminositySummaryCache(sc.eventID().run(),sc.eventID().luminosityBlock(),sid, m_module_id);
605  }
606 
607  stream.timer_last_transition = FastTimer::Clock::now();
608 }
assert(m_qm.get())
unsigned int m_module_id
std::vector< StreamData > m_stream
void FastTimerService::postStreamEndRun ( edm::StreamContext const &  sc)
private

Definition at line 574 of file FastTimerService.cc.

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

Referenced by FastTimerService().

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

Definition at line 540 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(), and edm::service::SystemBounds::maxNumberOfThreads().

Referenced by FastTimerService().

541 {
542  m_concurrent_runs = bounds.maxNumberOfConcurrentRuns();
543  m_concurrent_streams = bounds.maxNumberOfStreams();
544  m_concurrent_threads = bounds.maxNumberOfThreads();
545 
547  m_dqm_path += (boost::format("/Running %d processes") % m_concurrent_threads).str();
548 
552 
553  // assign a pseudo module id to the FastTimerService
555  for (auto & stream: m_stream) {
556  stream.fast_modules.resize( m_module_id, nullptr);
557  stream.fast_moduletypes.resize(m_module_id, nullptr);
558  }
559 
560  // resize the luminosity per event buffer
561  for (auto & stream: m_stream)
562  stream.luminosity.resize(m_dqm_luminosity.size(), 0);
563 }
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 749 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(), edm::StreamContext::streamID(), and edm::StreamID::value().

Referenced by FastTimerService().

749  {
750  unsigned int pid = processID(sc.processContext());
751  unsigned int sid = sc.streamID().value();
752  auto & stream = m_stream[sid];
753 
754  // new event, reset the per-event counter
755  stream.timer_event.start();
756 
757  // account the time spent between the last transition and the beginning of the event
758  stream.timing_perprocess[pid].preevent = delta(stream.timer_last_transition, stream.timer_event.getStartTime());
759 
760  // clear the event counters
761  stream.timing_perprocess[pid].event = 0;
762  stream.timing_perprocess[pid].all_paths = 0;
763  stream.timing_perprocess[pid].all_endpaths = 0;
764  stream.timing_perprocess[pid].interpaths = 0;
765  stream.timing_perprocess[pid].paths_interpaths.assign(stream.paths[pid].size() + 1, 0);
766  for (auto & keyval : stream.paths[pid]) {
767  keyval.second.timer.reset();
768  keyval.second.time_active = 0.;
769  keyval.second.time_exclusive = 0.;
770  keyval.second.time_premodules = 0.;
771  keyval.second.time_intermodules = 0.;
772  keyval.second.time_postmodules = 0.;
773  keyval.second.time_total = 0.;
774  }
775 
776  // copy the start event timestamp as the end of the previous path
777  // used by the inter-path overhead measurement
778  stream.timer_last_path = stream.timer_event.getStartTime();
779 
780  // if requested, set the lumisection for timing vs. lumisection plots
781  if (m_enable_dqm_byls and pid == 0)
782  setLuminosity(sid, 0, sc.eventID().luminosityBlock());
783 }
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 181 of file FastTimerService.cc.

References fillPathMap(), findFirstLast(), 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(), bril_dqm_clientPB-live_cfg::rid, edm::GlobalContext::runIndex(), findQualityFiles::size, AlCaHLTBitMon_QueryRunRegistry::string, and edmLumisInFiles::summary.

Referenced by FastTimerService().

182 {
183  unsigned int pid = processID(gc.processContext());
184  unsigned int rid = gc.runIndex();
185 
187 
188  uint32_t size_p = tns.getTrigPaths().size();
189  uint32_t size_e = tns.getEndPaths().size();
190  uint32_t size = size_p + size_e;
191  // resize the path maps
192  for (auto & stream: m_stream)
193  if (stream.paths.size() <= pid)
194  stream.paths.resize(pid+1);
195  for (uint32_t i = 0; i < size_p; ++i) {
196  std::string const & label = tns.getTrigPath(i);
197  for (auto & stream: m_stream)
198  stream.paths[pid][label].index = i;
199  }
200  for (uint32_t i = 0; i < size_e; ++i) {
201  std::string const & label = tns.getEndPath(i);
202  for (auto & stream: m_stream)
203  stream.paths[pid][label].index = size_p + i;
204  }
205  for (auto & stream: m_stream) {
206  // resize the stream buffers to account the number of subprocesses
207  if (stream.timing_perprocess.size() <= pid)
208  stream.timing_perprocess.resize(pid+1);
209  stream.timing_perprocess[pid].paths_interpaths.assign(size + 1, 0.);
210  // resize the stream plots to account the number of subprocesses
211  if (stream.dqm_perprocess.size() <= pid)
212  stream.dqm_perprocess.resize(pid+1);
213  if (stream.dqm_perprocess_byluminosity.size() <= pid)
214  stream.dqm_perprocess_byluminosity.resize(pid+1);
215  if (stream.dqm_paths.size() <= pid)
216  stream.dqm_paths.resize(pid+1);
217  }
218  for (auto & summary: m_run_summary_perprocess) {
219  if (summary.size() <= pid)
220  summary.resize(pid+1);
221  summary[pid].paths_interpaths.assign(size + 1, 0);
222  }
223  if (m_job_summary_perprocess.size() <= pid)
224  m_job_summary_perprocess.resize(pid+1);
225  m_job_summary_perprocess[pid].paths_interpaths.assign(size + 1, 0.);
226 
227  // reset the run summaries
228  if (pid == 0)
229  m_run_summary[rid].reset();
230  m_run_summary_perprocess[rid][pid].reset();
231 
232  // associate to each path all the modules it contains
233  for (uint32_t i = 0; i < tns.getTrigPaths().size(); ++i)
234  fillPathMap( pid, tns.getTrigPath(i), tns.getTrigPathModules(i) );
235  for (uint32_t i = 0; i < tns.getEndPaths().size(); ++i)
236  fillPathMap( pid, tns.getEndPath(i), tns.getEndPathModules(i) );
237 
238  // cache the names of the process, and of first and last non-empty path and endpath
239  if (m_process.size() <= pid)
240  m_process.resize(pid+1);
241  m_process[pid].name = gc.processContext()->processName();
242  std::tie(m_process[pid].first_path, m_process[pid].last_path) = findFirstLast(pid, tns.getTrigPaths(), m_skip_first_path and pid == 0);
243  std::tie(m_process[pid].first_endpath, m_process[pid].last_endpath) = findFirstLast(pid, tns.getEndPaths());
244 }
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
tuple rid
Histograms Source for live online DQM in P5
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.
std::pair< std::string, std::string > findFirstLast(unsigned int pid, std::vector< std::string > const &paths, bool skip=false)
void FastTimerService::preModuleBeginJob ( edm::ModuleDescription const &  module)
private

Definition at line 736 of file FastTimerService.cc.

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

Referenced by FastTimerService().

736  {
737  // allocate a counter for each module and module type
738  for (auto & stream: m_stream) {
739  if (module.id() >= stream.fast_modules.size())
740  stream.fast_modules.resize(module.id() + 1, nullptr);
741  if (module.id() >= stream.fast_moduletypes.size())
742  stream.fast_moduletypes.resize(module.id() + 1, nullptr);
743 
744  stream.fast_modules[module.id()] = & stream.modules[module.moduleLabel()];;
745  stream.fast_moduletypes[module.id()] = & stream.moduletypes[module.moduleName()];
746  }
747 }
std::vector< StreamData > m_stream
Definition: vlib.h:208
void FastTimerService::preModuleEvent ( edm::StreamContext const &  sc,
edm::ModuleCallingContext const &  mcc 
)
private

Definition at line 1130 of file FastTimerService.cc.

References assert(), 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(), edm::StreamContext::streamID(), FastTimerService::ModuleInfo::timer, and edm::StreamID::value().

1130  {
1131  // this is ever called only if m_enable_timing_modules = true
1133 
1134  if (mcc.moduleDescription() == nullptr) {
1135  edm::LogError("FastTimerService") << "FastTimerService::postModuleEventDelayedGet: invalid module";
1136  return;
1137  }
1138 
1139  edm::ModuleDescription const & md = * mcc.moduleDescription();
1140  unsigned int sid = sc.streamID().value();
1141  auto & stream = m_stream[sid];
1142 
1143  // time each module
1144  if (md.id() < stream.fast_modules.size()) {
1145  ModuleInfo & module = * stream.fast_modules[md.id()];
1146  module.run_in_path = stream.current_path;
1147  module.timer.start();
1148  stream.current_module = & module;
1149  // used to measure the time spent between the beginning of the path and the execution of the first module
1150  if (stream.current_path->first_module == nullptr)
1151  stream.current_path->first_module = & module;
1152  } else {
1153  // should never get here
1154  edm::LogError("FastTimerService") << "FastTimerService::preModuleEvent: unexpected module " << md.moduleLabel();
1155  }
1156 }
assert(m_qm.get())
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 1187 of file FastTimerService.cc.

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

1187  {
1188  // this is ever called only if m_enable_timing_modules = true
1190 
1191  if (mcc.moduleDescription() == nullptr) {
1192  edm::LogError("FastTimerService") << "FastTimerService::postModuleEventDelayedGet: invalid module";
1193  return;
1194  }
1195 
1196  edm::ModuleDescription const & md = * mcc.moduleDescription();
1197  unsigned int sid = sc.streamID().value();
1198  auto & stream = m_stream[sid];
1199 
1200  // if the ModuleCallingContext state is "Pefetching", the module is not running,
1201  // and is asking for its dependencies due to a "consumes" declaration.
1202  // we can ignore this signal.
1203 
1204  // if the ModuleCallingContext state is "Running", the module was running:
1205  // it declared its dependencies as "mayConsume", and is now calling getByToken/getByLabel.
1206  // we pause the timer for this module, and resume it later in the postModuleEventDelayedGet signal.
1207 
1208  // if the ModuleCallingContext state is "Invalid", we ignore the signal.
1209 
1210  if (mcc.state() == edm::ModuleCallingContext::State::kRunning) {
1211  if (md.id() < stream.fast_modules.size()) {
1212  ModuleInfo & module = * stream.fast_modules[md.id()];
1213  module.timer.pause();
1214  } else {
1215  // should never get here
1216  edm::LogError("FastTimerService") << "FastTimerService::preModuleEventDelayedGet: unexpected module " << md.moduleLabel();
1217  }
1218  }
1219 
1220 }
assert(m_qm.get())
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 987 of file FastTimerService.cc.

References delta(), m_process, m_stream, fed_dqm_sourceclient-live_cfg::path, edm::PathContext::pathName(), sysUtil::pid, edm::StreamContext::processContext(), processID(), edm::StreamContext::streamID(), and AlCaHLTBitMon_QueryRunRegistry::string.

987  {
988  std::string const & path = pc.pathName();
989  unsigned int pid = processID(sc.processContext());
990  unsigned int sid = sc.streamID();
991  auto & stream = m_stream[sid];
992 
993  auto keyval = stream.paths[pid].find(path);
994  if (keyval != stream.paths[pid].end()) {
995  stream.current_path = & keyval->second;
996  } else {
997  // should never get here
998  stream.current_path = nullptr;
999  edm::LogError("FastTimerService") << "FastTimerService::prePathEvent: unexpected path " << path;
1000  return;
1001  }
1002 
1003  // prepare to measure the time spent between the beginning of the path and the execution of the first module
1004  stream.current_path->first_module = nullptr;
1005 
1006  // time each (end)path
1007  stream.current_path->timer.start();
1008 
1009  if (path == m_process[pid].first_path) {
1010  // this is the first path, start the "all paths" counter
1011  stream.timer_paths.setStartTime(stream.current_path->timer.getStartTime());
1012  } else if (path == m_process[pid].first_endpath) {
1013  // this is the first endpath, start the "all paths" counter
1014  stream.timer_endpaths.setStartTime(stream.current_path->timer.getStartTime());
1015  }
1016 
1017  // measure the inter-path overhead as the time elapsed since the end of preiovus path
1018  // (or the beginning of the event, if this is the first path - see preEvent)
1019  double interpaths = delta(stream.timer_last_path, stream.current_path->timer.getStartTime());
1020  stream.timing_perprocess[pid].interpaths += interpaths;
1021  stream.timing_perprocess[pid].paths_interpaths[stream.current_path->index] = interpaths;
1022 }
static double delta(FastTimer::Clock::time_point const &first, FastTimer::Clock::time_point const &second)
std::vector< ProcessDescription > m_process
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 951 of file FastTimerService.cc.

References delta(), and m_stream.

Referenced by FastTimerService().

951  {
952  auto & stream = m_stream[sid];
953 
954  // clear the event counters
955  stream.timing.reset();
956  stream.timer_source.start();
957 
958  // clear the event counters
959  // note: this is done here and not in preEvent to avoid clearing the counter before each subprocess
960  for (auto & keyval : stream.modules) {
961  keyval.second.timer.reset();
962  keyval.second.time_active = 0.;
963  keyval.second.run_in_path = nullptr;
964  keyval.second.counter = 0;
965  }
966  for (auto & keyval : stream.moduletypes) {
967  keyval.second.timer.reset();
968  keyval.second.time_active = 0.;
969  keyval.second.run_in_path = nullptr;
970  keyval.second.counter = 0;
971  }
972 
973  // account the time spent before the source
974  stream.timing.presource = delta(stream.timer_last_transition, stream.timer_source.getStartTime());
975 }
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 246 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(), edm::service::TriggerNamesService::findEndPath(), edm::service::TriggerNamesService::findTrigPath(), cmsPerfStripChart::format, 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, HLT_25ns10e33_v2_cff::labels, CommonMethods::lock(), 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, edmConvertToStreamModule::modules, FastTimerService::PathInfo::modules, mutex, 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, edm::StreamContext::streamID(), AlCaHLTBitMon_QueryRunRegistry::string, SiPixelPhase1TrackClusters_cfi::title, and edm::StreamID::value().

Referenced by FastTimerService().

247 {
248  std::string const & process_name = sc.processContext()->processName();
249  unsigned int pid = processID(sc.processContext());
250  unsigned int sid = sc.streamID().value();
251  auto & stream = m_stream[sid];
252 
253  if (not m_enable_dqm)
254  return;
255 
256  if (not edm::Service<DQMStore>().isAvailable()) {
257  // the DQMStore is not available, disable all DQM plots
258  m_enable_dqm = false;
259  return;
260  }
261 
263  uint32_t size_p = tns.getTrigPaths().size();
264  uint32_t size_e = tns.getEndPaths().size();
265  uint32_t size = size_p + size_e;
266 
267  int eventbins = (int) std::ceil(m_dqm_eventtime_range / m_dqm_eventtime_resolution);
268  int pathbins = (int) std::ceil(m_dqm_pathtime_range / m_dqm_pathtime_resolution);
269  int modulebins = (int) std::ceil(m_dqm_moduletime_range / m_dqm_moduletime_resolution);
270 
271  // define a callback that can book the histograms
272  auto bookTransactionCallback = [&, this] (DQMStore::IBooker & booker) {
273 
274  // event summary plots
275  if (m_enable_dqm_summary) {
276  // whole event
277  if (pid == 0) {
278  booker.setCurrentFolder(m_dqm_path);
279  stream.dqm.presource = booker.book1D("presource", "Pre-Source processing time", modulebins, 0., m_dqm_moduletime_range)->getTH1F();
280  stream.dqm.presource ->StatOverflows(true);
281  stream.dqm.presource ->SetXTitle("processing time [ms]");
282  stream.dqm.source = booker.book1D("source", "Source processing time", modulebins, 0., m_dqm_moduletime_range)->getTH1F();
283  stream.dqm.source ->StatOverflows(true);
284  stream.dqm.source ->SetXTitle("processing time [ms]");
285  stream.dqm.preevent = booker.book1D("preevent", "Pre-Event processing time", modulebins, 0., m_dqm_moduletime_range)->getTH1F();
286  stream.dqm.preevent ->StatOverflows(true);
287  stream.dqm.preevent ->SetXTitle("processing time [ms]");
288  stream.dqm.event = booker.book1D("event", "Event processing time", eventbins, 0., m_dqm_eventtime_range)->getTH1F();
289  stream.dqm.event ->StatOverflows(true);
290  stream.dqm.event ->SetXTitle("processing time [ms]");
291  }
292 
293  // per subprocess
294  booker.setCurrentFolder(m_dqm_path + "/process " + process_name);
295  stream.dqm_perprocess[pid].preevent = booker.book1D("preevent", "Pre-Event processing time", modulebins, 0., m_dqm_moduletime_range)->getTH1F();
296  stream.dqm_perprocess[pid].preevent ->StatOverflows(true);
297  stream.dqm_perprocess[pid].preevent ->SetXTitle("processing time [ms]");
298  stream.dqm_perprocess[pid].event = booker.book1D("event", "Event processing time", eventbins, 0., m_dqm_eventtime_range)->getTH1F();
299  stream.dqm_perprocess[pid].event ->StatOverflows(true);
300  stream.dqm_perprocess[pid].event ->SetXTitle("processing time [ms]");
301  stream.dqm_perprocess[pid].all_paths = booker.book1D("all_paths", "Paths processing time", eventbins, 0., m_dqm_eventtime_range)->getTH1F();
302  stream.dqm_perprocess[pid].all_paths ->StatOverflows(true);
303  stream.dqm_perprocess[pid].all_paths ->SetXTitle("processing time [ms]");
304  stream.dqm_perprocess[pid].all_endpaths = booker.book1D("all_endpaths", "EndPaths processing time", pathbins, 0., m_dqm_pathtime_range)->getTH1F();
305  stream.dqm_perprocess[pid].all_endpaths ->StatOverflows(true);
306  stream.dqm_perprocess[pid].all_endpaths ->SetXTitle("processing time [ms]");
307  stream.dqm_perprocess[pid].interpaths = booker.book1D("interpaths", "Time spent between paths", pathbins, 0., m_dqm_eventtime_range)->getTH1F();
308  stream.dqm_perprocess[pid].interpaths ->StatOverflows(true);
309  stream.dqm_perprocess[pid].interpaths ->SetXTitle("processing time [ms]");
310  }
311 
312  // plots by path
313  if (m_enable_timing_paths) {
314  booker.setCurrentFolder(m_dqm_path + "/process " + process_name);
315  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();
316  stream.dqm_paths[pid].active_time ->StatOverflows(true);
317  stream.dqm_paths[pid].active_time ->SetYTitle("processing time [ms]");
318  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();
319  stream.dqm_paths[pid].total_time ->StatOverflows(true);
320  stream.dqm_paths[pid].total_time ->SetYTitle("processing time [ms]");
321  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();
322  stream.dqm_paths[pid].exclusive_time ->StatOverflows(true);
323  stream.dqm_paths[pid].exclusive_time ->SetYTitle("processing time [ms]");
324  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();
325  stream.dqm_paths[pid].interpaths ->StatOverflows(true);
326  stream.dqm_paths[pid].interpaths ->SetYTitle("processing time [ms]");
327 
328  for (uint32_t i = 0; i < size_p; ++i) {
329  std::string const & label = tns.getTrigPath(i);
330  stream.dqm_paths[pid].active_time ->GetXaxis()->SetBinLabel(i + 1, label.c_str());
331  stream.dqm_paths[pid].total_time ->GetXaxis()->SetBinLabel(i + 1, label.c_str());
332  stream.dqm_paths[pid].exclusive_time ->GetXaxis()->SetBinLabel(i + 1, label.c_str());
333  stream.dqm_paths[pid].interpaths ->GetXaxis()->SetBinLabel(i + 1, label.c_str());
334  }
335  for (uint32_t i = 0; i < size_e; ++i) {
336  std::string const & label = tns.getEndPath(i);
337  stream.dqm_paths[pid].active_time ->GetXaxis()->SetBinLabel(i + size_p + 1, label.c_str());
338  stream.dqm_paths[pid].total_time ->GetXaxis()->SetBinLabel(i + size_p + 1, label.c_str());
339  stream.dqm_paths[pid].exclusive_time ->GetXaxis()->SetBinLabel(i + size_p + 1, label.c_str());
340  stream.dqm_paths[pid].interpaths ->GetXaxis()->SetBinLabel(i + size_p + 1, label.c_str());
341  }
342  stream.dqm_paths[pid].interpaths ->GetXaxis()->SetBinLabel(size+1, "");
343  }
344 
345  // plots vs. instantaneous luminosity
346  if (not m_dqm_luminosity.empty()) {
347  if (pid == 0) {
348  // resize the plots vs. luminosity
349  stream.dqm_byluminosity.resize(m_dqm_luminosity.size());
350 
351  // whole event
352  booker.setCurrentFolder(m_dqm_path);
353  for (unsigned int i = 0; i < m_dqm_luminosity.size(); ++i) {
354  auto & plots = stream.dqm_byluminosity[i];
355  int lumibins = (int) std::ceil(m_dqm_luminosity[i].range / m_dqm_luminosity[i].resolution);
356  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();
357  plots.presource ->StatOverflows(true);
358  plots.presource ->SetXTitle(m_dqm_luminosity[i].label.c_str());
359  plots.presource ->SetYTitle("processing time [ms]");
360  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();
361  plots.source ->StatOverflows(true);
362  plots.source ->SetXTitle(m_dqm_luminosity[i].label.c_str());
363  plots.source ->SetYTitle("processing time [ms]");
364  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();
365  plots.preevent ->StatOverflows(true);
366  plots.preevent ->SetXTitle(m_dqm_luminosity[i].label.c_str());
367  plots.preevent ->SetYTitle("processing time [ms]");
368  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();
369  plots.event ->StatOverflows(true);
370  plots.event ->SetXTitle(m_dqm_luminosity[i].label.c_str());
371  plots.event ->SetYTitle("processing time [ms]");
372  }
373  }
374 
375  // resize the plots vs. luminosity
376  stream.dqm_perprocess_byluminosity[pid].resize(m_dqm_luminosity.size());
377 
378  // per subprocess
379  booker.setCurrentFolder(m_dqm_path + "/process " + process_name);
380  for (unsigned int i = 0; i < m_dqm_luminosity.size(); ++i) {
381  auto & plots = stream.dqm_perprocess_byluminosity[pid][i];
382  int lumibins = (int) std::ceil(m_dqm_luminosity[i].range / m_dqm_luminosity[i].resolution);
383  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();
384  plots.preevent ->StatOverflows(true);
385  plots.preevent ->SetXTitle(m_dqm_luminosity[i].label.c_str());
386  plots.preevent ->SetYTitle("processing time [ms]");
387  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();
388  plots.event ->StatOverflows(true);
389  plots.event ->SetXTitle(m_dqm_luminosity[i].label.c_str());
390  plots.event ->SetYTitle("processing time [ms]");
391  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();
392  plots.all_paths ->StatOverflows(true);
393  plots.all_paths ->SetXTitle(m_dqm_luminosity[i].label.c_str());
394  plots.all_paths ->SetYTitle("processing time [ms]");
395  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();
396  plots.all_endpaths ->StatOverflows(true);
397  plots.all_endpaths ->SetXTitle(m_dqm_luminosity[i].label.c_str());
398  plots.all_endpaths ->SetYTitle("processing time [ms]");
399  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();
400  plots.interpaths ->StatOverflows(true);
401  plots.interpaths ->SetXTitle(m_dqm_luminosity[i].label.c_str());
402  plots.interpaths ->SetYTitle("processing time [ms]");
403  }
404  }
405 
406  // per-path and per-module accounting
407  if (m_enable_timing_paths) {
408  booker.setCurrentFolder(m_dqm_path + "/process " + process_name + "/Paths");
409  for (auto & keyval: stream.paths[pid]) {
410  std::string const & pathname = keyval.first;
411  PathInfo & pathinfo = keyval.second;
412 
414  pathinfo.dqm_active = booker.book1D(pathname + "_active", pathname + " active time", pathbins, 0., m_dqm_pathtime_range)->getTH1F();
415  pathinfo.dqm_active ->StatOverflows(true);
416  pathinfo.dqm_active ->SetXTitle("processing time [ms]");
417  }
418 
420  pathinfo.dqm_total = booker.book1D(pathname + "_total", pathname + " total time", pathbins, 0., m_dqm_pathtime_range)->getTH1F();
421  pathinfo.dqm_total ->StatOverflows(true);
422  pathinfo.dqm_total ->SetXTitle("processing time [ms]");
423  }
424 
426  pathinfo.dqm_premodules = booker.book1D(pathname + "_premodules", pathname + " pre-modules overhead", modulebins, 0., m_dqm_moduletime_range)->getTH1F();
427  pathinfo.dqm_premodules ->StatOverflows(true);
428  pathinfo.dqm_premodules ->SetXTitle("processing time [ms]");
429  pathinfo.dqm_intermodules = booker.book1D(pathname + "_intermodules", pathname + " inter-modules overhead", modulebins, 0., m_dqm_moduletime_range)->getTH1F();
430  pathinfo.dqm_intermodules ->StatOverflows(true);
431  pathinfo.dqm_intermodules ->SetXTitle("processing time [ms]");
432  pathinfo.dqm_postmodules = booker.book1D(pathname + "_postmodules", pathname + " post-modules overhead", modulebins, 0., m_dqm_moduletime_range)->getTH1F();
433  pathinfo.dqm_postmodules ->StatOverflows(true);
434  pathinfo.dqm_postmodules ->SetXTitle("processing time [ms]");
435  pathinfo.dqm_overhead = booker.book1D(pathname + "_overhead", pathname + " overhead time", modulebins, 0., m_dqm_moduletime_range)->getTH1F();
436  pathinfo.dqm_overhead ->StatOverflows(true);
437  pathinfo.dqm_overhead ->SetXTitle("processing time [ms]");
438  }
439 
441  // book histograms for modules-in-paths statistics
442 
443  // find histograms X-axis labels
444  uint32_t id;
445  std::vector<std::string> const & modules = ((id = tns.findTrigPath(pathname)) != tns.getTrigPaths().size()) ? tns.getTrigPathModules(id) :
446  ((id = tns.findEndPath(pathname)) != tns.getEndPaths().size()) ? tns.getEndPathModules(id) :
447  std::vector<std::string>();
448 
449  // use a mutex to prevent two threads from assigning to the same element at the same time
450  static std::mutex dup_mutex;
451  // use a tbb::concurrent_vector because growing does not invalidate existing iterators and pointers
452  static tbb::concurrent_vector<std::string> dup;
453  // lock, and fill the first 32 elements
454  if (dup.empty()) {
455  std::lock_guard<std::mutex> lock(dup_mutex);
456  if (dup.empty()) {
457  dup.resize(32);
458  for (unsigned int i = 0; i < 32; ++i)
459  dup[i] = (boost::format("(dup.) (%d)") % i).str();
460  }
461  }
462  // lock, and fill as many elements as needed
463  if (modules.size() > dup.size()) {
464  std::lock_guard<std::mutex> lock(dup_mutex);
465  unsigned int old_size = dup.size();
466  unsigned int new_size = modules.size();
467  if (new_size > old_size) {
468  dup.resize(new_size);
469  for (unsigned int i = old_size; i < new_size; ++i)
470  dup[i] = (boost::format("(dup.) (%d)") % i).str();
471  }
472  }
473 
474  std::vector<const char *> labels(modules.size(), nullptr);
475  for (uint32_t i = 0; i < modules.size(); ++i)
476  labels[i] = (pathinfo.modules[i]) ? modules[i].c_str() : dup[i].c_str();
477 
478  // book counter histograms
479  if (m_enable_dqm_bypath_counters) {
480  pathinfo.dqm_module_counter = booker.book1D(pathname + "_module_counter", pathname + " module counter", modules.size() + 1, -0.5, modules.size() + 0.5)->getTH1F();
481  // find module labels
482  for (uint32_t i = 0; i < modules.size(); ++i)
483  pathinfo.dqm_module_counter->GetXaxis()->SetBinLabel( i+1, labels[i] );
484  pathinfo.dqm_module_counter->GetXaxis()->SetBinLabel( modules.size() + 1, "" );
485  }
486  // book detailed timing histograms
488  pathinfo.dqm_module_active = booker.book1D(pathname + "_module_active", pathname + " module active", modules.size(), -0.5, modules.size() - 0.5)->getTH1F();
489  pathinfo.dqm_module_active ->SetYTitle("cumulative processing time [ms]");
490  pathinfo.dqm_module_total = booker.book1D(pathname + "_module_total", pathname + " module total", modules.size(), -0.5, modules.size() - 0.5)->getTH1F();
491  pathinfo.dqm_module_total ->SetYTitle("cumulative processing time [ms]");
492  // find module labels
493  for (uint32_t i = 0; i < modules.size(); ++i) {
494  pathinfo.dqm_module_active ->GetXaxis()->SetBinLabel( i+1, labels[i] );
495  pathinfo.dqm_module_total ->GetXaxis()->SetBinLabel( i+1, labels[i] );
496  }
497  }
498  }
499 
500  // book exclusive path time histograms
502  pathinfo.dqm_exclusive = booker.book1D(pathname + "_exclusive", pathname + " exclusive time", pathbins, 0., m_dqm_pathtime_range)->getTH1F();
503  pathinfo.dqm_exclusive ->StatOverflows(true);
504  pathinfo.dqm_exclusive ->SetXTitle("processing time [ms]");
505  }
506 
507  }
508  }
509 
510  if (m_enable_dqm_bymodule) {
511  booker.setCurrentFolder(m_dqm_path + "/Modules");
512  for (auto & keyval: stream.modules) {
513  std::string const & label = keyval.first;
514  ModuleInfo & module = keyval.second;
515  module.dqm_active = booker.book1D(label, label, modulebins, 0., m_dqm_moduletime_range)->getTH1F();
516  module.dqm_active->StatOverflows(true);
517  module.dqm_active->SetXTitle("processing time [ms]");
518  }
519  }
520 
522  booker.setCurrentFolder(m_dqm_path + "/ModuleTypes");
523  for (auto & keyval: stream.moduletypes) {
524  std::string const & label = keyval.first;
525  ModuleInfo & module = keyval.second;
526  module.dqm_active = booker.book1D(label, label, modulebins, 0., m_dqm_moduletime_range)->getTH1F();
527  module.dqm_active->StatOverflows(true);
528  module.dqm_active->SetXTitle("processing time [ms]");
529  }
530  }
531 
532  };
533 
534  // book MonitorElement's for this stream
535  edm::Service<DQMStore>()->bookTransaction(bookTransactionCallback, sc.eventID().run(), sid, m_module_id);
536 }
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
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
static boost::mutex mutex
Definition: LHEProxy.cc:11
const bool m_enable_dqm_bypath_counters
const bool m_enable_dqm_bypath_exclusive
const double m_dqm_pathtime_range
string format
Some error handling for the usage.
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 639 of file FastTimerService.cc.

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

Referenced by postEndJob(), and postGlobalEndRun().

640 {
641  // print a timing summary for the run or job, for each subprocess
642  std::ostringstream out;
643  out << std::fixed << std::setprecision(6);
644  out << "FastReport for " << label << ", process " << process << '\n';
645  //out << "FastReport " << (m_use_realtime ? "(real time) " : "(CPU time) ") << '\n';
646  out << "FastReport " << std::right << std::setw(10) << summary.preevent / (double) total.count << " Pre-Event" << '\n';
647  out << "FastReport " << std::right << std::setw(10) << summary.event / (double) total.count << " Event" << '\n';
648  out << "FastReport " << std::right << std::setw(10) << summary.all_paths / (double) total.count << " all Paths" << '\n';
649  out << "FastReport " << std::right << std::setw(10) << summary.all_endpaths / (double) total.count << " all EndPaths" << '\n';
650  out << "FastReport " << std::right << std::setw(10) << summary.interpaths / (double) total.count << " between paths" << '\n';
651  edm::LogVerbatim("FastReport") << out.str();
652 }
tuple process
Definition: LaserDQM_cfg.py:3
void FastTimerService::printSummary ( Timing const &  summary,
std::string const &  label 
) const
private

Definition at line 655 of file FastTimerService.cc.

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

Referenced by postEndJob(), and postGlobalEndRun().

656 {
657  // print a timing summary for the run or job
658  //edm::service::TriggerNamesService & tns = * edm::Service<edm::service::TriggerNamesService>();
659 
660  std::ostringstream out;
661  out << std::fixed << std::setprecision(6);
662  out << "FastReport for " << label << ", over all subprocesses" << '\n';
663  //out << "FastReport " << (m_use_realtime ? "(real time) " : "(CPU time) ") << '\n';
664  out << "FastReport " << std::right << std::setw(10) << summary.presource / (double) summary.count << " Pre-Source" << '\n';
665  out << "FastReport " << std::right << std::setw(10) << summary.source / (double) summary.count << " Source" << '\n';
666  out << "FastReport " << std::right << std::setw(10) << summary.preevent / (double) summary.count << " Pre-Event" << '\n';
667  out << "FastReport " << std::right << std::setw(10) << summary.event / (double) summary.count << " Event" << '\n';
668  edm::LogVerbatim("FastReport") << out.str();
669 }
unsigned int FastTimerService::processID ( edm::ProcessContext const *  context)
staticprivate

Definition at line 1452 of file FastTimerService.cc.

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

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

1453 {
1454  unsigned int pid = 0;
1455 
1456  // iterate through the chain of ProcessContext until we reach the topmost process
1457  while (context->isSubProcess()) {
1458  context = & context->parentProcessContext();
1459  ++pid;
1460  }
1461  return pid;
1462 }
tuple pid
Definition: sysUtil.py:22
double FastTimerService::queryEventTime ( edm::StreamID  sid) const

Definition at line 1403 of file FastTimerService.cc.

References m_stream.

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

Definition at line 1319 of file FastTimerService.cc.

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

1319  {
1320  if (module.id() < m_stream[sid].fast_modules.size()) {
1321  return m_stream[sid].fast_modules[module.id()]->time_active;
1322  } else {
1323  //edm::LogError("FastTimerService") << "FastTimerService::queryModuleTime: unexpected module " << module.moduleLabel();
1324  return 0.;
1325  }
1326 }
std::vector< StreamData > m_stream
unsigned int id() const
double FastTimerService::queryModuleTime ( edm::StreamID  sid,
unsigned int  id 
) const

Definition at line 1329 of file FastTimerService.cc.

References m_stream.

1329  {
1330  if (id < m_stream[sid].fast_modules.size()) {
1331  return m_stream[sid].fast_modules[id]->time_active;
1332  } else {
1333  //edm::LogError("FastTimerService") << "FastTimerService::queryModuleTime: unexpected module id " << id;
1334  return 0.;
1335  }
1336 }
std::vector< StreamData > m_stream
double FastTimerService::queryModuleTimeByLabel ( edm::StreamID  sid,
const std::string &  label 
) const

Definition at line 1339 of file FastTimerService.cc.

References m_stream, and edmConvertToStreamModule::modules.

Referenced by IsoTrig::studyTiming().

1339  {
1340  auto const & keyval = m_stream[sid].modules.find(label);
1341  if (keyval != m_stream[sid].modules.end()) {
1342  return keyval->second.time_active;
1343  } else {
1344  // module not found
1345  //edm::LogError("FastTimerService") << "FastTimerService::queryModuleTimeByLabel: unexpected module " << label;
1346  return 0.;
1347  }
1348 }
std::vector< StreamData > m_stream
double FastTimerService::queryModuleTimeByType ( edm::StreamID  sid,
const std::string &  type 
) const

Definition at line 1351 of file FastTimerService.cc.

References m_stream.

1351  {
1352  auto const & keyval = m_stream[sid].moduletypes.find(type);
1353  if (keyval != m_stream[sid].moduletypes.end()) {
1354  return keyval->second.time_active;
1355  } else {
1356  // module not found
1357  //edm::LogError("FastTimerService") << "FastTimerService::queryModuleTimeByType: unexpected module type " << type;
1358  return 0.;
1359  }
1360 }
type
Definition: HCALResponse.h:21
std::vector< StreamData > m_stream
double FastTimerService::querySourceTime ( edm::StreamID  sid) const

Definition at line 1398 of file FastTimerService.cc.

References m_stream.

1398  {
1399  return m_stream[sid].timing.source;
1400 }
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 148 of file FastTimerService.cc.

References m_dqm_luminosity, and m_stream.

Referenced by FastTimerService().

149 {
150  // FIXME check that this is only called before any preStreamBeginRun
151  // FIXME check that this is not called with the same "name" twice
152  m_dqm_luminosity.push_back(LuminosityDescription(name, title, label, range, resolution));
153 
154  // resize the luminosity per event buffer
155  for (auto & stream: m_stream)
156  stream.luminosity.resize(m_dqm_luminosity.size(), 0);
157 
158  return m_dqm_luminosity.size() - 1;
159 }
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 161 of file FastTimerService.cc.

References diffTwoXMLs::label, m_dqm_luminosity, m_stream, mergeVDriftHistosByStation::name, and SiPixelPhase1TrackClusters_cfi::title.

162 {
163  // FIXME check that this is only called before any preStreamBeginRun
164  // FIXME check that this is not called with the same "name" twice
165  m_dqm_luminosity.push_back(LuminosityDescription(name, title, label, range, resolution));
166 
167  // resize the luminosity per event buffer
168  for (auto & stream: m_stream)
169  stream.luminosity.resize(m_dqm_luminosity.size(), 0);
170 
171  return m_dqm_luminosity.size() - 1;
172 }
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 175 of file FastTimerService.cc.

References m_stream, and relativeConstraints::value.

Referenced by preEvent().

176 {
177  // FIXME check that the luminosity id is valid ?
178  m_stream[stream_id].luminosity[luminosity_id] = value;
179 }
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
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
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.