CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
FastTimerService Class Reference

#include <FastTimerService.h>

Inheritance diagram for FastTimerService:

Classes

struct  AtomicResources
 
struct  GroupOfModules
 
struct  Measurement
 
struct  PlotRanges
 
class  PlotsPerElement
 
class  PlotsPerJob
 
class  PlotsPerPath
 
class  PlotsPerProcess
 
struct  Resources
 
struct  ResourcesPerJob
 
struct  ResourcesPerModule
 
struct  ResourcesPerPath
 
struct  ResourcesPerProcess
 

Public Member Functions

 FastTimerService (const edm::ParameterSet &, edm::ActivityRegistry &)
 
double queryEventTime (edm::StreamID) const
 
double queryEventTime (edm::StreamID, std::string const &process) const
 
double queryHighlightTime (edm::StreamID sid, std::string const &label) const
 
double queryModuleTime (edm::StreamID, const edm::ModuleDescription &module) const
 
double queryModuleTime (edm::StreamID, unsigned int id) const
 
double queryModuleTimeByLabel (edm::StreamID, std::string const &module) const
 
double queryModuleTimeByLabel (edm::StreamID, std::string const &process, const std::string &module) const
 
double queryPathTime (edm::StreamID, std::string const &path) const
 
double queryPathTime (edm::StreamID, std::string const &process, std::string const &path) const
 
double querySourceTime (edm::StreamID) const
 
 ~FastTimerService () override
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Member Functions

void ignoredSignal (const std::string &signal) const
 
bool isFirstSubprocess (edm::StreamContext const &)
 
bool isFirstSubprocess (edm::GlobalContext const &)
 
bool isLastSubprocess (std::atomic< unsigned int > &check)
 
void on_scheduler_entry (bool worker) final
 
void on_scheduler_exit (bool worker) final
 
void postBeginJob ()
 
void postEndJob ()
 
void postEvent (edm::StreamContext const &)
 
void postEventReadFromSource (edm::StreamContext const &, edm::ModuleCallingContext const &)
 
void postGlobalBeginLumi (edm::GlobalContext const &)
 
void postGlobalBeginRun (edm::GlobalContext const &)
 
void postGlobalEndLumi (edm::GlobalContext const &)
 
void postGlobalEndRun (edm::GlobalContext const &)
 
void postModuleEvent (edm::StreamContext const &, edm::ModuleCallingContext const &)
 
void postModuleEventDelayedGet (edm::StreamContext const &, edm::ModuleCallingContext const &)
 
void postModuleEventPrefetching (edm::StreamContext const &, edm::ModuleCallingContext const &)
 
void postModuleGlobalBeginLumi (edm::GlobalContext const &, edm::ModuleCallingContext const &)
 
void postModuleGlobalBeginRun (edm::GlobalContext const &, edm::ModuleCallingContext const &)
 
void postModuleGlobalEndLumi (edm::GlobalContext const &, edm::ModuleCallingContext const &)
 
void postModuleGlobalEndRun (edm::GlobalContext const &, edm::ModuleCallingContext const &)
 
void postModuleStreamBeginLumi (edm::StreamContext const &, edm::ModuleCallingContext const &)
 
void postModuleStreamBeginRun (edm::StreamContext const &, edm::ModuleCallingContext const &)
 
void postModuleStreamEndLumi (edm::StreamContext const &, edm::ModuleCallingContext const &)
 
void postModuleStreamEndRun (edm::StreamContext const &, edm::ModuleCallingContext const &)
 
void postPathEvent (edm::StreamContext const &, edm::PathContext const &, edm::HLTPathStatus const &)
 
void postSourceEvent (edm::StreamID)
 
void postSourceLumi ()
 
void postSourceRun ()
 
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 preBeginJob (edm::PathsAndConsumesOfModulesBase const &, edm::ProcessContext const &)
 
void preEvent (edm::StreamContext const &)
 
void preEventReadFromSource (edm::StreamContext const &, edm::ModuleCallingContext const &)
 
void preGlobalBeginLumi (edm::GlobalContext const &)
 
void preGlobalBeginRun (edm::GlobalContext const &)
 
void preGlobalEndLumi (edm::GlobalContext const &)
 
void preGlobalEndRun (edm::GlobalContext const &)
 
void preModuleEvent (edm::StreamContext const &, edm::ModuleCallingContext const &)
 
void preModuleEventDelayedGet (edm::StreamContext const &, edm::ModuleCallingContext const &)
 
void preModuleEventPrefetching (edm::StreamContext const &, edm::ModuleCallingContext const &)
 
void preModuleGlobalBeginLumi (edm::GlobalContext const &, edm::ModuleCallingContext const &)
 
void preModuleGlobalBeginRun (edm::GlobalContext const &, edm::ModuleCallingContext const &)
 
void preModuleGlobalEndLumi (edm::GlobalContext const &, edm::ModuleCallingContext const &)
 
void preModuleGlobalEndRun (edm::GlobalContext const &, edm::ModuleCallingContext const &)
 
void preModuleStreamBeginLumi (edm::StreamContext const &, edm::ModuleCallingContext const &)
 
void preModuleStreamBeginRun (edm::StreamContext const &, edm::ModuleCallingContext const &)
 
void preModuleStreamEndLumi (edm::StreamContext const &, edm::ModuleCallingContext const &)
 
void preModuleStreamEndRun (edm::StreamContext const &, edm::ModuleCallingContext const &)
 
void prePathEvent (edm::StreamContext const &, edm::PathContext const &)
 
void preSourceConstruction (edm::ModuleDescription const &)
 
void preSourceEvent (edm::StreamID)
 
void preSourceLumi ()
 
void preSourceRun ()
 
void preStreamBeginLumi (edm::StreamContext const &)
 
void preStreamBeginRun (edm::StreamContext const &)
 
void preStreamEndLumi (edm::StreamContext const &)
 
void preStreamEndRun (edm::StreamContext const &)
 
template<typename T >
void printEvent (T &out, ResourcesPerJob const &) const
 
template<typename T >
void printEventHeader (T &out, std::string const &label) const
 
template<typename T >
void printEventLine (T &out, Resources const &data, std::string const &label) const
 
template<typename T >
void printHeader (T &out, std::string const &label) const
 
template<typename T >
void printSummary (T &out, ResourcesPerJob const &, std::string const &label) const
 
template<typename T >
void printSummaryHeader (T &out, std::string const &label, bool detaile) const
 
template<typename T >
void printSummaryLine (T &out, Resources const &data, uint64_t events, std::string const &label) const
 
template<typename T >
void printSummaryLine (T &out, Resources const &data, uint64_t events, uint64_t active, std::string const &label) const
 
double queryModuleTime_ (edm::StreamID, unsigned int id) const
 
Measurementthread ()
 
void unsupportedSignal (const std::string &signal) const
 

Private Attributes

ProcessCallGraph callgraph_
 
unsigned int concurrent_runs_
 
unsigned int concurrent_streams_
 
unsigned int concurrent_threads_
 
const PlotRanges dqm_event_ranges_
 
const unsigned int dqm_lumisections_range_
 
const PlotRanges dqm_module_ranges_
 
std::string dqm_path_
 
const PlotRanges dqm_path_ranges_
 
bool enable_dqm_
 
const bool enable_dqm_byls_
 
const bool enable_dqm_bymodule_
 
const bool enable_dqm_bynproc_
 
const bool enable_dqm_bypath_
 
std::vector< edm::ParameterSethighlight_module_psets_
 
std::vector< GroupOfModuleshighlight_modules_
 
ResourcesPerJob job_summary_
 
unsigned int module_id_
 
const bool print_event_summary_
 
const bool print_job_summary_
 
const bool print_run_summary_
 
std::vector< ResourcesPerJobrun_summary_
 
std::vector< PlotsPerJobstream_plots_
 
std::vector< ResourcesPerJobstreams_
 
std::unique_ptr< std::atomic< unsigned int >[]> subprocess_event_check_
 
std::unique_ptr< std::atomic< unsigned int >[]> subprocess_global_run_check_
 
std::unique_ptr< std::atomic< unsigned int >[]> subprocess_lumisection_check_
 
std::unique_ptr< std::atomic< unsigned int >[]> subprocess_run_check_
 
std::mutex summary_mutex_
 
tbb::enumerable_thread_specific< Measurement, tbb::cache_aligned_allocator< Measurement >, tbb::ets_key_per_instance > threads_
 
tbb::concurrent_unordered_set< std::string > unsupported_signals_
 

Detailed Description

Definition at line 83 of file FastTimerService.h.

Constructor & Destructor Documentation

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

Definition at line 905 of file FastTimerService.cc.

References dqm_lumisections_range_, dqm_module_ranges_, dqm_path_, dqm_path_ranges_, edm::ParameterSet::getUntrackedParameter(), highlight_module_psets_, highlight_modules_, postBeginJob(), postEndJob(), postEvent(), postGlobalEndRun(), postModuleEvent(), postModuleEventDelayedGet(), postPathEvent(), postSourceEvent(), postStreamEndLumi(), postStreamEndRun(), preallocate(), preBeginJob(), preEvent(), preGlobalBeginRun(), preModuleEvent(), preModuleEventDelayedGet(), prePathEvent(), preSourceConstruction(), preSourceEvent(), preStreamBeginLumi(), preStreamBeginRun(), PhysicsTools::registry, AlCaHLTBitMon_QueryRunRegistry::string, and ~FastTimerService().

