CMS 3D CMS Logo

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

#include <FastTimerService.h>

Classes

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

Public Member Functions

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

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Types

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

Private Member Functions

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

Static Private Member Functions

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

Private Attributes

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

Detailed Description

Definition at line 84 of file FastTimerService.h.

Member Typedef Documentation

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

Definition at line 328 of file FastTimerService.h.

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

Definition at line 324 of file FastTimerService.h.

Constructor & Destructor Documentation

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

Definition at line 46 of file FastTimerService.cc.

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

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

Definition at line 146 of file FastTimerService.cc.

147 {
148 }

Member Function Documentation

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

Definition at line 1286 of file FastTimerService.cc.

References m_stream.

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

Definition at line 1276 of file FastTimerService.cc.

References m_stream.

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

Definition at line 1281 of file FastTimerService.cc.

References m_stream.

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

Definition at line 754 of file FastTimerService.h.

References prof2calltree::count, and first.

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

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

Definition at line 1392 of file FastTimerService.cc.

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

1392  {
1394  desc.addUntracked<bool>( "useRealTimeClock", true);
1395  desc.addUntracked<bool>( "enableTimingPaths", true);
1396  desc.addUntracked<bool>( "enableTimingModules", true);
1397  desc.addUntracked<bool>( "enableTimingExclusive", false);
1398  desc.addUntracked<bool>( "enableTimingSummary", false);
1399  desc.addUntracked<bool>( "skipFirstPath", false),
1400  desc.addUntracked<bool>( "enableDQM", true);
1401  desc.addUntracked<bool>( "enableDQMbyPathActive", false);
1402  desc.addUntracked<bool>( "enableDQMbyPathTotal", true);
1403  desc.addUntracked<bool>( "enableDQMbyPathOverhead", false);
1404  desc.addUntracked<bool>( "enableDQMbyPathDetails", false);
1405  desc.addUntracked<bool>( "enableDQMbyPathCounters", true);
1406  desc.addUntracked<bool>( "enableDQMbyPathExclusive", false);
1407  desc.addUntracked<bool>( "enableDQMbyModule", false);
1408  desc.addUntracked<bool>( "enableDQMbyModuleType", false);
1409  desc.addUntracked<bool>( "enableDQMSummary", false);
1410  desc.addUntracked<bool>( "enableDQMbyLumiSection", false);
1411  desc.addUntracked<bool>( "enableDQMbyProcesses", false);
1412  desc.addUntracked<double>( "dqmTimeRange", 1000. ); // ms
1413  desc.addUntracked<double>( "dqmTimeResolution", 5. ); // ms
1414  desc.addUntracked<double>( "dqmPathTimeRange", 100. ); // ms
1415  desc.addUntracked<double>( "dqmPathTimeResolution", 0.5); // ms
1416  desc.addUntracked<double>( "dqmModuleTimeRange", 40. ); // ms
1417  desc.addUntracked<double>( "dqmModuleTimeResolution", 0.2); // ms
1418  desc.addUntracked<uint32_t>( "dqmLumiSectionsRange", 2500 ); // ~ 16 hours
1419  desc.addUntracked<std::string>( "dqmPath", "HLT/TimerService");
1420  descriptions.add("FastTimerService", desc);
1421 }
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 1244 of file FastTimerService.cc.

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

Referenced by preGlobalBeginRun().

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

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

623 {
625  const std::string label = "the whole job";
626  for (unsigned int pid = 0; pid < m_process.size(); ++pid)
628 
629  printSummary(m_job_summary, label);
630  }
631 }
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 780 of file FastTimerService.cc.

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

Referenced by FastTimerService().

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

Definition at line 606 of file FastTimerService.cc.

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

Referenced by FastTimerService().

607 {
609  unsigned int pid = processID(gc.processContext());
610  unsigned int rid = gc.runIndex();
611  unsigned int run = gc.luminosityBlockID().run();
612  const std::string label = (boost::format("run %d") % run).str();
613 
615 
616  if (pid+1 == m_process.size())
617  printSummary(m_run_summary[rid], label);
618  }
619 }
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 1153 of file FastTimerService.cc.

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

Referenced by FastTimerService().

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

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

Referenced by FastTimerService().

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

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

Referenced by FastTimerService().

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

Definition at line 972 of file FastTimerService.cc.

References m_stream, and edmStreamStallGrapher::stream.

Referenced by FastTimerService().

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

Definition at line 585 of file FastTimerService.cc.

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

Referenced by FastTimerService().

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

Definition at line 562 of file FastTimerService.cc.

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

Referenced by FastTimerService().

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

Definition at line 592 of file FastTimerService.cc.

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

Referenced by FastTimerService().

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

Definition at line 569 of file FastTimerService.cc.

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

Referenced by FastTimerService().

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

Definition at line 535 of file FastTimerService.cc.

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

Referenced by FastTimerService().

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

Definition at line 744 of file FastTimerService.cc.

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

Referenced by FastTimerService().

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

Definition at line 184 of file FastTimerService.cc.

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

Referenced by FastTimerService().

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

Definition at line 731 of file FastTimerService.cc.

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

Referenced by FastTimerService().

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

