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
 
struct  ThreadGuard
 

Public Member Functions

template<typename T >
json encodeToJSON (std::string const &type, std::string const &label, unsigned int events, T const &data) const
 
 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, AtomicResources const &data, uint64_t events, uint64_t active, std::string const &label) const
 
template<typename T >
void printSummaryLine (T &out, AtomicResources 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
 
 ~FastTimerService () override=default
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
static void fixForDQM (std::string &label)
 

Private Member Functions

template<typename T >
json encodeToJSON (std::string const &type, std::string const &label, unsigned int events, T const &data) const
 
json encodeToJSON (edm::ModuleDescription const &module, ResourcesPerModule const &data) const
 
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 postESModule (edm::eventsetup::EventSetupRecordKey const &, edm::ESModuleCallingContext const &)
 
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 postModuleEventAcquire (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 preESModule (edm::eventsetup::EventSetupRecordKey const &, edm::ESModuleCallingContext 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 preModuleEventAcquire (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 printSummaryLine (T &out, AtomicResources const &data, uint64_t events, std::string const &label) const
 
template<typename T >
void printSummaryLine (T &out, AtomicResources 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
 
Measurementthread ()
 
void unsupportedSignal (const std::string &signal) const
 
void writeSummaryJSON (ResourcesPerJob const &data, std::string const &filename) 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_
 
ThreadGuard guard_
 
std::vector< edm::ParameterSethighlight_module_psets_
 
std::vector< GroupOfModuleshighlight_modules_
 
ResourcesPerJob job_summary_
 
const std::string json_filename_
 
std::vector< AtomicResourceslumi_transition_
 
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::concurrent_unordered_set< std::string > unsupported_signals_
 
const bool write_json_summary_
 

Detailed Description

Definition at line 55 of file FastTimerService.h.

Constructor & Destructor Documentation

◆ FastTimerService()

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

Definition at line 778 of file FastTimerService.cc.

779  : // configuration
780  callgraph_(),
781  // job configuration
783  concurrent_runs_(0),
786  print_event_summary_(config.getUntrackedParameter<bool>("printEventSummary")),
787  print_run_summary_(config.getUntrackedParameter<bool>("printRunSummary")),
788  print_job_summary_(config.getUntrackedParameter<bool>("printJobSummary")),
789  // JSON configuration
790  //write_json_per_event_(config.getUntrackedParameter<bool>("writeJSONByEvent")),
791  //write_json_per_ls_(config.getUntrackedParameter<bool>("writeJSONByLumiSection")),
792  //write_json_per_run_(config.getUntrackedParameter<bool>("writeJSONByRun")),
793  write_json_summary_(config.getUntrackedParameter<bool>("writeJSONSummary")),
794  json_filename_(config.getUntrackedParameter<std::string>("jsonFileName")),
795  // DQM configuration
796  enable_dqm_(config.getUntrackedParameter<bool>("enableDQM")),
797  enable_dqm_bymodule_(config.getUntrackedParameter<bool>("enableDQMbyModule")),
798  enable_dqm_bypath_(config.getUntrackedParameter<bool>("enableDQMbyPath")),
799  enable_dqm_byls_(config.getUntrackedParameter<bool>("enableDQMbyLumiSection")),
800  enable_dqm_bynproc_(config.getUntrackedParameter<bool>("enableDQMbyProcesses")),
801  enable_dqm_transitions_(config.getUntrackedParameter<bool>("enableDQMTransitions")),
802  dqm_event_ranges_({config.getUntrackedParameter<double>("dqmTimeRange"), // ms
803  config.getUntrackedParameter<double>("dqmTimeResolution"), // ms
804  config.getUntrackedParameter<double>("dqmMemoryRange"), // kB
805  config.getUntrackedParameter<double>("dqmMemoryResolution")}), // kB
806  dqm_path_ranges_({config.getUntrackedParameter<double>("dqmPathTimeRange"), // ms
807  config.getUntrackedParameter<double>("dqmPathTimeResolution"), // ms
808  config.getUntrackedParameter<double>("dqmPathMemoryRange"), // kB
809  config.getUntrackedParameter<double>("dqmPathMemoryResolution")}), // kB
810  dqm_module_ranges_({config.getUntrackedParameter<double>("dqmModuleTimeRange"), // ms
811  config.getUntrackedParameter<double>("dqmModuleTimeResolution"), // ms
812  config.getUntrackedParameter<double>("dqmModuleMemoryRange"), // kB
813  config.getUntrackedParameter<double>("dqmModuleMemoryResolution")}), // kB
814  dqm_lumisections_range_(config.getUntrackedParameter<unsigned int>("dqmLumiSectionsRange")),
815  dqm_path_(config.getUntrackedParameter<std::string>("dqmPath")),
816  // highlight configuration
817  highlight_module_psets_(config.getUntrackedParameter<std::vector<edm::ParameterSet>>("highlightModules")),
818  highlight_modules_(highlight_module_psets_.size()) // filled in postBeginJob()
819 {
820  // start observing when a thread enters or leaves the TBB global thread arena
821  tbb::task_scheduler_observer::observe();
822 
823  // register EDM call backs
829  //registry.watchPostGlobalBeginRun( this, & FastTimerService::postGlobalBeginRun );
830  //registry.watchPreGlobalEndRun( this, & FastTimerService::preGlobalEndRun );
833  //registry.watchPostStreamBeginRun( this, & FastTimerService::postStreamBeginRun );
834  //registry.watchPreStreamEndRun( this, & FastTimerService::preStreamEndRun );
837  //registry.watchPostGlobalBeginLumi( this, & FastTimerService::postGlobalBeginLumi );
838  //registry.watchPreGlobalEndLumi( this, & FastTimerService::preGlobalEndLumi );
841  //registry.watchPostStreamBeginLumi( this, & FastTimerService::postStreamBeginLumi );
842  //registry.watchPreStreamEndLumi( this, & FastTimerService::preStreamEndLumi );
844  registry.watchPreEvent(this, &FastTimerService::preEvent);
849  //registry.watchPostSourceConstruction( this, & FastTimerService::postSourceConstruction);
856  //registry.watchPreModuleConstruction( this, & FastTimerService::preModuleConstruction);
857  //registry.watchPostModuleConstruction( this, & FastTimerService::postModuleConstruction);
858  //registry.watchPreModuleBeginJob( this, & FastTimerService::preModuleBeginJob );
859  //registry.watchPostModuleBeginJob( this, & FastTimerService::postModuleBeginJob );
860  //registry.watchPreModuleEndJob( this, & FastTimerService::preModuleEndJob );
861  //registry.watchPostModuleEndJob( this, & FastTimerService::postModuleEndJob );
862  //registry.watchPreModuleBeginStream( this, & FastTimerService::preModuleBeginStream );
863  //registry.watchPostModuleBeginStream( this, & FastTimerService::postModuleBeginStream );
864  //registry.watchPreModuleEndStream( this, & FastTimerService::preModuleEndStream );
865  //registry.watchPostModuleEndStream( this, & FastTimerService::postModuleEndStream );
882  //registry.watchPreModuleEventPrefetching( this, & FastTimerService::preModuleEventPrefetching );
883  //registry.watchPostModuleEventPrefetching( this, & FastTimerService::postModuleEventPrefetching );
894 }
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)
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 preEventReadFromSource(edm::StreamContext 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 postEventReadFromSource(edm::StreamContext const &, edm::ModuleCallingContext const &)
void watchPreESModule(PreESModule::slot_type const &iSlot)
void watchPreModuleEventAcquire(PreModuleEventAcquire::slot_type const &iSlot)
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_
const bool write_json_summary_
void watchPreModuleEvent(PreModuleEvent::slot_type const &iSlot)
void watchPostEvent(PostEvent::slot_type const &iSlot)
void preESModule(edm::eventsetup::EventSetupRecordKey const &, edm::ESModuleCallingContext const &)
const std::string json_filename_
void watchPreSourceConstruction(PreSourceConstruction::slot_type const &iSlot)
const bool enable_dqm_bynproc_
void postESModule(edm::eventsetup::EventSetupRecordKey const &, edm::ESModuleCallingContext const &)
unsigned int concurrent_runs_
void watchPostStreamEndLumi(PostStreamEndLumi::slot_type const &iSlot)
void watchPreGlobalBeginLumi(PreGlobalBeginLumi::slot_type const &iSlot)
void watchPreEventReadFromSource(PreEventReadFromSource::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)
Definition: config.py:1
void postPathEvent(edm::StreamContext const &, edm::PathContext const &, edm::HLTPathStatus const &)
void preModuleGlobalBeginLumi(edm::GlobalContext const &, edm::ModuleCallingContext const &)
void watchPostESModule(PostESModule::slot_type const &iSlot)
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 &)
void watchPostModuleEventAcquire(PostModuleEventAcquire::slot_type const &iSlot)
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 postModuleEventAcquire(edm::StreamContext const &, edm::ModuleCallingContext const &)
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 watchPostEventReadFromSource(PostEventReadFromSource::slot_type const &iSlot)
void watchPostModuleGlobalBeginRun(PostModuleGlobalBeginRun::slot_type const &iSlot)
void preGlobalBeginLumi(edm::GlobalContext const &)
void preSourceConstruction(edm::ModuleDescription const &)
void preModuleEventAcquire(edm::StreamContext const &, edm::ModuleCallingContext 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::~FastTimerService ( )
overridedefault

Member Function Documentation

◆ encodeToJSON() [1/3]

template<typename T >
json FastTimerService::encodeToJSON ( std::string const &  type,
std::string const &  label,
unsigned int  events,
T const &  data 
) const
private

◆ encodeToJSON() [2/3]

json FastTimerService::encodeToJSON ( edm::ModuleDescription const &  module,
ResourcesPerModule const &  data 
) const
private

Definition at line 1402 of file FastTimerService.cc.

References data.

1402  {
1403  return encodeToJSON(module.moduleName(), module.moduleLabel(), data.events, data.total);
1404 }
json encodeToJSON(std::string const &type, std::string const &label, unsigned int events, T const &data) const
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80

◆ encodeToJSON() [3/3]

template<typename T >
json FastTimerService::encodeToJSON ( std::string const &  type,
std::string const &  label,
unsigned int  events,
T const &  data 
) const

Definition at line 1389 of file FastTimerService.cc.

References data, events, and label.

1392  {
1393  return json{{"type", type},
1394  {"label", label},
1395  {"events", events},
1396  {"time_thread", ms(data.time_thread)},
1397  {"time_real", ms(data.time_real)},
1398  {"mem_alloc", kB(data.allocated)},
1399  {"mem_free", kB(data.deallocated)}};
1400 }
nlohmann::json json
char const * label
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
int events

◆ fillDescriptions()

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

Definition at line 1803 of file FastTimerService.cc.

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

1803  {
1805  desc.addUntracked<bool>("printEventSummary", false);
1806  desc.addUntracked<bool>("printRunSummary", true);
1807  desc.addUntracked<bool>("printJobSummary", true);
1808  // JSON configuration
1809  //desc.addUntracked<bool>("writeJSONByEvent", false);
1810  //desc.addUntracked<bool>("writeJSONByLumiSection", false);
1811  //desc.addUntracked<bool>("writeJSONByRun", false);
1812  desc.addUntracked<bool>("writeJSONSummary", false);
1813  desc.addUntracked<std::string>("jsonFileName", "resources.json");
1814  // DQM configuration
1815  desc.addUntracked<bool>("enableDQM", true);
1816  desc.addUntracked<bool>("enableDQMbyModule", false);
1817  desc.addUntracked<bool>("enableDQMbyPath", false);
1818  desc.addUntracked<bool>("enableDQMbyLumiSection", false);
1819  desc.addUntracked<bool>("enableDQMbyProcesses", false);
1820  desc.addUntracked<bool>("enableDQMTransitions", false);
1821  desc.addUntracked<double>("dqmTimeRange", 1000.); // ms
1822  desc.addUntracked<double>("dqmTimeResolution", 5.); // ms
1823  desc.addUntracked<double>("dqmMemoryRange", 1000000.); // kB
1824  desc.addUntracked<double>("dqmMemoryResolution", 5000.); // kB
1825  desc.addUntracked<double>("dqmPathTimeRange", 100.); // ms
1826  desc.addUntracked<double>("dqmPathTimeResolution", 0.5); // ms
1827  desc.addUntracked<double>("dqmPathMemoryRange", 1000000.); // kB
1828  desc.addUntracked<double>("dqmPathMemoryResolution", 5000.); // kB
1829  desc.addUntracked<double>("dqmModuleTimeRange", 40.); // ms
1830  desc.addUntracked<double>("dqmModuleTimeResolution", 0.2); // ms
1831  desc.addUntracked<double>("dqmModuleMemoryRange", 100000.); // kB
1832  desc.addUntracked<double>("dqmModuleMemoryResolution", 500.); // kB
1833  desc.addUntracked<unsigned>("dqmLumiSectionsRange", 2500); // ~ 16 hours
1834  desc.addUntracked<std::string>("dqmPath", "HLT/TimerService");
1835 
1836  edm::ParameterSetDescription highlightModulesDescription;
1837  highlightModulesDescription.addUntracked<std::vector<std::string>>("modules", {});
1838  highlightModulesDescription.addUntracked<std::string>("label", "producers");
1839  desc.addVPSetUntracked("highlightModules", highlightModulesDescription, {});
1840 
1841  // # OBSOLETE - these parameters are ignored, they are left only not to break old configurations
1842  // they will not be printed in the generated cfi.py file
1843  desc.addOptionalNode(edm::ParameterDescription<bool>("useRealTimeClock", true, false), false)
1844  ->setComment("This parameter is obsolete and will be ignored.");
1845  desc.addOptionalNode(edm::ParameterDescription<bool>("enableTimingPaths", true, false), false)
1846  ->setComment("This parameter is obsolete and will be ignored.");
1847  desc.addOptionalNode(edm::ParameterDescription<bool>("enableTimingModules", true, false), false)
1848  ->setComment("This parameter is obsolete and will be ignored.");
1849  desc.addOptionalNode(edm::ParameterDescription<bool>("enableTimingExclusive", false, false), false)
1850  ->setComment("This parameter is obsolete and will be ignored.");
1851  desc.addOptionalNode(edm::ParameterDescription<bool>("enableTimingSummary", false, false), false)
1852  ->setComment("This parameter is obsolete and will be ignored.");
1853  desc.addOptionalNode(edm::ParameterDescription<bool>("skipFirstPath", false, false), false)
1854  ->setComment("This parameter is obsolete and will be ignored.");
1855  desc.addOptionalNode(edm::ParameterDescription<bool>("enableDQMbyPathActive", false, false), false)
1856  ->setComment("This parameter is obsolete and will be ignored.");
1857  desc.addOptionalNode(edm::ParameterDescription<bool>("enableDQMbyPathTotal", true, false), false)
1858  ->setComment("This parameter is obsolete and will be ignored.");
1859  desc.addOptionalNode(edm::ParameterDescription<bool>("enableDQMbyPathOverhead", false, false), false)
1860  ->setComment("This parameter is obsolete and will be ignored.");
1861  desc.addOptionalNode(edm::ParameterDescription<bool>("enableDQMbyPathDetails", false, false), false)
1862  ->setComment("This parameter is obsolete and will be ignored.");
1863  desc.addOptionalNode(edm::ParameterDescription<bool>("enableDQMbyPathCounters", true, false), false)
1864  ->setComment("This parameter is obsolete and will be ignored.");
1865  desc.addOptionalNode(edm::ParameterDescription<bool>("enableDQMbyPathExclusive", false, false), false)
1866  ->setComment("This parameter is obsolete and will be ignored.");
1867  desc.addOptionalNode(edm::ParameterDescription<bool>("enableDQMbyModuleType", false, false), false)
1868  ->setComment("This parameter is obsolete and will be ignored.");
1869  desc.addOptionalNode(edm::ParameterDescription<bool>("enableDQMSummary", false, false), false)
1870  ->setComment("This parameter is obsolete and will be ignored.");
1871 
1872  descriptions.add("FastTimerService", desc);
1873 }
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ fixForDQM()

void FastTimerService::fixForDQM ( std::string &  label)
static

Definition at line 951 of file FastTimerService.cc.

References HltBtagPostValidation_cff::c, label, and alignCSCRings::s.

Referenced by FastTimerService::PlotsPerPath::book(), and FastTimerService::PlotsPerJob::book().

951  {
952  // clean characters that are deemed unsafe for DQM
953  // see the definition of `s_safe` in DQMServices/Core/src/DQMStore.cc
954  static const auto safe_for_dqm = "/ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+=_()# "s;
955  for (auto& c : label)
956  if (safe_for_dqm.find(c) == std::string::npos)
957  c = '_';
958 }
char const * label

◆ ignoredSignal()

void FastTimerService::ignoredSignal ( const std::string &  signal) const
private

Definition at line 896 of file FastTimerService.cc.

References LogDebug.

896  {
897  LogDebug("FastTimerService") << "The FastTimerService received is currently not monitoring the signal \"" << signal
898  << "\".\n";
899 }
#define LogDebug(id)

◆ isFirstSubprocess() [1/2]

bool FastTimerService::isFirstSubprocess ( edm::StreamContext const &  )
private

◆ isFirstSubprocess() [2/2]

bool FastTimerService::isFirstSubprocess ( edm::GlobalContext const &  )
private

◆ isLastSubprocess()

bool FastTimerService::isLastSubprocess ( std::atomic< unsigned int > &  check)
private

Definition at line 1448 of file FastTimerService.cc.

References RPCNoise_example::check.

1448  {
1449  // release-acquire semantic guarantees that all writes in this and other threads are visible
1450  // after this operation; full sequentially-consistent ordering is (probably) not needed.
1451  unsigned int old_value = check.fetch_add(1, std::memory_order_acq_rel);
1452  return (old_value == callgraph_.processes().size() - 1);
1453 }
std::vector< ProcessType > const & processes() const
ProcessCallGraph callgraph_

◆ on_scheduler_entry()

void FastTimerService::on_scheduler_entry ( bool  worker)
finalprivate

Definition at line 1778 of file FastTimerService.cc.

References guard_, FastTimerService::ResourcesPerJob::idle, job_summary_, FastTimerService::Measurement::measure(), FastTimerService::ThreadGuard::register_thread(), and thread().

1778  {
1779  // The AtomicResources passed to register_thread are used to account the resources
1780  // used or freed by the thread after the last active measurement and before leaving the TBB pool.
1782  // initialise the measurement point for a thread that has newly joined the TBB pool
1783  thread().measure();
1784  } else {
1785  // An existing thread is re-joining the TBB pool.
1786  // Note: unsure whether the resources used outside of the TBB pool should be
1787  // - not accounted: thread().measure()
1788  // - considered as idle: thread().measure_and_accumulate(job_summary_.idle)
1789  // - considered as other: thread().measure_and_accumulate(job_summary_.overhead)
1790  // FIXME "considered as other" has been seen to produce unreliable results; revert to "not accounted" for the time being.
1791  thread().measure();
1792  }
1793 }
ResourcesPerJob job_summary_
Measurement & thread()
bool register_thread(FastTimerService::AtomicResources &r)

◆ on_scheduler_exit()

void FastTimerService::on_scheduler_exit ( bool  worker)
finalprivate

Definition at line 1795 of file FastTimerService.cc.

References FastTimerService::ResourcesPerJob::idle, job_summary_, FastTimerService::Measurement::measure_and_accumulate(), and thread().

1795  {
1796  // Account for the resources used or freed by the thread after the last active measurement and before leaving the TBB pool.
1798 }
ResourcesPerJob job_summary_
Measurement & thread()
void measure_and_accumulate(Resources &store) noexcept

◆ postBeginJob()

void FastTimerService::postBeginJob ( )
private

Definition at line 998 of file FastTimerService.cc.

References watchdog::group, mps_fire::i, label, SummaryClient_cfi::labels, LogMessageMonitor_cff::modules, jetUpdater_cfi::sort, AlCaHLTBitMon_QueryRunRegistry::string, and groupFilesInBlocks::temp.

998  {
999  unsigned int modules = callgraph_.size();
1000 
1001  // module highlights
1002  for (unsigned int group : boost::irange(0ul, highlight_module_psets_.size())) {
1003  // copy and sort for faster search via std::binary_search
1004  auto labels = highlight_module_psets_[group].getUntrackedParameter<std::vector<std::string>>("modules");
1005  std::sort(labels.begin(), labels.end());
1006 
1007  highlight_modules_[group].label = highlight_module_psets_[group].getUntrackedParameter<std::string>("label");
1008  highlight_modules_[group].modules.reserve(labels.size());
1009  // convert the module labels in module ids
1010  for (unsigned int i = 0; i < modules; ++i) {
1011  auto const& label = callgraph_.module(i).moduleLabel();
1012  if (std::binary_search(labels.begin(), labels.end(), label))
1013  highlight_modules_[group].modules.push_back(i);
1014  }
1015  }
1016  highlight_module_psets_.clear();
1017 
1018  // allocate the resource counters for each stream, process, path and module
1019  ResourcesPerJob temp(callgraph_, highlight_modules_);
1022  job_summary_ = temp;
1023 
1024  // check that the DQMStore service is available
1025  if (enable_dqm_ and not edm::Service<dqm::legacy::DQMStore>().isAvailable()) {
1026  // the DQMStore is not available, disable all DQM plots
1027  enable_dqm_ = false;
1028  edm::LogWarning("FastTimerService") << "The DQMStore is not avalable, the DQM plots will not be generated";
1029  }
1030 
1031  // allocate the structures to hold pointers to the DQM plots
1032  if (enable_dqm_) {
1033  plots_ = std::make_unique<PlotsPerJob>(callgraph_, highlight_modules_);
1034  }
1035 }
std::vector< edm::ParameterSet > highlight_module_psets_
std::vector< GroupOfModules > highlight_modules_
ResourcesPerJob job_summary_
unsigned int concurrent_runs_
std::vector< ResourcesPerJob > streams_
edm::ModuleDescription const & module(unsigned int module) const
char const * label
std::vector< ResourcesPerJob > run_summary_
unsigned int size() const
std::unique_ptr< PlotsPerJob > plots_
Log< level::Warning, false > LogWarning
ProcessCallGraph callgraph_
std::string const & moduleLabel() const
unsigned int concurrent_streams_

◆ postEndJob()

void FastTimerService::postEndJob ( )
private

Definition at line 1120 of file FastTimerService.cc.

References MillePedeFileConverter_cfg::out, and SiStripPI::printSummary().

1120  {
1121  // stop observing to avoid potential race conditions at exit
1122  tbb::task_scheduler_observer::observe(false);
1123  guard_.finalize();
1124  // print the job summaries
1125  if (print_job_summary_) {
1126  edm::LogVerbatim out("FastReport");
1127  printSummary(out, job_summary_, "Job");
1128  }
1129  if (write_json_summary_) {
1131  }
1132 }
void printSummary(T &out, ResourcesPerJob const &data, std::string const &label) const
void writeSummaryJSON(ResourcesPerJob const &data, std::string const &filename) const
const bool write_json_summary_
ResourcesPerJob job_summary_
const std::string json_filename_
const bool print_job_summary_

◆ postESModule()

void FastTimerService::postESModule ( edm::eventsetup::EventSetupRecordKey const &  ,
edm::ESModuleCallingContext const &  cc 
)
private

Definition at line 1716 of file FastTimerService.cc.

References gpuPixelDoublets::cc, edm::ParentContext::kPlaceInPath, and cms::cuda::stream.

1717  {
1718  auto top = cc.getTopModuleCallingContext();
1719  if (top->type() == edm::ParentContext::Type::kPlaceInPath) {
1720  unsigned int sid = top->parent().placeInPathContext()->pathContext()->streamContext()->streamID().value();
1721  auto& stream = streams_[sid];
1722  thread().measure_and_accumulate(stream.eventsetup);
1723  }
1724 }
uint32_t cc[maxCellsPerHit]
Definition: gpuFishbone.h:49
std::vector< ResourcesPerJob > streams_
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t stream
Measurement & thread()
void measure_and_accumulate(Resources &store) noexcept

◆ postEvent()

void FastTimerService::postEvent ( edm::StreamContext const &  sc)
private

Definition at line 1457 of file FastTimerService.cc.

References data, edm::StreamContext::eventID(), watchdog::group, mps_fire::i, l1ctLayer2EG_cff::id, dqmdumpme::last, edm::EventID::luminosityBlock(), MillePedeFileConverter_cfg::out, LaserDQM_cfg::process, edm::StreamContext::processContext(), edm::StreamContext::runIndex(), cms::cuda::stream, and edm::StreamContext::streamID().

1457  {
1458  ignoredSignal(__func__);
1459 
1460  unsigned int pid = callgraph_.processId(*sc.processContext());
1461  unsigned int sid = sc.streamID();
1462  auto& stream = streams_[sid];
1463  auto& process = callgraph_.processDescription(pid);
1464 
1465  // measure the event resources as the sum of all modules' resources
1466  auto& data = stream.processes[pid].total;
1467  for (unsigned int id : process.modules_)
1468  data += stream.modules[id].total;
1469  stream.total += data;
1470 
1471  // handle the summaries and fill the plots only after the last subprocess has run
1473  if (not last)
1474  return;
1475 
1476  // measure the event resources explicitly
1477  stream.event_measurement.measure_and_store(stream.event);
1478 
1479  // add to the event resources those used by source (which is not part of any process)
1480  unsigned int id = 0;
1481  stream.total += stream.modules[id].total;
1482 
1483  // highlighted modules
1484  for (unsigned int group : boost::irange(0ul, highlight_modules_.size()))
1485  for (unsigned int i : highlight_modules_[group].modules)
1486  stream.highlight[group] += stream.modules[i].total;
1487 
1488  // avoid concurrent access to the summary objects
1489  {
1490  std::lock_guard<std::mutex> guard(summary_mutex_);
1491  job_summary_ += stream;
1492  run_summary_[sc.runIndex()] += stream;
1493  }
1494 
1495  if (print_event_summary_) {
1496  edm::LogVerbatim out("FastReport");
1497  printEvent(out, stream);
1498  }
1499 
1500  if (enable_dqm_) {
1501  plots_->fill(callgraph_, stream, sc.eventID().luminosityBlock());
1502  }
1503 }
std::vector< GroupOfModules > highlight_modules_
ResourcesPerJob job_summary_
std::vector< ResourcesPerJob > streams_
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t stream
std::mutex summary_mutex_
void printEvent(T &out, ResourcesPerJob const &) const
std::vector< ResourcesPerJob > run_summary_
std::unique_ptr< std::atomic< unsigned int >[]> subprocess_event_check_
unsigned int processId(edm::ProcessContext const &) const
void ignoredSignal(const std::string &signal) const
const bool print_event_summary_
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
std::unique_ptr< PlotsPerJob > plots_
ProcessType const & processDescription(unsigned int) const
ProcessCallGraph callgraph_
bool isLastSubprocess(std::atomic< unsigned int > &check)

◆ postEventReadFromSource()

void FastTimerService::postEventReadFromSource ( edm::StreamContext const &  sc,
edm::ModuleCallingContext const &  mcc 
)
private

Definition at line 1624 of file FastTimerService.cc.

References edm::ModuleDescription::id(), l1ctLayer2EG_cff::id, edm::ModuleCallingContext::kPrefetching, edm::ModuleCallingContext::state(), cms::cuda::stream, and edm::StreamContext::streamID().

1624  {
1627  unsigned int id = md.id();
1628  auto& stream = streams_[sc.streamID()];
1629  auto& module = stream.modules[id];
1630 
1632  }
1633 }
edm::ModuleDescription const & source() const
std::vector< ResourcesPerJob > streams_
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t stream
Measurement & thread()
unsigned int id() const
void measure_and_accumulate(Resources &store) noexcept
ProcessCallGraph callgraph_

◆ postGlobalBeginLumi()

void FastTimerService::postGlobalBeginLumi ( edm::GlobalContext const &  gc)
private

Definition at line 1054 of file FastTimerService.cc.

1054 { ignoredSignal(__func__); }
void ignoredSignal(const std::string &signal) const

◆ postGlobalBeginRun()

void FastTimerService::postGlobalBeginRun ( edm::GlobalContext const &  gc)
private

Definition at line 947 of file FastTimerService.cc.

947 { ignoredSignal(__func__); }
void ignoredSignal(const std::string &signal) const

◆ postGlobalEndLumi()

void FastTimerService::postGlobalEndLumi ( edm::GlobalContext const &  gc)
private

Definition at line 1058 of file FastTimerService.cc.

References label, dqmdumpme::last, edm::LuminosityBlockID::luminosityBlock(), edm::GlobalContext::luminosityBlockID(), edm::GlobalContext::luminosityBlockIndex(), MillePedeFileConverter_cfg::out, and edm::LuminosityBlockID::run().

1058  {
1059  ignoredSignal(__func__);
1060 
1061  // handle the summaries only after the last subprocess has run
1062  auto index = gc.luminosityBlockIndex();
1064  if (not last)
1065  return;
1066 
1067  edm::LogVerbatim out("FastReport");
1068  auto const& label =
1069  fmt::sprintf("run %d, lumisection %d", gc.luminosityBlockID().run(), gc.luminosityBlockID().luminosityBlock());
1071 
1073  plots_->fill_lumi(lumi_transition_[index], gc.luminosityBlockID().luminosityBlock());
1074  }
1075 }
std::unique_ptr< std::atomic< unsigned int >[]> subprocess_global_lumi_check_
char const * label
const bool enable_dqm_transitions_
void ignoredSignal(const std::string &signal) const
std::unique_ptr< PlotsPerJob > plots_
void printTransition(T &out, AtomicResources const &data, std::string const &label) const
std::vector< AtomicResources > lumi_transition_
bool isLastSubprocess(std::atomic< unsigned int > &check)

◆ postGlobalEndRun()

void FastTimerService::postGlobalEndRun ( edm::GlobalContext const &  gc)
private

Definition at line 1087 of file FastTimerService.cc.

References label, dqmdumpme::last, edm::GlobalContext::luminosityBlockID(), MillePedeFileConverter_cfg::out, SiStripPI::printSummary(), edm::LuminosityBlockID::run(), and edm::GlobalContext::runIndex().

1087  {
1088  ignoredSignal(__func__);
1089 
1090  // handle the summaries only after the last subprocess has run
1091  auto index = gc.runIndex();
1093  if (not last)
1094  return;
1095 
1096  edm::LogVerbatim out("FastReport");
1097  auto const& label = fmt::sprintf("run %d", gc.luminosityBlockID().run());
1098  if (print_run_summary_) {
1100  }
1102 
1104  plots_->fill_run(run_transition_[index]);
1105  }
1106 }
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_
char const * label
std::vector< ResourcesPerJob > run_summary_
const bool enable_dqm_transitions_
void ignoredSignal(const std::string &signal) const
std::vector< AtomicResources > run_transition_
std::unique_ptr< PlotsPerJob > plots_
void printTransition(T &out, AtomicResources const &data, std::string const &label) const
bool isLastSubprocess(std::atomic< unsigned int > &check)

◆ postModuleEvent()

void FastTimerService::postModuleEvent ( edm::StreamContext const &  sc,
edm::ModuleCallingContext const &  mcc 
)
private

Definition at line 1586 of file FastTimerService.cc.

References edm::ModuleDescription::id(), l1ctLayer2EG_cff::id, edm::ModuleCallingContext::moduleDescription(), cms::cuda::stream, edm::StreamContext::streamID(), and edm::StreamID::value().

1586  {
1587  edm::ModuleDescription const& md = *mcc.moduleDescription();
1588  unsigned int id = md.id();
1589  unsigned int sid = sc.streamID().value();
1590  auto& stream = streams_[sid];
1591  auto& module = stream.modules[id];
1592 
1593  if (module.has_acquire) {
1595  } else {
1596  thread().measure_and_store(module.total);
1597  }
1598  ++module.events;
1599 }
std::vector< ResourcesPerJob > streams_
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t stream
Measurement & thread()
unsigned int id() const
void measure_and_store(Resources &store) noexcept
void measure_and_accumulate(Resources &store) noexcept

◆ postModuleEventAcquire()

void FastTimerService::postModuleEventAcquire ( edm::StreamContext const &  sc,
edm::ModuleCallingContext const &  mcc 
)
private

Definition at line 1569 of file FastTimerService.cc.

References edm::ModuleDescription::id(), l1ctLayer2EG_cff::id, edm::ModuleCallingContext::moduleDescription(), cms::cuda::stream, edm::StreamContext::streamID(), and edm::StreamID::value().

1569  {
1570  edm::ModuleDescription const& md = *mcc.moduleDescription();
1571  unsigned int id = md.id();
1572  unsigned int sid = sc.streamID().value();
1573  auto& stream = streams_[sid];
1574  auto& module = stream.modules[id];
1575 
1576  module.has_acquire = true;
1577  thread().measure_and_store(module.total);
1578 }
std::vector< ResourcesPerJob > streams_
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t stream
Measurement & thread()
unsigned int id() const
void measure_and_store(Resources &store) noexcept

◆ postModuleEventDelayedGet()

void FastTimerService::postModuleEventDelayedGet ( edm::StreamContext const &  sc,
edm::ModuleCallingContext const &  mcc 
)
private

Definition at line 1605 of file FastTimerService.cc.

1605  {
1606  unsupportedSignal(__func__);
1607 }
void unsupportedSignal(const std::string &signal) const

◆ postModuleEventPrefetching()

void FastTimerService::postModuleEventPrefetching ( edm::StreamContext const &  sc,
edm::ModuleCallingContext const &  mcc 
)
private

Definition at line 1613 of file FastTimerService.cc.

1613  {
1614  ignoredSignal(__func__);
1615 }
void ignoredSignal(const std::string &signal) const

◆ postModuleGlobalBeginLumi()

void FastTimerService::postModuleGlobalBeginLumi ( edm::GlobalContext const &  gc,
edm::ModuleCallingContext const &  mcc 
)
private

Definition at line 1657 of file FastTimerService.cc.

References edm::GlobalContext::luminosityBlockIndex().

1657  {
1658  auto index = gc.luminosityBlockIndex();
1660 }
Measurement & thread()
void measure_and_accumulate(Resources &store) noexcept
std::vector< AtomicResources > lumi_transition_

◆ postModuleGlobalBeginRun()

void FastTimerService::postModuleGlobalBeginRun ( edm::GlobalContext const &  gc,
edm::ModuleCallingContext const &  mcc 
)
private

Definition at line 1639 of file FastTimerService.cc.

References edm::GlobalContext::runIndex().

1639  {
1640  auto index = gc.runIndex();
1642 }
Measurement & thread()
std::vector< AtomicResources > run_transition_
void measure_and_accumulate(Resources &store) noexcept

◆ postModuleGlobalEndLumi()

void FastTimerService::postModuleGlobalEndLumi ( edm::GlobalContext const &  gc,
edm::ModuleCallingContext const &  mcc 
)
private

Definition at line 1666 of file FastTimerService.cc.

References edm::GlobalContext::luminosityBlockIndex().

1666  {
1667  auto index = gc.luminosityBlockIndex();
1669 }
Measurement & thread()
void measure_and_accumulate(Resources &store) noexcept
std::vector< AtomicResources > lumi_transition_

◆ postModuleGlobalEndRun()

void FastTimerService::postModuleGlobalEndRun ( edm::GlobalContext const &  gc,
edm::ModuleCallingContext const &  mcc 
)
private

Definition at line 1648 of file FastTimerService.cc.

References edm::GlobalContext::runIndex().

1648  {
1649  auto index = gc.runIndex();
1651 }
Measurement & thread()
std::vector< AtomicResources > run_transition_
void measure_and_accumulate(Resources &store) noexcept

◆ postModuleStreamBeginLumi()

void FastTimerService::postModuleStreamBeginLumi ( edm::StreamContext const &  sc,
edm::ModuleCallingContext const &  mcc 
)
private

Definition at line 1693 of file FastTimerService.cc.

References edm::StreamContext::luminosityBlockIndex().

1693  {
1694  auto index = sc.luminosityBlockIndex();
1696 }
Measurement & thread()
void measure_and_accumulate(Resources &store) noexcept
std::vector< AtomicResources > lumi_transition_

◆ postModuleStreamBeginRun()

void FastTimerService::postModuleStreamBeginRun ( edm::StreamContext const &  sc,
edm::ModuleCallingContext const &  mcc 
)
private

Definition at line 1675 of file FastTimerService.cc.

References edm::StreamContext::runIndex().

1675  {
1676  auto index = sc.runIndex();
1678 }
Measurement & thread()
std::vector< AtomicResources > run_transition_
void measure_and_accumulate(Resources &store) noexcept

◆ postModuleStreamEndLumi()

void FastTimerService::postModuleStreamEndLumi ( edm::StreamContext const &  sc,
edm::ModuleCallingContext const &  mcc 
)
private

Definition at line 1702 of file FastTimerService.cc.

References edm::StreamContext::luminosityBlockIndex().

1702  {
1703  auto index = sc.luminosityBlockIndex();
1705 }
Measurement & thread()
void measure_and_accumulate(Resources &store) noexcept
std::vector< AtomicResources > lumi_transition_

◆ postModuleStreamEndRun()

void FastTimerService::postModuleStreamEndRun ( edm::StreamContext const &  sc,
edm::ModuleCallingContext const &  mcc 
)
private

Definition at line 1684 of file FastTimerService.cc.

References edm::StreamContext::runIndex().

1684  {
1685  auto index = sc.runIndex();
1687 }
Measurement & thread()
std::vector< AtomicResources > run_transition_
void measure_and_accumulate(Resources &store) noexcept

◆ postPathEvent()

void FastTimerService::postPathEvent ( edm::StreamContext const &  sc,
edm::PathContext const &  pc,
edm::HLTPathStatus const &  status 
)
private

Definition at line 1539 of file FastTimerService.cc.

References data, mps_fire::i, l1ctLayer2EG_cff::id, edm::PathContext::isEndPath(), castor_dqm_sourceclient_file_cfg::path, edm::PathContext::pathID(), edm::StreamContext::processContext(), mps_update::status, cms::cuda::stream, edm::StreamContext::streamID(), and edm::StreamID::value().

1541  {
1542  unsigned int sid = sc.streamID().value();
1543  unsigned int pid = callgraph_.processId(*sc.processContext());
1544  unsigned int id = pc.pathID();
1545  auto& stream = streams_[sid];
1546  auto& data = pc.isEndPath() ? stream.processes[pid].endpaths[id] : stream.processes[pid].paths[id];
1547 
1548  auto const& path =
1550  unsigned int index = path.modules_on_path_.empty() ? 0 : status.index() + 1;
1551  data.last = path.modules_on_path_.empty() ? 0 : path.last_dependency_of_module_[status.index()];
1552 
1553  for (unsigned int i = 0; i < index; ++i) {
1554  auto const& module = stream.modules[path.modules_on_path_[i]];
1555  data.active += module.total;
1556  }
1557  for (unsigned int i = 0; i < data.last; ++i) {
1558  auto const& module = stream.modules[path.modules_and_dependencies_[i]];
1559  data.total += module.total;
1560  }
1561 }
std::vector< ResourcesPerJob > streams_
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t stream
std::vector< PathType > paths_
unsigned int processId(edm::ProcessContext const &) const
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
std::vector< PathType > endPaths_
ProcessType const & processDescription(unsigned int) const
ProcessCallGraph callgraph_

◆ postSourceEvent()

void FastTimerService::postSourceEvent ( edm::StreamID  sid)
private

Definition at line 1519 of file FastTimerService.cc.

References edm::ModuleDescription::id(), l1ctLayer2EG_cff::id, and cms::cuda::stream.

1519  {
1521  unsigned int id = md.id();
1522  auto& stream = streams_[sid];
1523  auto& module = stream.modules[id];
1524 
1525  thread().measure_and_store(module.total);
1526  ++stream.modules[id].events;
1527 }
edm::ModuleDescription const & source() const
std::vector< ResourcesPerJob > streams_
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t stream
Measurement & thread()
unsigned int id() const
void measure_and_store(Resources &store) noexcept
ProcessCallGraph callgraph_

◆ postSourceLumi()

void FastTimerService::postSourceLumi ( edm::LuminosityBlockIndex  index)
private

Definition at line 1116 of file FastTimerService.cc.

1116  {
1118 }
Measurement & thread()
void measure_and_accumulate(Resources &store) noexcept
std::vector< AtomicResources > lumi_transition_

◆ postSourceRun()

void FastTimerService::postSourceRun ( edm::RunIndex  index)
private

Definition at line 1110 of file FastTimerService.cc.

Measurement & thread()
std::vector< AtomicResources > run_transition_
void measure_and_accumulate(Resources &store) noexcept

◆ postStreamBeginLumi()

void FastTimerService::postStreamBeginLumi ( edm::StreamContext const &  sc)
private

Definition at line 1079 of file FastTimerService.cc.

1079 { ignoredSignal(__func__); }
void ignoredSignal(const std::string &signal) const

◆ postStreamBeginRun()

void FastTimerService::postStreamBeginRun ( edm::StreamContext const &  sc)
private

Definition at line 1037 of file FastTimerService.cc.

1037 { ignoredSignal(__func__); }
void ignoredSignal(const std::string &signal) const

◆ postStreamEndLumi()

void FastTimerService::postStreamEndLumi ( edm::StreamContext const &  sc)
private

Definition at line 1083 of file FastTimerService.cc.

1083 { ignoredSignal(__func__); }
void ignoredSignal(const std::string &signal) const

◆ postStreamEndRun()

void FastTimerService::postStreamEndRun ( edm::StreamContext const &  sc)
private

Definition at line 1041 of file FastTimerService.cc.

1041 { ignoredSignal(__func__); }
void ignoredSignal(const std::string &signal) const

◆ preallocate()

void FastTimerService::preallocate ( edm::service::SystemBounds const &  bounds)
private

Definition at line 960 of file FastTimerService.cc.

References mps_fire::i, and processor_model.

960  {
961  concurrent_lumis_ = bounds.maxNumberOfConcurrentLuminosityBlocks();
962  concurrent_runs_ = bounds.maxNumberOfConcurrentRuns();
963  concurrent_streams_ = bounds.maxNumberOfStreams();
964  concurrent_threads_ = bounds.maxNumberOfThreads();
965 
967  dqm_path_ += fmt::sprintf(
968  "/Running on %s with %d streams on %d threads", processor_model, concurrent_streams_, concurrent_threads_);
969 
970  // fix the DQM path to avoid invalid characters
972 
973  // allocate atomic variables to keep track of the completion of each step, process by process
974  subprocess_event_check_ = std::make_unique<std::atomic<unsigned int>[]>(concurrent_streams_);
975  for (unsigned int i = 0; i < concurrent_streams_; ++i)
977  subprocess_global_run_check_ = std::make_unique<std::atomic<unsigned int>[]>(concurrent_runs_);
978  for (unsigned int i = 0; i < concurrent_runs_; ++i)
980  subprocess_global_lumi_check_ = std::make_unique<std::atomic<unsigned int>[]>(concurrent_lumis_);
981  for (unsigned int i = 0; i < concurrent_lumis_; ++i)
983 
984  // allocate buffers to keep track of the resources spent in the lumi and run transitions
987 }
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_
const std::string processor_model
std::unique_ptr< std::atomic< unsigned int >[]> subprocess_event_check_
unsigned int concurrent_lumis_
std::string dqm_path_
std::vector< AtomicResources > run_transition_
std::vector< AtomicResources > lumi_transition_
static void fixForDQM(std::string &label)
unsigned int concurrent_streams_

◆ preBeginJob()

void FastTimerService::preBeginJob ( edm::PathsAndConsumesOfModulesBase const &  pathsAndConsumes,
edm::ProcessContext const &  context 
)
private

Definition at line 993 of file FastTimerService.cc.

References visDQMUpload::context.

994  {
995  callgraph_.preBeginJob(pathsAndConsumes, context);
996 }
void preBeginJob(edm::PathsAndConsumesOfModulesBase const &, edm::ProcessContext const &)
ProcessCallGraph callgraph_

◆ preESModule()

void FastTimerService::preESModule ( edm::eventsetup::EventSetupRecordKey const &  ,
edm::ESModuleCallingContext const &  cc 
)
private

Definition at line 1707 of file FastTimerService.cc.

References gpuPixelDoublets::cc, edm::ParentContext::kPlaceInPath, and cms::cuda::stream.

1707  {
1708  auto top = cc.getTopModuleCallingContext();
1709  if (top->type() == edm::ParentContext::Type::kPlaceInPath) {
1710  //Paths are only used when processing an Event
1711  unsigned int sid = top->parent().placeInPathContext()->pathContext()->streamContext()->streamID().value();
1712  auto& stream = streams_[sid];
1713  thread().measure_and_accumulate(stream.overhead);
1714  }
1715 }
uint32_t cc[maxCellsPerHit]
Definition: gpuFishbone.h:49
std::vector< ResourcesPerJob > streams_
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t stream
Measurement & thread()
void measure_and_accumulate(Resources &store) noexcept

◆ preEvent()

void FastTimerService::preEvent ( edm::StreamContext const &  sc)
private

Definition at line 1455 of file FastTimerService.cc.

1455 { ignoredSignal(__func__); }
void ignoredSignal(const std::string &signal) const

◆ preEventReadFromSource()

void FastTimerService::preEventReadFromSource ( edm::StreamContext const &  sc,
edm::ModuleCallingContext const &  mcc 
)
private

Definition at line 1617 of file FastTimerService.cc.

References edm::ModuleCallingContext::kPrefetching, edm::ModuleCallingContext::state(), cms::cuda::stream, and edm::StreamContext::streamID().

1617  {
1619  auto& stream = streams_[sc.streamID()];
1620  thread().measure_and_accumulate(stream.overhead);
1621  }
1622 }
std::vector< ResourcesPerJob > streams_
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t stream
Measurement & thread()
void measure_and_accumulate(Resources &store) noexcept