905  :
906  // configuration
907  callgraph_(),
908  // job configuration
909  concurrent_runs_( 0 ),
910  concurrent_streams_( 0 ),
911  concurrent_threads_( 0 ),
912  print_event_summary_( config.getUntrackedParameter<bool>( "printEventSummary" ) ),
913  print_run_summary_( config.getUntrackedParameter<bool>( "printRunSummary" ) ),
914  print_job_summary_( config.getUntrackedParameter<bool>( "printJobSummary" ) ),
915  // dqm configuration
917  enable_dqm_( config.getUntrackedParameter<bool>( "enableDQM" ) ),
918  enable_dqm_bymodule_( config.getUntrackedParameter<bool>( "enableDQMbyModule" ) ),
919  enable_dqm_bypath_( config.getUntrackedParameter<bool>( "enableDQMbyPath" ) ),
920  enable_dqm_byls_( config.getUntrackedParameter<bool>( "enableDQMbyLumiSection" ) ),
921  enable_dqm_bynproc_( config.getUntrackedParameter<bool>( "enableDQMbyProcesses" ) ),
922  dqm_event_ranges_( { config.getUntrackedParameter<double>( "dqmTimeRange" ), // ms
923  config.getUntrackedParameter<double>( "dqmTimeResolution" ), // ms
924  config.getUntrackedParameter<double>( "dqmMemoryRange" ), // kB
925  config.getUntrackedParameter<double>( "dqmMemoryResolution" ) } ), // kB
926  dqm_path_ranges_( { config.getUntrackedParameter<double>( "dqmPathTimeRange" ), // ms
927  config.getUntrackedParameter<double>( "dqmPathTimeResolution" ), // ms
928  config.getUntrackedParameter<double>( "dqmPathMemoryRange" ), // kB
929  config.getUntrackedParameter<double>( "dqmPathMemoryResolution" ) } ), // kB
930  dqm_module_ranges_( { config.getUntrackedParameter<double>( "dqmModuleTimeRange" ), // ms
931  config.getUntrackedParameter<double>( "dqmModuleTimeResolution" ), // ms
932  config.getUntrackedParameter<double>( "dqmModuleMemoryRange" ), // kB
933  config.getUntrackedParameter<double>( "dqmModuleMemoryResolution") } ), // kB
934  dqm_lumisections_range_( config.getUntrackedParameter<unsigned int>( "dqmLumiSectionsRange" ) ),
935  dqm_path_( config.getUntrackedParameter<std::string>("dqmPath" ) ),
936  // highlight configuration
937  highlight_module_psets_( config.getUntrackedParameter<std::vector<edm::ParameterSet>>("highlightModules") ),
938  highlight_modules_( highlight_module_psets_.size()) // filled in postBeginJob()
939 {
940  // start observing when a thread enters or leaves the TBB global thread arena
941  tbb::task_scheduler_observer::observe();
942 
943  // register EDM call backs
947  registry.watchPostEndJob( this, & FastTimerService::postEndJob );
949 //registry.watchPostGlobalBeginRun( this, & FastTimerService::postGlobalBeginRun );
950 //registry.watchPreGlobalEndRun( this, & FastTimerService::preGlobalEndRun );
953 //registry.watchPostStreamBeginRun( this, & FastTimerService::postStreamBeginRun );
954 //registry.watchPreStreamEndRun( this, & FastTimerService::preStreamEndRun );
956 //registry.watchPreGlobalBeginLumi( this, & FastTimerService::preGlobalBeginLumi );
957 //registry.watchPostGlobalBeginLumi( this, & FastTimerService::postGlobalBeginLumi );
958 //registry.watchPreGlobalEndLumi( this, & FastTimerService::preGlobalEndLumi );
959 //registry.watchPostGlobalEndLumi( this, & FastTimerService::postGlobalEndLumi );
961 //registry.watchPostStreamBeginLumi( this, & FastTimerService::postStreamBeginLumi );
962 //registry.watchPreStreamEndLumi( this, & FastTimerService::preStreamEndLumi );
964  registry.watchPreEvent( this, & FastTimerService::preEvent );
965  registry.watchPostEvent( this, & FastTimerService::postEvent );
969 //registry.watchPostSourceConstruction( this, & FastTimerService::postSourceConstruction);
970 //registry.watchPreSourceRun( this, & FastTimerService::preSourceRun );
971 //registry.watchPostSourceRun( this, & FastTimerService::postSourceRun );
972 //registry.watchPreSourceLumi( this, & FastTimerService::preSourceLumi );
973 //registry.watchPostSourceLumi( this, & FastTimerService::postSourceLumi );
976 //registry.watchPreModuleBeginJob( this, & FastTimerService::preModuleBeginJob );
977 //registry.watchPostModuleBeginJob( this, & FastTimerService::postModuleBeginJob );
978 //registry.watchPreModuleEndJob( this, & FastTimerService::preModuleEndJob );
979 //registry.watchPostModuleEndJob( this, & FastTimerService::postModuleEndJob );
980 //registry.watchPreModuleBeginStream( this, & FastTimerService::preModuleBeginStream );
981 //registry.watchPostModuleBeginStream( this, & FastTimerService::postModuleBeginStream );
982 //registry.watchPreModuleEndStream( this, & FastTimerService::preModuleEndStream );
983 //registry.watchPostModuleEndStream( this, & FastTimerService::postModuleEndStream );
984 //registry.watchPreModuleGlobalBeginRun( this, & FastTimerService::preModuleGlobalBeginRun );
985 //registry.watchPostModuleGlobalBeginRun( this, & FastTimerService::postModuleGlobalBeginRun );
986 //registry.watchPreModuleGlobalEndRun( this, & FastTimerService::preModuleGlobalEndRun );
987 //registry.watchPostModuleGlobalEndRun( this, & FastTimerService::postModuleGlobalEndRun );
988 //registry.watchPreModuleGlobalBeginLumi( this, & FastTimerService::preModuleGlobalBeginLumi );
989 //registry.watchPostModuleGlobalBeginLumi( this, & FastTimerService::postModuleGlobalBeginLumi );
990 //registry.watchPreModuleGlobalEndLumi( this, & FastTimerService::preModuleGlobalEndLumi );
991 //registry.watchPostModuleGlobalEndLumi( this, & FastTimerService::postModuleGlobalEndLumi );
992 //registry.watchPreModuleStreamBeginRun( this, & FastTimerService::preModuleStreamBeginRun );
993 //registry.watchPostModuleStreamBeginRun( this, & FastTimerService::postModuleStreamBeginRun );
994 //registry.watchPreModuleStreamEndRun( this, & FastTimerService::preModuleStreamEndRun );
995 //registry.watchPostModuleStreamEndRun( this, & FastTimerService::postModuleStreamEndRun );
996 //registry.watchPreModuleStreamBeginLumi( this, & FastTimerService::preModuleStreamBeginLumi );
997 //registry.watchPostModuleStreamBeginLumi( this, & FastTimerService::postModuleStreamBeginLumi );
998 //registry.watchPreModuleStreamEndLumi( this, & FastTimerService::preModuleStreamEndLumi );
999 //registry.watchPostModuleStreamEndLumi( this, & FastTimerService::postModuleStreamEndLumi );
1000 //registry.watchPreModuleEventPrefetching( this, & FastTimerService::preModuleEventPrefetching );
1001 //registry.watchPostModuleEventPrefetching( this, & FastTimerService::postModuleEventPrefetching );
1006 //registry.watchPreEventReadFromSource( this, & FastTimerService::preEventReadFromSource );
1007 //registry.watchPostEventReadFromSource( this, & FastTimerService::postEventReadFromSource );
1008 }
void preGlobalBeginRun(edm::GlobalContext const &)
void preModuleEventDelayedGet(edm::StreamContext const &, edm::ModuleCallingContext const &)
const bool print_run_summary_
T getUntrackedParameter(std::string const &, T const &) const
void watchPreEvent(PreEvent::slot_type const &iSlot)
void postStreamEndLumi(edm::StreamContext const &)
std::vector< edm::ParameterSet > highlight_module_psets_
void preBeginJob(edm::PathsAndConsumesOfModulesBase const &, edm::ProcessContext const &)
void watchPrePathEvent(PrePathEvent::slot_type const &iSlot)
void watchPreallocate(Preallocate::slot_type const &iSlot)
unsigned int concurrent_threads_
void watchPostEndJob(PostEndJob::slot_type const &iSlot)
const PlotRanges dqm_event_ranges_
void postModuleEvent(edm::StreamContext const &, edm::ModuleCallingContext const &)
std::vector< GroupOfModules > highlight_modules_
void watchPreModuleEvent(PreModuleEvent::slot_type const &iSlot)
void watchPostEvent(PostEvent::slot_type const &iSlot)
void watchPreSourceConstruction(PreSourceConstruction::slot_type const &iSlot)
const bool enable_dqm_bynproc_
unsigned int concurrent_runs_
void watchPostStreamEndLumi(PostStreamEndLumi::slot_type const &iSlot)
void watchPostPathEvent(PostPathEvent::slot_type const &iSlot)
void watchPostModuleEvent(PostModuleEvent::slot_type const &iSlot)
void watchPostSourceEvent(PostSourceEvent::slot_type const &iSlot)
void postPathEvent(edm::StreamContext const &, edm::PathContext const &, edm::HLTPathStatus const &)
const bool print_job_summary_
const bool enable_dqm_bypath_
const PlotRanges dqm_path_ranges_
void prePathEvent(edm::StreamContext const &, edm::PathContext const &)
unsigned int module_id_
void watchPreModuleEventDelayedGet(PreModuleEventDelayedGet::slot_type const &iSlot)
void postEvent(edm::StreamContext const &)
void postGlobalEndRun(edm::GlobalContext const &)
const unsigned int dqm_lumisections_range_
void postStreamEndRun(edm::StreamContext const &)
void preModuleEvent(edm::StreamContext const &, edm::ModuleCallingContext const &)
std::string dqm_path_
static constexpr unsigned int invalidID()
Returns a value identifying an invalid id (the max unsigned int value)
void watchPostStreamEndRun(PostStreamEndRun::slot_type const &iSlot)
const bool enable_dqm_bymodule_
void watchPreGlobalBeginRun(PreGlobalBeginRun::slot_type const &iSlot)
const PlotRanges dqm_module_ranges_
const bool enable_dqm_byls_
void postModuleEventDelayedGet(edm::StreamContext const &, edm::ModuleCallingContext const &)
const bool print_event_summary_
void watchPostModuleEventDelayedGet(PostModuleEventDelayedGet::slot_type const &iSlot)
void watchPostGlobalEndRun(PostGlobalEndRun::slot_type const &iSlot)
void preSourceEvent(edm::StreamID)
void watchPreStreamBeginLumi(PreStreamBeginLumi::slot_type const &iSlot)
void preEvent(edm::StreamContext const &)
void watchPreBeginJob(PreBeginJob::slot_type const &iSlot)
convenience function for attaching to signal
void preStreamBeginLumi(edm::StreamContext const &)
void postSourceEvent(edm::StreamID)
void watchPreStreamBeginRun(PreStreamBeginRun::slot_type const &iSlot)
void preSourceConstruction(edm::ModuleDescription const &)
void watchPreSourceEvent(PreSourceEvent::slot_type const &iSlot)
ProcessCallGraph callgraph_
void preStreamBeginRun(edm::StreamContext const &)
unsigned int concurrent_streams_
void preallocate(edm::service::SystemBounds const &)
void watchPostBeginJob(PostBeginJob::slot_type const &iSlot)
convenience function for attaching to signal
FastTimerService::~FastTimerService ( )
overridedefault

Referenced by FastTimerService().

Member Function Documentation

void FastTimerService::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 1905 of file FastTimerService.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::addOptionalNode(), edm::ParameterSetDescription::addUntracked(), edm::ParameterSetDescription::addVPSetUntracked(), edm::ParameterDescriptionNode::setComment(), and AlCaHLTBitMon_QueryRunRegistry::string.

