1 #ifndef FastTimerService_h 2 #define FastTimerService_h 8 #include <unordered_map> 171 resolution(_resolution)
179 resolution(_resolution)
214 dqm_active =
nullptr;
215 run_in_path =
nullptr;
259 time_intermodules(0.),
260 time_postmodules(0.),
264 summary_premodules(0.),
265 summary_intermodules(0.),
266 summary_postmodules(0.),
267 summary_overhead(0.),
290 first_module =
nullptr;
294 time_premodules = 0.;
295 time_intermodules = 0.;
296 time_postmodules = 0.;
300 summary_premodules = 0.;
301 summary_intermodules = 0.;
302 summary_postmodules = 0.;
303 summary_overhead = 0.;
310 dqm_active =
nullptr;
311 dqm_premodules =
nullptr;
312 dqm_intermodules =
nullptr;
313 dqm_postmodules =
nullptr;
314 dqm_overhead =
nullptr;
316 dqm_module_counter =
nullptr;
317 dqm_module_active =
nullptr;
318 dqm_module_total =
nullptr;
323 template <
typename T>
324 using PathMap = std::vector<std::unordered_map<std::string, T>>;
327 template <
typename T>
401 event += other.
event;
402 count += other.
count;
438 paths_interpaths.assign(paths_interpaths.size(), 0.);
445 event += other.
event;
449 for (
unsigned int i = 0;
i < paths_interpaths.size(); ++
i)
486 presource ->Fill( 1000. * value.
presource );
487 source ->Fill( 1000. * value.
source );
488 preevent ->Fill( 1000. * value.
preevent );
489 event ->Fill( 1000. * value.
event );
515 all_endpaths =
nullptr;
516 interpaths =
nullptr;
521 preevent ->Fill( 1000. * value.
preevent );
522 event ->Fill( 1000. * value.
event );
523 all_paths ->Fill( 1000. * value.
all_paths );
525 interpaths ->Fill( 1000. * value.
interpaths );
553 presource ->Fill( x, 1000. * value.
presource );
554 source ->Fill( x, 1000. * value.
source );
555 preevent ->Fill( x, 1000. * value.
preevent );
556 event ->Fill( x, 1000. * value.
event );
586 all_endpaths =
nullptr;
587 interpaths =
nullptr;
591 preevent ->Fill( x, 1000. * value.
preevent );
592 event ->Fill( x, 1000. * value.
event );
593 all_paths ->Fill( x, 1000. * value.
all_paths );
595 interpaths ->Fill( x, 1000. * value.
interpaths );
620 active_time =
nullptr;
621 total_time =
nullptr;
622 exclusive_time =
nullptr;
623 interpaths =
nullptr;
658 std::unordered_map<std::string, ModuleInfo>
modules;
671 timer_last_transition(),
681 dqm_perprocess_byluminosity(),
698 timer_source.
reset();
700 timer_endpaths.
reset();
702 timer_last_path = FastTimer::Clock::time_point();
703 timer_last_transition = FastTimer::Clock::time_point();
706 for (
auto & timing: timing_perprocess)
709 for (
auto &
lumi: luminosity)
713 for (
auto &
plots: dqm_byluminosity)
715 for (
auto & perprocess_plots: dqm_perprocess)
716 perprocess_plots.reset();
717 for (
auto & process_plots: dqm_perprocess_byluminosity)
718 for (
auto &
plots: process_plots)
721 for (
auto &
plots: dqm_paths)
724 current_path =
nullptr;
725 current_module =
nullptr;
726 for (
auto &
map: paths)
727 for (
auto & keyval:
map)
728 keyval.second.
reset();
729 for (
auto & keyval: modules)
730 keyval.second.reset();
731 for (
auto & keyval: moduletypes)
732 keyval.second.reset();
754 double delta(FastTimer::Clock::time_point
const &
first, FastTimer::Clock::time_point
const &
second)
756 return std::chrono::duration_cast<std::chrono::duration<double>>(second -
first).
count();
763 std::pair<std::string,std::string>
findFirstLast(
unsigned int pid, std::vector<std::string>
const & paths,
bool skip =
false);
775 #endif // ! FastTimerService_h
void preGlobalBeginRun(edm::GlobalContext const &)
void preModuleEventDelayedGet(edm::StreamContext const &, edm::ModuleCallingContext const &)
FastTimer::Clock::time_point timer_last_path
PathMap< PathInfo > paths
void postStreamBeginRun(edm::StreamContext const &)
double queryEventTime(edm::StreamID) const
const double m_dqm_eventtime_resolution
~SummaryProfilesPerProcess()
std::vector< std::unordered_map< std::string, T >> PathMap
void postStreamEndLumi(edm::StreamContext const &)
LuminosityDescription(std::string &&_name, std::string &&_title, std::string const &_label, double _range, double _resolution)
static double delta(FastTimer::Clock::time_point const &first, FastTimer::Clock::time_point const &second)
bool m_enable_timing_modules
unsigned int m_concurrent_streams
void postModuleEvent(edm::StreamContext const &, edm::ModuleCallingContext const &)
std::vector< TimingPerProcess > timing_perprocess
static boost::mutex mutex
LuminosityDescription(std::string const &_name, std::string const &_title, std::string const &_label, double _range, double _resolution)
FastTimer::Clock::time_point timer_last_transition
double summary_postmodules
const bool m_enable_dqm_bypath_counters
const bool m_skip_first_path
const bool m_enable_dqm_bypath_exclusive
void printSummary(Timing const &summary, std::string const &label) const
ModuleMap< ModuleInfo * > fast_moduletypes
std::vector< ProcessDescription > m_process
void fill(double x, TimingPerProcess const &value)
const double m_dqm_pathtime_range
double currentPathTime(edm::StreamID) const
std::vector< SummaryProfiles > dqm_byluminosity
std::vector< TimingPerProcess > m_job_summary_perprocess
void postPathEvent(edm::StreamContext const &, edm::PathContext const &, edm::HLTPathStatus const &)
unsigned int m_concurrent_threads
TProfile * exclusive_time
~PathProfilesPerProcess()
unsigned int m_concurrent_runs
void postStreamBeginLumi(edm::StreamContext const &)
ModuleInfo * current_module
U second(std::pair< T, U > const &p)
void preModuleBeginJob(edm::ModuleDescription const &)
std::vector< T > ModuleMap
const bool m_enable_dqm_bynproc
bool m_enable_timing_paths
Timing & operator+=(Timing const &other)
std::vector< LuminosityDescription > m_dqm_luminosity
void prePathEvent(edm::StreamContext const &, edm::PathContext const &)
const bool m_enable_dqm_byls
const double m_dqm_moduletime_resolution
std::mutex m_summary_mutex
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
FastTimerService(const edm::ParameterSet &, edm::ActivityRegistry &)
double queryModuleTimeByLabel(edm::StreamID, const std::string &) const
double currentEventTime(edm::StreamID) const
std::unordered_map< std::string, ModuleInfo > modules
void postEvent(edm::StreamContext const &)
void postGlobalEndRun(edm::GlobalContext const &)
void setLuminosity(unsigned int stream_id, unsigned int luminosity_id, double value)
std::vector< std::vector< TimingPerProcess > > m_run_summary_perprocess
void postStreamEndRun(edm::StreamContext const &)
void preModuleEvent(edm::StreamContext const &, edm::ModuleCallingContext const &)
const bool m_enable_dqm_bypath_details
std::unordered_map< std::string, ModuleInfo > moduletypes
std::vector< double > luminosity
std::vector< Timing > m_run_summary
void fillPathMap(unsigned int pid, std::string const &name, std::vector< std::string > const &modules)
const bool m_enable_dqm_bypath_overhead
std::vector< SummaryPlotsPerProcess > dqm_perprocess
TimingPerProcess & operator+=(TimingPerProcess const &other)
ModuleMap< ModuleInfo * > fast_modules
const bool m_enable_dqm_bymodule
void postModuleEventDelayedGet(edm::StreamContext const &, edm::ModuleCallingContext const &)
const double m_dqm_moduletime_range
std::vector< std::vector< SummaryProfilesPerProcess > > dqm_perprocess_byluminosity
bool m_enable_timing_exclusive
double querySourceTime(edm::StreamID) const
Timing operator+(Timing const &other) const
void preSourceEvent(edm::StreamID)
void preEvent(edm::StreamContext const &)
const bool m_enable_timing_summary
void postSourceEvent(edm::StreamID)
const bool m_enable_dqm_bymoduletype
const bool m_enable_dqm_summary
double queryModuleTimeByType(edm::StreamID, const std::string &) const
double summary_premodules
std::string first_endpath
const bool m_enable_dqm_bypath_total
double queryModuleTime(edm::StreamID, const edm::ModuleDescription &) const
const bool m_enable_dqm_bypath_active
void fill(Timing const &value)
std::vector< ModuleInfo * > modules
double summary_intermodules
TH1F * dqm_module_counter
std::vector< PathProfilesPerProcess > dqm_paths
static unsigned int processID(edm::ProcessContext const *)
double currentModuleTime(edm::StreamID) const
void fill(TimingPerProcess const &value)
void preStreamBeginRun(edm::StreamContext const &)
std::vector< StreamData > m_stream
void reset(double vett[256])
std::vector< double > paths_interpaths
ModuleInfo * first_module
unsigned int reserveLuminosityPlots(std::string const &name, std::string const &title, std::string const &label, double range, double resolution)
SummaryProfilesPerProcess()
void printProcessSummary(Timing const &total, TimingPerProcess const &summary, std::string const &label, std::string const &process) const
void fill(double x, Timing const &value)
void preallocate(edm::service::SystemBounds const &)
std::pair< std::string, std::string > findFirstLast(unsigned int pid, std::vector< std::string > const &paths, bool skip=false)
const double m_dqm_eventtime_range
TimingPerProcess operator+(TimingPerProcess const &other) const
const double m_dqm_pathtime_resolution