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 &)
 
template<typename T >
void printEvent (T &out, ResourcesPerJob const &data) 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 printEventLine (T &out, AtomicResources const &data, std::string const &label) const
 
template<typename T >
void printHeader (T &out, std::string const &label) const
 
template<typename T >
void printPathSummaryHeader (T &out, std::string const &label) const
 
template<typename T >
void printPathSummaryLine (T &out, Resources const &data, Resources const &total, uint64_t events, std::string const &label) const
 
template<typename T >
void printSummary (T &out, ResourcesPerJob const &data, std::string const &label) const
 
template<typename T >
void printSummaryHeader (T &out, std::string const &label, bool detailed) 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
 
template<typename T >
void printTransition (T &out, AtomicResources const &data, std::string const &label) const
 
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 (edm::LuminosityBlockIndex)
 
void postSourceRun (edm::RunIndex)
 
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 (edm::LuminosityBlockIndex)
 
void preSourceRun (edm::RunIndex)
 
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 printEventLine (T &out, AtomicResources const &data, std::string const &label) const
 
template<typename T >
void printHeader (T &out, std::string const &label) const
 
template<typename T >
void printPathSummaryHeader (T &out, std::string const &label) const
 
template<typename T >
void printPathSummaryLine (T &out, Resources const &data, Resources const &total, uint64_t events, std::string const &label) const
 
template<typename T >
void printSummary (T &out, ResourcesPerJob const &data, std::string const &label) const
 
template<typename T >
void printSummaryHeader (T &out, std::string const &label, bool detailed) 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
 