1906 {
1908  desc.addUntracked<bool>( "printEventSummary", false);
1909  desc.addUntracked<bool>( "printRunSummary", true);
1910  desc.addUntracked<bool>( "printJobSummary", true);
1911  desc.addUntracked<bool>( "enableDQM", true);
1912  desc.addUntracked<bool>( "enableDQMbyModule", false);
1913  desc.addUntracked<bool>( "enableDQMbyPath", false);
1914  desc.addUntracked<bool>( "enableDQMbyLumiSection", false);
1915  desc.addUntracked<bool>( "enableDQMbyProcesses", false);
1916  desc.addUntracked<double>( "dqmTimeRange", 1000. ); // ms
1917  desc.addUntracked<double>( "dqmTimeResolution", 5. ); // ms
1918  desc.addUntracked<double>( "dqmMemoryRange", 1000000. ); // kB
1919  desc.addUntracked<double>( "dqmMemoryResolution", 5000. ); // kB
1920  desc.addUntracked<double>( "dqmPathTimeRange", 100. ); // ms
1921  desc.addUntracked<double>( "dqmPathTimeResolution", 0.5); // ms
1922  desc.addUntracked<double>( "dqmPathMemoryRange", 1000000. ); // kB
1923  desc.addUntracked<double>( "dqmPathMemoryResolution", 5000. ); // kB
1924  desc.addUntracked<double>( "dqmModuleTimeRange", 40. ); // ms
1925  desc.addUntracked<double>( "dqmModuleTimeResolution", 0.2); // ms
1926  desc.addUntracked<double>( "dqmModuleMemoryRange", 100000. ); // kB
1927  desc.addUntracked<double>( "dqmModuleMemoryResolution", 500. ); // kB
1928  desc.addUntracked<unsigned>( "dqmLumiSectionsRange", 2500 ); // ~ 16 hours
1929  desc.addUntracked<std::string>( "dqmPath", "HLT/TimerService");
1930 
1931  edm::ParameterSetDescription highlightModulesDescription;
1932  highlightModulesDescription.addUntracked<std::vector<std::string>>("modules", {});
1933  highlightModulesDescription.addUntracked<std::string>("label", "producers");
1934  desc.addVPSetUntracked("highlightModules", highlightModulesDescription, {});
1935 
1936  // # OBSOLETE - these parameters are ignored, they are left only not to break old configurations
1937  // they will not be printed in the generated cfi.py file
1938  desc.addOptionalNode(edm::ParameterDescription<bool>("useRealTimeClock", true, false), false)->setComment("This parameter is obsolete and will be ignored.");
1939  desc.addOptionalNode(edm::ParameterDescription<bool>("enableTimingPaths", true, false), false)->setComment("This parameter is obsolete and will be ignored.");
1940  desc.addOptionalNode(edm::ParameterDescription<bool>("enableTimingModules", true, false), false)->setComment("This parameter is obsolete and will be ignored.");
1941  desc.addOptionalNode(edm::ParameterDescription<bool>("enableTimingExclusive", false, false), false)->setComment("This parameter is obsolete and will be ignored.");
1942  desc.addOptionalNode(edm::ParameterDescription<bool>("enableTimingSummary", false, false), false)->setComment("This parameter is obsolete and will be ignored.");
1943  desc.addOptionalNode(edm::ParameterDescription<bool>("skipFirstPath", false, false), false)->setComment("This parameter is obsolete and will be ignored.");
1944  desc.addOptionalNode(edm::ParameterDescription<bool>("enableDQMbyPathActive", false, false), false)->setComment("This parameter is obsolete and will be ignored.");
1945  desc.addOptionalNode(edm::ParameterDescription<bool>("enableDQMbyPathTotal", true, false), false)->setComment("This parameter is obsolete and will be ignored.");
1946  desc.addOptionalNode(edm::ParameterDescription<bool>("enableDQMbyPathOverhead", false, false), false)->setComment("This parameter is obsolete and will be ignored.");
1947  desc.addOptionalNode(edm::ParameterDescription<bool>("enableDQMbyPathDetails", false, false), false)->setComment("This parameter is obsolete and will be ignored.");
1948  desc.addOptionalNode(edm::ParameterDescription<bool>("enableDQMbyPathCounters", true, false), false)->setComment("This parameter is obsolete and will be ignored.");
1949  desc.addOptionalNode(edm::ParameterDescription<bool>("enableDQMbyPathExclusive", false, false), false)->setComment("This parameter is obsolete and will be ignored.");
1950  desc.addOptionalNode(edm::ParameterDescription<bool>("enableDQMbyModuleType", false, false), false)->setComment("This parameter is obsolete and will be ignored.");
1951  desc.addOptionalNode(edm::ParameterDescription<bool>("enableDQMSummary", false, false), false)->setComment("This parameter is obsolete and will be ignored.");
1952 
1953  descriptions.add("FastTimerService", desc);
1954 }
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void FastTimerService::ignoredSignal ( const std::string &  signal) const
private
bool FastTimerService::isFirstSubprocess ( edm::StreamContext const &  sc)
private

Definition at line 1590 of file FastTimerService.cc.

References edm::ProcessContext::isSubProcess(), and edm::StreamContext::processContext().

Referenced by preGlobalBeginRun(), preStreamBeginLumi(), and preStreamBeginRun().

1591 {
1592  return (not sc.processContext()->isSubProcess());
1593 }
bool FastTimerService::isFirstSubprocess ( edm::GlobalContext const &  gc)
private

Definition at line 1596 of file FastTimerService.cc.

References edm::ProcessContext::isSubProcess(), and edm::GlobalContext::processContext().

1597 {
1598  return (not gc.processContext()->isSubProcess());
1599 }
bool FastTimerService::isLastSubprocess ( std::atomic< unsigned int > &  check)
private

Definition at line 1603 of file FastTimerService.cc.

References callgraph_, and ProcessCallGraph::processes().

Referenced by postEvent(), postGlobalEndRun(), postStreamEndLumi(), and postStreamEndRun().

1604 {
1605  // release-acquire semantic guarantees that all writes in this and other threads are visible
1606  // after this operation; full sequentially-consistent ordering is (probably) not needed.
1607  unsigned int old_value = check.fetch_add(1, std::memory_order_acq_rel);
1608  return (old_value == callgraph_.processes().size() - 1);
1609 }
std::vector< ProcessType > const & processes() const
def check(config)
Definition: trackerTree.py:14
ProcessCallGraph callgraph_
void FastTimerService::on_scheduler_entry ( bool  worker)
finalprivate

Definition at line 1880 of file FastTimerService.cc.

References FastTimerService::Measurement::measure(), and thread().

1881 {
1882  // initialise the measurement point for a thread that has newly joining the TBB pool
1883  // FIXME any resources used or freed will be accounted to the next stream the uses this thread
1884  thread().measure();
1885 }
Measurement & thread()
void FastTimerService::on_scheduler_exit ( bool  worker)
finalprivate

Definition at line 1888 of file FastTimerService.cc.

References FastTimerService::Measurement::measure_and_accumulate(), streams_, and thread().

1889 {
1890  // account any resources used or freed by the thread before leaving the TBB pool.
1891  // FIXME arbitrarility use the first stream because there is no global measurement
1892  auto & stream = streams_.front();
1893  thread().measure_and_accumulate(stream.overhead);
1894 }
void measure_and_accumulate(AtomicResources &store)
std::vector< ResourcesPerJob > streams_
Measurement & thread()
void FastTimerService::postBeginJob ( )
private

Definition at line 1236 of file FastTimerService.cc.

References callgraph_, concurrent_runs_, concurrent_streams_, enable_dqm_, edmIntegrityCheck::group, highlight_module_psets_, highlight_modules_, mps_fire::i, job_summary_, diffTwoXMLs::label, tablePrinter::labels, ProcessCallGraph::module(), edm::ModuleDescription::moduleLabel(), electrons_cff::modules, run_summary_, ProcessCallGraph::size(), stream_plots_, streams_, AlCaHLTBitMon_QueryRunRegistry::string, and groupFilesInBlocks::temp.

Referenced by FastTimerService().

1236  {
1237  unsigned int modules = callgraph_.size();
1238 
1239  // module highlights
1240  for (unsigned int group: boost::irange(0ul, highlight_module_psets_.size())) {
1241  // copy and sort for faster search via std::binary_search
1242  auto labels = highlight_module_psets_[group].getUntrackedParameter<std::vector<std::string>>("modules");
1243  std::sort(labels.begin(), labels.end());
1244 
1245  highlight_modules_[group].label = highlight_module_psets_[group].getUntrackedParameter<std::string>("label");
1246  highlight_modules_[group].modules.reserve(labels.size());
1247  // convert the module labels in module ids
1248  for (unsigned int i = 0; i < modules; ++i) {
1249  auto const & label = callgraph_.module(i).moduleLabel();
1250  if (std::binary_search(labels.begin(), labels.end(), label))
1251  highlight_modules_[group].modules.push_back(i);
1252  }
1253  }
1254  highlight_module_psets_.clear();
1255 
1256  // allocate the resource counters for each stream, process, path and module
1257  ResourcesPerJob temp(callgraph_, highlight_modules_);
1260  job_summary_ = temp;
1261 
1262  // check that the DQMStore service is available
1263  if (enable_dqm_ and not edm::Service<DQMStore>().isAvailable()) {
1264  // the DQMStore is not available, disable all DQM plots
1265  enable_dqm_ = false;
1266  // FIXME issue a LogWarning ?
1267  }
1268 
1269  // allocate the structures to hold pointers to the DQM plots
1270  if (enable_dqm_)
1272 
1273 }
std::vector< edm::ParameterSet > highlight_module_psets_
std::vector< GroupOfModules > highlight_modules_
ResourcesPerJob job_summary_
unsigned int concurrent_runs_
std::vector< ResourcesPerJob > streams_
std::string const & moduleLabel() const
std::vector< PlotsPerJob > stream_plots_
std::vector< ResourcesPerJob > run_summary_
unsigned int size() const
edm::ModuleDescription const & module(unsigned int module) const
ProcessCallGraph callgraph_
unsigned int concurrent_streams_
void FastTimerService::postEndJob ( )
private

Definition at line 1408 of file FastTimerService.cc.

References job_summary_, MillePedeFileConverter_cfg::out, print_job_summary_, and printSummary().

Referenced by FastTimerService().

1409 {
1410  if (print_job_summary_) {
1411  edm::LogVerbatim out("FastReport");
1412  printSummary(out, job_summary_, "Job");
1413  }
1414 }
ResourcesPerJob job_summary_
const bool print_job_summary_
void printSummary(T &out, ResourcesPerJob const &, std::string const &label) const
void FastTimerService::postEvent ( edm::StreamContext const &  sc)
private

Definition at line 1618 of file FastTimerService.cc.

References callgraph_, data, enable_dqm_, edm::StreamContext::eventID(), edmIntegrityCheck::group, highlight_modules_, mps_fire::i, ignoredSignal(), isLastSubprocess(), job_summary_, plotBeamSpotDB::last, edm::EventID::luminosityBlock(), MillePedeFileConverter_cfg::out, sysUtil::pid, print_event_summary_, printEvent(), LaserDQM_cfg::process, edm::StreamContext::processContext(), ProcessCallGraph::processDescription(), ProcessCallGraph::processId(), run_summary_, edm::StreamContext::runIndex(), stream_plots_, edm::StreamContext::streamID(), streams_, subprocess_event_check_, and summary_mutex_.

Referenced by FastTimerService().

1619 {
1620  ignoredSignal(__func__);
1621 
1622  unsigned int pid = callgraph_.processId(* sc.processContext());
1623  unsigned int sid = sc.streamID();
1624  auto & stream = streams_[sid];
1625  auto & process = callgraph_.processDescription(pid);
1626 
1627  // measure the event resources as the sum of all modules' resources
1628  auto & data = stream.processes[pid].total;
1629  for (unsigned int i: process.modules_)
1630  data += stream.modules[i].total;
1631  stream.total += data;
1632 
1633  // handle the summaries and fill the plots only after the last subprocess has run
1635  if (not last)
1636  return;
1637 
1638  // measure the event resources explicitly
1639  stream.event_measurement.measure_and_store(stream.event);
1640 
1641  // highlighted modules
1642  for (unsigned int group: boost::irange(0ul, highlight_modules_.size()))
1643  for (unsigned int i: highlight_modules_[group].modules)
1644  stream.highlight[group] += stream.modules[i].total;
1645 
1646  // avoid concurrent access to the summary objects
1647  {
1648  std::lock_guard<std::mutex> guard(summary_mutex_);
1649  job_summary_ += stream;
1650  run_summary_[sc.runIndex()] += stream;
1651  }
1652 
1653  if (print_event_summary_) {
1654  edm::LogVerbatim out("FastReport");
1655  printEvent(out, stream);
1656  }
1657 
1658  if (enable_dqm_)
1659  stream_plots_[sid].fill(callgraph_, stream, sc.eventID().luminosityBlock());
1660 }
std::vector< GroupOfModules > highlight_modules_
ResourcesPerJob job_summary_
unsigned int processId(edm::ProcessContext const &) const
std::vector< ResourcesPerJob > streams_
void printEvent(T &out, ResourcesPerJob const &) const
std::mutex summary_mutex_
std::vector< PlotsPerJob > stream_plots_
std::vector< ResourcesPerJob > run_summary_
std::unique_ptr< std::atomic< unsigned int >[]> subprocess_event_check_
ProcessType const & processDescription(unsigned int) const
const bool print_event_summary_
void ignoredSignal(const std::string &signal) const
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
ProcessCallGraph callgraph_
bool isLastSubprocess(std::atomic< unsigned int > &check)
void FastTimerService::postEventReadFromSource ( edm::StreamContext const &  ,
edm::ModuleCallingContext const &   
)
private