◆ preGlobalBeginLumi()

void FastTimerService::preGlobalBeginLumi ( edm::GlobalContext const &  gc)
private

Definition at line 1043 of file FastTimerService.cc.

References edm::GlobalContext::luminosityBlockIndex().

1043  {
1044  ignoredSignal(__func__);
1045 
1046  // reset the lumi counters only during the main process being run
1047  if (isFirstSubprocess(gc)) {
1048  auto index = gc.luminosityBlockIndex();
1050  lumi_transition_[index].reset();
1051  }
1052 }
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_

◆ preGlobalBeginRun()

void FastTimerService::preGlobalBeginRun ( edm::GlobalContext const &  gc)
private

Definition at line 909 of file FastTimerService.cc.

References edm::GlobalContext::runIndex(), and dqm::implementation::NavigatorBase::setCurrentFolder().

909  {
910  ignoredSignal(__func__);
911 
912  // reset the run counters only during the main process being run
913  if (isFirstSubprocess(gc)) {
914  auto index = gc.runIndex();
916  run_transition_[index].reset();
917  run_summary_[index].reset();
918 
919  // book the DQM plots
920  if (enable_dqm_) {
921  // define a callback to book the MonitorElements
922  auto bookTransactionCallback = [&, this](dqm::reco::DQMStore::IBooker& booker, dqm::reco::DQMStore::IGetter&) {
923  auto scope = dqm::reco::DQMStore::IBooker::UseRunScope(booker);
924  // we should really do this, but only DQMStore is allowed to touch it
925  // We could move to postGlobalBeginRun, then the DQMStore has sure set it up.
926  //booker.setRunLumi(gc.luminosityBlockID());
927  booker.setCurrentFolder(dqm_path_);
928  plots_->book(booker,
929  callgraph_,
939  };
940 
941  // book MonitorElements for this stream
942  edm::Service<dqm::legacy::DQMStore>()->meBookerGetter(bookTransactionCallback);
943  }
944  }
945 }
const PlotRanges dqm_event_ranges_
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
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_
void ignoredSignal(const std::string &signal) const
const bool enable_dqm_bymodule_
const PlotRanges dqm_module_ranges_
const bool enable_dqm_byls_
std::vector< AtomicResources > run_transition_
std::unique_ptr< PlotsPerJob > plots_
UseScope< MonitorElementData::Scope::RUN > UseRunScope
Definition: DQMStore.h:541
ProcessCallGraph callgraph_

◆ preGlobalEndLumi()

void FastTimerService::preGlobalEndLumi ( edm::GlobalContext const &  gc)
private

Definition at line 1056 of file FastTimerService.cc.

1056 { ignoredSignal(__func__); }
void ignoredSignal(const std::string &signal) const

◆ preGlobalEndRun()

void FastTimerService::preGlobalEndRun ( edm::GlobalContext const &  gc)
private

Definition at line 1085 of file FastTimerService.cc.

1085 { ignoredSignal(__func__); }
void ignoredSignal(const std::string &signal) const

◆ preModuleEvent()

void FastTimerService::preModuleEvent ( edm::StreamContext const &  sc,
edm::ModuleCallingContext const &  mcc 
)
private

Definition at line 1580 of file FastTimerService.cc.

References cms::cuda::stream, edm::StreamContext::streamID(), and edm::StreamID::value().

1580  {
1581  unsigned int sid = sc.streamID().value();
1582  auto& stream = streams_[sid];
1583  thread().measure_and_accumulate(stream.overhead);
1584 }
std::vector< ResourcesPerJob > streams_
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t stream
Measurement & thread()
void measure_and_accumulate(Resources &store) noexcept

◆ preModuleEventAcquire()

void FastTimerService::preModuleEventAcquire ( edm::StreamContext const &  sc,
edm::ModuleCallingContext const &  mcc 
)
private

Definition at line 1563 of file FastTimerService.cc.

References cms::cuda::stream, edm::StreamContext::streamID(), and edm::StreamID::value().

1563  {
1564  unsigned int sid = sc.streamID().value();
1565  auto& stream = streams_[sid];
1566  thread().measure_and_accumulate(stream.overhead);
1567 }
std::vector< ResourcesPerJob > streams_
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t stream
Measurement & thread()
void measure_and_accumulate(Resources &store) noexcept

◆ preModuleEventDelayedGet()

void FastTimerService::preModuleEventDelayedGet ( edm::StreamContext const &  sc,
edm::ModuleCallingContext const &  mcc 
)
private

Definition at line 1601 of file FastTimerService.cc.

1601  {
1602  unsupportedSignal(__func__);
1603 }
void unsupportedSignal(const std::string &signal) const

◆ preModuleEventPrefetching()

void FastTimerService::preModuleEventPrefetching ( edm::StreamContext const &  sc,
edm::ModuleCallingContext const &  mcc 
)
private

Definition at line 1609 of file FastTimerService.cc.

1609  {
1610  ignoredSignal(__func__);
1611 }
void ignoredSignal(const std::string &signal) const

◆ preModuleGlobalBeginLumi()

void FastTimerService::preModuleGlobalBeginLumi ( edm::GlobalContext const &  gc,
edm::ModuleCallingContext const &  mcc 
)
private

Definition at line 1653 of file FastTimerService.cc.

1653  {
1655 }
ResourcesPerJob job_summary_
Measurement & thread()
void measure_and_accumulate(Resources &store) noexcept

◆ preModuleGlobalBeginRun()

void FastTimerService::preModuleGlobalBeginRun ( edm::GlobalContext const &  gc,
edm::ModuleCallingContext const &  mcc 
)
private

Definition at line 1635 of file FastTimerService.cc.

1635  {
1637 }
ResourcesPerJob job_summary_
Measurement & thread()
void measure_and_accumulate(Resources &store) noexcept

◆ preModuleGlobalEndLumi()

void FastTimerService::preModuleGlobalEndLumi ( edm::GlobalContext const &  gc,
edm::ModuleCallingContext const &  mcc 
)
private

Definition at line 1662 of file FastTimerService.cc.

1662  {
1664 }
ResourcesPerJob job_summary_
Measurement & thread()
void measure_and_accumulate(Resources &store) noexcept

◆ preModuleGlobalEndRun()

void FastTimerService::preModuleGlobalEndRun ( edm::GlobalContext const &  gc,
edm::ModuleCallingContext const &  mcc 
)
private

Definition at line 1644 of file FastTimerService.cc.

1644  {
1646 }
ResourcesPerJob job_summary_
Measurement & thread()
void measure_and_accumulate(Resources &store) noexcept

◆ preModuleStreamBeginLumi()

void FastTimerService::preModuleStreamBeginLumi ( edm::StreamContext const &  sc,
edm::ModuleCallingContext const &  mcc 
)
private

Definition at line 1689 of file FastTimerService.cc.

1689  {
1691 }
ResourcesPerJob job_summary_
Measurement & thread()
void measure_and_accumulate(Resources &store) noexcept

◆ preModuleStreamBeginRun()

void FastTimerService::preModuleStreamBeginRun ( edm::StreamContext const &  sc,
edm::ModuleCallingContext const &  mcc 
)
private

Definition at line 1671 of file FastTimerService.cc.

1671  {
1673 }
ResourcesPerJob job_summary_
Measurement & thread()
void measure_and_accumulate(Resources &store) noexcept

◆ preModuleStreamEndLumi()

void FastTimerService::preModuleStreamEndLumi ( edm::StreamContext const &  sc,
edm::ModuleCallingContext const &  mcc 
)
private

Definition at line 1698 of file FastTimerService.cc.

1698  {
1700 }
ResourcesPerJob job_summary_
Measurement & thread()
void measure_and_accumulate(Resources &store) noexcept

◆ preModuleStreamEndRun()

void FastTimerService::preModuleStreamEndRun ( edm::StreamContext const &  sc,
edm::ModuleCallingContext const &  mcc 
)
private

Definition at line 1680 of file FastTimerService.cc.

1680  {
1682 }
ResourcesPerJob job_summary_
Measurement & thread()
void measure_and_accumulate(Resources &store) noexcept

◆ prePathEvent()

void FastTimerService::prePathEvent ( edm::StreamContext const &  sc,
edm::PathContext const &  pc 
)
private

Definition at line 1529 of file FastTimerService.cc.

References data, l1ctLayer2EG_cff::id, edm::PathContext::isEndPath(), edm::PathContext::pathID(), edm::StreamContext::processContext(), cms::cuda::stream, edm::StreamContext::streamID(), and edm::StreamID::value().

1529  {
1530  unsigned int sid = sc.streamID().value();
1531  unsigned int pid = callgraph_.processId(*sc.processContext());
1532  unsigned int id = pc.pathID();
1533  auto& stream = streams_[sid];
1534  auto& data = pc.isEndPath() ? stream.processes[pid].endpaths[id] : stream.processes[pid].paths[id];
1535  data.status = false;
1536  data.last = 0;
1537 }
std::vector< ResourcesPerJob > streams_
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t stream
unsigned int processId(edm::ProcessContext const &) const
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
ProcessCallGraph callgraph_

◆ preSourceConstruction()

void FastTimerService::preSourceConstruction ( edm::ModuleDescription const &  module)
private

Definition at line 989 of file FastTimerService.cc.

989  {
991 }
void preSourceConstruction(edm::ModuleDescription const &)
ProcessCallGraph callgraph_

◆ preSourceEvent()

void FastTimerService::preSourceEvent ( edm::StreamID  sid)
private

Definition at line 1505 of file FastTimerService.cc.

References cms::cuda::stream.

1505  {
1506  // clear the event counters
1507  auto& stream = streams_[sid];
1508  stream.reset();
1509  ++stream.events;
1510 
1511  subprocess_event_check_[sid] = 0;
1512 
1513  // reuse the same measurement for the Source module and for the explicit begin of the Event
1514  auto& measurement = thread();
1515  measurement.measure_and_accumulate(stream.overhead);
1516  stream.event_measurement = measurement;
1517 }
std::vector< ResourcesPerJob > streams_
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t stream
Measurement & thread()
std::unique_ptr< std::atomic< unsigned int >[]> subprocess_event_check_

◆ preSourceLumi()

void FastTimerService::preSourceLumi ( edm::LuminosityBlockIndex  index)
private

Definition at line 1112 of file FastTimerService.cc.

1112  {
1114 }
ResourcesPerJob job_summary_
Measurement & thread()
void measure_and_accumulate(Resources &store) noexcept

◆ preSourceRun()

void FastTimerService::preSourceRun ( edm::RunIndex  index)
private

Definition at line 1108 of file FastTimerService.cc.

ResourcesPerJob job_summary_
Measurement & thread()
void measure_and_accumulate(Resources &store) noexcept

◆ preStreamBeginLumi()

void FastTimerService::preStreamBeginLumi ( edm::StreamContext const &  sc)
private

Definition at line 1077 of file FastTimerService.cc.

1077 { ignoredSignal(__func__); }
void ignoredSignal(const std::string &signal) const

◆ preStreamBeginRun()

void FastTimerService::preStreamBeginRun ( edm::StreamContext const &  sc)
private

Definition at line 949 of file FastTimerService.cc.

949 { ignoredSignal(__func__); }
void ignoredSignal(const std::string &signal) const

◆ preStreamEndLumi()

void FastTimerService::preStreamEndLumi ( edm::StreamContext const &  sc)
private

Definition at line 1081 of file FastTimerService.cc.

1081 { ignoredSignal(__func__); }
void ignoredSignal(const std::string &signal) const

◆ preStreamEndRun()

void FastTimerService::preStreamEndRun ( edm::StreamContext const &  sc)
private

Definition at line 1039 of file FastTimerService.cc.

1039 { ignoredSignal(__func__); }
void ignoredSignal(const std::string &signal) const

◆ printEvent() [1/2]

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

◆ printEvent() [2/2]

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

Definition at line 1174 of file FastTimerService.cc.

References data, watchdog::group, mps_fire::i, visualization-live-secondInstance_cfg::m, Skims_PA_cff::name, MillePedeFileConverter_cfg::out, AlCaHLTBitMon_ParallelJobs::p, castor_dqm_sourceclient_file_cfg::path, ValidateTausOnZEEFastSim_cff::proc, and source.

1174  {
1175  printHeader(out, "Event");
1176  printEventHeader(out, "Modules");
1177  auto const& source_d = callgraph_.source();
1178  auto const& source = data.modules[source_d.id()];
1179  printEventLine(out, source.total, source_d.moduleLabel());
1180  for (unsigned int i = 0; i < callgraph_.processes().size(); ++i) {
1181  auto const& proc_d = callgraph_.processDescription(i);
1182  auto const& proc = data.processes[i];
1183  printEventLine(out, proc.total, "process " + proc_d.name_);
1184  for (unsigned int m : proc_d.modules_) {
1185  auto const& module_d = callgraph_.module(m);
1186  auto const& module = data.modules[m];
1187  printEventLine(out, module.total, " " + module_d.moduleLabel());
1188  }
1189  }
1190  printEventLine(out, data.total, "total");
1191  out << '\n';
1192  printEventHeader(out, "Processes and Paths");
1193  printEventLine(out, source.total, source_d.moduleLabel());
1194  for (unsigned int i = 0; i < callgraph_.processes().size(); ++i) {
1195  auto const& proc_d = callgraph_.processDescription(i);
1196  auto const& proc = data.processes[i];
1197  printEventLine(out, proc.total, "process " + proc_d.name_);
1198  for (unsigned int p = 0; p < proc.paths.size(); ++p) {
1199  auto const& name = proc_d.paths_[p].name_;
1200  auto const& path = proc.paths[p];
1201  printEventLine(out, path.active, name + " (only scheduled modules)");
1202  printEventLine(out, path.total, name + " (including dependencies)");
1203  }
1204  for (unsigned int p = 0; p < proc.endpaths.size(); ++p) {
1205  auto const& name = proc_d.endPaths_[p].name_;
1206  auto const& path = proc.endpaths[p];
1207  printEventLine(out, path.active, name + " (only scheduled modules)");
1208  printEventLine(out, path.total, name + " (including dependencies)");
1209  }
1210  }
1211  printEventLine(out, data.total, "total");
1212  out << '\n';
1213  for (unsigned int group : boost::irange(0ul, highlight_modules_.size())) {
1214  printEventHeader(out, "Highlighted modules");
1215  for (unsigned int m : highlight_modules_[group].modules) {
1216  auto const& module_d = callgraph_.module(m);
1217  auto const& module = data.modules[m];
1218  printEventLine(out, module.total, " " + module_d.moduleLabel());
1219  }
1220  printEventLine(out, data.highlight[group], highlight_modules_[group].label);
1221  out << '\n';
1222  }
1223 }
std::vector< GroupOfModules > highlight_modules_
edm::ModuleDescription const & source() const
edm::ModuleDescription const & module(unsigned int module) const
std::vector< ProcessType > const & processes() const
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:80
void printHeader(T &out, std::string const &label) const
ProcessType const & processDescription(unsigned int) const
ProcessCallGraph callgraph_
static std::string const source
Definition: EdmProvDump.cc:49

◆ printEventHeader() [1/2]

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

◆ printEventHeader() [2/2]

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

Definition at line 1148 of file FastTimerService.cc.

References label, and MillePedeFileConverter_cfg::out.

1148  {
1149  out << "FastReport CPU time Real time Allocated Deallocated " << label << "\n";
1150  // FastReport ########.# ms ########.# ms +######### kB -######### kB ...
1151 }
char const * label

◆ printEventLine() [1/4]

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

◆ printEventLine() [2/4]

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

◆ printEventLine() [3/4]

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

Definition at line 1154 of file FastTimerService.cc.

References data, label, and MillePedeFileConverter_cfg::out.

1154  {
1155  out << fmt::sprintf("FastReport %10.1f ms %10.1f ms %+10d kB %+10d kB %s\n",
1156  ms(data.time_thread),
1157  ms(data.time_real),
1158  +static_cast<int64_t>(kB(data.allocated)),
1159  -static_cast<int64_t>(kB(data.deallocated)),
1160  label);
1161 }
char const * label
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80

◆ printEventLine() [4/4]

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

Definition at line 1164 of file FastTimerService.cc.

References data, label, and MillePedeFileConverter_cfg::out.

1164  {
1165  out << fmt::sprintf("FastReport %10.1f ms %10.1f ms %+10d kB %+10d kB %s\n",
1166  ms(boost::chrono::nanoseconds(data.time_thread.load())),
1167  ms(boost::chrono::nanoseconds(data.time_real.load())),
1168  +static_cast<int64_t>(kB(data.allocated)),
1169  -static_cast<int64_t>(kB(data.deallocated)),
1170  label);
1171 }
boost::date_time::subsecond_duration< boost::posix_time::time_duration, 1000000000 > nanoseconds
char const * label
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80

◆ printHeader() [1/2]

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

◆ printHeader() [2/2]

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

Definition at line 1135 of file FastTimerService.cc.

References mps_fire::i, label, and MillePedeFileConverter_cfg::out.

1135  {
1136  out << "FastReport ";
1137  if (label.size() < 60)
1138  for (unsigned int i = (60 - label.size()) / 2; i > 0; --i)
1139  out << '-';
1140  out << ' ' << label << " Summary ";
1141  if (label.size() < 60)
1142  for (unsigned int i = (59 - label.size()) / 2; i > 0; --i)
1143  out << '-';
1144  out << '\n';
1145 }
char const * label

◆ printPathSummaryHeader() [1/2]

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

◆ printPathSummaryHeader() [2/2]

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

Definition at line 1239 of file FastTimerService.cc.

References label, and MillePedeFileConverter_cfg::out.

1239  {
1240  // clang-format off
1241  out << "FastReport CPU time sched. / depend. Real time sched. / depend. Alloc. sched. / depend. Dealloc. sched. / depend. ";
1242  // FastReport ########.# ms ########.# ms ########.# ms ########.# ms +######### kB +######### kB -######### kB -######### kB ...
1243  out << label << '\n';
1244  // clang-format on
1245 }
char const * label

◆ printPathSummaryLine() [1/2]

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

◆ printPathSummaryLine() [2/2]

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 1311 of file FastTimerService.cc.

References data, events, label, MillePedeFileConverter_cfg::out, and dqmMemoryStats::total.

1312  {
1313  out << fmt::sprintf(
1314  "FastReport %10.1f ms %10.1f ms %10.1f ms %10.1f ms %+10d kB %+10d kB %+10d kB %+10d kB %s\n",
1315  (events ? ms(data.time_thread) / events : 0),
1316  (events ? ms(total.time_thread) / events : 0),
1317  (events ? ms(data.time_real) / events : 0),
1318  (events ? ms(total.time_real) / events : 0),
1319  (events ? +static_cast<int64_t>(kB(data.allocated) / events) : 0),
1320  (events ? +static_cast<int64_t>(kB(total.allocated) / events) : 0),
1321  (events ? -static_cast<int64_t>(kB(data.deallocated) / events) : 0),
1322  (events ? -static_cast<int64_t>(kB(total.deallocated) / events) : 0),
1323  label);
1324 }
char const * label
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
int events

◆ printSummary() [1/2]

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

◆ printSummary() [2/2]

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

Definition at line 1327 of file FastTimerService.cc.

References data, watchdog::group, mps_fire::i, label, visualization-live-secondInstance_cfg::m, Skims_PA_cff::name, MillePedeFileConverter_cfg::out, AlCaHLTBitMon_ParallelJobs::p, castor_dqm_sourceclient_file_cfg::path, ValidateTausOnZEEFastSim_cff::proc, and source.

1327  {
1328  printHeader(out, label);
1329  printSummaryHeader(out, "Modules", true);
1330  auto const& source_d = callgraph_.source();
1331  auto const& source = data.modules[source_d.id()];
1332  printSummaryLine(out, source.total, data.events, source.events, source_d.moduleLabel());
1333  for (unsigned int i = 0; i < callgraph_.processes().size(); ++i) {
1334  auto const& proc_d = callgraph_.processDescription(i);
1335  auto const& proc = data.processes[i];
1336  printSummaryLine(out, proc.total, data.events, "process " + proc_d.name_);
1337  for (unsigned int m : proc_d.modules_) {
1338  auto const& module_d = callgraph_.module(m);
1339  auto const& module = data.modules[m];
1340  printSummaryLine(out, module.total, data.events, module.events, " " + module_d.moduleLabel());
1341  }
1342  }
1343  printSummaryLine(out, data.total, data.events, "total");
1344  printSummaryLine(out, data.eventsetup, data.events, "eventsetup");
1345  printSummaryLine(out, data.overhead, data.events, "other");
1346  printSummaryLine(out, data.idle, data.events, "idle");
1347  out << '\n';
1348  printPathSummaryHeader(out, "Processes and Paths");
1349  printSummaryLine(out, source.total, data.events, source_d.moduleLabel());
1350  for (unsigned int i = 0; i < callgraph_.processes().size(); ++i) {
1351  auto const& proc_d = callgraph_.processDescription(i);
1352  auto const& proc = data.processes[i];
1353  printSummaryLine(out, proc.total, data.events, "process " + proc_d.name_);
1354  for (unsigned int p = 0; p < proc.paths.size(); ++p) {
1355  auto const& name = proc_d.paths_[p].name_;
1356  auto const& path = proc.paths[p];
1357  printPathSummaryLine(out, path.active, path.total, data.events, " " + name);
1358  }
1359  for (unsigned int p = 0; p < proc.endpaths.size(); ++p) {
1360  auto const& name = proc_d.endPaths_[p].name_;
1361  auto const& path = proc.endpaths[p];
1362  printPathSummaryLine(out, path.active, path.total, data.events, " " + name);
1363  }
1364  }
1365  printSummaryLine(out, data.total, data.events, "total");
1366  printSummaryLine(out, data.eventsetup, data.events, "eventsetup");
1367  printSummaryLine(out, data.overhead, data.events, "other");
1368  printSummaryLine(out, data.idle, data.events, "idle");
1369  out << '\n';
1370  for (unsigned int group : boost::irange(0ul, highlight_modules_.size())) {
1371  printSummaryHeader(out, "Highlighted modules", true);
1372  for (unsigned int m : highlight_modules_[group].modules) {
1373  auto const& module_d = callgraph_.module(m);
1374  auto const& module = data.modules[m];
1375  printSummaryLine(out, module.total, data.events, module.events, module_d.moduleLabel());
1376  }
1377  printSummaryLine(out, data.highlight[group], data.events, highlight_modules_[group].label);
1378  out << '\n';
1379  }
1380 }
std::vector< GroupOfModules > highlight_modules_
edm::ModuleDescription const & source() const
edm::ModuleDescription const & module(unsigned int module) const
char const * label
std::vector< ProcessType > const & processes() 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
void printSummaryHeader(T &out, std::string const &label, bool detailed) const
void printPathSummaryHeader(T &out, std::string const &label) const
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
void printHeader(T &out, std::string const &label) const
ProcessType const & processDescription(unsigned int) const
ProcessCallGraph callgraph_
static std::string const source
Definition: EdmProvDump.cc:49

◆ printSummaryHeader() [1/2]

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

◆ printSummaryHeader() [2/2]

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

Definition at line 1226 of file FastTimerService.cc.

References label, and MillePedeFileConverter_cfg::out.

1226  {
1227  // clang-format off
1228  if (detailed)
1229  out << "FastReport CPU time avg. when run Real time avg. when run Alloc. avg. when run Dealloc. avg. when run ";
1230  // FastReport ########.# ms ########.# ms ########.# ms ########.# ms +######### kB +######### kB -######### kB -######### kB ...
1231  else
1232  out << "FastReport CPU time avg. Real time avg. Alloc. avg. Dealloc. avg. ";
1233  // FastReport ########.# ms ########.# ms +######### kB -######### kB ...
1234  out << label << '\n';
1235  // clang-format on
1236 }
char const * label

◆ printSummaryLine() [1/8]

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

◆ printSummaryLine() [2/8]

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

◆ printSummaryLine() [3/8]

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

◆ printSummaryLine() [4/8]

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

◆ printSummaryLine() [5/8]

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

Definition at line 1248 of file FastTimerService.cc.

References data, events, label, and MillePedeFileConverter_cfg::out.

1248  {
1249  out << fmt::sprintf(
1250  // clang-format off
1251  "FastReport %10.1f ms %10.1f ms %+10d kB %+10d kB %s\n",
1252  // clang-format on
1253  (events ? ms(data.time_thread) / events : 0),
1254  (events ? ms(data.time_real) / events : 0),
1255  (events ? +static_cast<int64_t>(kB(data.allocated) / events) : 0),
1256  (events ? -static_cast<int64_t>(kB(data.deallocated) / events) : 0),
1257  label);
1258 }
char const * label
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
int events

◆ printSummaryLine() [6/8]

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

Definition at line 1261 of file FastTimerService.cc.

References data, events, label, and MillePedeFileConverter_cfg::out.

1262  {
1263  out << fmt::sprintf(
1264  // clang-format off
1265  "FastReport %10.1f ms %10.1f ms %10.1f ms %10.1f ms %+10d kB %+10d kB %+10d kB %+10d kB %s\n",
1266  // clang-format on
1267  (events ? ms(data.time_thread) / events : 0),
1268  (active ? ms(data.time_thread) / active : 0),
1269  (events ? ms(data.time_real) / events : 0),
1270  (active ? ms(data.time_real) / active : 0),
1271  (events ? +static_cast<int64_t>(kB(data.allocated) / events) : 0),
1272  (active ? +static_cast<int64_t>(kB(data.allocated) / active) : 0),
1273  (events ? -static_cast<int64_t>(kB(data.deallocated) / events) : 0),
1274  (active ? -static_cast<int64_t>(kB(data.deallocated) / active) : 0),
1275  label);
1276 }
char const * label
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
int events

◆ printSummaryLine() [7/8]

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

Definition at line 1279 of file FastTimerService.cc.

References data, events, label, and MillePedeFileConverter_cfg::out.

1282  {
1283  out << fmt::sprintf(
1284  // clang-format off
1285  "FastReport %10.1f ms %10.1f ms %+10d kB %+10d kB %s\n",
1286  // clang-format on
1287  (events ? ms(data.time_thread) / events : 0),
1288  (events ? ms(data.time_real) / events : 0),
1289  (events ? +static_cast<int64_t>(kB(data.allocated) / events) : 0),
1290  (events ? -static_cast<int64_t>(kB(data.deallocated) / events) : 0),
1291  label);
1292 }
char const * label
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
int events

◆ printSummaryLine() [8/8]

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 1295 of file FastTimerService.cc.

References data, events, label, and MillePedeFileConverter_cfg::out.

1296  {
1297  out << fmt::sprintf(
1298  "FastReport %10.1f ms %10.1f ms %10.1f ms %10.1f ms %+10d kB %+10d kB %+10d kB %+10d kB %s\n",
1299  (events ? ms(data.time_thread) / events : 0),
1300  (active ? ms(data.time_thread) / active : 0),
1301  (events ? ms(data.time_real) / events : 0),
1302  (active ? ms(data.time_real) / active : 0),
1303  (events ? +static_cast<int64_t>(kB(data.allocated) / events) : 0),
1304  (active ? +static_cast<int64_t>(kB(data.allocated) / active) : 0),
1305  (events ? -static_cast<int64_t>(kB(data.deallocated) / events) : 0),
1306  (active ? -static_cast<int64_t>(kB(data.deallocated) / active) : 0),
1307  label);
1308 }
char const * label
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
int events

◆ printTransition() [1/2]

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

◆ printTransition() [2/2]

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

Definition at line 1383 of file FastTimerService.cc.

References data, label, and MillePedeFileConverter_cfg::out.

1383  {
1384  printEventHeader(out, "Transition");
1386 }
char const * label
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:80

◆ thread()

FastTimerService::Measurement & FastTimerService::thread ( )
private

Definition at line 1800 of file FastTimerService.cc.

References guard_, and FastTimerService::ThreadGuard::thread().

Referenced by on_scheduler_entry(), and on_scheduler_exit().

1800 { return guard_.thread(); }

◆ unsupportedSignal()

void FastTimerService::unsupportedSignal ( const std::string &  signal) const
private

Definition at line 901 of file FastTimerService.cc.

901  {
902  // warn about each signal only once per job
903  if (unsupported_signals_.insert(signal).second)
904  edm::LogWarning("FastTimerService") << "The FastTimerService received the unsupported signal \"" << signal
905  << "\".\n"
906  << "Please report how to reproduce the issue to cms-hlt@cern.ch .";
907 }
tbb::concurrent_unordered_set< std::string > unsupported_signals_

◆ writeSummaryJSON()

void FastTimerService::writeSummaryJSON ( ResourcesPerJob const &  data,
std::string const &  filename 
) const
private

Definition at line 1406 of file FastTimerService.cc.

References mps_check::array, data, corrVsCorr::filename, mps_fire::i, dqmiolumiharvest::j, and MillePedeFileConverter_cfg::out.

1406  {
1407  json j;
1408 
1409  // write a description of the resources
1410  j["resources"] = json::array({json{{"time_real", "real time"}},
1411  json{{"time_thread", "cpu time"}},
1412  json{{"mem_alloc", "allocated memory"}},
1413  json{{"mem_free", "deallocated memory"}}});
1414 
1415  // write the resources used by the job
1416  j["total"] = encodeToJSON("Job",
1418  data.events,
1419  data.total + data.eventsetup + data.overhead + data.idle);
1420 
1421  // write the resources used by every module
1422  j["modules"] = json::array();
1423  for (unsigned int i = 0; i < callgraph_.size(); ++i) {
1424  auto const& module = callgraph_.module(i);
1425  auto const& data_m = data.modules[i];
1426  j["modules"].push_back(encodeToJSON(module, data_m));
1427  }
1428 
1429  // add an entry for the non-event transitions, modules, and idle states
1430  j["modules"].push_back(encodeToJSON("other", "other", data.events, data.overhead));
1431  j["modules"].push_back(encodeToJSON("eventsetup", "eventsetup", data.events, data.eventsetup));
1432  j["modules"].push_back(encodeToJSON("idle", "idle", data.events, data.idle));
1433 
1434  std::ofstream out(filename);
1435  out << std::setw(2) << j << std::flush;
1436 }
nlohmann::json json
edm::ModuleDescription const & module(unsigned int module) const
json encodeToJSON(std::string const &type, std::string const &label, unsigned int events, T const &data) const
unsigned int size() const
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
ProcessType const & processDescription(unsigned int) const
ProcessCallGraph callgraph_

Member Data Documentation

◆ callgraph_

ProcessCallGraph FastTimerService::callgraph_
private

Definition at line 449 of file FastTimerService.h.

◆ concurrent_lumis_

unsigned int FastTimerService::concurrent_lumis_
private

Definition at line 503 of file FastTimerService.h.

◆ concurrent_runs_

unsigned int FastTimerService::concurrent_runs_
private

Definition at line 504 of file FastTimerService.h.

◆ concurrent_streams_

unsigned int FastTimerService::concurrent_streams_
private

Definition at line 505 of file FastTimerService.h.

◆ concurrent_threads_

unsigned int FastTimerService::concurrent_threads_
private

Definition at line 506 of file FastTimerService.h.

◆ dqm_event_ranges_

const PlotRanges FastTimerService::dqm_event_ranges_
private

Definition at line 528 of file FastTimerService.h.

◆ dqm_lumisections_range_

const unsigned int FastTimerService::dqm_lumisections_range_
private

Definition at line 531 of file FastTimerService.h.

◆ dqm_module_ranges_

const PlotRanges FastTimerService::dqm_module_ranges_
private

Definition at line 530 of file FastTimerService.h.

◆ dqm_path_

std::string FastTimerService::dqm_path_
private

Definition at line 532 of file FastTimerService.h.

◆ dqm_path_ranges_

const PlotRanges FastTimerService::dqm_path_ranges_
private

Definition at line 529 of file FastTimerService.h.

◆ enable_dqm_

bool FastTimerService::enable_dqm_
private

Definition at line 521 of file FastTimerService.h.

◆ enable_dqm_byls_

const bool FastTimerService::enable_dqm_byls_
private

Definition at line 524 of file FastTimerService.h.

◆ enable_dqm_bymodule_

const bool FastTimerService::enable_dqm_bymodule_
private

Definition at line 522 of file FastTimerService.h.

◆ enable_dqm_bynproc_

const bool FastTimerService::enable_dqm_bynproc_
private

Definition at line 525 of file FastTimerService.h.

◆ enable_dqm_bypath_

const bool FastTimerService::enable_dqm_bypath_
private

Definition at line 523 of file FastTimerService.h.

◆ enable_dqm_transitions_

const bool FastTimerService::enable_dqm_transitions_
private

Definition at line 526 of file FastTimerService.h.

◆ guard_

ThreadGuard FastTimerService::guard_
private

Definition at line 492 of file FastTimerService.h.

Referenced by on_scheduler_entry(), and thread().

◆ highlight_module_psets_

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

Definition at line 534 of file FastTimerService.h.

◆ highlight_modules_

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

Definition at line 535 of file FastTimerService.h.

◆ job_summary_

ResourcesPerJob FastTimerService::job_summary_
private

Definition at line 462 of file FastTimerService.h.

Referenced by on_scheduler_entry(), and on_scheduler_exit().

◆ json_filename_

const std::string FastTimerService::json_filename_
private

Definition at line 518 of file FastTimerService.h.

◆ lumi_transition_

std::vector<AtomicResources> FastTimerService::lumi_transition_
private

Definition at line 458 of file FastTimerService.h.

◆ plots_

std::unique_ptr<PlotsPerJob> FastTimerService::plots_
private

Definition at line 455 of file FastTimerService.h.

◆ print_event_summary_

const bool FastTimerService::print_event_summary_
private

Definition at line 509 of file FastTimerService.h.

◆ print_job_summary_

const bool FastTimerService::print_job_summary_
private

Definition at line 511 of file FastTimerService.h.

◆ print_run_summary_

const bool FastTimerService::print_run_summary_
private

Definition at line 510 of file FastTimerService.h.

◆ run_summary_

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

Definition at line 463 of file FastTimerService.h.

◆ run_transition_

std::vector<AtomicResources> FastTimerService::run_transition_
private

Definition at line 459 of file FastTimerService.h.

◆ streams_

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

Definition at line 452 of file FastTimerService.h.

◆ subprocess_event_check_

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

Definition at line 495 of file FastTimerService.h.

◆ subprocess_global_lumi_check_

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

Definition at line 496 of file FastTimerService.h.

◆ subprocess_global_run_check_

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

Definition at line 497 of file FastTimerService.h.

◆ summary_mutex_

std::mutex FastTimerService::summary_mutex_
private

Definition at line 464 of file FastTimerService.h.

◆ unsupported_signals_

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

Definition at line 538 of file FastTimerService.h.

◆ write_json_summary_

const bool FastTimerService::write_json_summary_
private

Definition at line 517 of file FastTimerService.h.