template<typename T >
void printTransition (T &out, AtomicResources const &data, 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_lumis_
 
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_
 
const bool enable_dqm_transitions_
 
std::vector< edm::ParameterSethighlight_module_psets_
 
std::vector< GroupOfModuleshighlight_modules_
 
ResourcesPerJob job_summary_
 
std::vector< AtomicResourceslumi_transition_
 
AtomicResources overhead_
 
std::unique_ptr< PlotsPerJobplots_
 
const bool print_event_summary_
 
const bool print_job_summary_
 
const bool print_run_summary_
 
std::vector< ResourcesPerJobrun_summary_
 
std::vector< AtomicResourcesrun_transition_
 
std::vector< ResourcesPerJobstreams_
 
std::unique_ptr< std::atomic< unsigned int >[]> subprocess_event_check_
 
std::unique_ptr< std::atomic< unsigned int >[]> subprocess_global_lumi_check_
 
std::unique_ptr< std::atomic< unsigned int >[]> subprocess_global_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 51 of file FastTimerService.h.

Constructor & Destructor Documentation

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

Definition at line 849 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(), postGlobalEndLumi(), postGlobalEndRun(), postModuleEvent(), postModuleEventDelayedGet(), postModuleGlobalBeginLumi(), postModuleGlobalBeginRun(), postModuleGlobalEndLumi(), postModuleGlobalEndRun(), postModuleStreamBeginLumi(), postModuleStreamBeginRun(), postModuleStreamEndLumi(), postModuleStreamEndRun(), postPathEvent(), postSourceEvent(), postSourceLumi(), postSourceRun(), postStreamEndLumi(), postStreamEndRun(), preallocate(), preBeginJob(), preEvent(), preGlobalBeginLumi(), preGlobalBeginRun(), preModuleEvent(), preModuleEventDelayedGet(), preModuleGlobalBeginLumi(), preModuleGlobalBeginRun(), preModuleGlobalEndLumi(), preModuleGlobalEndRun(), preModuleStreamBeginLumi(), preModuleStreamBeginRun(), preModuleStreamEndLumi(), preModuleStreamEndRun(), prePathEvent(), preSourceConstruction(), preSourceEvent(), preSourceLumi(), preSourceRun(), preStreamBeginLumi(), preStreamBeginRun(), PhysicsTools::registry, AlCaHLTBitMon_QueryRunRegistry::string, and ~FastTimerService().

849  :
850  // configuration
851  callgraph_(),
852  // job configuration
853  concurrent_lumis_( 0 ),
854  concurrent_runs_( 0 ),
855  concurrent_streams_( 0 ),
856  concurrent_threads_( 0 ),
857  print_event_summary_( config.getUntrackedParameter<bool>( "printEventSummary" ) ),
858  print_run_summary_( config.getUntrackedParameter<bool>( "printRunSummary" ) ),
859  print_job_summary_( config.getUntrackedParameter<bool>( "printJobSummary" ) ),
860  // dqm configuration
861  enable_dqm_( config.getUntrackedParameter<bool>( "enableDQM" ) ),
862  enable_dqm_bymodule_( config.getUntrackedParameter<bool>( "enableDQMbyModule" ) ),
863  enable_dqm_bypath_( config.getUntrackedParameter<bool>( "enableDQMbyPath" ) ),
864  enable_dqm_byls_( config.getUntrackedParameter<bool>( "enableDQMbyLumiSection" ) ),
865  enable_dqm_bynproc_( config.getUntrackedParameter<bool>( "enableDQMbyProcesses" ) ),
866  enable_dqm_transitions_( config.getUntrackedParameter<bool>( "enableDQMTransitions" ) ),
867  dqm_event_ranges_( { config.getUntrackedParameter<double>( "dqmTimeRange" ), // ms
868  config.getUntrackedParameter<double>( "dqmTimeResolution" ), // ms
869  config.getUntrackedParameter<double>( "dqmMemoryRange" ), // kB
870  config.getUntrackedParameter<double>( "dqmMemoryResolution" ) } ), // kB
871  dqm_path_ranges_( { config.getUntrackedParameter<double>( "dqmPathTimeRange" ), // ms
872  config.getUntrackedParameter<double>( "dqmPathTimeResolution" ), // ms
873  config.getUntrackedParameter<double>( "dqmPathMemoryRange" ), // kB
874  config.getUntrackedParameter<double>( "dqmPathMemoryResolution" ) } ), // kB
875  dqm_module_ranges_( { config.getUntrackedParameter<double>( "dqmModuleTimeRange" ), // ms
876  config.getUntrackedParameter<double>( "dqmModuleTimeResolution" ), // ms
877  config.getUntrackedParameter<double>( "dqmModuleMemoryRange" ), // kB
878  config.getUntrackedParameter<double>( "dqmModuleMemoryResolution") } ), // kB
879  dqm_lumisections_range_( config.getUntrackedParameter<unsigned int>( "dqmLumiSectionsRange" ) ),
880  dqm_path_( config.getUntrackedParameter<std::string>("dqmPath" ) ),
881  // highlight configuration
882  highlight_module_psets_( config.getUntrackedParameter<std::vector<edm::ParameterSet>>("highlightModules") ),
883  highlight_modules_( highlight_module_psets_.size()) // filled in postBeginJob()
884 {
885  // start observing when a thread enters or leaves the TBB global thread arena
886  tbb::task_scheduler_observer::observe();
887 
888  // register EDM call backs
892  registry.watchPostEndJob( this, & FastTimerService::postEndJob );
894 //registry.watchPostGlobalBeginRun( this, & FastTimerService::postGlobalBeginRun );
895 //registry.watchPreGlobalEndRun( this, & FastTimerService::preGlobalEndRun );
898 //registry.watchPostStreamBeginRun( this, & FastTimerService::postStreamBeginRun );
899 //registry.watchPreStreamEndRun( this, & FastTimerService::preStreamEndRun );
902 //registry.watchPostGlobalBeginLumi( this, & FastTimerService::postGlobalBeginLumi );
903 //registry.watchPreGlobalEndLumi( this, & FastTimerService::preGlobalEndLumi );
906 //registry.watchPostStreamBeginLumi( this, & FastTimerService::postStreamBeginLumi );
907 //registry.watchPreStreamEndLumi( this, & FastTimerService::preStreamEndLumi );
909  registry.watchPreEvent( this, & FastTimerService::preEvent );
910  registry.watchPostEvent( this, & FastTimerService::postEvent );
914 //registry.watchPostSourceConstruction( this, & FastTimerService::postSourceConstruction);
921 //registry.watchPreModuleConstruction( this, & FastTimerService::preModuleConstruction);
922 //registry.watchPostModuleConstruction( this, & FastTimerService::postModuleConstruction);
923 //registry.watchPreModuleBeginJob( this, & FastTimerService::preModuleBeginJob );
924 //registry.watchPostModuleBeginJob( this, & FastTimerService::postModuleBeginJob );
925 //registry.watchPreModuleEndJob( this, & FastTimerService::preModuleEndJob );
926 //registry.watchPostModuleEndJob( this, & FastTimerService::postModuleEndJob );
927 //registry.watchPreModuleBeginStream( this, & FastTimerService::preModuleBeginStream );
928 //registry.watchPostModuleBeginStream( this, & FastTimerService::postModuleBeginStream );
929 //registry.watchPreModuleEndStream( this, & FastTimerService::preModuleEndStream );
930 //registry.watchPostModuleEndStream( this, & FastTimerService::postModuleEndStream );
947 //registry.watchPreModuleEventPrefetching( this, & FastTimerService::preModuleEventPrefetching );
948 //registry.watchPostModuleEventPrefetching( this, & FastTimerService::postModuleEventPrefetching );
953 //registry.watchPreEventReadFromSource( this, & FastTimerService::preEventReadFromSource );
954 //registry.watchPostEventReadFromSource( this, & FastTimerService::postEventReadFromSource );
955 }
void watchPostModuleGlobalEndLumi(PostModuleGlobalEndLumi::slot_type const &iSlot)
void preGlobalBeginRun(edm::GlobalContext const &)
void preModuleEventDelayedGet(edm::StreamContext const &, edm::ModuleCallingContext const &)
const bool print_run_summary_
void watchPreModuleGlobalBeginRun(PreModuleGlobalBeginRun::slot_type const &iSlot)
T getUntrackedParameter(std::string const &, T const &) const
void watchPreEvent(PreEvent::slot_type const &iSlot)
void postGlobalEndLumi(edm::GlobalContext const &)
void postStreamEndLumi(edm::StreamContext const &)
std::vector< edm::ParameterSet > highlight_module_psets_
void postModuleGlobalEndLumi(edm::GlobalContext const &, edm::ModuleCallingContext const &)
void preBeginJob(edm::PathsAndConsumesOfModulesBase const &, edm::ProcessContext const &)
void watchPrePathEvent(PrePathEvent::slot_type const &iSlot)
void preSourceLumi(edm::LuminosityBlockIndex)
void watchPreallocate(Preallocate::slot_type const &iSlot)
unsigned int concurrent_threads_
void watchPostEndJob(PostEndJob::slot_type const &iSlot)
const PlotRanges dqm_event_ranges_
void postModuleGlobalEndRun(edm::GlobalContext const &, edm::ModuleCallingContext const &)
void preSourceRun(edm::RunIndex)
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 watchPreGlobalBeginLumi(PreGlobalBeginLumi::slot_type const &iSlot)
void watchPostPathEvent(PostPathEvent::slot_type const &iSlot)
void watchPostModuleEvent(PostModuleEvent::slot_type const &iSlot)
void watchPostModuleGlobalBeginLumi(PostModuleGlobalBeginLumi::slot_type const &iSlot)
void watchPostModuleStreamEndLumi(PostModuleStreamEndLumi::slot_type const &iSlot)
void watchPostModuleStreamBeginRun(PostModuleStreamBeginRun::slot_type const &iSlot)
void watchPostSourceEvent(PostSourceEvent::slot_type const &iSlot)
void postSourceRun(edm::RunIndex)
void postPathEvent(edm::StreamContext const &, edm::PathContext const &, edm::HLTPathStatus const &)
void preModuleGlobalBeginLumi(edm::GlobalContext const &, edm::ModuleCallingContext const &)
const bool print_job_summary_
void watchPreModuleGlobalEndRun(PreModuleGlobalEndRun::slot_type const &iSlot)
const bool enable_dqm_bypath_
const PlotRanges dqm_path_ranges_
void postModuleStreamEndLumi(edm::StreamContext const &, edm::ModuleCallingContext const &)
void prePathEvent(edm::StreamContext const &, edm::PathContext const &)
void watchPostSourceRun(PostSourceRun::slot_type const &iSlot)
void watchPreSourceLumi(PreSourceLumi::slot_type const &iSlot)
void preModuleStreamEndLumi(edm::StreamContext const &, edm::ModuleCallingContext const &)
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 &)
unsigned int concurrent_lumis_
std::string dqm_path_
void watchPostGlobalEndLumi(PostGlobalEndLumi::slot_type const &iSlot)
const bool enable_dqm_transitions_
void watchPreSourceRun(PreSourceRun::slot_type const &iSlot)
void watchPostStreamEndRun(PostStreamEndRun::slot_type const &iSlot)
const bool enable_dqm_bymodule_
void watchPostModuleStreamEndRun(PostModuleStreamEndRun::slot_type const &iSlot)
void watchPreModuleGlobalBeginLumi(PreModuleGlobalBeginLumi::slot_type const &iSlot)
void watchPreGlobalBeginRun(PreGlobalBeginRun::slot_type const &iSlot)
void watchPreModuleStreamBeginLumi(PreModuleStreamBeginLumi::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 watchPostSourceLumi(PostSourceLumi::slot_type const &iSlot)
void watchPostModuleEventDelayedGet(PostModuleEventDelayedGet::slot_type const &iSlot)
void watchPostModuleGlobalEndRun(PostModuleGlobalEndRun::slot_type const &iSlot)
void watchPostModuleStreamBeginLumi(PostModuleStreamBeginLumi::slot_type const &iSlot)
void postModuleStreamBeginLumi(edm::StreamContext const &, edm::ModuleCallingContext const &)
void preModuleStreamEndRun(edm::StreamContext const &, edm::ModuleCallingContext const &)
void postModuleStreamEndRun(edm::StreamContext const &, edm::ModuleCallingContext const &)
void watchPreModuleStreamEndLumi(PreModuleStreamEndLumi::slot_type const &iSlot)
void watchPreModuleStreamBeginRun(PreModuleStreamBeginRun::slot_type const &iSlot)
void postModuleStreamBeginRun(edm::StreamContext const &, edm::ModuleCallingContext const &)
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 preModuleStreamBeginLumi(edm::StreamContext const &, edm::ModuleCallingContext const &)
void preModuleStreamBeginRun(edm::StreamContext const &, edm::ModuleCallingContext const &)
void watchPreStreamBeginRun(PreStreamBeginRun::slot_type const &iSlot)
void watchPreModuleStreamEndRun(PreModuleStreamEndRun::slot_type const &iSlot)
void preModuleGlobalEndLumi(edm::GlobalContext const &, edm::ModuleCallingContext const &)
void watchPostModuleGlobalBeginRun(PostModuleGlobalBeginRun::slot_type const &iSlot)
void preGlobalBeginLumi(edm::GlobalContext const &)
void preSourceConstruction(edm::ModuleDescription const &)
void preModuleGlobalEndRun(edm::GlobalContext const &, edm::ModuleCallingContext const &)
void postSourceLumi(edm::LuminosityBlockIndex)
void postModuleGlobalBeginRun(edm::GlobalContext const &, edm::ModuleCallingContext const &)
void watchPreSourceEvent(PreSourceEvent::slot_type const &iSlot)
ProcessCallGraph callgraph_
void postModuleGlobalBeginLumi(edm::GlobalContext const &, edm::ModuleCallingContext const &)
void preStreamBeginRun(edm::StreamContext const &)
void preModuleGlobalBeginRun(edm::GlobalContext const &, edm::ModuleCallingContext const &)
unsigned int concurrent_streams_
void watchPreModuleGlobalEndLumi(PreModuleGlobalEndLumi::slot_type const &iSlot)
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 1903 of file FastTimerService.cc.

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

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

Definition at line 1595 of file FastTimerService.cc.

References callgraph_, and ProcessCallGraph::processes().

Referenced by postEvent(), postGlobalEndLumi(), and postGlobalEndRun().

1596 {
1597  // release-acquire semantic guarantees that all writes in this and other threads are visible
1598  // after this operation; full sequentially-consistent ordering is (probably) not needed.
1599  unsigned int old_value = check.fetch_add(1, std::memory_order_acq_rel);
1600  return (old_value == callgraph_.processes().size() - 1);
1601 }
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 1881 of file FastTimerService.cc.

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

1882 {
1883  // initialise the measurement point for a thread that has newly joining the TBB pool
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(), overhead_, and thread().

1889 {
1890  // account any resources used or freed by the thread before leaving the TBB pool
1892 }
AtomicResources overhead_
void measure_and_accumulate(AtomicResources &store)
Measurement & thread()
void FastTimerService::postBeginJob ( )
private

Definition at line 1184 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, plots_, run_summary_, ProcessCallGraph::size(), streams_, AlCaHLTBitMon_QueryRunRegistry::string, and groupFilesInBlocks::temp.

Referenced by FastTimerService().

1184  {
1185  unsigned int modules = callgraph_.size();
1186 
1187  // module highlights
1188  for (unsigned int group: boost::irange(0ul, highlight_module_psets_.size())) {
1189  // copy and sort for faster search via std::binary_search
1190  auto labels = highlight_module_psets_[group].getUntrackedParameter<std::vector<std::string>>("modules");
1191  std::sort(labels.begin(), labels.end());
1192 
1193  highlight_modules_[group].label = highlight_module_psets_[group].getUntrackedParameter<std::string>("label");
1194  highlight_modules_[group].modules.reserve(labels.size());
1195  // convert the module labels in module ids
1196  for (unsigned int i = 0; i < modules; ++i) {
1197  auto const & label = callgraph_.module(i).moduleLabel();
1198  if (std::binary_search(labels.begin(), labels.end(), label))
1199  highlight_modules_[group].modules.push_back(i);
1200  }
1201  }
1202  highlight_module_psets_.clear();
1203 
1204  // allocate the resource counters for each stream, process, path and module
1205  ResourcesPerJob temp(callgraph_, highlight_modules_);
1208  job_summary_ = temp;
1209 
1210  // check that the DQMStore service is available
1211  if (enable_dqm_ and not edm::Service<DQMStore>().isAvailable()) {
1212  // the DQMStore is not available, disable all DQM plots
1213  enable_dqm_ = false;
1214  // FIXME issue a LogWarning ?
1215  }
1216 
1217  // allocate the structures to hold pointers to the DQM plots
1218  if (enable_dqm_) {
1219  plots_ = std::make_unique<PlotsPerJob>(callgraph_, highlight_modules_);
1220  }
1221 
1222 }
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< ResourcesPerJob > run_summary_
std::unique_ptr< PlotsPerJob > plots_
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 1364 of file FastTimerService.cc.

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

Referenced by FastTimerService().

1365 {
1366  if (print_job_summary_) {
1367  edm::LogVerbatim out("FastReport");
1368  printSummary(out, job_summary_, "Job");
1369  }
1370 }
void printSummary(T &out, ResourcesPerJob const &data, std::string const &label) const
ResourcesPerJob job_summary_
const bool print_job_summary_
void FastTimerService::postEvent ( edm::StreamContext const &  sc)
private

Definition at line 1610 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, plots_, print_event_summary_, printEvent(), LaserDQM_cfg::process, edm::StreamContext::processContext(), ProcessCallGraph::processDescription(), ProcessCallGraph::processId(), run_summary_, edm::StreamContext::runIndex(), edm::StreamContext::streamID(), streams_, subprocess_event_check_, and summary_mutex_.

Referenced by FastTimerService().

1611 {
1612  ignoredSignal(__func__);
1613 
1614  unsigned int pid = callgraph_.processId(* sc.processContext());
1615  unsigned int sid = sc.streamID();
1616  auto & stream = streams_[sid];
1617  auto & process = callgraph_.processDescription(pid);
1618 
1619  // measure the event resources as the sum of all modules' resources
1620  auto & data = stream.processes[pid].total;
1621  for (unsigned int i: process.modules_)
1622  data += stream.modules[i].total;
1623  stream.total += data;
1624 
1625  // handle the summaries and fill the plots only after the last subprocess has run
1627  if (not last)
1628  return;
1629 
1630  // measure the event resources explicitly
1631  stream.event_measurement.measure_and_store(stream.event);
1632 
1633  // highlighted modules
1634  for (unsigned int group: boost::irange(0ul, highlight_modules_.size()))
1635  for (unsigned int i: highlight_modules_[group].modules)
1636  stream.highlight[group] += stream.modules[i].total;
1637 
1638  // avoid concurrent access to the summary objects
1639  {
1640  std::lock_guard<std::mutex> guard(summary_mutex_);
1641  job_summary_ += stream;
1642  run_summary_[sc.runIndex()] += stream;
1643  }
1644 
1645  if (print_event_summary_) {
1646  edm::LogVerbatim out("FastReport");
1647  printEvent(out, stream);
1648  }
1649 
1650  if (enable_dqm_) {
1651  plots_->fill(callgraph_, stream, sc.eventID().luminosityBlock());
1652  }
1653 }
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< 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
std::unique_ptr< PlotsPerJob > plots_
ProcessCallGraph callgraph_
bool isLastSubprocess(std::atomic< unsigned int > &check)
void FastTimerService::postEventReadFromSource ( edm::StreamContext const &  sc,
edm::ModuleCallingContext const &  mcc 
)
private

Definition at line 1771 of file FastTimerService.cc.

References ignoredSignal().

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

Definition at line 1256 of file FastTimerService.cc.

References ignoredSignal().

1257 {
1258  ignoredSignal(__func__);
1259 }
void ignoredSignal(const std::string &signal) const
void FastTimerService::postGlobalBeginRun ( edm::GlobalContext const &  gc)
private

Definition at line 1128 of file FastTimerService.cc.

References ignoredSignal().

1129 {
1130  ignoredSignal(__func__);
1131 }
void ignoredSignal(const std::string &signal) const
void FastTimerService::postGlobalEndLumi ( edm::GlobalContext const &  gc)
private

Definition at line 1268 of file FastTimerService.cc.

References enable_dqm_transitions_, cmsPerfStripChart::format, ignoredSignal(), isLastSubprocess(), diffTwoXMLs::label, plotBeamSpotDB::last, lumi_transition_, edm::LuminosityBlockID::luminosityBlock(), edm::GlobalContext::luminosityBlockID(), edm::GlobalContext::luminosityBlockIndex(), MillePedeFileConverter_cfg::out, plots_, printTransition(), edm::LuminosityBlockID::run(), harvestTrackValidationPlots::str, and subprocess_global_lumi_check_.

Referenced by FastTimerService().

1269 {
1270  ignoredSignal(__func__);
1271 
1272  // handle the summaries only after the last subprocess has run
1273  auto index = gc.luminosityBlockIndex();
1275  if (not last)
1276  return;
1277 
1278  edm::LogVerbatim out("FastReport");
1279  auto const& label = (boost::format("run %d, lumisection %d") % gc.luminosityBlockID().run() % gc.luminosityBlockID().luminosityBlock()).str();
1281 
1283  plots_->fill_lumi(lumi_transition_[index], gc.luminosityBlockID().luminosityBlock());
1284  }
1285 }
std::unique_ptr< std::atomic< unsigned int >[]> subprocess_global_lumi_check_
format
Some error handling for the usage.
const bool enable_dqm_transitions_
void printTransition(T &out, AtomicResources const &data, std::string const &label) const
void ignoredSignal(const std::string &signal) const
std::unique_ptr< PlotsPerJob > plots_
std::vector< AtomicResources > lumi_transition_
bool isLastSubprocess(std::atomic< unsigned int > &check)
void FastTimerService::postGlobalEndRun ( edm::GlobalContext const &  gc)
private

Definition at line 1317 of file FastTimerService.cc.

References enable_dqm_transitions_, cmsPerfStripChart::format, ignoredSignal(), isLastSubprocess(), diffTwoXMLs::label, plotBeamSpotDB::last, edm::GlobalContext::luminosityBlockID(), MillePedeFileConverter_cfg::out, plots_, print_run_summary_, printSummary(), printTransition(), edm::LuminosityBlockID::run(), run_summary_, run_transition_, edm::GlobalContext::runIndex(), harvestTrackValidationPlots::str, and subprocess_global_run_check_.

Referenced by FastTimerService().

1318 {
1319  ignoredSignal(__func__);
1320 
1321  // handle the summaries only after the last subprocess has run
1322  auto index = gc.runIndex();
1324  if (not last)
1325  return;
1326 
1327  edm::LogVerbatim out("FastReport");
1328  auto const& label = (boost::format("Run %d") % gc.luminosityBlockID().run()).str();
1329  if (print_run_summary_) {
1331  }
1333 
1335  plots_->fill_run(run_transition_[index]);
1336  }
1337 }
const bool print_run_summary_
void printSummary(T &out, ResourcesPerJob const &data, std::string const &label) const
std::unique_ptr< std::atomic< unsigned int >[]> subprocess_global_run_check_
std::vector< ResourcesPerJob > run_summary_
format
Some error handling for the usage.
const bool enable_dqm_transitions_
std::vector< AtomicResources > run_transition_
void printTransition(T &out, AtomicResources const &data, std::string const &label) const
void ignoredSignal(const std::string &signal) const
std::unique_ptr< PlotsPerJob > plots_
bool isLastSubprocess(std::atomic< unsigned int > &check)
void FastTimerService::postModuleEvent ( edm::StreamContext const &  sc,
edm::ModuleCallingContext const &  mcc 
)
private

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