Definition at line 1778 of file FastTimerService.cc.

References ignoredSignal().

1779 {
1780  ignoredSignal(__func__);
1781 }
void ignoredSignal(const std::string &signal) const
void FastTimerService::postGlobalBeginLumi ( edm::GlobalContext const &  )
private

Definition at line 1309 of file FastTimerService.cc.

References ignoredSignal().

1310 {
1311  ignoredSignal(__func__);
1312 }
void ignoredSignal(const std::string &signal) const
void FastTimerService::postGlobalBeginRun ( edm::GlobalContext const &  )
private

Definition at line 1157 of file FastTimerService.cc.

References ignoredSignal().

1158 {
1159  ignoredSignal(__func__);
1160 }
void ignoredSignal(const std::string &signal) const
void FastTimerService::postGlobalEndLumi ( edm::GlobalContext const &  )
private

Definition at line 1321 of file FastTimerService.cc.

References ignoredSignal().

1322 {
1323  ignoredSignal(__func__);
1324 }
void ignoredSignal(const std::string &signal) const
void FastTimerService::postGlobalEndRun ( edm::GlobalContext const &  gc)
private

Definition at line 1371 of file FastTimerService.cc.

References ignoredSignal(), isLastSubprocess(), plotBeamSpotDB::last, MillePedeFileConverter_cfg::out, print_run_summary_, printSummary(), run_summary_, edm::GlobalContext::runIndex(), and subprocess_global_run_check_.

Referenced by FastTimerService().

1372 {
1373  ignoredSignal(__func__);
1374 
1375  // handle the summaries only after the last subprocess has run
1376  bool last = isLastSubprocess(subprocess_global_run_check_[gc.runIndex()]);
1377  if (print_run_summary_ and last) {
1378  edm::LogVerbatim out("FastReport");
1379  printSummary(out, run_summary_[gc.runIndex()], "Run");
1380  }
1381 }
const bool print_run_summary_
std::unique_ptr< std::atomic< unsigned int >[]> subprocess_global_run_check_
void printSummary(T &out, ResourcesPerJob const &, std::string const &label) const
std::vector< ResourcesPerJob > run_summary_
void ignoredSignal(const std::string &signal) const
bool isLastSubprocess(std::atomic< unsigned int > &check)
void FastTimerService::postModuleEvent ( edm::StreamContext const &  sc,
edm::ModuleCallingContext const &  mcc 
)
private

Definition at line 1736 of file FastTimerService.cc.

References triggerObjects_cff::id, edm::ModuleDescription::id(), FastTimerService::Measurement::measure_and_store(), edm::ModuleCallingContext::moduleDescription(), edm::StreamContext::streamID(), streams_, thread(), and edm::StreamID::value().

Referenced by FastTimerService().

1737 {
1738  edm::ModuleDescription const& md = * mcc.moduleDescription();
1739  unsigned int id = md.id();
1740  unsigned int sid = sc.streamID().value();
1741  auto & stream = streams_[sid];
1742 
1743  thread().measure_and_store(stream.modules[id].total);
1744  ++stream.modules[id].events;
1745 }
std::vector< ResourcesPerJob > streams_
Measurement & thread()
void measure_and_store(Resources &store)
unsigned int id() const
void FastTimerService::postModuleEventDelayedGet ( edm::StreamContext const &  sc,
edm::ModuleCallingContext const &  mcc 
)
private

Definition at line 1754 of file FastTimerService.cc.

References unsupportedSignal().

Referenced by FastTimerService().

1755 {
1756  unsupportedSignal(__func__);
1757 }
void unsupportedSignal(const std::string &signal) const
void FastTimerService::postModuleEventPrefetching ( edm::StreamContext const &  ,
edm::ModuleCallingContext const &   
)
private

Definition at line 1766 of file FastTimerService.cc.

References ignoredSignal().

1767 {
1768  ignoredSignal(__func__);
1769 }
void ignoredSignal(const std::string &signal) const
void FastTimerService::postModuleGlobalBeginLumi ( edm::GlobalContext const &  ,
edm::ModuleCallingContext const &   
)
private

Definition at line 1814 of file FastTimerService.cc.

References ignoredSignal().

1815 {
1816  ignoredSignal(__func__);
1817 }
void ignoredSignal(const std::string &signal) const
void FastTimerService::postModuleGlobalBeginRun ( edm::GlobalContext const &  ,
edm::ModuleCallingContext const &   
)
private

Definition at line 1790 of file FastTimerService.cc.

References ignoredSignal().

1791 {
1792  ignoredSignal(__func__);
1793 }
void ignoredSignal(const std::string &signal) const
void FastTimerService::postModuleGlobalEndLumi ( edm::GlobalContext const &  ,
edm::ModuleCallingContext const &   
)
private

Definition at line 1826 of file FastTimerService.cc.

References ignoredSignal().

1827 {
1828  ignoredSignal(__func__);
1829 }
void ignoredSignal(const std::string &signal) const
void FastTimerService::postModuleGlobalEndRun ( edm::GlobalContext const &  ,
edm::ModuleCallingContext const &   
)
private

Definition at line 1802 of file FastTimerService.cc.

References ignoredSignal().

1803 {
1804  ignoredSignal(__func__);
1805 }
void ignoredSignal(const std::string &signal) const
void FastTimerService::postModuleStreamBeginLumi ( edm::StreamContext const &  ,
edm::ModuleCallingContext const &   
)
private

Definition at line 1862 of file FastTimerService.cc.

References ignoredSignal().

1863 {
1864  ignoredSignal(__func__);
1865 }
void ignoredSignal(const std::string &signal) const
void FastTimerService::postModuleStreamBeginRun ( edm::StreamContext const &  ,
edm::ModuleCallingContext const &   
)
private

Definition at line 1838 of file FastTimerService.cc.

References ignoredSignal().

1839 {
1840  ignoredSignal(__func__);
1841 }
void ignoredSignal(const std::string &signal) const
void FastTimerService::postModuleStreamEndLumi ( edm::StreamContext const &  ,
edm::ModuleCallingContext const &   
)
private

Definition at line 1874 of file FastTimerService.cc.

References ignoredSignal().

1875 {
1876  ignoredSignal(__func__);
1877 }
void ignoredSignal(const std::string &signal) const
void FastTimerService::postModuleStreamEndRun ( edm::StreamContext const &  ,
edm::ModuleCallingContext const &   
)
private

Definition at line 1850 of file FastTimerService.cc.

References ignoredSignal().

1851 {
1852  ignoredSignal(__func__);
1853 }
void ignoredSignal(const std::string &signal) const
void FastTimerService::postPathEvent ( edm::StreamContext const &  sc,
edm::PathContext const &  pc,
edm::HLTPathStatus const &  status 
)
private

Definition at line 1705 of file FastTimerService.cc.

References callgraph_, data, ProcessCallGraph::ProcessType::endPaths_, mps_fire::i, triggerObjects_cff::id, edm::HLTPathStatus::index(), diffTreeTool::index, edm::PathContext::isEndPath(), callgraph::path, edm::PathContext::pathID(), ProcessCallGraph::ProcessType::paths_, sysUtil::pid, edm::StreamContext::processContext(), ProcessCallGraph::processDescription(), ProcessCallGraph::processId(), edm::StreamContext::streamID(), streams_, and edm::StreamID::value().

Referenced by FastTimerService().

1706 {
1707  unsigned int sid = sc.streamID().value();
1708  unsigned int pid = callgraph_.processId(* sc.processContext());
1709  unsigned int id = pc.pathID();
1710  auto & stream = streams_[sid];
1711  auto & data = pc.isEndPath() ? stream.processes[pid].endpaths[id] : stream.processes[pid].paths[id];
1712 
1713  auto const& path = pc.isEndPath() ? callgraph_.processDescription(pid).endPaths_[id] : callgraph_.processDescription(pid).paths_[id];
1714  unsigned int index = path.modules_on_path_.empty() ? 0 : status.index() + 1;
1715  data.last = path.modules_on_path_.empty() ? 0 : path.last_dependency_of_module_[status.index()];
1716 
1717  for (unsigned int i = 0; i < index; ++i) {
1718  auto const& module = stream.modules[path.modules_on_path_[i]];
1719  data.active += module.total;
1720  }
1721  for (unsigned int i = 0; i < data.last; ++i) {
1722  auto const& module = stream.modules[path.modules_and_dependencies_[i]];
1723  data.total += module.total;
1724  }
1725 }
unsigned int processId(edm::ProcessContext const &) const
std::vector< ResourcesPerJob > streams_
std::vector< PathType > paths_
ProcessType const & processDescription(unsigned int) const
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
std::vector< PathType > endPaths_
ProcessCallGraph callgraph_
Definition: vlib.h:208
void FastTimerService::postSourceEvent ( edm::StreamID  sid)
private

Definition at line 1680 of file FastTimerService.cc.

References callgraph_, triggerObjects_cff::id, edm::ModuleDescription::id(), FastTimerService::Measurement::measure_and_store(), ProcessCallGraph::source(), streams_, and thread().

Referenced by FastTimerService().

1681 {
1683  unsigned int id = md.id();
1684  auto & stream = streams_[sid];
1685 
1686  thread().measure_and_store(stream.modules[id].total);
1687  ++stream.modules[id].events;
1688 }
std::vector< ResourcesPerJob > streams_
edm::ModuleDescription const & source() const
Measurement & thread()
void measure_and_store(Resources &store)
ProcessCallGraph callgraph_
unsigned int id() const
void FastTimerService::postSourceLumi ( )
private

Definition at line 1402 of file FastTimerService.cc.

References ignoredSignal().

1403 {
1404  ignoredSignal(__func__);
1405 }
void ignoredSignal(const std::string &signal) const
void FastTimerService::postSourceRun ( )
private

Definition at line 1390 of file FastTimerService.cc.

References ignoredSignal().

1391 {
1392  ignoredSignal(__func__);
1393 }
void ignoredSignal(const std::string &signal) const
void FastTimerService::postStreamBeginLumi ( edm::StreamContext const &  sc)
private

Definition at line 1339 of file FastTimerService.cc.

References ignoredSignal().

1340 {
1341  ignoredSignal(__func__);
1342 }
void ignoredSignal(const std::string &signal) const
void FastTimerService::postStreamBeginRun ( edm::StreamContext const &  sc)
private

Definition at line 1276 of file FastTimerService.cc.

References ignoredSignal().

1277 {
1278  ignoredSignal(__func__);
1279 }
void ignoredSignal(const std::string &signal) const
void FastTimerService::postStreamEndLumi ( edm::StreamContext const &  sc)
private

Definition at line 1351 of file FastTimerService.cc.