Definition at line 1125 of file FastTimerService.cc.

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

Referenced by FastTimerService().

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

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

Referenced by FastTimerService().

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

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

Referenced by FastTimerService().

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

Definition at line 946 of file FastTimerService.cc.

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

Referenced by FastTimerService().

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

Definition at line 263 of file FastTimerService.cc.

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

Referenced by FastTimerService().

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

Definition at line 634 of file FastTimerService.cc.

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

Referenced by postEndJob(), and postGlobalEndRun().

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

Definition at line 650 of file FastTimerService.cc.

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

Referenced by postEndJob(), and postGlobalEndRun().

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

Definition at line 1424 of file FastTimerService.cc.

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

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

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

Definition at line 1375 of file FastTimerService.cc.

References m_stream.

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

Definition at line 1291 of file FastTimerService.cc.

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

1291  {
1292  if (module.id() < m_stream[sid].fast_modules.size()) {
1293  return m_stream[sid].fast_modules[module.id()]->time_active;
1294  } else {
1295  edm::LogError("FastTimerService") << "FastTimerService::queryModuleTime: unexpected module " << module.moduleLabel();
1296  return 0.;
1297  }
1298 }
std::string const & moduleLabel() const
std::vector< StreamData > m_stream
unsigned int id() const
double FastTimerService::queryModuleTime ( edm::StreamID  sid,
unsigned int  id 
) const

Definition at line 1301 of file FastTimerService.cc.

References m_stream.

1301  {
1302  if (id < m_stream[sid].fast_modules.size()) {
1303  return m_stream[sid].fast_modules[id]->time_active;
1304  } else {
1305  edm::LogError("FastTimerService") << "FastTimerService::queryModuleTime: unexpected module id " << id;
1306  return 0.;
1307  }
1308 }
std::vector< StreamData > m_stream
double FastTimerService::queryModuleTimeByLabel ( edm::StreamID  sid,
const std::string &  label 
) const

Definition at line 1311 of file FastTimerService.cc.

References diffTwoXMLs::label, m_stream, and edmConvertToStreamModule::modules.

1311  {
1312  auto const & keyval = m_stream[sid].modules.find(label);
1313  if (keyval != m_stream[sid].modules.end()) {
1314  return keyval->second.time_active;
1315  } else {
1316  // module not found
1317  edm::LogError("FastTimerService") << "FastTimerService::queryModuleTimeByLabel: unexpected module " << label;
1318  return 0.;
1319  }
1320 }
std::vector< StreamData > m_stream
double FastTimerService::queryModuleTimeByType ( edm::StreamID  sid,
const std::string &  type 
) const

Definition at line 1323 of file FastTimerService.cc.

References m_stream.

1323  {
1324  auto const & keyval = m_stream[sid].moduletypes.find(type);
1325  if (keyval != m_stream[sid].moduletypes.end()) {
1326  return keyval->second.time_active;
1327  } else {
1328  // module not found
1329  edm::LogError("FastTimerService") << "FastTimerService::queryModuleTimeByType: unexpected module type " << type;
1330  return 0.;
1331  }
1332 }
type
Definition: HCALResponse.h:21
std::vector< StreamData > m_stream
double FastTimerService::querySourceTime ( edm::StreamID  sid) const

Definition at line 1370 of file FastTimerService.cc.

References m_stream.

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

Definition at line 151 of file FastTimerService.cc.

References m_dqm_luminosity, m_stream, and edmStreamStallGrapher::stream.

Referenced by FastTimerService().

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

Definition at line 164 of file FastTimerService.cc.

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

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

Definition at line 178 of file FastTimerService.cc.

References m_stream, and relativeConstraints::value.

Referenced by preEvent().

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

Member Data Documentation

unsigned int FastTimerService::m_concurrent_runs
private

Definition at line 352 of file FastTimerService.h.

Referenced by preallocate().

unsigned int FastTimerService::m_concurrent_streams
private

Definition at line 353 of file FastTimerService.h.

Referenced by preallocate().

unsigned int FastTimerService::m_concurrent_threads
private

Definition at line 354 of file FastTimerService.h.

Referenced by preallocate().

const double FastTimerService::m_dqm_eventtime_range
private

Definition at line 357 of file FastTimerService.h.

Referenced by preStreamBeginRun().

const double FastTimerService::m_dqm_eventtime_resolution
private

Definition at line 358 of file FastTimerService.h.

Referenced by preStreamBeginRun().

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

Definition at line 361 of file FastTimerService.h.

Referenced by preStreamBeginRun().

const double FastTimerService::m_dqm_moduletime_resolution
private

Definition at line 362 of file FastTimerService.h.

Referenced by preStreamBeginRun().

std::string FastTimerService::m_dqm_path
private

Definition at line 363 of file FastTimerService.h.

Referenced by preallocate(), and preStreamBeginRun().

const double FastTimerService::m_dqm_pathtime_range
private

Definition at line 359 of file FastTimerService.h.

Referenced by preStreamBeginRun().

const double FastTimerService::m_dqm_pathtime_resolution
private

Definition at line 360 of file FastTimerService.h.

Referenced by preStreamBeginRun().

bool FastTimerService::m_enable_dqm
private
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.