1730 {
1731  edm::ModuleDescription const& md = * mcc.moduleDescription();
1732  unsigned int id = md.id();
1733  unsigned int sid = sc.streamID().value();
1734  auto & stream = streams_[sid];
1735 
1736  thread().measure_and_store(stream.modules[id].total);
1737  ++stream.modules[id].events;
1738 }
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 1747 of file FastTimerService.cc.

References unsupportedSignal().

Referenced by FastTimerService().

1748 {
1749  unsupportedSignal(__func__);
1750 }
void unsupportedSignal(const std::string &signal) const
void FastTimerService::postModuleEventPrefetching ( edm::StreamContext const &  sc,
edm::ModuleCallingContext const &  mcc 
)
private

Definition at line 1759 of file FastTimerService.cc.

References ignoredSignal().

1760 {
1761  ignoredSignal(__func__);
1762 }
void ignoredSignal(const std::string &signal) const
void FastTimerService::postModuleGlobalBeginLumi ( edm::GlobalContext const &  gc,
edm::ModuleCallingContext const &  mcc 
)
private

Definition at line 1809 of file FastTimerService.cc.

References lumi_transition_, edm::GlobalContext::luminosityBlockIndex(), FastTimerService::Measurement::measure_and_accumulate(), and thread().

Referenced by FastTimerService().