References enable_dqm_, edm::StreamContext::eventID(), ignoredSignal(), isLastSubprocess(), plotBeamSpotDB::last, edm::EventID::luminosityBlock(), DQMStore::mergeAndResetMEsLuminositySummaryCache(), module_id_, edm::EventID::run(), edm::StreamContext::streamID(), subprocess_lumisection_check_, and edm::StreamID::value().

Referenced by FastTimerService().

1351  {
1352  ignoredSignal(__func__);
1353 
1354  unsigned int sid = sc.streamID().value();
1355 
1356  // merge plots only after the last subprocess has run
1358  if (enable_dqm_ and last) {
1359  DQMStore & store = * edm::Service<DQMStore>();
1360  store.mergeAndResetMEsLuminositySummaryCache(sc.eventID().run(),sc.eventID().luminosityBlock(),sid, module_id_);
1361  }
1362 }
unsigned int module_id_
std::unique_ptr< std::atomic< unsigned int >[]> subprocess_lumisection_check_
void ignoredSignal(const std::string &signal) const
void mergeAndResetMEsLuminositySummaryCache(uint32_t run, uint32_t lumi, uint32_t streamId, uint32_t moduleId)
Definition: DQMStore.cc:434
bool isLastSubprocess(std::atomic< unsigned int > &check)
void FastTimerService::postStreamEndRun ( edm::StreamContext const &  sc)
private

Definition at line 1288 of file FastTimerService.cc.

References enable_dqm_, edm::StreamContext::eventID(), ignoredSignal(), isLastSubprocess(), plotBeamSpotDB::last, DQMStore::mergeAndResetMEsRunSummaryCache(), module_id_, edm::EventID::run(), edm::StreamContext::streamID(), subprocess_run_check_, and edm::StreamID::value().

Referenced by FastTimerService().

1289 {
1290  ignoredSignal(__func__);
1291 
1292  unsigned int sid = sc.streamID().value();
1293 
1294  // merge plots only after the last subprocess has run
1296  if (enable_dqm_ and last) {
1297  DQMStore & store = * edm::Service<DQMStore>();
1298  store.mergeAndResetMEsRunSummaryCache(sc.eventID().run(), sid, module_id_);
1299  }
1300 }
unsigned int module_id_
void mergeAndResetMEsRunSummaryCache(uint32_t run, uint32_t streamId, uint32_t moduleId)
Definition: DQMStore.cc:360
void ignoredSignal(const std::string &signal) const
std::unique_ptr< std::atomic< unsigned int >[]> subprocess_run_check_
bool isLastSubprocess(std::atomic< unsigned int > &check)
void FastTimerService::preallocate ( edm::service::SystemBounds const &  bounds)
private

Definition at line 1198 of file FastTimerService.cc.

References concurrent_runs_, concurrent_streams_, concurrent_threads_, dqm_path_, enable_dqm_bynproc_, cmsPerfStripChart::format, edm::ModuleDescription::getUniqueID(), mps_fire::i, edm::service::SystemBounds::maxNumberOfConcurrentRuns(), edm::service::SystemBounds::maxNumberOfStreams(), edm::service::SystemBounds::maxNumberOfThreads(), module_id_, harvestTrackValidationPlots::str, subprocess_event_check_, subprocess_global_run_check_, subprocess_lumisection_check_, and subprocess_run_check_.

Referenced by FastTimerService().

1199 {
1200  concurrent_runs_ = bounds.maxNumberOfConcurrentRuns();
1201  concurrent_streams_ = bounds.maxNumberOfStreams();
1202  concurrent_threads_ = bounds.maxNumberOfThreads();
1203 
1204  if (enable_dqm_bynproc_)
1205  dqm_path_ += (boost::format("/Running %d processes") % concurrent_threads_).str();
1206 
1207  // allocate atomic variables to keep track of the completion of each step, process by process
1208  subprocess_event_check_ = std::make_unique<std::atomic<unsigned int>[]>(concurrent_streams_);
1209  for (unsigned int i = 0; i < concurrent_streams_; ++i)
1211  subprocess_lumisection_check_ = std::make_unique<std::atomic<unsigned int>[]>(concurrent_streams_);
1212  for (unsigned int i = 0; i < concurrent_streams_; ++i)
1214  subprocess_run_check_ = std::make_unique<std::atomic<unsigned int>[]>(concurrent_streams_);
1215  for (unsigned int i = 0; i < concurrent_streams_; ++i)
1216  subprocess_run_check_[i] = 0;
1217  subprocess_global_run_check_ = std::make_unique<std::atomic<unsigned int>[]>(concurrent_streams_);
1218  for (unsigned int i = 0; i < concurrent_runs_; ++i)
1220 
1221  // assign a pseudo module id to the FastTimerService
1223 }
unsigned int concurrent_threads_
const bool enable_dqm_bynproc_
unsigned int concurrent_runs_
std::unique_ptr< std::atomic< unsigned int >[]> subprocess_global_run_check_
static unsigned int getUniqueID()
Returns a unique id each time called. Intended to be passed to ModuleDescription&#39;s constructor&#39;s modI...
unsigned int module_id_
std::unique_ptr< std::atomic< unsigned int >[]> subprocess_lumisection_check_
std::unique_ptr< std::atomic< unsigned int >[]> subprocess_event_check_
std::string dqm_path_
format
Some error handling for the usage.
std::unique_ptr< std::atomic< unsigned int >[]> subprocess_run_check_
unsigned int concurrent_streams_
void FastTimerService::preBeginJob ( edm::PathsAndConsumesOfModulesBase const &  pathsAndConsumes,
edm::ProcessContext const &  context 
)
private

Definition at line 1231 of file FastTimerService.cc.

References callgraph_, and ProcessCallGraph::preBeginJob().

Referenced by FastTimerService().

1231  {
1232  callgraph_.preBeginJob(pathsAndConsumes, context);
1233 }
void preBeginJob(edm::PathsAndConsumesOfModulesBase const &, edm::ProcessContext const &)
ProcessCallGraph callgraph_
void FastTimerService::preEvent ( edm::StreamContext const &  sc)
private

Definition at line 1612 of file FastTimerService.cc.

References ignoredSignal().

Referenced by FastTimerService().

1613 {
1614  ignoredSignal(__func__);
1615 }
void ignoredSignal(const std::string &signal) const
void FastTimerService::preEventReadFromSource ( edm::StreamContext const &  ,
edm::ModuleCallingContext const &   
)
private

Definition at line 1772 of file FastTimerService.cc.

References ignoredSignal().

1773 {
1774  ignoredSignal(__func__);
1775 }
void ignoredSignal(const std::string &signal) const
void FastTimerService::preGlobalBeginLumi ( edm::GlobalContext const &  )
private

Definition at line 1303 of file FastTimerService.cc.

References ignoredSignal().

1304 {
1305  ignoredSignal(__func__);
1306 }
void ignoredSignal(const std::string &signal) const
void FastTimerService::preGlobalBeginRun ( edm::GlobalContext const &  gc)
private

Definition at line 1145 of file FastTimerService.cc.

References ignoredSignal(), isFirstSubprocess(), run_summary_, edm::GlobalContext::runIndex(), and subprocess_global_run_check_.

Referenced by FastTimerService().

1146 {
1147  ignoredSignal(__func__);
1148 
1149  // reset the run counters only during the main process being run
1150  if (isFirstSubprocess(gc)) {
1151  subprocess_global_run_check_[gc.runIndex()] = 0;
1152  run_summary_[gc.runIndex()].reset();
1153  }
1154 }
bool isFirstSubprocess(edm::StreamContext const &)
std::unique_ptr< std::atomic< unsigned int >[]> subprocess_global_run_check_
std::vector< ResourcesPerJob > run_summary_
void ignoredSignal(const std::string &signal) const
void FastTimerService::preGlobalEndLumi ( edm::GlobalContext const &  )
private

Definition at line 1315 of file FastTimerService.cc.

References ignoredSignal().

1316 {
1317  ignoredSignal(__func__);
1318 }
void ignoredSignal(const std::string &signal) const
void FastTimerService::preGlobalEndRun ( edm::GlobalContext const &  )
private

Definition at line 1365 of file FastTimerService.cc.

References ignoredSignal().

1366 {
1367  ignoredSignal(__func__);
1368 }
void ignoredSignal(const std::string &signal) const
void FastTimerService::preModuleEvent ( edm::StreamContext const &  sc,
edm::ModuleCallingContext const &  mcc 
)
private

Definition at line 1728 of file FastTimerService.cc.

References FastTimerService::Measurement::measure_and_accumulate(), edm::StreamContext::streamID(), streams_, thread(), and edm::StreamID::value().

Referenced by FastTimerService().

1729 {
1730  unsigned int sid = sc.streamID().value();
1731  auto & stream = streams_[sid];
1732  thread().measure_and_accumulate(stream.overhead);
1733 }
void measure_and_accumulate(AtomicResources &store)
std::vector< ResourcesPerJob > streams_
Measurement & thread()
void FastTimerService::preModuleEventDelayedGet ( edm::StreamContext const &  sc,
edm::ModuleCallingContext const &  mcc 
)
private

Definition at line 1748 of file FastTimerService.cc.

References unsupportedSignal().

Referenced by FastTimerService().

1749 {
1750  unsupportedSignal(__func__);
1751 }
void unsupportedSignal(const std::string &signal) const
void FastTimerService::preModuleEventPrefetching ( edm::StreamContext const &  ,
edm::ModuleCallingContext const &   
)
private

Definition at line 1760 of file FastTimerService.cc.

References ignoredSignal().

1761 {
1762  ignoredSignal(__func__);
1763 }
void ignoredSignal(const std::string &signal) const
void FastTimerService::preModuleGlobalBeginLumi ( edm::GlobalContext const &  ,
edm::ModuleCallingContext const &   
)
private

Definition at line 1808 of file FastTimerService.cc.

References ignoredSignal().

1809 {
1810  ignoredSignal(__func__);
1811 }
void ignoredSignal(const std::string &signal) const
void FastTimerService::preModuleGlobalBeginRun ( edm::GlobalContext const &  ,
edm::ModuleCallingContext const &   
)
private

Definition at line 1784 of file FastTimerService.cc.

References ignoredSignal().

1785 {
1786  ignoredSignal(__func__);
1787 }
void ignoredSignal(const std::string &signal) const
void FastTimerService::preModuleGlobalEndLumi ( edm::GlobalContext const &  ,
edm::ModuleCallingContext const &   
)
private

Definition at line 1820 of file FastTimerService.cc.

References ignoredSignal().

1821 {
1822  ignoredSignal(__func__);
1823 }
void ignoredSignal(const std::string &signal) const
void FastTimerService::preModuleGlobalEndRun ( edm::GlobalContext const &  ,
edm::ModuleCallingContext const &   
)
private

Definition at line 1796 of file FastTimerService.cc.

References ignoredSignal().

1797 {
1798  ignoredSignal(__func__);
1799 }
void ignoredSignal(const std::string &signal) const
void FastTimerService::preModuleStreamBeginLumi ( edm::StreamContext const &  ,
edm::ModuleCallingContext const &   
)
private

Definition at line 1856 of file FastTimerService.cc.

References ignoredSignal().

1857 {
1858  ignoredSignal(__func__);
1859 }
void ignoredSignal(const std::string &signal) const
void FastTimerService::preModuleStreamBeginRun ( edm::StreamContext const &  ,
edm::ModuleCallingContext const &   
)
private

Definition at line 1832 of file FastTimerService.cc.

References ignoredSignal().

