1 #ifndef FastTimerService_h
2 #define FastTimerService_h
14 #include <unordered_map>
17 #include <boost/chrono.hpp>
20 #include <oneapi/tbb/concurrent_unordered_set.h>
21 #include <oneapi/tbb/enumerable_thread_specific.h>
22 #include <oneapi/tbb/task_scheduler_observer.h>
25 #include <nlohmann/json_fwd.hpp>
201 #ifdef DEBUG_THREAD_CONCURRENCY
203 #endif // DEBUG_THREAD_CONCURRENCY
205 boost::chrono::high_resolution_clock::time_point
time_real;
261 void reset() noexcept;
294 std::vector<ResourcesPerPath>
paths;
333 unsigned int lumisections,
360 unsigned int lumisections,
365 unsigned int lumisection);
393 unsigned int lumisections,
411 std::vector<GroupOfModules>
const&,
415 unsigned int lumisections,
474 static std::shared_ptr<specific_t>*
ptr(
void*
p);
534 template <
typename T>
537 template <
typename T>
540 template <
typename T>
543 template <
typename T>
546 template <
typename T>
549 template <
typename T>
552 template <
typename T>
555 template <
typename T>
558 template <
typename T>
561 template <
typename T>
564 template <
typename T>
568 template <
typename T>
572 template <
typename T>
575 template <
typename T>
578 template <
typename T>
593 #endif // ! FastTimerService_h
ResourcesPerJob()=default
void preGlobalBeginRun(edm::GlobalContext const &)
void preModuleEventDelayedGet(edm::StreamContext const &, edm::ModuleCallingContext const &)
const bool print_run_summary_
void fill(Resources const &, unsigned int lumisection)
specific_t(AtomicResources &r)
std::unique_ptr< std::atomic< unsigned int >[]> subprocess_global_lumi_check_
void postStreamBeginRun(edm::StreamContext const &)
void postGlobalEndLumi(edm::GlobalContext const &)
void postGlobalBeginLumi(edm::GlobalContext const &)
void on_scheduler_entry(bool worker) final
void postStreamEndLumi(edm::StreamContext const &)
void on_scheduler_exit(bool worker) final
std::vector< edm::ParameterSet > highlight_module_psets_
void postModuleGlobalEndLumi(edm::GlobalContext const &, edm::ModuleCallingContext const &)
void preEventReadFromSource(edm::StreamContext const &, edm::ModuleCallingContext const &)
void preGlobalEndRun(edm::GlobalContext const &)
PlotsPerElement event_ex_
void preBeginJob(edm::PathsAndConsumesOfModulesBase const &, edm::ProcessContext const &)
void fill_lumi(AtomicResources const &, unsigned int lumisection)
void preSourceLumi(edm::LuminosityBlockIndex)
void printSummary(T &out, ResourcesPerJob const &data, std::string const &label) const
boost::date_time::subsecond_duration< boost::posix_time::time_duration, 1000000000 > nanoseconds
dqm::reco::MonitorElement * deallocated_byls_
AtomicResources operator+(AtomicResources const &other) const
unsigned int concurrent_threads_
void postEventReadFromSource(edm::StreamContext const &, edm::ModuleCallingContext const &)
uint16_t *__restrict__ id
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 &)
void unsupportedSignal(const std::string &signal) const
std::vector< GroupOfModules > highlight_modules_
const bool write_json_summary_
void book(dqm::reco::DQMStore::IBooker &, ProcessCallGraph const &, ProcessCallGraph::ProcessType const &, PlotRanges const &event_ranges, PlotRanges const &path_ranges, unsigned int lumisections, bool bypath, bool byls)
ResourcesPerJob job_summary_
dqm::reco::MonitorElement * module_deallocated_total_
PlotsPerJob(ProcessCallGraph const &job, std::vector< GroupOfModules > const &groups)
PlotsPerProcess(ProcessCallGraph::ProcessType const &)
std::vector< unsigned int > modules
void preGlobalEndLumi(edm::GlobalContext const &)
std::vector< ResourcesPerPath > endpaths
AtomicResources overhead_
const std::string json_filename_
bool isFirstSubprocess(edm::StreamContext const &)
const bool enable_dqm_bynproc_
unsigned int concurrent_runs_
void writeSummaryJSON(ResourcesPerJob const &data, std::string const &filename) const
boost::chrono::nanoseconds time_real
std::atomic< uint64_t > deallocated
PlotsPerElement overhead_
std::unique_ptr< std::atomic< unsigned int >[]> subprocess_global_run_check_
void postSourceRun(edm::RunIndex)
std::vector< ResourcesPerJob > streams_
dqm::reco::MonitorElement * time_thread_byls_
std::atomic< uint64_t > allocated
void postPathEvent(edm::StreamContext const &, edm::PathContext const &, edm::HLTPathStatus const &)
std::vector< PlotsPerElement > highlight_
void preModuleGlobalBeginLumi(edm::GlobalContext const &, edm::ModuleCallingContext const &)
dqm::reco::MonitorElement * time_thread_
ResourcesPerProcess & operator+=(ResourcesPerProcess const &other)
void book(dqm::reco::DQMStore::IBooker &, std::string const &, ProcessCallGraph const &, ProcessCallGraph::PathType const &, PlotRanges const &ranges, unsigned int lumisections, bool byls)
const bool print_job_summary_
const bool enable_dqm_bypath_
PlotsPerElement()=default
void book(dqm::reco::DQMStore::IBooker &, ProcessCallGraph const &, std::vector< GroupOfModules > const &, PlotRanges const &event_ranges, PlotRanges const &path_ranges, PlotRanges const &module_ranges, unsigned int lumisections, bool bymodule, bool bypath, bool byls, bool transitions)
void postStreamBeginLumi(edm::StreamContext const &)
dqm::reco::MonitorElement * deallocated_
dqm::reco::MonitorElement * time_real_
const PlotRanges dqm_path_ranges_
ResourcesPerProcess operator+(ResourcesPerProcess const &other) const
boost::chrono::thread_clock::time_point time_thread
ResourcesPerJob operator+(ResourcesPerJob const &other) const
std::atomic< bool > live_
std::vector< ResourcesPerModule > modules
void printEvent(T &out, ResourcesPerJob const &) const
void printHeader(T &out, std::string const &label) const
void postModuleStreamEndLumi(edm::StreamContext const &, edm::ModuleCallingContext const &)
std::mutex summary_mutex_
void printPathSummaryHeader(T &out, std::string const &label) const
ResourcesPerJob & operator+=(ResourcesPerJob const &other)
void printSummaryHeader(T &out, std::string const &label, bool detailed) const
void fill(ProcessCallGraph::ProcessType const &, ResourcesPerJob const &, ResourcesPerProcess const &, unsigned int ls)
void prePathEvent(edm::StreamContext const &, edm::PathContext const &)
Measurement event_measurement
dqm::reco::MonitorElement * module_time_thread_total_
std::vector< ResourcesPerJob > run_summary_
dqm::reco::MonitorElement * time_real_byls_
~FastTimerService() override=default
void printEventHeader(T &out, std::string const &label) const
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
FastTimerService(const edm::ParameterSet &, edm::ActivityRegistry &)
void preModuleStreamEndLumi(edm::StreamContext const &, edm::ModuleCallingContext const &)
void postEvent(edm::StreamContext const &)
void postGlobalEndRun(edm::GlobalContext const &)
std::unique_ptr< std::atomic< unsigned int >[]> subprocess_event_check_
void fill_fraction(Resources const &, Resources const &, unsigned int lumisection)
ResourcesPerModule operator+(ResourcesPerModule const &other) const
const unsigned int dqm_lumisections_range_
void postStreamEndRun(edm::StreamContext const &)
void preModuleEvent(edm::StreamContext const &, edm::ModuleCallingContext const &)
ResourcesPerPath & operator+=(ResourcesPerPath const &other)
std::vector< PlotsPerElement > modules_
unsigned int concurrent_lumis_
ResourcesPerModule() noexcept
bool register_thread(FastTimerService::AtomicResources &r)
dqm::reco::MonitorElement * module_time_real_total_
void printSummaryLine(T &out, Resources const &data, uint64_t events, std::string const &label) const
const bool enable_dqm_transitions_
void printEventLine(T &out, Resources const &data, std::string const &label) const
std::atomic< boost::chrono::nanoseconds::rep > time_thread
Resources operator+(Resources const &other) const
void measure_and_store(Resources &store) noexcept
std::vector< Resources > highlight
const bool enable_dqm_bymodule_
void printPathSummaryLine(T &out, Resources const &data, Resources const &total, uint64_t events, std::string const &label) const
void book(dqm::reco::DQMStore::IBooker &, std::string const &name, std::string const &title, PlotRanges const &ranges, unsigned int lumisections, bool byls)
AtomicResources & resource_
void fill_run(AtomicResources const &)
const PlotRanges dqm_module_ranges_
std::vector< PlotsPerPath > endpaths_
const bool enable_dqm_byls_
std::vector< PlotsPerProcess > processes_
void postModuleEventAcquire(edm::StreamContext const &, edm::ModuleCallingContext const &)
void postModuleEventDelayedGet(edm::StreamContext const &, edm::ModuleCallingContext const &)
const bool print_event_summary_
boost::chrono::high_resolution_clock::time_point time_real
dqm::reco::MonitorElement * allocated_byls_
static std::shared_ptr< specific_t > * ptr(void *p)
unsigned long long uint64_t
tbb::concurrent_vector< std::shared_ptr< specific_t > > thread_resources_
void postModuleStreamBeginLumi(edm::StreamContext const &, edm::ModuleCallingContext const &)
void printTransition(T &out, AtomicResources const &data, std::string const &label) const
std::vector< AtomicResources > run_transition_
void preModuleStreamEndRun(edm::StreamContext const &, edm::ModuleCallingContext const &)
void postModuleStreamEndRun(edm::StreamContext const &, edm::ModuleCallingContext const &)
void postModuleStreamBeginRun(edm::StreamContext const &, edm::ModuleCallingContext const &)
void preSourceEvent(edm::StreamID)
static void retire_thread(void *t)
boost::chrono::nanoseconds time_thread
void preEvent(edm::StreamContext const &)
void postGlobalBeginRun(edm::GlobalContext const &)
void preStreamBeginLumi(edm::StreamContext const &)
ResourcesPerProcess(ProcessCallGraph::ProcessType const &process)
void ignoredSignal(const std::string &signal) const
void postSourceEvent(edm::StreamID)
dqm::reco::MonitorElement * allocated_
void preModuleStreamBeginLumi(edm::StreamContext const &, edm::ModuleCallingContext const &)
void preStreamEndRun(edm::StreamContext const &)
char data[epos_bytes_allocation]
std::atomic< boost::chrono::nanoseconds::rep > time_real
void preModuleStreamBeginRun(edm::StreamContext const &, edm::ModuleCallingContext const &)
void preStreamEndLumi(edm::StreamContext const &)
void measure_and_accumulate(Resources &store) noexcept
ResourcesPerModule & operator+=(ResourcesPerModule const &other)
void postModuleEventPrefetching(edm::StreamContext const &, edm::ModuleCallingContext const &)
void preModuleGlobalEndLumi(edm::GlobalContext const &, edm::ModuleCallingContext const &)
std::unique_ptr< PlotsPerJob > plots_
void preGlobalBeginLumi(edm::GlobalContext const &)
AtomicResources & operator+=(AtomicResources const &other)
Resources & operator+=(Resources const &other)
void preModuleEventPrefetching(edm::StreamContext const &, edm::ModuleCallingContext const &)
void preSourceConstruction(edm::ModuleDescription const &)
void preModuleEventAcquire(edm::StreamContext const &, edm::ModuleCallingContext const &)
void preModuleGlobalEndRun(edm::GlobalContext const &, edm::ModuleCallingContext const &)
dqm::reco::MonitorElement * module_allocated_total_
tbb::concurrent_unordered_set< std::string > unsupported_signals_
std::vector< PlotsPerPath > paths_
void postSourceLumi(edm::LuminosityBlockIndex)
void postModuleGlobalBeginRun(edm::GlobalContext const &, edm::ModuleCallingContext const &)
std::vector< ResourcesPerProcess > processes
AtomicResources & operator=(AtomicResources const &other)
ProcessCallGraph callgraph_
void postModuleGlobalBeginLumi(edm::GlobalContext const &, edm::ModuleCallingContext const &)
void preStreamBeginRun(edm::StreamContext const &)
dqm::reco::MonitorElement * module_counter_
std::vector< ResourcesPerPath > paths
ResourcesPerPath operator+(ResourcesPerPath const &other) const
void preModuleGlobalBeginRun(edm::GlobalContext const &, edm::ModuleCallingContext const &)
std::vector< AtomicResources > lumi_transition_
unsigned int concurrent_streams_
bool isLastSubprocess(std::atomic< unsigned int > &check)
void preallocate(edm::service::SystemBounds const &)
void fill(ProcessCallGraph const &, ResourcesPerJob const &, unsigned int ls)
json encodeToJSON(std::string const &type, std::string const &label, unsigned int events, T const &data) const
void fill(ProcessCallGraph::PathType const &, ResourcesPerJob const &, ResourcesPerPath const &, unsigned int lumisection)