1810 {
1811  auto index = gc.luminosityBlockIndex();
1813 }
void measure_and_accumulate(AtomicResources &store)
Measurement & thread()
std::vector< AtomicResources > lumi_transition_
void FastTimerService::postModuleGlobalBeginRun ( edm::GlobalContext const &  gc,
edm::ModuleCallingContext const &  mcc 
)
private

Definition at line 1783 of file FastTimerService.cc.

References FastTimerService::Measurement::measure_and_accumulate(), run_transition_, edm::GlobalContext::runIndex(), and thread().

Referenced by FastTimerService().

1784 {
1785  auto index = gc.runIndex();
1787 }
void measure_and_accumulate(AtomicResources &store)
Measurement & thread()
std::vector< AtomicResources > run_transition_
void FastTimerService::postModuleGlobalEndLumi ( edm::GlobalContext const &  gc,
edm::ModuleCallingContext const &  mcc 
)
private

Definition at line 1822 of file FastTimerService.cc.

References lumi_transition_, edm::GlobalContext::luminosityBlockIndex(), FastTimerService::Measurement::measure_and_accumulate(), and thread().

Referenced by FastTimerService().

1823 {
1824  auto index = gc.luminosityBlockIndex();
1826 }
void measure_and_accumulate(AtomicResources &store)
Measurement & thread()
std::vector< AtomicResources > lumi_transition_
void FastTimerService::postModuleGlobalEndRun ( edm::GlobalContext const &  gc,
edm::ModuleCallingContext const &  mcc 
)
private

Definition at line 1796 of file FastTimerService.cc.

References FastTimerService::Measurement::measure_and_accumulate(), run_transition_, edm::GlobalContext::runIndex(), and thread().

Referenced by FastTimerService().

1797 {
1798  auto index = gc.runIndex();
1800 }
void measure_and_accumulate(AtomicResources &store)
Measurement & thread()
std::vector< AtomicResources > run_transition_
void FastTimerService::postModuleStreamBeginLumi ( edm::StreamContext const &  sc,
edm::ModuleCallingContext const &  mcc 
)
private

Definition at line 1861 of file FastTimerService.cc.

References lumi_transition_, edm::StreamContext::luminosityBlockIndex(), FastTimerService::Measurement::measure_and_accumulate(), and thread().

Referenced by FastTimerService().

1862 {
1863  auto index = sc.luminosityBlockIndex();
1865 }
void measure_and_accumulate(AtomicResources &store)
Measurement & thread()
std::vector< AtomicResources > lumi_transition_
void FastTimerService::postModuleStreamBeginRun ( edm::StreamContext const &  sc,
edm::ModuleCallingContext const &  mcc 
)
private

Definition at line 1835 of file FastTimerService.cc.

References FastTimerService::Measurement::measure_and_accumulate(), run_transition_, edm::StreamContext::runIndex(), and thread().

Referenced by FastTimerService().

1836 {
1837  auto index = sc.runIndex();
1839 }
void measure_and_accumulate(AtomicResources &store)
Measurement & thread()
std::vector< AtomicResources > run_transition_
void FastTimerService::postModuleStreamEndLumi ( edm::StreamContext const &  sc,
edm::ModuleCallingContext const &  mcc 
)
private

Definition at line 1874 of file FastTimerService.cc.

References lumi_transition_, edm::StreamContext::luminosityBlockIndex(), FastTimerService::Measurement::measure_and_accumulate(), and thread().

Referenced by FastTimerService().

1875 {
1876  auto index = sc.luminosityBlockIndex();
1878 }
void measure_and_accumulate(AtomicResources &store)
Measurement & thread()
std::vector< AtomicResources > lumi_transition_
void FastTimerService::postModuleStreamEndRun ( edm::StreamContext const &  sc,
edm::ModuleCallingContext const &  mcc 
)
private

Definition at line 1848 of file FastTimerService.cc.

References FastTimerService::Measurement::measure_and_accumulate(), run_transition_, edm::StreamContext::runIndex(), and thread().

Referenced by FastTimerService().

1849 {
1850  auto index = sc.runIndex();
1852 }
void measure_and_accumulate(AtomicResources &store)
Measurement & thread()
std::vector< AtomicResources > run_transition_
void FastTimerService::postPathEvent ( edm::StreamContext const &  sc,
edm::PathContext const &  pc,
edm::HLTPathStatus const &  status 
)
private

Definition at line 1698 of file FastTimerService.cc.

References callgraph_, data, ProcessCallGraph::ProcessType::endPaths_, mps_fire::i, triggerObjects_cff::id, edm::HLTPathStatus::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().

1699 {
1700  unsigned int sid = sc.streamID().value();
1701  unsigned int pid = callgraph_.processId(* sc.processContext());
1702  unsigned int id = pc.pathID();
1703  auto & stream = streams_[sid];
1704  auto & data = pc.isEndPath() ? stream.processes[pid].endpaths[id] : stream.processes[pid].paths[id];
1705 
1706  auto const& path = pc.isEndPath() ? callgraph_.processDescription(pid).endPaths_[id] : callgraph_.processDescription(pid).paths_[id];
1707  unsigned int index = path.modules_on_path_.empty() ? 0 : status.index() + 1;
1708  data.last = path.modules_on_path_.empty() ? 0 : path.last_dependency_of_module_[status.index()];
1709 
1710  for (unsigned int i = 0; i < index; ++i) {
1711  auto const& module = stream.modules[path.modules_on_path_[i]];
1712  data.active += module.total;
1713  }
1714  for (unsigned int i = 0; i < data.last; ++i) {
1715  auto const& module = stream.modules[path.modules_and_dependencies_[i]];
1716  data.total += module.total;
1717  }
1718 }
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 1673 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().

1674 {
1676  unsigned int id = md.id();
1677  auto & stream = streams_[sid];
1678 
1679  thread().measure_and_store(stream.modules[id].total);
1680  ++stream.modules[id].events;
1681 }
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 ( edm::LuminosityBlockIndex  index)
private

Definition at line 1358 of file FastTimerService.cc.

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

Referenced by FastTimerService().

1359 {
1361 }
void measure_and_accumulate(AtomicResources &store)
Measurement & thread()
std::vector< AtomicResources > lumi_transition_
void FastTimerService::postSourceRun ( edm::RunIndex  index)
private

Definition at line 1346 of file FastTimerService.cc.

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

Referenced by FastTimerService().

1347 {
1349 }
void measure_and_accumulate(AtomicResources &store)
Measurement & thread()
std::vector< AtomicResources > run_transition_
void FastTimerService::postStreamBeginLumi ( edm::StreamContext const &  sc)
private

Definition at line 1294 of file FastTimerService.cc.

References ignoredSignal().

1295 {
1296  ignoredSignal(__func__);
1297 }
void ignoredSignal(const std::string &signal) const
void FastTimerService::postStreamBeginRun ( edm::StreamContext const &  sc)
private

Definition at line 1225 of file FastTimerService.cc.

References ignoredSignal().

1226 {
1227  ignoredSignal(__func__);
1228 }
void ignoredSignal(const std::string &signal) const
void FastTimerService::postStreamEndLumi ( edm::StreamContext const &  sc)
private

Definition at line 1306 of file FastTimerService.cc.

References ignoredSignal().

Referenced by FastTimerService().

1306  {
1307  ignoredSignal(__func__);
1308 }
void ignoredSignal(const std::string &signal) const
void FastTimerService::postStreamEndRun ( edm::StreamContext const &  sc)
private

Definition at line 1237 of file FastTimerService.cc.

References ignoredSignal().

Referenced by FastTimerService().