1833 {
1834  ignoredSignal(__func__);
1835 }
void ignoredSignal(const std::string &signal) const
void FastTimerService::preModuleStreamEndLumi ( edm::StreamContext const &  ,
edm::ModuleCallingContext const &   
)
private

Definition at line 1868 of file FastTimerService.cc.

References ignoredSignal().

1869 {
1870  ignoredSignal(__func__);
1871 }
void ignoredSignal(const std::string &signal) const
void FastTimerService::preModuleStreamEndRun ( edm::StreamContext const &  ,
edm::ModuleCallingContext const &   
)
private

Definition at line 1844 of file FastTimerService.cc.

References ignoredSignal().

1845 {
1846  ignoredSignal(__func__);
1847 }
void ignoredSignal(const std::string &signal) const
void FastTimerService::prePathEvent ( edm::StreamContext const &  sc,
edm::PathContext const &  pc 
)
private

Definition at line 1692 of file FastTimerService.cc.

References callgraph_, data, triggerObjects_cff::id, edm::PathContext::isEndPath(), edm::PathContext::pathID(), sysUtil::pid, edm::StreamContext::processContext(), ProcessCallGraph::processId(), edm::StreamContext::streamID(), streams_, and edm::StreamID::value().

Referenced by FastTimerService().

1693 {
1694  unsigned int sid = sc.streamID().value();
1695  unsigned int pid = callgraph_.processId(* sc.processContext());
1696  unsigned int id = pc.pathID();
1697  auto & stream = streams_[sid];
1698  auto & data = pc.isEndPath() ? stream.processes[pid].endpaths[id] : stream.processes[pid].paths[id];
1699  data.status = false;
1700  data.last = 0;
1701 }
unsigned int processId(edm::ProcessContext const &) const
std::vector< ResourcesPerJob > streams_
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
ProcessCallGraph callgraph_
void FastTimerService::preSourceConstruction ( edm::ModuleDescription const &  module)
private

Definition at line 1226 of file FastTimerService.cc.

References callgraph_, and ProcessCallGraph::preSourceConstruction().

Referenced by FastTimerService().

1226  {
1228 }
void preSourceConstruction(edm::ModuleDescription const &)
ProcessCallGraph callgraph_
Definition: vlib.h:208
void FastTimerService::preSourceEvent ( edm::StreamID  sid)
private

Definition at line 1663 of file FastTimerService.cc.

References streams_, subprocess_event_check_, and thread().

Referenced by FastTimerService().

1664 {
1665  // clear the event counters
1666  auto & stream = streams_[sid];
1667  stream.reset();
1668  ++stream.events;
1669 
1670  subprocess_event_check_[sid] = 0;
1671 
1672  // reuse the same measurement for the Source module and for the explicit begin of the Event
1673  auto & measurement = thread();
1674  measurement.measure_and_accumulate(stream.overhead);
1675  stream.event_measurement = measurement;
1676 }
std::vector< ResourcesPerJob > streams_
Measurement & thread()
std::unique_ptr< std::atomic< unsigned int >[]> subprocess_event_check_
void FastTimerService::preSourceLumi ( )
private

Definition at line 1396 of file FastTimerService.cc.

References ignoredSignal().

1397 {
1398  ignoredSignal(__func__);
1399 }
void ignoredSignal(const std::string &signal) const
void FastTimerService::preSourceRun ( )
private

Definition at line 1384 of file FastTimerService.cc.

References ignoredSignal().

1385 {
1386  ignoredSignal(__func__);
1387 }
void ignoredSignal(const std::string &signal) const
void FastTimerService::preStreamBeginLumi ( edm::StreamContext const &  sc)
private

Definition at line 1327 of file FastTimerService.cc.

References ignoredSignal(), isFirstSubprocess(), edm::StreamContext::streamID(), subprocess_lumisection_check_, and edm::StreamID::value().

Referenced by FastTimerService().

1328 {
1329  ignoredSignal(__func__);
1330 
1331  // reset counters only during the main process transition
1332  if (isFirstSubprocess(sc)) {
1333  unsigned int sid = sc.streamID().value();
1335  }
1336 }
bool isFirstSubprocess(edm::StreamContext const &)
std::unique_ptr< std::atomic< unsigned int >[]> subprocess_lumisection_check_
void ignoredSignal(const std::string &signal) const
void FastTimerService::preStreamBeginRun ( edm::StreamContext const &  sc)
private

Definition at line 1163 of file FastTimerService.cc.

References callgraph_, dqm_event_ranges_, dqm_lumisections_range_, dqm_module_ranges_, dqm_path_, dqm_path_ranges_, enable_dqm_, enable_dqm_byls_, enable_dqm_bymodule_, enable_dqm_bypath_, edm::StreamContext::eventID(), highlight_modules_, ignoredSignal(), isFirstSubprocess(), module_id_, edm::EventID::run(), stream_plots_, edm::StreamContext::streamID(), subprocess_run_check_, and edm::StreamID::value().

Referenced by FastTimerService().