1238 {
1239  ignoredSignal(__func__);
1240 }
void ignoredSignal(const std::string &signal) const
void FastTimerService::preallocate ( edm::service::SystemBounds const &  bounds)
private

Definition at line 1140 of file FastTimerService.cc.

References EnergyCorrector::c, concurrent_lumis_, concurrent_runs_, concurrent_streams_, concurrent_threads_, dqm_path_, enable_dqm_bynproc_, cmsPerfStripChart::format, mps_fire::i, lumi_transition_, edm::service::SystemBounds::maxNumberOfConcurrentLuminosityBlocks(), edm::service::SystemBounds::maxNumberOfConcurrentRuns(), edm::service::SystemBounds::maxNumberOfStreams(), edm::service::SystemBounds::maxNumberOfThreads(), processor_model, run_transition_, alignCSCRings::s, harvestTrackValidationPlots::str, subprocess_event_check_, subprocess_global_lumi_check_, and subprocess_global_run_check_.

Referenced by FastTimerService().

1141 {
1142  concurrent_lumis_ = bounds.maxNumberOfConcurrentLuminosityBlocks();
1143  concurrent_runs_ = bounds.maxNumberOfConcurrentRuns();
1144  concurrent_streams_ = bounds.maxNumberOfStreams();
1145  concurrent_threads_ = bounds.maxNumberOfThreads();
1146 
1147  if (enable_dqm_bynproc_)
1148  dqm_path_ += (boost::format("/Running on %s with %d streams on %d threads") % processor_model % concurrent_streams_ % concurrent_threads_).str();
1149 
1150  // clean characters that are deemed unsafe for DQM
1151  // see the definition of `s_safe` in DQMServices/Core/src/DQMStore.cc
1152  auto safe_for_dqm = "/ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+=_()# "s;
1153  for (auto & c: dqm_path_)
1154  if (safe_for_dqm.find(c) == std::string::npos)
1155  c = '_';
1156 
1157  // allocate atomic variables to keep track of the completion of each step, process by process
1158  subprocess_event_check_ = std::make_unique<std::atomic<unsigned int>[]>(concurrent_streams_);
1159  for (unsigned int i = 0; i < concurrent_streams_; ++i)
1161  subprocess_global_run_check_ = std::make_unique<std::atomic<unsigned int>[]>(concurrent_runs_);
1162  for (unsigned int i = 0; i < concurrent_runs_; ++i)
1164  subprocess_global_lumi_check_ = std::make_unique<std::atomic<unsigned int>[]>(concurrent_lumis_);
1165  for (unsigned int i = 0; i < concurrent_lumis_; ++i)
1167 
1168  // allocate buffers to keep track of the resources spent in the lumi and run transitions
1169  lumi_transition_.resize(concurrent_lumis_);
1170  run_transition_.resize(concurrent_runs_);
1171 }
std::unique_ptr< std::atomic< unsigned int >[]> subprocess_global_lumi_check_
unsigned int concurrent_threads_
const bool enable_dqm_bynproc_
unsigned int concurrent_runs_
std::unique_ptr< std::atomic< unsigned int >[]> subprocess_global_run_check_
std::unique_ptr< std::atomic< unsigned int >[]> subprocess_event_check_
unsigned int concurrent_lumis_
std::string dqm_path_
format
Some error handling for the usage.
const std::string processor_model
std::vector< AtomicResources > run_transition_
std::vector< AtomicResources > lumi_transition_
unsigned int concurrent_streams_
void FastTimerService::preBeginJob ( edm::PathsAndConsumesOfModulesBase const &  pathsAndConsumes,
edm::ProcessContext const &  context 
)
private

Definition at line 1179 of file FastTimerService.cc.

References callgraph_, and ProcessCallGraph::preBeginJob().

Referenced by FastTimerService().

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

Definition at line 1604 of file FastTimerService.cc.

References ignoredSignal().

Referenced by FastTimerService().

1605 {
1606  ignoredSignal(__func__);
1607 }
void ignoredSignal(const std::string &signal) const
void FastTimerService::preEventReadFromSource ( edm::StreamContext const &  sc,
edm::ModuleCallingContext const &  mcc 
)
private

Definition at line 1765 of file FastTimerService.cc.

References ignoredSignal().

1766 {
1767  ignoredSignal(__func__);
1768 }
void ignoredSignal(const std::string &signal) const
void FastTimerService::preGlobalBeginLumi ( edm::GlobalContext const &  gc)
private

Definition at line 1243 of file FastTimerService.cc.

References ignoredSignal(), isFirstSubprocess(), lumi_transition_, edm::GlobalContext::luminosityBlockIndex(), and subprocess_global_lumi_check_.

Referenced by FastTimerService().

1244 {
1245  ignoredSignal(__func__);
1246 
1247  // reset the lumi counters only during the main process being run
1248  if (isFirstSubprocess(gc)) {
1249  auto index = gc.luminosityBlockIndex();
1251  lumi_transition_[index].reset();
1252  }
1253 }
std::unique_ptr< std::atomic< unsigned int >[]> subprocess_global_lumi_check_
bool isFirstSubprocess(edm::StreamContext const &)
void ignoredSignal(const std::string &signal) const
std::vector< AtomicResources > lumi_transition_
void FastTimerService::preGlobalBeginRun ( edm::GlobalContext const &  gc)
private

Definition at line 1092 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_, enable_dqm_transitions_, highlight_modules_, ignoredSignal(), isFirstSubprocess(), edm::GlobalContext::luminosityBlockID(), plots_, edm::LuminosityBlockID::run(), run_summary_, run_transition_, edm::GlobalContext::runIndex(), and subprocess_global_run_check_.

Referenced by FastTimerService().