1164 {
1165  ignoredSignal(__func__);
1166 
1167  unsigned int sid = sc.streamID().value();
1168 
1169  // reset counters and book the DQM plots during the main process being run
1170  if (isFirstSubprocess(sc)) {
1171  subprocess_run_check_[sid] = 0;
1172 
1173  // book the DQM plots
1174  if (enable_dqm_) {
1175  // define a callback to book the MonitorElements
1176  auto bookTransactionCallback = [&, this] (DQMStore::IBooker & booker)
1177  {
1178  booker.setCurrentFolder(dqm_path_);
1179  stream_plots_[sid].book(booker, callgraph_,
1188  };
1189 
1190  // book MonitorElements for this stream
1191  edm::Service<DQMStore>()->bookTransaction(bookTransactionCallback, sc.eventID().run(), sid, module_id_);
1192  }
1193  }
1194 }
const PlotRanges dqm_event_ranges_
std::vector< GroupOfModules > highlight_modules_
bool isFirstSubprocess(edm::StreamContext const &)
const bool enable_dqm_bypath_
const PlotRanges dqm_path_ranges_
std::vector< PlotsPerJob > stream_plots_
unsigned int module_id_
const unsigned int dqm_lumisections_range_
std::string dqm_path_
const bool enable_dqm_bymodule_
const PlotRanges dqm_module_ranges_
const bool enable_dqm_byls_
void ignoredSignal(const std::string &signal) const
ProcessCallGraph callgraph_
std::unique_ptr< std::atomic< unsigned int >[]> subprocess_run_check_
void FastTimerService::preStreamEndLumi ( edm::StreamContext const &  )
private

Definition at line 1345 of file FastTimerService.cc.

References ignoredSignal().

1346 {
1347  ignoredSignal(__func__);
1348 }
void ignoredSignal(const std::string &signal) const
void FastTimerService::preStreamEndRun ( edm::StreamContext const &  )
private

Definition at line 1282 of file FastTimerService.cc.

References ignoredSignal().

1283 {
1284  ignoredSignal(__func__);
1285 }
void ignoredSignal(const std::string &signal) const
template<typename T >
void FastTimerService::printEvent ( T out,
ResourcesPerJob const &  data 
) const
private

Definition at line 1450 of file FastTimerService.cc.

References callgraph_, edmIntegrityCheck::group, FastTimerService::ResourcesPerJob::highlight, highlight_modules_, mps_fire::i, funct::m, ProcessCallGraph::module(), FastTimerService::ResourcesPerJob::modules, dataset::name, AlCaHLTBitMon_ParallelJobs::p, callgraph::path, printEventHeader(), printEventLine(), printHeader(), proc, ProcessCallGraph::processDescription(), ProcessCallGraph::processes(), FastTimerService::ResourcesPerJob::processes, source, ProcessCallGraph::source(), and FastTimerService::ResourcesPerJob::total.

Referenced by postEvent().

1451 {
1452  printHeader(out, "Event");
1453  printEventHeader(out, "Modules");
1454  auto const& source_d = callgraph_.source();
1455  auto const& source = data.modules[source_d.id()];
1456  printEventLine(out, source.total, source_d.moduleLabel());
1457  for (unsigned int i = 0; i < callgraph_.processes().size(); ++i) {
1458  auto const& proc_d = callgraph_.processDescription(i);
1459  auto const& proc = data.processes[i];
1460  printEventLine(out, proc.total, "process " + proc_d.name_);
1461  for (unsigned int m: proc_d.modules_) {
1462  auto const& module_d = callgraph_.module(m);
1463  auto const& module = data.modules[m];
1464  printEventLine(out, module.total, " " + module_d.moduleLabel());
1465  }
1466  }
1467  printEventLine(out, data.total, "total");
1468  out << '\n';
1469  printEventHeader(out, "Processes and Paths");
1470  printEventLine(out, source.total, source_d.moduleLabel());
1471  for (unsigned int i = 0; i < callgraph_.processes().size(); ++i) {
1472  auto const& proc_d = callgraph_.processDescription(i);
1473  auto const& proc = data.processes[i];
1474  printEventLine(out, proc.total, "process " + proc_d.name_);
1475  for (unsigned int p = 0; p < proc.paths.size(); ++p) {
1476  auto const& name = proc_d.paths_[p].name_;
1477  auto const& path = proc.paths[p];
1478  printEventLine(out, path.active, name + " (only scheduled modules)");
1479  printEventLine(out, path.total, name + " (including dependencies)");
1480  }
1481  for (unsigned int p = 0; p < proc.endpaths.size(); ++p) {
1482  auto const& name = proc_d.endPaths_[p].name_;
1483  auto const& path = proc.endpaths[p];
1484  printEventLine(out, path.active, name + " (only scheduled modules)");
1485  printEventLine(out, path.total, name + " (including dependencies)");
1486  }
1487  }
1488  printEventLine(out, data.total, "total");
1489  out << '\n';
1490  for (unsigned int group: boost::irange(0ul, highlight_modules_.size())) {
1491  printEventHeader(out, "Highlighted modules");
1492  for (unsigned int m: highlight_modules_[group].modules) {
1493  auto const& module_d = callgraph_.module(m);
1494  auto const& module = data.modules[m];
1495  printEventLine(out, module.total, " " + module_d.moduleLabel());
1496  }
1497  printEventLine(out, data.highlight[group], highlight_modules_[group].label);
1498  out << '\n';
1499  }
1500 }
std::vector< GroupOfModules > highlight_modules_
TrainProcessor *const proc
Definition: MVATrainer.cc:101
edm::ModuleDescription const & source() const
void printHeader(T &out, std::string const &label) const
void printEventHeader(T &out, std::string const &label) const
std::vector< ProcessType > const & processes() const
ProcessType const & processDescription(unsigned int) const
void printEventLine(T &out, Resources const &data, std::string const &label) const
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
edm::ModuleDescription const & module(unsigned int module) const
ProcessCallGraph callgraph_
Definition: vlib.h:208
static std::string const source
Definition: EdmProvDump.cc:43
template<typename T >
void FastTimerService::printEventHeader ( T out,
std::string const &  label 
) const
private

Definition at line 1432 of file FastTimerService.cc.

Referenced by printEvent().

1433 {
1434  out << "FastReport CPU time Real time Allocated Deallocated " << label << "\n";
1435  // FastReport ######.### ms ######.### ms +######### kB -######### kB ...
1436 }
template<typename T >
void FastTimerService::printEventLine ( T out,
Resources const &  data,
std::string const &  label 
) const
private

Definition at line 1439 of file FastTimerService.cc.

References FastTimerService::Resources::allocated, FastTimerService::Resources::deallocated, cmsPerfStripChart::format, diffTwoXMLs::label, AnalysisDataFormats_SUSYBSMObjects::ms, FastTimerService::Resources::time_real, and FastTimerService::Resources::time_thread.

Referenced by printEvent().

1440 {
1441  out << boost::format("FastReport %10.3f ms %10.3f ms %+10d kB %+10d kB %s\n")
1442  % ms(data.time_thread)
1443  % ms(data.time_real)
1444  % kB(data.allocated)
1445  % kB(data.deallocated)
1446  % label;
1447 }
format
Some error handling for the usage.
susybsm::MuonSegment ms
Definition: classes.h:31
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
template<typename T >
void FastTimerService::printHeader ( T out,
std::string const &  label 
) const
private

Definition at line 1418 of file FastTimerService.cc.

References mps_fire::i.

Referenced by ntuplePrintersDiff.SeedPrinter::diff(), ntuplePrintersDiff.TrackPrinter::diff(), printEvent(), ntuplePrintersDiff.SeedPrinter::printSeed(), printSummary(), and ntuplePrintersDiff.TrackPrinter::printTrack().

1419 {
1420  out << "FastReport ";
1421  if (label.size() < 60)
1422  for (unsigned int i = (60-label.size()) / 2; i > 0; --i)
1423  out << '-';
1424  out << ' ' << label << " Summary ";
1425  if (label.size() < 60)
1426  for (unsigned int i = (59-label.size()) / 2; i > 0; --i)
1427  out << '-';
1428  out << '\n';
1429 }
template<typename T >
void FastTimerService::printSummary ( T out,
ResourcesPerJob const &  data,
std::string const &  label 
) const
private

Definition at line 1536 of file FastTimerService.cc.

References callgraph_, FastTimerService::ResourcesPerJob::events, edmIntegrityCheck::group, FastTimerService::ResourcesPerJob::highlight, highlight_modules_, mps_fire::i, funct::m, ProcessCallGraph::module(), FastTimerService::ResourcesPerJob::modules, dataset::name, AlCaHLTBitMon_ParallelJobs::p, callgraph::path, printHeader(), printSummaryHeader(), printSummaryLine(), proc, ProcessCallGraph::processDescription(), ProcessCallGraph::processes(), FastTimerService::ResourcesPerJob::processes, source, ProcessCallGraph::source(), and FastTimerService::ResourcesPerJob::total.

Referenced by postEndJob(), and postGlobalEndRun().

1537 {
1538  printHeader(out, label);
1539  printSummaryHeader(out, "Modules", true);
1540  auto const& source_d = callgraph_.source();
1541  auto const& source = data.modules[source_d.id()];
1542  printSummaryLine(out, source.total, data.events, source.events, source_d.moduleLabel());
1543  for (unsigned int i = 0; i < callgraph_.processes().size(); ++i) {
1544  auto const& proc_d = callgraph_.processDescription(i);
1545  auto const& proc = data.processes[i];
1546  printSummaryLine(out, proc.total, data.events, "process " + proc_d.name_);
1547  for (unsigned int m: proc_d.modules_) {
1548  auto const& module_d = callgraph_.module(m);
1549  auto const& module = data.modules[m];
1550  printSummaryLine(out, module.total, data.events, module.events, module_d.moduleLabel());
1551  }
1552  }
1553  printSummaryLine(out, data.total, data.events, "total");
1554  out << '\n';
1555  printSummaryHeader(out, "Processes and Paths", false);
1556  printSummaryLine(out, source.total, data.events, source_d.moduleLabel());
1557  for (unsigned int i = 0; i < callgraph_.processes().size(); ++i) {
1558  auto const& proc_d = callgraph_.processDescription(i);
1559  auto const& proc = data.processes[i];
1560  printSummaryLine(out, proc.total, data.events, "process " + proc_d.name_);
1561  for (unsigned int p = 0; p < proc.paths.size(); ++p) {
1562  auto const& name = proc_d.paths_[p].name_;
1563  auto const& path = proc.paths[p];
1564  printSummaryLine(out, path.active, data.events, name + " (only scheduled modules)");
1565  printSummaryLine(out, path.total, data.events, name + " (including dependencies)");
1566  }
1567  for (unsigned int p = 0; p < proc.endpaths.size(); ++p) {
1568  auto const& name = proc_d.endPaths_[p].name_;
1569  auto const& path = proc.endpaths[p];
1570  printSummaryLine(out, path.active, data.events, name + " (only scheduled modules)");
1571  printSummaryLine(out, path.total, data.events, name + " (including dependencies)");
1572  }
1573  }
1574  printSummaryLine(out, data.total, data.events, "total");
1575  out << '\n';
1576  for (unsigned int group: boost::irange(0ul, highlight_modules_.size())) {
1577  printSummaryHeader(out, "Highlighted modules", true);
1578  for (unsigned int m: highlight_modules_[group].modules) {
1579  auto const& module_d = callgraph_.module(m);
1580  auto const& module = data.modules[m];
1581  printSummaryLine(out, module.total, data.events, module.events, module_d.moduleLabel());
1582  }
1583  printSummaryLine(out, data.highlight[group], data.events, highlight_modules_[group].label);
1584  out << '\n';
1585  }
1586 }
std::vector< GroupOfModules > highlight_modules_
TrainProcessor *const proc
Definition: MVATrainer.cc:101
edm::ModuleDescription const & source() const
void printHeader(T &out, std::string const &label) const
void printSummaryHeader(T &out, std::string const &label, bool detaile) const
std::vector< ProcessType > const & processes() const
ProcessType const & processDescription(unsigned int) const
void printSummaryLine(T &out, Resources const &data, uint64_t events, std::string const &label) const
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
edm::ModuleDescription const & module(unsigned int module) const
ProcessCallGraph callgraph_
Definition: vlib.h:208
static std::string const source
Definition: EdmProvDump.cc:43
template<typename T >
void FastTimerService::printSummaryHeader ( T out,
std::string const &  label,
bool  detaile 
) const
private

Definition at line 1503 of file FastTimerService.cc.

References diffTwoXMLs::label.

Referenced by printSummary().

1504 {
1505  if (detailed)
1506  out << "FastReport CPU time avg. when run Real time avg. when run Alloc, avg. when run Dealloc. avg. when run " << label;
1507  // FastReport ######.### ms ######.### ms ######.### ms ######.### ms +######### kB +######### kB -######### kB -######### kB ...
1508  else
1509  out << "FastReport CPU time avg. Real time avg. Alloc, avg. Dealloc. avg. " << label;
1510  // FastReport ######.### ms ######.### ms +######### kB -######### kB ...
1511 }
template<typename T >
void FastTimerService::printSummaryLine ( T out,
Resources const &  data,
uint64_t  events,
std::string const &  label 
) const
private

Definition at line 1514 of file FastTimerService.cc.

References FastTimerService::Resources::allocated, FastTimerService::Resources::deallocated, cmsPerfStripChart::format, AnalysisDataFormats_SUSYBSMObjects::ms, FastTimerService::Resources::time_real, and FastTimerService::Resources::time_thread.

Referenced by printSummary().

1515 {
1516  out << boost::format("FastReport %10.3f ms %10.3f ms %+10d kB %+10d kB %s\n")
1517  % (events ? ms(data.time_thread) / events : 0)
1518  % (events ? ms(data.time_real) / events : 0)
1519  % (events ? kB(data.allocated) / events : 0)
1520  % (events ? kB(data.deallocated) / events : 0)
1521  % label;
1522 }
format
Some error handling for the usage.
susybsm::MuonSegment ms
Definition: classes.h:31
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
template<typename T >
void FastTimerService::printSummaryLine ( T out,
Resources const &  data,
uint64_t  events,
uint64_t  active,
std::string const &  label 
) const
private

Definition at line 1525 of file FastTimerService.cc.

References FastTimerService::Resources::allocated, FastTimerService::Resources::deallocated, cmsPerfStripChart::format, AnalysisDataFormats_SUSYBSMObjects::ms, FastTimerService::Resources::time_real, and FastTimerService::Resources::time_thread.

1526 {
1527  out << boost::format("FastReport %10.3f ms %10.3f ms %10.3f ms %10.3f ms %+10d kB %+10d kB %+10d kB %+10d kB %s\n")
1528  % (events ? ms(data.time_thread) / events : 0) % (active ? ms(data.time_thread) / active : 0)
1529  % (events ? ms(data.time_real) / events : 0) % (active ? ms(data.time_real) / active : 0)
1530  % (events ? kB(data.allocated) / events : 0) % (active ? kB(data.allocated) / active : 0)
1531  % (events ? kB(data.deallocated) / events : 0) % (active ? kB(data.deallocated) / active : 0)
1532  % label;
1533 }
format
Some error handling for the usage.
susybsm::MuonSegment ms
Definition: classes.h:31
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
double FastTimerService::queryEventTime ( edm::StreamID  sid) const

Definition at line 1028 of file FastTimerService.cc.

References AnalysisDataFormats_SUSYBSMObjects::ms, and streams_.

1029 {
1030  auto const& stream = streams_[sid];
1031  return ms(stream.total.time_real);
1032 }
std::vector< ResourcesPerJob > streams_
susybsm::MuonSegment ms
Definition: classes.h:31
double FastTimerService::queryEventTime ( edm::StreamID  sid,
std::string const &  process 
) const

Definition at line 1035 of file FastTimerService.cc.

References callgraph_, AnalysisDataFormats_SUSYBSMObjects::ms, sysUtil::pid, ProcessCallGraph::processId(), and streams_.

1036 {
1037  unsigned int pid = callgraph_.processId(process);
1038  auto const& stream = streams_[sid];
1039  return ms(stream.processes[pid].total.time_real);
1040 }
unsigned int processId(edm::ProcessContext const &) const
std::vector< ResourcesPerJob > streams_
susybsm::MuonSegment ms
Definition: classes.h:31
ProcessCallGraph callgraph_
double FastTimerService::queryHighlightTime ( edm::StreamID  sid,
std::string const &  label 
) const

Definition at line 1117 of file FastTimerService.cc.

References edmIntegrityCheck::group, highlight_modules_, AnalysisDataFormats_SUSYBSMObjects::ms, and streams_.

1118 {
1119  auto const& stream = streams_[sid];
1120  for (unsigned int group: boost::irange(0ul, highlight_modules_.size()))
1122  return ms(stream.highlight[group].time_real);
1123 
1124  // FIXME issue a LogWarning, raise an exception, or return NaN
1125  return 0.;
1126 }
std::vector< GroupOfModules > highlight_modules_
std::vector< ResourcesPerJob > streams_
susybsm::MuonSegment ms
Definition: classes.h:31
double FastTimerService::queryModuleTime ( edm::StreamID  sid,
const edm::ModuleDescription module 
) const

Definition at line 1043 of file FastTimerService.cc.

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

1044 {
1045  return queryModuleTime_(sid, md.id());
1046 }
double queryModuleTime_(edm::StreamID, unsigned int id) const
double FastTimerService::queryModuleTime ( edm::StreamID  sid,
unsigned int  id 
) const

Definition at line 1049 of file FastTimerService.cc.

References callgraph_, queryModuleTime_(), and ProcessCallGraph::size().

1050 {
1051  if (id < callgraph_.size())
1052  return queryModuleTime_(sid, id);
1053 
1054  // FIXME issue a LogWarning, raise an exception, or return NaN
1055  return 0.;
1056 }
double queryModuleTime_(edm::StreamID, unsigned int id) const
unsigned int size() const
ProcessCallGraph callgraph_
double FastTimerService::queryModuleTime_ ( edm::StreamID  sid,
unsigned int  id 
) const
private

Definition at line 1013 of file FastTimerService.cc.

References triggerObjects_cff::id, AnalysisDataFormats_SUSYBSMObjects::ms, and streams_.

Referenced by queryModuleTime(), queryModuleTimeByLabel(), and querySourceTime().

1014 {
1015  // private version, assume "id" is valid
1016  auto const& stream = streams_[sid];
1017  auto const& module = stream.modules[id];
1018  return ms(module.total.time_real);
1019 }
std::vector< ResourcesPerJob > streams_
susybsm::MuonSegment ms
Definition: classes.h:31
Definition: vlib.h:208
double FastTimerService::queryModuleTimeByLabel ( edm::StreamID  sid,
std::string const &  module 
) const

Definition at line 1059 of file FastTimerService.cc.

References callgraph_, diffTwoXMLs::label, ProcessCallGraph::module(), edm::ModuleDescription::moduleLabel(), queryModuleTime_(), and ProcessCallGraph::size().

Referenced by IsoTrig::studyTiming().

1060 {
1061  for (unsigned int id: boost::irange(0u, callgraph_.size()))
1062  if (callgraph_.module(id).moduleLabel() == label)
1063  return queryModuleTime_(sid, id);
1064 
1065  // FIXME issue a LogWarning, raise an exception, or return NaN
1066  return 0.;
1067 }
double queryModuleTime_(edm::StreamID, unsigned int id) const
std::string const & moduleLabel() const
unsigned int size() const
edm::ModuleDescription const & module(unsigned int module) const
ProcessCallGraph callgraph_
double FastTimerService::queryModuleTimeByLabel ( edm::StreamID  sid,
std::string const &  process,
const std::string &  module 
) const

Definition at line 1070 of file FastTimerService.cc.

References callgraph_, diffTwoXMLs::label, ProcessCallGraph::module(), edm::ModuleDescription::moduleLabel(), ProcessCallGraph::ProcessType::modules_, ProcessCallGraph::processDescription(), and queryModuleTime_().

1071 {
1072  for (unsigned int id: callgraph_.processDescription(process).modules_)
1073  if (callgraph_.module(id).moduleLabel() == label)
1074  return queryModuleTime_(sid, id);
1075 
1076  // FIXME issue a LogWarning, raise an exception, or return NaN
1077  return 0.;
1078 }
double queryModuleTime_(edm::StreamID, unsigned int id) const
std::string const & moduleLabel() const
ProcessType const & processDescription(unsigned int) const
edm::ModuleDescription const & module(unsigned int module) const
ProcessCallGraph callgraph_
std::vector< unsigned int > modules_
double FastTimerService::queryPathTime ( edm::StreamID  sid,
std::string const &  path 
) const

Definition at line 1081 of file FastTimerService.cc.

References callgraph_, AnalysisDataFormats_SUSYBSMObjects::ms, sysUtil::pid, ProcessCallGraph::processDescription(), ProcessCallGraph::processes(), and streams_.

1082 {
1083  auto const& stream = streams_[sid];
1084  for (unsigned int pid: boost::irange(0ul, callgraph_.processes().size()))
1085  {
1086  auto const& desc = callgraph_.processDescription(pid);
1087  for (unsigned int id: boost::irange(0ul, desc.paths_.size()))
1088  if (desc.paths_[id].name_ == path)
1089  return ms(stream.processes[pid].paths[id].total.time_real);
1090  for (unsigned int id: boost::irange(0ul, desc.endPaths_.size()))
1091  if (desc.paths_[id].name_ == path)
1092  return ms(stream.processes[pid].endpaths[id].total.time_real);
1093  }
1094 
1095  // FIXME issue a LogWarning, raise an exception, or return NaN
1096  return 0.;
1097 }
std::vector< ResourcesPerJob > streams_
std::vector< ProcessType > const & processes() const
ProcessType const & processDescription(unsigned int) const
susybsm::MuonSegment ms
Definition: classes.h:31
ProcessCallGraph callgraph_
double FastTimerService::queryPathTime ( edm::StreamID  sid,
std::string const &  process,
std::string const &  path 
) const

Definition at line 1100 of file FastTimerService.cc.

References callgraph_, AnalysisDataFormats_SUSYBSMObjects::ms, sysUtil::pid, ProcessCallGraph::processDescription(), ProcessCallGraph::processId(), and streams_.

1101 {
1102  auto const& stream = streams_[sid];
1103  unsigned int pid = callgraph_.processId(process);
1104  auto const& desc = callgraph_.processDescription(pid);
1105  for (unsigned int id: boost::irange(0ul, desc.paths_.size()))
1106  if (desc.paths_[id].name_ == path)
1107  return ms(stream.processes[pid].paths[id].total.time_real);
1108  for (unsigned int id: boost::irange(0ul, desc.endPaths_.size()))
1109  if (desc.paths_[id].name_ == path)
1110  return ms(stream.processes[pid].endpaths[id].total.time_real);
1111 
1112  // FIXME issue a LogWarning, raise an exception, or return NaN
1113  return 0.;
1114 }
unsigned int processId(edm::ProcessContext const &) const
std::vector< ResourcesPerJob > streams_
ProcessType const & processDescription(unsigned int) const
susybsm::MuonSegment ms
Definition: classes.h:31
ProcessCallGraph callgraph_
double FastTimerService::querySourceTime ( edm::StreamID  sid) const

Definition at line 1022 of file FastTimerService.cc.

References callgraph_, edm::ModuleDescription::id(), queryModuleTime_(), and ProcessCallGraph::source().

1023 {
1024  return queryModuleTime_(sid, callgraph_.source().id());
1025 }
double queryModuleTime_(edm::StreamID, unsigned int id) const
edm::ModuleDescription const & source() const
ProcessCallGraph callgraph_
unsigned int id() const
FastTimerService::Measurement & FastTimerService::thread ( )
private

Definition at line 1897 of file FastTimerService.cc.

References threads_.

Referenced by on_scheduler_entry(), on_scheduler_exit(), postModuleEvent(), postSourceEvent(), preModuleEvent(), and preSourceEvent().

1898 {
1899  return threads_.local();
1900 }
tbb::enumerable_thread_specific< Measurement, tbb::cache_aligned_allocator< Measurement >, tbb::ets_key_per_instance > threads_
void FastTimerService::unsupportedSignal ( const std::string &  signal) const
private

Definition at line 1136 of file FastTimerService.cc.

References unsupported_signals_.

Referenced by postModuleEventDelayedGet(), and preModuleEventDelayedGet().

1137 {
1138  // warn about each signal only once per job
1139  if (unsupported_signals_.insert(signal).second)
1140  edm::LogWarning("FastTimerService") << "The FastTimerService received the unsupported signal \"" << signal << "\".\n"
1141  << "Please report how to reproduce the issue to cms-hlt@cern.ch .";
1142 }
tbb::concurrent_unordered_set< std::string > unsupported_signals_

Member Data Documentation

ProcessCallGraph FastTimerService::callgraph_
private
unsigned int FastTimerService::concurrent_runs_
private

Definition at line 466 of file FastTimerService.h.

Referenced by postBeginJob(), and preallocate().

unsigned int FastTimerService::concurrent_streams_
private

Definition at line 467 of file FastTimerService.h.

Referenced by postBeginJob(), and preallocate().

unsigned int FastTimerService::concurrent_threads_
private

Definition at line 468 of file FastTimerService.h.

Referenced by preallocate().

const PlotRanges FastTimerService::dqm_event_ranges_
private

Definition at line 484 of file FastTimerService.h.

Referenced by preStreamBeginRun().

const unsigned int FastTimerService::dqm_lumisections_range_
private

Definition at line 487 of file FastTimerService.h.

Referenced by FastTimerService(), and preStreamBeginRun().

const PlotRanges FastTimerService::dqm_module_ranges_
private

Definition at line 486 of file FastTimerService.h.

Referenced by FastTimerService(), and preStreamBeginRun().

std::string FastTimerService::dqm_path_
private

Definition at line 488 of file FastTimerService.h.

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

const PlotRanges FastTimerService::dqm_path_ranges_
private

Definition at line 485 of file FastTimerService.h.

Referenced by FastTimerService(), and preStreamBeginRun().

bool FastTimerService::enable_dqm_
private
const bool FastTimerService::enable_dqm_byls_
private

Definition at line 481 of file FastTimerService.h.

Referenced by preStreamBeginRun().

const bool FastTimerService::enable_dqm_bymodule_
private

Definition at line 479 of file FastTimerService.h.

Referenced by preStreamBeginRun().

const bool FastTimerService::enable_dqm_bynproc_
private

Definition at line 482 of file FastTimerService.h.

Referenced by preallocate().

const bool FastTimerService::enable_dqm_bypath_
private

Definition at line 480 of file FastTimerService.h.

Referenced by preStreamBeginRun().

std::vector<edm::ParameterSet> FastTimerService::highlight_module_psets_
private

Definition at line 491 of file FastTimerService.h.

Referenced by FastTimerService(), and postBeginJob().

std::vector<GroupOfModules> FastTimerService::highlight_modules_
private
ResourcesPerJob FastTimerService::job_summary_
private

Definition at line 448 of file FastTimerService.h.

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

unsigned int FastTimerService::module_id_
private
const bool FastTimerService::print_event_summary_
private

Definition at line 471 of file FastTimerService.h.

Referenced by postEvent().

const bool FastTimerService::print_job_summary_
private

Definition at line 473 of file FastTimerService.h.

Referenced by postEndJob().

const bool FastTimerService::print_run_summary_
private

Definition at line 472 of file FastTimerService.h.

Referenced by postGlobalEndRun().

std::vector<ResourcesPerJob> FastTimerService::run_summary_
private

Definition at line 449 of file FastTimerService.h.

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

std::vector<PlotsPerJob> FastTimerService::stream_plots_
private

Definition at line 445 of file FastTimerService.h.

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

std::vector<ResourcesPerJob> FastTimerService::streams_
private
std::unique_ptr<std::atomic<unsigned int>[]> FastTimerService::subprocess_event_check_
private

Definition at line 457 of file FastTimerService.h.

Referenced by postEvent(), preallocate(), and preSourceEvent().

std::unique_ptr<std::atomic<unsigned int>[]> FastTimerService::subprocess_global_run_check_
private

Definition at line 460 of file FastTimerService.h.

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

std::unique_ptr<std::atomic<unsigned int>[]> FastTimerService::subprocess_lumisection_check_
private

Definition at line 458 of file FastTimerService.h.

Referenced by postStreamEndLumi(), preallocate(), and preStreamBeginLumi().

std::unique_ptr<std::atomic<unsigned int>[]> FastTimerService::subprocess_run_check_
private

Definition at line 459 of file FastTimerService.h.

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

std::mutex FastTimerService::summary_mutex_
private

Definition at line 450 of file FastTimerService.h.

Referenced by postEvent().

tbb::enumerable_thread_specific<Measurement, tbb::cache_aligned_allocator<Measurement>, tbb::ets_key_per_instance> FastTimerService::threads_
private

Definition at line 454 of file FastTimerService.h.

Referenced by thread().

tbb::concurrent_unordered_set<std::string> FastTimerService::unsupported_signals_
mutableprivate

Definition at line 495 of file FastTimerService.h.

Referenced by unsupportedSignal().