1093 {
1094  ignoredSignal(__func__);
1095 
1096  // reset the run counters only during the main process being run
1097  if (isFirstSubprocess(gc)) {
1098  auto index = gc.runIndex();
1100  run_transition_[index].reset();
1101  run_summary_[index].reset();
1102 
1103  // book the DQM plots
1104  if (enable_dqm_) {
1105  // define a callback to book the MonitorElements
1106  auto bookTransactionCallback = [&, this] (DQMStore::ConcurrentBooker & booker)
1107  {
1108  booker.setCurrentFolder(dqm_path_);
1109  plots_->book(booker, callgraph_,
1119  };
1120 
1121  // book MonitorElements for this stream
1122  edm::Service<DQMStore>()->bookConcurrentTransaction(bookTransactionCallback, gc.luminosityBlockID().run());
1123  }
1124  }
1125 }
const PlotRanges dqm_event_ranges_
std::vector< GroupOfModules > highlight_modules_
bool isFirstSubprocess(edm::StreamContext const &)
std::unique_ptr< std::atomic< unsigned int >[]> subprocess_global_run_check_
const bool enable_dqm_bypath_
const PlotRanges dqm_path_ranges_
std::vector< ResourcesPerJob > run_summary_
const unsigned int dqm_lumisections_range_
std::string dqm_path_
const bool enable_dqm_transitions_
const bool enable_dqm_bymodule_
const PlotRanges dqm_module_ranges_
const bool enable_dqm_byls_
std::vector< AtomicResources > run_transition_
void ignoredSignal(const std::string &signal) const
std::unique_ptr< PlotsPerJob > plots_
ProcessCallGraph callgraph_
void FastTimerService::preGlobalEndLumi ( edm::GlobalContext const &  gc)
private

Definition at line 1262 of file FastTimerService.cc.

References ignoredSignal().

1263 {
1264  ignoredSignal(__func__);
1265 }
void ignoredSignal(const std::string &signal) const
void FastTimerService::preGlobalEndRun ( edm::GlobalContext const &  gc)
private

Definition at line 1311 of file FastTimerService.cc.

References ignoredSignal().

1312 {
1313  ignoredSignal(__func__);
1314 }
void ignoredSignal(const std::string &signal) const
void FastTimerService::preModuleEvent ( edm::StreamContext const &  sc,
edm::ModuleCallingContext const &  mcc 
)
private

Definition at line 1721 of file FastTimerService.cc.

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

Referenced by FastTimerService().

1722 {
1723  unsigned int sid = sc.streamID().value();
1724  auto & stream = streams_[sid];
1725  thread().measure_and_accumulate(stream.overhead);
1726 }
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 1741 of file FastTimerService.cc.

References unsupportedSignal().

Referenced by FastTimerService().

1742 {
1743  unsupportedSignal(__func__);
1744 }
void unsupportedSignal(const std::string &signal) const
void FastTimerService::preModuleEventPrefetching ( edm::StreamContext const &  sc,
edm::ModuleCallingContext const &  mcc 
)
private

Definition at line 1753 of file FastTimerService.cc.

References ignoredSignal().

1754 {
1755  ignoredSignal(__func__);
1756 }
void ignoredSignal(const std::string &signal) const
void FastTimerService::preModuleGlobalBeginLumi ( edm::GlobalContext const &  gc,
edm::ModuleCallingContext const &  mcc 
)
private

Definition at line 1803 of file FastTimerService.cc.

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

Referenced by FastTimerService().

1804 {
1806 }
AtomicResources overhead_
void measure_and_accumulate(AtomicResources &store)
Measurement & thread()
void FastTimerService::preModuleGlobalBeginRun ( edm::GlobalContext const &  gc,
edm::ModuleCallingContext const &  mcc 
)
private

Definition at line 1777 of file FastTimerService.cc.

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

Referenced by FastTimerService().

1778 {
1780 }
AtomicResources overhead_
void measure_and_accumulate(AtomicResources &store)
Measurement & thread()
void FastTimerService::preModuleGlobalEndLumi ( edm::GlobalContext const &  gc,
edm::ModuleCallingContext const &  mcc 
)
private

Definition at line 1816 of file FastTimerService.cc.

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

Referenced by FastTimerService().

1817 {
1819 }
AtomicResources overhead_
void measure_and_accumulate(AtomicResources &store)
Measurement & thread()
void FastTimerService::preModuleGlobalEndRun ( edm::GlobalContext const &  gc,
edm::ModuleCallingContext const &  mcc 
)
private

Definition at line 1790 of file FastTimerService.cc.

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

Referenced by FastTimerService().

1791 {
1793 }
AtomicResources overhead_
void measure_and_accumulate(AtomicResources &store)
Measurement & thread()
void FastTimerService::preModuleStreamBeginLumi ( edm::StreamContext const &  sc,
edm::ModuleCallingContext const &  mcc 
)
private

Definition at line 1855 of file FastTimerService.cc.

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

Referenced by FastTimerService().

1856 {
1858 }
AtomicResources overhead_
void measure_and_accumulate(AtomicResources &store)
Measurement & thread()
void FastTimerService::preModuleStreamBeginRun ( edm::StreamContext const &  sc,
edm::ModuleCallingContext const &  mcc 
)
private

Definition at line 1829 of file FastTimerService.cc.

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

Referenced by FastTimerService().

1830 {
1832 }
AtomicResources overhead_
void measure_and_accumulate(AtomicResources &store)
Measurement & thread()
void FastTimerService::preModuleStreamEndLumi ( edm::StreamContext const &  sc,
edm::ModuleCallingContext const &  mcc 
)
private

Definition at line 1868 of file FastTimerService.cc.

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

Referenced by FastTimerService().

1869 {
1871 }
AtomicResources overhead_
void measure_and_accumulate(AtomicResources &store)
Measurement & thread()
void FastTimerService::preModuleStreamEndRun ( edm::StreamContext const &  sc,
edm::ModuleCallingContext const &  mcc 
)
private

Definition at line 1842 of file FastTimerService.cc.

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

Referenced by FastTimerService().

1843 {
1845 }
AtomicResources overhead_
void measure_and_accumulate(AtomicResources &store)
Measurement & thread()
void FastTimerService::prePathEvent ( edm::StreamContext const &  sc,
edm::PathContext const &  pc 
)
private

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

1686 {
1687  unsigned int sid = sc.streamID().value();
1688  unsigned int pid = callgraph_.processId(* sc.processContext());
1689  unsigned int id = pc.pathID();
1690  auto & stream = streams_[sid];
1691  auto & data = pc.isEndPath() ? stream.processes[pid].endpaths[id] : stream.processes[pid].paths[id];
1692  data.status = false;
1693  data.last = 0;
1694 }
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 1174 of file FastTimerService.cc.

References callgraph_, and ProcessCallGraph::preSourceConstruction().

Referenced by FastTimerService().

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

Definition at line 1656 of file FastTimerService.cc.

References streams_, subprocess_event_check_, and thread().

Referenced by FastTimerService().

1657 {
1658  // clear the event counters
1659  auto & stream = streams_[sid];
1660  stream.reset();
1661  ++stream.events;
1662 
1663  subprocess_event_check_[sid] = 0;
1664 
1665  // reuse the same measurement for the Source module and for the explicit begin of the Event
1666  auto & measurement = thread();
1667  measurement.measure_and_accumulate(stream.overhead);
1668  stream.event_measurement = measurement;
1669 }
std::vector< ResourcesPerJob > streams_
Measurement & thread()
std::unique_ptr< std::atomic< unsigned int >[]> subprocess_event_check_
void FastTimerService::preSourceLumi ( edm::LuminosityBlockIndex  index)
private

Definition at line 1352 of file FastTimerService.cc.

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

Referenced by FastTimerService().

1353 {
1355 }
AtomicResources overhead_
void measure_and_accumulate(AtomicResources &store)
Measurement & thread()
void FastTimerService::preSourceRun ( edm::RunIndex  index)
private

Definition at line 1340 of file FastTimerService.cc.

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

Referenced by FastTimerService().

1341 {
1343 }
AtomicResources overhead_
void measure_and_accumulate(AtomicResources &store)
Measurement & thread()
void FastTimerService::preStreamBeginLumi ( edm::StreamContext const &  sc)
private

Definition at line 1288 of file FastTimerService.cc.

References ignoredSignal().

Referenced by FastTimerService().

1289 {
1290  ignoredSignal(__func__);
1291 }
void ignoredSignal(const std::string &signal) const
void FastTimerService::preStreamBeginRun ( edm::StreamContext const &  sc)
private

Definition at line 1134 of file FastTimerService.cc.

References ignoredSignal().

Referenced by FastTimerService().

1135 {
1136  ignoredSignal(__func__);
1137 }
void ignoredSignal(const std::string &signal) const
void FastTimerService::preStreamEndLumi ( edm::StreamContext const &  sc)
private

Definition at line 1300 of file FastTimerService.cc.

References ignoredSignal().

1301 {
1302  ignoredSignal(__func__);
1303 }
void ignoredSignal(const std::string &signal) const
void FastTimerService::preStreamEndRun ( edm::StreamContext const &  sc)
private

Definition at line 1231 of file FastTimerService.cc.

References ignoredSignal().

1232 {
1233  ignoredSignal(__func__);
1234 }
void ignoredSignal(const std::string &signal) const
template<typename T >
void FastTimerService::printEvent ( T out,
ResourcesPerJob const &   
) const
private

Referenced by postEvent().

template<typename T >
void FastTimerService::printEvent ( T out,
ResourcesPerJob const &  data 
) const

Definition at line 1417 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.

1418 {
1419  printHeader(out, "Event");
1420  printEventHeader(out, "Modules");
1421  auto const& source_d = callgraph_.source();
1422  auto const& source = data.modules[source_d.id()];
1423  printEventLine(out, source.total, source_d.moduleLabel());
1424  for (unsigned int i = 0; i < callgraph_.processes().size(); ++i) {
1425  auto const& proc_d = callgraph_.processDescription(i);
1426  auto const& proc = data.processes[i];
1427  printEventLine(out, proc.total, "process " + proc_d.name_);
1428  for (unsigned int m: proc_d.modules_) {
1429  auto const& module_d = callgraph_.module(m);
1430  auto const& module = data.modules[m];
1431  printEventLine(out, module.total, " " + module_d.moduleLabel());
1432  }
1433  }
1434  printEventLine(out, data.total, "total");
1435  out << '\n';
1436  printEventHeader(out, "Processes and Paths");
1437  printEventLine(out, source.total, source_d.moduleLabel());
1438  for (unsigned int i = 0; i < callgraph_.processes().size(); ++i) {
1439  auto const& proc_d = callgraph_.processDescription(i);
1440  auto const& proc = data.processes[i];
1441  printEventLine(out, proc.total, "process " + proc_d.name_);
1442  for (unsigned int p = 0; p < proc.paths.size(); ++p) {
1443  auto const& name = proc_d.paths_[p].name_;
1444  auto const& path = proc.paths[p];
1445  printEventLine(out, path.active, name + " (only scheduled modules)");
1446  printEventLine(out, path.total, name + " (including dependencies)");
1447  }
1448  for (unsigned int p = 0; p < proc.endpaths.size(); ++p) {
1449  auto const& name = proc_d.endPaths_[p].name_;
1450  auto const& path = proc.endpaths[p];
1451  printEventLine(out, path.active, name + " (only scheduled modules)");
1452  printEventLine(out, path.total, name + " (including dependencies)");
1453  }
1454  }
1455  printEventLine(out, data.total, "total");
1456  out << '\n';
1457  for (unsigned int group: boost::irange(0ul, highlight_modules_.size())) {
1458  printEventHeader(out, "Highlighted modules");
1459  for (unsigned int m: highlight_modules_[group].modules) {
1460  auto const& module_d = callgraph_.module(m);
1461  auto const& module = data.modules[m];
1462  printEventLine(out, module.total, " " + module_d.moduleLabel());
1463  }
1464  printEventLine(out, data.highlight[group], highlight_modules_[group].label);
1465  out << '\n';
1466  }
1467 }
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

Referenced by printEvent(), and printTransition().

template<typename T >
void FastTimerService::printEventHeader ( T out,
std::string const &  label 
) const

Definition at line 1388 of file FastTimerService.cc.

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

Referenced by printEvent(), and printTransition().

template<typename T >
void FastTimerService::printEventLine ( T out,
AtomicResources const &  data,
std::string const &  label 
) const
private
template<typename T >
void FastTimerService::printEventLine ( T out,
Resources const &  data,
std::string const &  label 
) const

Definition at line 1395 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.

1396 {
1397  out << boost::format("FastReport %10.1f ms %10.1f ms %+10d kB %+10d kB %s\n")
1398  % ms(data.time_thread)
1399  % ms(data.time_real)
1400  % +static_cast<int64_t>(kB(data.allocated))
1401  % -static_cast<int64_t>(kB(data.deallocated))
1402  % label;
1403 }
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::printEventLine ( T out,
AtomicResources const &  data,
std::string const &  label 
) const

Definition at line 1406 of file FastTimerService.cc.

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

1407 {
1408  out << boost::format("FastReport %10.1f ms %10.1f ms %+10d kB %+10d kB %s\n")
1409  % ms(boost::chrono::nanoseconds(data.time_thread.load()))
1410  % ms(boost::chrono::nanoseconds(data.time_real.load()))
1411  % +static_cast<int64_t>(kB(data.allocated))
1412  % -static_cast<int64_t>(kB(data.deallocated))
1413  % label;
1414 }
format
Some error handling for the usage.
susybsm::MuonSegment ms
Definition: classes.h:31
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
boost::date_time::subsecond_duration< boost::posix_time::time_duration, 1000000000 > nanoseconds
template<typename T >
void FastTimerService::printHeader ( T out,
std::string const &  label 
) const
private
template<typename T >
void FastTimerService::printHeader ( T out,
std::string const &  label 
) const

Definition at line 1374 of file FastTimerService.cc.

References mps_fire::i.

1375 {
1376  out << "FastReport ";
1377  if (label.size() < 60)
1378  for (unsigned int i = (60-label.size()) / 2; i > 0; --i)
1379  out << '-';
1380  out << ' ' << label << " Summary ";
1381  if (label.size() < 60)
1382  for (unsigned int i = (59-label.size()) / 2; i > 0; --i)
1383  out << '-';
1384  out << '\n';
1385 }
template<typename T >
void FastTimerService::printPathSummaryHeader ( T out,
std::string const &  label 
) const
private

Referenced by printSummary().

template<typename T >
void FastTimerService::printPathSummaryHeader ( T out,
std::string const &  label 
) const

Definition at line 1482 of file FastTimerService.cc.

1483 {
1484  out << "FastReport CPU time sched. / depend. Real time sched. / depend. Alloc. sched. / depend. Dealloc. sched. / depend. ";
1485  // FastReport ########.# ms ########.# ms ########.# ms ########.# ms +######### kB +######### kB -######### kB -######### kB ...
1486  out << label << '\n';
1487 }
template<typename T >
void FastTimerService::printPathSummaryLine ( T out,
Resources const &  data,
Resources const &  total,
uint64_t  events,
std::string const &  label 
) const
private

Referenced by printSummary().

template<typename T >
void FastTimerService::printPathSummaryLine ( T out,
Resources const &  data,
Resources const &  total,
uint64_t  events,
std::string const &  label 
) const

Definition at line 1512 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.

1513 {
1514  out << boost::format("FastReport %10.1f ms %10.1f ms %10.1f ms %10.1f ms %+10d kB %+10d kB %+10d kB %+10d kB %s\n")
1515  % (events ? ms(data.time_thread) / events : 0) % (events ? ms(total.time_thread) / events : 0)
1516  % (events ? ms(data.time_real) / events : 0) % (events ? ms(total.time_real) / events : 0)
1517  % (events ? +static_cast<int64_t>(kB(data.allocated) / events) : 0) % (events ? +static_cast<int64_t>(kB(total.allocated) / events) : 0)
1518  % (events ? -static_cast<int64_t>(kB(data.deallocated) / events) : 0) % (events ? -static_cast<int64_t>(kB(total.deallocated) / events) : 0)
1519  % label;
1520 }
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::printSummary ( T out,
ResourcesPerJob const &  data,
std::string const &  label 
) const
private

Referenced by postEndJob(), and postGlobalEndRun().

template<typename T >
void FastTimerService::printSummary ( T out,
ResourcesPerJob const &  data,
std::string const &  label 
) const

Definition at line 1523 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(), printPathSummaryHeader(), printPathSummaryLine(), printSummaryHeader(), printSummaryLine(), proc, ProcessCallGraph::processDescription(), ProcessCallGraph::processes(), FastTimerService::ResourcesPerJob::processes, source, ProcessCallGraph::source(), and FastTimerService::ResourcesPerJob::total.

1524 {
1525  printHeader(out, label);
1526  printSummaryHeader(out, "Modules", true);
1527  auto const& source_d = callgraph_.source();
1528  auto const& source = data.modules[source_d.id()];
1529  printSummaryLine(out, source.total, data.events, source.events, source_d.moduleLabel());
1530  for (unsigned int i = 0; i < callgraph_.processes().size(); ++i) {
1531  auto const& proc_d = callgraph_.processDescription(i);
1532  auto const& proc = data.processes[i];
1533  printSummaryLine(out, proc.total, data.events, "process " + proc_d.name_);
1534  for (unsigned int m: proc_d.modules_) {
1535  auto const& module_d = callgraph_.module(m);
1536  auto const& module = data.modules[m];
1537  printSummaryLine(out, module.total, data.events, module.events, " " + module_d.moduleLabel());
1538  }
1539  }
1540  printSummaryLine(out, data.total, data.events, "total");
1541  out << '\n';
1542  printPathSummaryHeader(out, "Processes and Paths");
1543  printSummaryLine(out, source.total, data.events, source_d.moduleLabel());
1544  for (unsigned int i = 0; i < callgraph_.processes().size(); ++i) {
1545  auto const& proc_d = callgraph_.processDescription(i);
1546  auto const& proc = data.processes[i];
1547  printSummaryLine(out, proc.total, data.events, "process " + proc_d.name_);
1548  for (unsigned int p = 0; p < proc.paths.size(); ++p) {
1549  auto const& name = proc_d.paths_[p].name_;
1550  auto const& path = proc.paths[p];
1551  printPathSummaryLine(out, path.active, path.total, data.events, " " + name);
1552  }
1553  for (unsigned int p = 0; p < proc.endpaths.size(); ++p) {
1554  auto const& name = proc_d.endPaths_[p].name_;
1555  auto const& path = proc.endpaths[p];
1556  printPathSummaryLine(out, path.active, path.total, data.events, " " + name);
1557  }
1558  }
1559  printSummaryLine(out, data.total, data.events, "total");
1560  out << '\n';
1561  for (unsigned int group: boost::irange(0ul, highlight_modules_.size())) {
1562  printSummaryHeader(out, "Highlighted modules", true);
1563  for (unsigned int m: highlight_modules_[group].modules) {
1564  auto const& module_d = callgraph_.module(m);
1565  auto const& module = data.modules[m];
1566  printSummaryLine(out, module.total, data.events, module.events, module_d.moduleLabel());
1567  }
1568  printSummaryLine(out, data.highlight[group], data.events, highlight_modules_[group].label);
1569  out << '\n';
1570  }
1571 }
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 printPathSummaryHeader(T &out, std::string const &label) const
void printSummaryHeader(T &out, std::string const &label, bool detailed) 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
void printPathSummaryLine(T &out, Resources const &data, Resources const &total, 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  detailed 
) const
private

Referenced by printSummary().

template<typename T >
void FastTimerService::printSummaryHeader ( T out,
std::string const &  label,
bool  detailed 
) const

Definition at line 1470 of file FastTimerService.cc.

1471 {
1472  if (detailed)
1473  out << "FastReport CPU time avg. when run Real time avg. when run Alloc. avg. when run Dealloc. avg. when run ";
1474  // FastReport ########.# ms ########.# ms ########.# ms ########.# ms +######### kB +######### kB -######### kB -######### kB ...
1475  else
1476  out << "FastReport CPU time avg. Real time avg. Alloc. avg. Dealloc. avg. ";
1477  // FastReport ########.# ms ########.# ms +######### kB -######### kB ...
1478  out << label << '\n';
1479 }
template<typename T >
void FastTimerService::printSummaryLine ( T out,
Resources const &  data,
uint64_t  events,
std::string const &  label 
) const
private

Referenced by printSummary().

template<typename T >
void FastTimerService::printSummaryLine ( T out,
Resources const &  data,
uint64_t  events,
uint64_t  active,
std::string const &  label 
) const
private
template<typename T >
void FastTimerService::printSummaryLine ( T out,
Resources const &  data,
uint64_t  events,
std::string const &  label 
) const

Definition at line 1490 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.

1491 {
1492  out << boost::format("FastReport %10.1f ms %10.1f ms %+10d kB %+10d kB %s\n")
1493  % (events ? ms(data.time_thread) / events : 0)
1494  % (events ? ms(data.time_real) / events : 0)
1495  % (events ? +static_cast<int64_t>(kB(data.allocated) / events) : 0)
1496  % (events ? -static_cast<int64_t>(kB(data.deallocated) / events) : 0)
1497  % label;
1498 }
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

Definition at line 1501 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.

1502 {
1503  out << boost::format("FastReport %10.1f ms %10.1f ms %10.1f ms %10.1f ms %+10d kB %+10d kB %+10d kB %+10d kB %s\n")
1504  % (events ? ms(data.time_thread) / events : 0) % (active ? ms(data.time_thread) / active : 0)
1505  % (events ? ms(data.time_real) / events : 0) % (active ? ms(data.time_real) / active : 0)
1506  % (events ? +static_cast<int64_t>(kB(data.allocated) / events) : 0) % (active ? +static_cast<int64_t>(kB(data.allocated) / active) : 0)
1507  % (events ? -static_cast<int64_t>(kB(data.deallocated) / events) : 0) % (active ? -static_cast<int64_t>(kB(data.deallocated) / active) : 0)
1508  % label;
1509 }
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::printTransition ( T out,
AtomicResources const &  data,
std::string const &  label 
) const
private
template<typename T >
void FastTimerService::printTransition ( T out,
AtomicResources const &  data,
std::string const &  label 
) const

Definition at line 1574 of file FastTimerService.cc.

References isFirstSubprocess(), edm::ProcessContext::isSubProcess(), printEventHeader(), printEventLine(), edm::GlobalContext::processContext(), edm::StreamContext::processContext(), and SimDataFormats::CaloAnalysis::sc.

1575 {
1576  printEventHeader(out, "Transition");
1578 }
void printEventHeader(T &out, std::string const &label) const
void printEventLine(T &out, Resources const &data, std::string const &label) const
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
double FastTimerService::queryEventTime ( edm::StreamID  ) const

Referenced by querySourceTime().

double FastTimerService::queryEventTime ( edm::StreamID  ,
std::string const &  process 
) const
double FastTimerService::queryHighlightTime ( edm::StreamID  sid,
std::string const &  label 
) const

Definition at line 1064 of file FastTimerService.cc.

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

1065 {
1066  auto const& stream = streams_[sid];
1067  for (unsigned int group: boost::irange(0ul, highlight_modules_.size()))
1069  return ms(stream.highlight[group].time_real);
1070 
1071  // FIXME issue a LogWarning, raise an exception, or return NaN
1072  return 0.;
1073 }
std::vector< GroupOfModules > highlight_modules_
std::vector< ResourcesPerJob > streams_
susybsm::MuonSegment ms
Definition: classes.h:31
double FastTimerService::queryModuleTime ( edm::StreamID  ,
const edm::ModuleDescription module 
) const

Referenced by querySourceTime().

double FastTimerService::queryModuleTime ( edm::StreamID  ,
unsigned int  id 
) const
double FastTimerService::queryModuleTime_ ( edm::StreamID  sid,
unsigned int  id 
) const
private

Definition at line 960 of file FastTimerService.cc.

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

Referenced by querySourceTime().

961 {
962  // private version, assume "id" is valid
963  auto const& stream = streams_[sid];
964  auto const& module = stream.modules[id];
965  return ms(module.total.time_real);
966 }
std::vector< ResourcesPerJob > streams_
susybsm::MuonSegment ms
Definition: classes.h:31
Definition: vlib.h:208
double FastTimerService::queryModuleTimeByLabel ( edm::StreamID  ,
std::string const &  module 
) const
double FastTimerService::queryModuleTimeByLabel ( edm::StreamID  ,
std::string const &  process,
const std::string &  module 
) const
double FastTimerService::queryPathTime ( edm::StreamID  ,
std::string const &  path 
) const

Referenced by querySourceTime().

double FastTimerService::queryPathTime ( edm::StreamID  ,
std::string const &  process,
std::string const &  path 
) const
double FastTimerService::querySourceTime ( edm::StreamID  sid) const
FastTimerService::Measurement & FastTimerService::thread ( )
private
void FastTimerService::unsupportedSignal ( const std::string &  signal) const
private

Definition at line 1083 of file FastTimerService.cc.

References unsupported_signals_.

Referenced by postModuleEventDelayedGet(), and preModuleEventDelayedGet().

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

Member Data Documentation

ProcessCallGraph FastTimerService::callgraph_
private
unsigned int FastTimerService::concurrent_lumis_
private

Definition at line 443 of file FastTimerService.h.

Referenced by preallocate().

unsigned int FastTimerService::concurrent_runs_
private

Definition at line 444 of file FastTimerService.h.

Referenced by postBeginJob(), and preallocate().

unsigned int FastTimerService::concurrent_streams_
private

Definition at line 445 of file FastTimerService.h.

Referenced by postBeginJob(), and preallocate().

unsigned int FastTimerService::concurrent_threads_
private

Definition at line 446 of file FastTimerService.h.

Referenced by preallocate().

const PlotRanges FastTimerService::dqm_event_ranges_
private

Definition at line 461 of file FastTimerService.h.

Referenced by preGlobalBeginRun().

const unsigned int FastTimerService::dqm_lumisections_range_
private

Definition at line 464 of file FastTimerService.h.

Referenced by FastTimerService(), and preGlobalBeginRun().

const PlotRanges FastTimerService::dqm_module_ranges_
private

Definition at line 463 of file FastTimerService.h.

Referenced by FastTimerService(), and preGlobalBeginRun().

std::string FastTimerService::dqm_path_
private

Definition at line 465 of file FastTimerService.h.

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

const PlotRanges FastTimerService::dqm_path_ranges_
private

Definition at line 462 of file FastTimerService.h.

Referenced by FastTimerService(), and preGlobalBeginRun().

bool FastTimerService::enable_dqm_
private

Definition at line 454 of file FastTimerService.h.

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

const bool FastTimerService::enable_dqm_byls_
private

Definition at line 457 of file FastTimerService.h.

Referenced by preGlobalBeginRun().

const bool FastTimerService::enable_dqm_bymodule_
private

Definition at line 455 of file FastTimerService.h.

Referenced by preGlobalBeginRun().

const bool FastTimerService::enable_dqm_bynproc_
private

Definition at line 458 of file FastTimerService.h.

Referenced by preallocate().

const bool FastTimerService::enable_dqm_bypath_
private

Definition at line 456 of file FastTimerService.h.

Referenced by preGlobalBeginRun().

const bool FastTimerService::enable_dqm_transitions_
private

Definition at line 459 of file FastTimerService.h.

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

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

Definition at line 468 of file FastTimerService.h.

Referenced by FastTimerService(), and postBeginJob().

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

Definition at line 426 of file FastTimerService.h.

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

std::vector<AtomicResources> FastTimerService::lumi_transition_
private
AtomicResources FastTimerService::overhead_
private
std::unique_ptr<PlotsPerJob> FastTimerService::plots_
private
const bool FastTimerService::print_event_summary_
private

Definition at line 449 of file FastTimerService.h.

Referenced by postEvent().

const bool FastTimerService::print_job_summary_
private

Definition at line 451 of file FastTimerService.h.

Referenced by postEndJob().

const bool FastTimerService::print_run_summary_
private

Definition at line 450 of file FastTimerService.h.

Referenced by postGlobalEndRun().

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

Definition at line 427 of file FastTimerService.h.

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

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

Definition at line 435 of file FastTimerService.h.

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

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

Definition at line 436 of file FastTimerService.h.

Referenced by postGlobalEndLumi(), preallocate(), and preGlobalBeginLumi().

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

Definition at line 437 of file FastTimerService.h.

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

std::mutex FastTimerService::summary_mutex_
private

Definition at line 428 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 432 of file FastTimerService.h.

Referenced by thread().

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

Definition at line 472 of file FastTimerService.h.

Referenced by unsupportedSignal().