CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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)
 

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 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 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_
 
AtomicResources overhead_
 
std::unique_ptr< PlotsPerJobplots_
 
const bool print_event_summary_
 
const bool print_job_summary_
 
const bool print_run_summary_
 
std::vector< ResourcesPerJobrun_summary_
 
std::vector< AtomicResourcesrun_transition_
 
std::vector< ResourcesPerJobstreams_
 
std::unique_ptr< std::atomic
< unsigned int >[]> 
subprocess_event_check_
 
std::unique_ptr< std::atomic
< unsigned int >[]> 
subprocess_global_lumi_check_
 
std::unique_ptr< std::atomic
< unsigned int >[]> 
subprocess_global_run_check_
 
std::mutex summary_mutex_
 
tbb::concurrent_unordered_set
< std::string > 
unsupported_signals_
 
const bool write_json_summary_
 

Detailed Description

Definition at line 54 of file FastTimerService.h.

Constructor & Destructor Documentation

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

Definition at line 769 of file FastTimerService.cc.

References edm::ParameterSet::getUntrackedParameter().

770  : // configuration
771  callgraph_(),
772  // job configuration
774  concurrent_runs_(0),
777  print_event_summary_(config.getUntrackedParameter<bool>("printEventSummary")),
778  print_run_summary_(config.getUntrackedParameter<bool>("printRunSummary")),
779  print_job_summary_(config.getUntrackedParameter<bool>("printJobSummary")),
780  // JSON configuration
781  //write_json_per_event_(config.getUntrackedParameter<bool>("writeJSONByEvent")),
782  //write_json_per_ls_(config.getUntrackedParameter<bool>("writeJSONByLumiSection")),
783  //write_json_per_run_(config.getUntrackedParameter<bool>("writeJSONByRun")),
784  write_json_summary_(config.getUntrackedParameter<bool>("writeJSONSummary")),
785  json_filename_(config.getUntrackedParameter<std::string>("jsonFileName")),
786  // DQM configuration
787  enable_dqm_(config.getUntrackedParameter<bool>("enableDQM")),
788  enable_dqm_bymodule_(config.getUntrackedParameter<bool>("enableDQMbyModule")),
789  enable_dqm_bypath_(config.getUntrackedParameter<bool>("enableDQMbyPath")),
790  enable_dqm_byls_(config.getUntrackedParameter<bool>("enableDQMbyLumiSection")),
791  enable_dqm_bynproc_(config.getUntrackedParameter<bool>("enableDQMbyProcesses")),
792  enable_dqm_transitions_(config.getUntrackedParameter<bool>("enableDQMTransitions")),
793  dqm_event_ranges_({config.getUntrackedParameter<double>("dqmTimeRange"), // ms
794  config.getUntrackedParameter<double>("dqmTimeResolution"), // ms
795  config.getUntrackedParameter<double>("dqmMemoryRange"), // kB
796  config.getUntrackedParameter<double>("dqmMemoryResolution")}), // kB
const bool print_run_summary_
T getUntrackedParameter(std::string const &, T const &) const
unsigned int concurrent_threads_
const PlotRanges dqm_event_ranges_
const bool write_json_summary_
const std::string json_filename_
const bool enable_dqm_bynproc_
unsigned int concurrent_runs_
const bool print_job_summary_
const bool enable_dqm_bypath_
unsigned int concurrent_lumis_
const bool enable_dqm_transitions_
const bool enable_dqm_bymodule_
const bool enable_dqm_byls_
const bool print_event_summary_
ProcessCallGraph callgraph_
unsigned int concurrent_streams_
FastTimerService::~FastTimerService ( )
overridedefault

Member Function Documentation

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

Definition at line 1366 of file FastTimerService.cc.

1369  {
1370  return json{{"type", type},
1371  {"label", label},
1372  {"events", events},
1373  {"time_thread", ms(data.time_thread)},
1374  {"time_real", ms(data.time_real)},
1375  {"mem_alloc", kB(data.allocated)},
1376  {"mem_free", kB(data.deallocated)}};
1377 }
nlohmann::json json
char const * label
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
tuple events
Definition: patZpeak.py:20
void FastTimerService::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 1733 of file FastTimerService.cc.

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

1733  {
1735  desc.addUntracked<bool>("printEventSummary", false);
1736  desc.addUntracked<bool>("printRunSummary", true);
1737  desc.addUntracked<bool>("printJobSummary", true);
1738  // JSON configuration
1739  //desc.addUntracked<bool>("writeJSONByEvent", false);
1740  //desc.addUntracked<bool>("writeJSONByLumiSection", false);
1741  //desc.addUntracked<bool>("writeJSONByRun", false);
1742  desc.addUntracked<bool>("writeJSONSummary", false);
1743  desc.addUntracked<std::string>("jsonFileName", "resources.json");
1744  // DQM configuration
1745  desc.addUntracked<bool>("enableDQM", true);
1746  desc.addUntracked<bool>("enableDQMbyModule", false);
1747  desc.addUntracked<bool>("enableDQMbyPath", false);
1748  desc.addUntracked<bool>("enableDQMbyLumiSection", false);
1749  desc.addUntracked<bool>("enableDQMbyProcesses", false);
1750  desc.addUntracked<bool>("enableDQMTransitions", false);
1751  desc.addUntracked<double>("dqmTimeRange", 1000.); // ms
1752  desc.addUntracked<double>("dqmTimeResolution", 5.); // ms
1753  desc.addUntracked<double>("dqmMemoryRange", 1000000.); // kB
1754  desc.addUntracked<double>("dqmMemoryResolution", 5000.); // kB
1755  desc.addUntracked<double>("dqmPathTimeRange", 100.); // ms
1756  desc.addUntracked<double>("dqmPathTimeResolution", 0.5); // ms
1757  desc.addUntracked<double>("dqmPathMemoryRange", 1000000.); // kB
1758  desc.addUntracked<double>("dqmPathMemoryResolution", 5000.); // kB
1759  desc.addUntracked<double>("dqmModuleTimeRange", 40.); // ms
1760  desc.addUntracked<double>("dqmModuleTimeResolution", 0.2); // ms
1761  desc.addUntracked<double>("dqmModuleMemoryRange", 100000.); // kB
1762  desc.addUntracked<double>("dqmModuleMemoryResolution", 500.); // kB
1763  desc.addUntracked<unsigned>("dqmLumiSectionsRange", 2500); // ~ 16 hours
1764  desc.addUntracked<std::string>("dqmPath", "HLT/TimerService");
1765 
1766  edm::ParameterSetDescription highlightModulesDescription;
1767  highlightModulesDescription.addUntracked<std::vector<std::string>>("modules", {});
1768  highlightModulesDescription.addUntracked<std::string>("label", "producers");
1769  desc.addVPSetUntracked("highlightModules", highlightModulesDescription, {});
1770 
1771  // # OBSOLETE - these parameters are ignored, they are left only not to break old configurations
1772  // they will not be printed in the generated cfi.py file
1773  desc.addOptionalNode(edm::ParameterDescription<bool>("useRealTimeClock", true, false), false)
1774  ->setComment("This parameter is obsolete and will be ignored.");
1775  desc.addOptionalNode(edm::ParameterDescription<bool>("enableTimingPaths", true, false), false)
1776  ->setComment("This parameter is obsolete and will be ignored.");
1777  desc.addOptionalNode(edm::ParameterDescription<bool>("enableTimingModules", true, false), false)
1778  ->setComment("This parameter is obsolete and will be ignored.");
1779  desc.addOptionalNode(edm::ParameterDescription<bool>("enableTimingExclusive", false, false), false)
1780  ->setComment("This parameter is obsolete and will be ignored.");
1781  desc.addOptionalNode(edm::ParameterDescription<bool>("enableTimingSummary", false, false), false)
1782  ->setComment("This parameter is obsolete and will be ignored.");
1783  desc.addOptionalNode(edm::ParameterDescription<bool>("skipFirstPath", false, false), false)
1784  ->setComment("This parameter is obsolete and will be ignored.");
1785  desc.addOptionalNode(edm::ParameterDescription<bool>("enableDQMbyPathActive", false, false), false)
1786  ->setComment("This parameter is obsolete and will be ignored.");
1787  desc.addOptionalNode(edm::ParameterDescription<bool>("enableDQMbyPathTotal", true, false), false)
1788  ->setComment("This parameter is obsolete and will be ignored.");
1789  desc.addOptionalNode(edm::ParameterDescription<bool>("enableDQMbyPathOverhead", false, false), false)
1790  ->setComment("This parameter is obsolete and will be ignored.");
1791  desc.addOptionalNode(edm::ParameterDescription<bool>("enableDQMbyPathDetails", false, false), false)
1792  ->setComment("This parameter is obsolete and will be ignored.");
1793  desc.addOptionalNode(edm::ParameterDescription<bool>("enableDQMbyPathCounters", true, false), false)
1794  ->setComment("This parameter is obsolete and will be ignored.");
1795  desc.addOptionalNode(edm::ParameterDescription<bool>("enableDQMbyPathExclusive", false, false), false)
1796  ->setComment("This parameter is obsolete and will be ignored.");
1797  desc.addOptionalNode(edm::ParameterDescription<bool>("enableDQMbyModuleType", false, false), false)
1798  ->setComment("This parameter is obsolete and will be ignored.");
1799  desc.addOptionalNode(edm::ParameterDescription<bool>("enableDQMSummary", false, false), false)
1800  ->setComment("This parameter is obsolete and will be ignored.");
1801 
1802  descriptions.add("FastTimerService", desc);
1803 }
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void FastTimerService::ignoredSignal ( const std::string &  signal) const
private

Definition at line 885 of file FastTimerService.cc.

References LogDebug.

885  {
886  LogDebug("FastTimerService") << "The FastTimerService received is currently not monitoring the signal \"" << signal
887  << "\".\n";
888 }
#define LogDebug(id)
bool FastTimerService::isFirstSubprocess ( edm::StreamContext const &  )
private
bool FastTimerService::isFirstSubprocess ( edm::GlobalContext const &  )
private
bool FastTimerService::isLastSubprocess ( std::atomic< unsigned int > &  check)
private

Definition at line 1420 of file FastTimerService.cc.

1420  {
1421  // release-acquire semantic guarantees that all writes in this and other threads are visible
1422  // after this operation; full sequentially-consistent ordering is (probably) not needed.
1423  unsigned int old_value = check.fetch_add(1, std::memory_order_acq_rel);
1424  return (old_value == callgraph_.processes().size() - 1);
1425 }
std::vector< ProcessType > const & processes() const
ProcessCallGraph callgraph_
void FastTimerService::on_scheduler_entry ( bool  worker)
finalprivate

Definition at line 1721 of file FastTimerService.cc.

References guard_, FastTimerService::Measurement::measure(), overhead_, FastTimerService::ThreadGuard::register_thread(), and thread().

1721  {
1723  // initialise the measurement point for a thread that has newly joined the TBB pool
1724  thread().measure();
1725  }
1726 }
AtomicResources overhead_
Measurement & thread()
bool register_thread(FastTimerService::AtomicResources &r)
void FastTimerService::on_scheduler_exit ( bool  worker)
finalprivate

Definition at line 1728 of file FastTimerService.cc.

1728 {}
void FastTimerService::postBeginJob ( )
private

Definition at line 982 of file FastTimerService.cc.

References watchdog::group, highlight_module_psets_(), highlight_modules_(), mps_fire::i, label, HLT_FULL_cff::labels, TrackingSourceConfig_Tier0_Cosmic_cff::modules, AlCaHLTBitMon_QueryRunRegistry::string, and groupFilesInBlocks::temp.

Referenced by highlight_modules_().

982  {
983  unsigned int modules = callgraph_.size();
984 
985  // module highlights
986  for (unsigned int group : boost::irange(0ul, highlight_module_psets_.size())) {
987  // copy and sort for faster search via std::binary_search
988  auto labels = highlight_module_psets_[group].getUntrackedParameter<std::vector<std::string>>("modules");
989  std::sort(labels.begin(), labels.end());
990 
991  highlight_modules_[group].label = highlight_module_psets_[group].getUntrackedParameter<std::string>("label");
992  highlight_modules_[group].modules.reserve(labels.size());
993  // convert the module labels in module ids
994  for (unsigned int i = 0; i < modules; ++i) {
995  auto const& label = callgraph_.module(i).moduleLabel();
996  if (std::binary_search(labels.begin(), labels.end(), label))
997  highlight_modules_[group].modules.push_back(i);
998  }
999  }
1000  highlight_module_psets_.clear();
1001 
1002  // allocate the resource counters for each stream, process, path and module
1003  ResourcesPerJob temp(callgraph_, highlight_modules_);
1006  job_summary_ = temp;
1007 
1008  // check that the DQMStore service is available
1009  if (enable_dqm_ and not edm::Service<dqm::legacy::DQMStore>().isAvailable()) {
1010  // the DQMStore is not available, disable all DQM plots
1011  enable_dqm_ = false;
1012  edm::LogWarning("FastTimerService") << "The DQMStore is not avalable, the DQM plots will not be generated";
1013  }
1014 
1015  // allocate the structures to hold pointers to the DQM plots
1016  if (enable_dqm_) {
1017  plots_ = std::make_unique<PlotsPerJob>(callgraph_, highlight_modules_);
1018  }
1019 }
std::vector< edm::ParameterSet > highlight_module_psets_
std::vector< GroupOfModules > highlight_modules_
ResourcesPerJob job_summary_
unsigned int concurrent_runs_
std::vector< ResourcesPerJob > streams_
std::string const & moduleLabel() const
char const * label
std::vector< ResourcesPerJob > run_summary_
tuple group
Definition: watchdog.py:82
std::unique_ptr< PlotsPerJob > plots_
unsigned int size() const
edm::ModuleDescription const & module(unsigned int module) const
Log< level::Warning, false > LogWarning
ProcessCallGraph callgraph_
unsigned int concurrent_streams_
void FastTimerService::postEndJob ( )
private

Definition at line 1102 of file FastTimerService.cc.

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

Referenced by highlight_modules_().

1102  {
1103  // stop observing to avoid potential race conditions at exit
1104  tbb::task_scheduler_observer::observe(false);
1105  guard_.finalize();
1106  if (print_job_summary_) {
1107  edm::LogVerbatim out("FastReport");
1108  printSummary(out, job_summary_, "Job");
1109  }
1110  if (write_json_summary_) {
1112  }
1113 }
void printSummary(T &out, ResourcesPerJob const &data, std::string const &label) const
const bool write_json_summary_
ResourcesPerJob job_summary_
const std::string json_filename_
void writeSummaryJSON(ResourcesPerJob const &data, std::string const &filename) const
const bool print_job_summary_
void FastTimerService::postEvent ( edm::StreamContext const &  sc)
private

Definition at line 1429 of file FastTimerService.cc.

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

Referenced by highlight_modules_().

1429  {
1430  ignoredSignal(__func__);
1431 
1432  unsigned int pid = callgraph_.processId(*sc.processContext());
1433  unsigned int sid = sc.streamID();
1434  auto& stream = streams_[sid];
1435  auto& process = callgraph_.processDescription(pid);
1436 
1437  // measure the event resources as the sum of all modules' resources
1438  auto& data = stream.processes[pid].total;
1439  for (unsigned int id : process.modules_)
1440  data += stream.modules[id].total;
1441  stream.total += data;
1442 
1443  // handle the summaries and fill the plots only after the last subprocess has run
1445  if (not last)
1446  return;
1447 
1448  // measure the event resources explicitly
1449  stream.event_measurement.measure_and_store(stream.event);
1450 
1451  // add to the event resources those used by source (which is not part of any process)
1452  unsigned int id = 0;
1453  stream.total += stream.modules[id].total;
1454 
1455  // highlighted modules
1456  for (unsigned int group : boost::irange(0ul, highlight_modules_.size()))
1457  for (unsigned int i : highlight_modules_[group].modules)
1458  stream.highlight[group] += stream.modules[i].total;
1459 
1460  // avoid concurrent access to the summary objects
1461  {
1462  std::lock_guard<std::mutex> guard(summary_mutex_);
1463  job_summary_ += stream;
1464  run_summary_[sc.runIndex()] += stream;
1465  }
1466 
1467  if (print_event_summary_) {
1468  edm::LogVerbatim out("FastReport");
1469  printEvent(out, stream);
1470  }
1471 
1472  if (enable_dqm_) {
1473  plots_->fill(callgraph_, stream, sc.eventID().luminosityBlock());
1474  }
1475 }
uint16_t *__restrict__ id
std::vector< GroupOfModules > highlight_modules_
ResourcesPerJob job_summary_
unsigned int processId(edm::ProcessContext const &) const
std::vector< ResourcesPerJob > streams_
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t stream
void printEvent(T &out, ResourcesPerJob const &) const
std::mutex summary_mutex_
std::vector< ResourcesPerJob > run_summary_
std::unique_ptr< std::atomic< unsigned int >[]> subprocess_event_check_
ProcessType const & processDescription(unsigned int) const
tuple group
Definition: watchdog.py:82
const bool print_event_summary_
void ignoredSignal(const std::string &signal) const
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
std::unique_ptr< PlotsPerJob > plots_
tuple last
Definition: dqmdumpme.py:56
tuple process
Definition: LaserDQM_cfg.py:3
ProcessCallGraph callgraph_
bool isLastSubprocess(std::atomic< unsigned int > &check)
void FastTimerService::postEventReadFromSource ( edm::StreamContext const &  sc,
edm::ModuleCallingContext const &  mcc 
)
private

Definition at line 1593 of file FastTimerService.cc.

1593  {
1594  ignoredSignal(__func__);
1595 }
void ignoredSignal(const std::string &signal) const
void FastTimerService::postGlobalBeginLumi ( edm::GlobalContext const &  gc)
private

Definition at line 1038 of file FastTimerService.cc.

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

Definition at line 936 of file FastTimerService.cc.

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

Definition at line 1042 of file FastTimerService.cc.

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

Referenced by highlight_modules_().

1042  {
1043  ignoredSignal(__func__);
1044 
1045  // handle the summaries only after the last subprocess has run
1046  auto index = gc.luminosityBlockIndex();
1048  if (not last)
1049  return;
1050 
1051  edm::LogVerbatim out("FastReport");
1052  auto const& label =
1053  fmt::sprintf("run %d, lumisection %d", gc.luminosityBlockID().run(), gc.luminosityBlockID().luminosityBlock());
1055 
1057  plots_->fill_lumi(lumi_transition_[index], gc.luminosityBlockID().luminosityBlock());
1058  }
1059 }
std::unique_ptr< std::atomic< unsigned int >[]> subprocess_global_lumi_check_
char const * label
const bool enable_dqm_transitions_
void printTransition(T &out, AtomicResources const &data, std::string const &label) const
void ignoredSignal(const std::string &signal) const
std::unique_ptr< PlotsPerJob > plots_
tuple last
Definition: dqmdumpme.py:56
std::vector< AtomicResources > lumi_transition_
bool isLastSubprocess(std::atomic< unsigned int > &check)
void FastTimerService::postGlobalEndRun ( edm::GlobalContext const &  gc)
private

Definition at line 1071 of file FastTimerService.cc.

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

Referenced by highlight_modules_().

1071  {
1072  ignoredSignal(__func__);
1073 
1074  // handle the summaries only after the last subprocess has run
1075  auto index = gc.runIndex();
1077  if (not last)
1078  return;
1079 
1080  edm::LogVerbatim out("FastReport");
1081  auto const& label = fmt::sprintf("Run %d", gc.luminosityBlockID().run());
1082  if (print_run_summary_) {
1084  }
1086 
1088  plots_->fill_run(run_transition_[index]);
1089  }
1090 }
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_
std::vector< AtomicResources > run_transition_
void printTransition(T &out, AtomicResources const &data, std::string const &label) const
void ignoredSignal(const std::string &signal) const
std::unique_ptr< PlotsPerJob > plots_
tuple last
Definition: dqmdumpme.py:56
bool isLastSubprocess(std::atomic< unsigned int > &check)
void FastTimerService::postModuleEvent ( edm::StreamContext const &  sc,
edm::ModuleCallingContext const &  mcc 
)
private

Definition at line 1558 of file FastTimerService.cc.

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

Referenced by highlight_modules_().

1558  {
1559  edm::ModuleDescription const& md = *mcc.moduleDescription();
1560  unsigned int id = md.id();
1561  unsigned int sid = sc.streamID().value();
1562  auto& stream = streams_[sid];
1563  auto& module = stream.modules[id];
1564 
1565  if (module.has_acquire) {
1567  } else {
1568  thread().measure_and_store(module.total);
1569  }
1570  ++module.events;
1571 }
uint16_t *__restrict__ id
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_store(Resources &store) noexcept
void measure_and_accumulate(Resources &store) noexcept
tuple module
Definition: callgraph.py:69
unsigned int id() const
void FastTimerService::postModuleEventAcquire ( edm::StreamContext const &  sc,
edm::ModuleCallingContext const &  mcc 
)
private

Definition at line 1541 of file FastTimerService.cc.

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

Referenced by highlight_modules_().

1541  {
1542  edm::ModuleDescription const& md = *mcc.moduleDescription();
1543  unsigned int id = md.id();
1544  unsigned int sid = sc.streamID().value();
1545  auto& stream = streams_[sid];
1546  auto& module = stream.modules[id];
1547 
1548  module.has_acquire = true;
1549  thread().measure_and_store(module.total);
1550 }
uint16_t *__restrict__ id
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_store(Resources &store) noexcept
tuple module
Definition: callgraph.py:69
unsigned int id() const
void FastTimerService::postModuleEventDelayedGet ( edm::StreamContext const &  sc,
edm::ModuleCallingContext const &  mcc 
)
private

Definition at line 1577 of file FastTimerService.cc.

Referenced by highlight_modules_().

1577  {
1578  unsupportedSignal(__func__);
1579 }
void unsupportedSignal(const std::string &signal) const
void FastTimerService::postModuleEventPrefetching ( edm::StreamContext const &  sc,
edm::ModuleCallingContext const &  mcc 
)
private

Definition at line 1585 of file FastTimerService.cc.

1585  {
1586  ignoredSignal(__func__);
1587 }
void ignoredSignal(const std::string &signal) const
void FastTimerService::postModuleGlobalBeginLumi ( edm::GlobalContext const &  gc,
edm::ModuleCallingContext const &  mcc 
)
private

Definition at line 1619 of file FastTimerService.cc.

References edm::GlobalContext::luminosityBlockIndex().

Referenced by highlight_modules_().

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

Definition at line 1601 of file FastTimerService.cc.

References edm::GlobalContext::runIndex().

Referenced by highlight_modules_().

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

Definition at line 1628 of file FastTimerService.cc.

References edm::GlobalContext::luminosityBlockIndex().

Referenced by highlight_modules_().

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

Definition at line 1610 of file FastTimerService.cc.

References edm::GlobalContext::runIndex().

Referenced by highlight_modules_().

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

Definition at line 1655 of file FastTimerService.cc.

References edm::StreamContext::luminosityBlockIndex().

Referenced by highlight_modules_().

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

Definition at line 1637 of file FastTimerService.cc.

References edm::StreamContext::runIndex().

Referenced by highlight_modules_().

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

Definition at line 1664 of file FastTimerService.cc.

References edm::StreamContext::luminosityBlockIndex().

Referenced by highlight_modules_().

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

Definition at line 1646 of file FastTimerService.cc.

References edm::StreamContext::runIndex().

Referenced by highlight_modules_().

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

Definition at line 1511 of file FastTimerService.cc.

References mps_fire::i, gpuClustering::id, edm::HLTPathStatus::index(), edm::PathContext::isEndPath(), fed_dqm_sourceclient-live_cfg::path, edm::PathContext::pathID(), edm::StreamContext::processContext(), cms::cuda::stream, edm::StreamContext::streamID(), and edm::StreamID::value().

Referenced by highlight_modules_().

1513  {
1514  unsigned int sid = sc.streamID().value();
1515  unsigned int pid = callgraph_.processId(*sc.processContext());
1516  unsigned int id = pc.pathID();
1517  auto& stream = streams_[sid];
1518  auto& data = pc.isEndPath() ? stream.processes[pid].endpaths[id] : stream.processes[pid].paths[id];
1519 
1520  auto const& path =
1522  unsigned int index = path.modules_on_path_.empty() ? 0 : status.index() + 1;
1523  data.last = path.modules_on_path_.empty() ? 0 : path.last_dependency_of_module_[status.index()];
1524 
1525  for (unsigned int i = 0; i < index; ++i) {
1526  auto const& module = stream.modules[path.modules_on_path_[i]];
1527  data.active += module.total;
1528  }
1529  for (unsigned int i = 0; i < data.last; ++i) {
1530  auto const& module = stream.modules[path.modules_and_dependencies_[i]];
1531  data.total += module.total;
1532  }
1533 }
uint16_t *__restrict__ id
unsigned int processId(edm::ProcessContext const &) const
list status
Definition: mps_update.py:107
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_
ProcessType const & processDescription(unsigned int) const
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
std::vector< PathType > endPaths_
ProcessCallGraph callgraph_
tuple module
Definition: callgraph.py:69
void FastTimerService::postSourceEvent ( edm::StreamID  sid)
private

Definition at line 1491 of file FastTimerService.cc.

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

Referenced by highlight_modules_().

1491  {
1493  unsigned int id = md.id();
1494  auto& stream = streams_[sid];
1495  auto& module = stream.modules[id];
1496 
1497  thread().measure_and_store(module.total);
1498  ++stream.modules[id].events;
1499 }
uint16_t *__restrict__ id
std::vector< ResourcesPerJob > streams_
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t stream
edm::ModuleDescription const & source() const
Measurement & thread()
void measure_and_store(Resources &store) noexcept
ProcessCallGraph callgraph_
tuple module
Definition: callgraph.py:69
unsigned int id() const
void FastTimerService::postSourceLumi ( edm::LuminosityBlockIndex  index)
private

Definition at line 1098 of file FastTimerService.cc.

Referenced by highlight_modules_().

1098  {
1100 }
Measurement & thread()
void measure_and_accumulate(Resources &store) noexcept
std::vector< AtomicResources > lumi_transition_
void FastTimerService::postSourceRun ( edm::RunIndex  index)
private

Definition at line 1094 of file FastTimerService.cc.

Referenced by highlight_modules_().

Measurement & thread()
std::vector< AtomicResources > run_transition_
void measure_and_accumulate(Resources &store) noexcept
void FastTimerService::postStreamBeginLumi ( edm::StreamContext const &  sc)
private

Definition at line 1063 of file FastTimerService.cc.

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

Definition at line 1021 of file FastTimerService.cc.

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

Definition at line 1067 of file FastTimerService.cc.

Referenced by highlight_modules_().

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

Definition at line 1025 of file FastTimerService.cc.

Referenced by highlight_modules_().

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

Definition at line 940 of file FastTimerService.cc.

References c, dqm_path_(), mps_fire::i, edm::service::SystemBounds::maxNumberOfConcurrentLuminosityBlocks(), edm::service::SystemBounds::maxNumberOfConcurrentRuns(), edm::service::SystemBounds::maxNumberOfStreams(), edm::service::SystemBounds::maxNumberOfThreads(), processor_model, and alignCSCRings::s.

Referenced by highlight_modules_().

940  {
941  concurrent_lumis_ = bounds.maxNumberOfConcurrentLuminosityBlocks();
942  concurrent_runs_ = bounds.maxNumberOfConcurrentRuns();
943  concurrent_streams_ = bounds.maxNumberOfStreams();
944  concurrent_threads_ = bounds.maxNumberOfThreads();
945 
947  dqm_path_ += fmt::sprintf(
948  "/Running on %s with %d streams on %d threads", processor_model, concurrent_streams_, concurrent_threads_);
949 
950  // clean characters that are deemed unsafe for DQM
951  // see the definition of `s_safe` in DQMServices/Core/src/DQMStore.cc
952  auto safe_for_dqm = "/ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+=_()# "s;
953  for (auto& c : dqm_path_)
954  if (safe_for_dqm.find(c) == std::string::npos)
955  c = '_';
956 
957  // allocate atomic variables to keep track of the completion of each step, process by process
958  subprocess_event_check_ = std::make_unique<std::atomic<unsigned int>[]>(concurrent_streams_);
959  for (unsigned int i = 0; i < concurrent_streams_; ++i)
961  subprocess_global_run_check_ = std::make_unique<std::atomic<unsigned int>[]>(concurrent_runs_);
962  for (unsigned int i = 0; i < concurrent_runs_; ++i)
964  subprocess_global_lumi_check_ = std::make_unique<std::atomic<unsigned int>[]>(concurrent_lumis_);
965  for (unsigned int i = 0; i < concurrent_lumis_; ++i)
967 
968  // allocate buffers to keep track of the resources spent in the lumi and run transitions
969  lumi_transition_.resize(concurrent_lumis_);
970  run_transition_.resize(concurrent_runs_);
971 }
std::unique_ptr< std::atomic< unsigned int >[]> subprocess_global_lumi_check_
const edm::EventSetup & c
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_
unsigned int concurrent_streams_
void FastTimerService::preBeginJob ( edm::PathsAndConsumesOfModulesBase const &  pathsAndConsumes,
edm::ProcessContext const &  context 
)
private

Definition at line 977 of file FastTimerService.cc.

Referenced by highlight_modules_().

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

Definition at line 1427 of file FastTimerService.cc.

Referenced by highlight_modules_().

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

Definition at line 1589 of file FastTimerService.cc.

1589  {
1590  ignoredSignal(__func__);
1591 }
void ignoredSignal(const std::string &signal) const
void FastTimerService::preGlobalBeginLumi ( edm::GlobalContext const &  gc)
private

Definition at line 1027 of file FastTimerService.cc.

References edm::GlobalContext::luminosityBlockIndex().

Referenced by highlight_modules_().

1027  {
1028  ignoredSignal(__func__);
1029 
1030  // reset the lumi counters only during the main process being run
1031  if (isFirstSubprocess(gc)) {
1032  auto index = gc.luminosityBlockIndex();
1034  lumi_transition_[index].reset();
1035  }
1036 }
std::unique_ptr< std::atomic< unsigned int >[]> subprocess_global_lumi_check_
bool isFirstSubprocess(edm::StreamContext const &)
void ignoredSignal(const std::string &signal) const
std::vector< AtomicResources > lumi_transition_
void FastTimerService::preGlobalBeginRun ( edm::GlobalContext const &  gc)
private

Definition at line 898 of file FastTimerService.cc.

References dqm_lumisections_range_(), dqm_module_ranges_(), dqm_path_(), dqm_path_ranges_(), highlight_modules_(), edm::GlobalContext::runIndex(), and dqm::implementation::NavigatorBase::setCurrentFolder().

Referenced by highlight_modules_().

898  {
899  ignoredSignal(__func__);
900 
901  // reset the run counters only during the main process being run
902  if (isFirstSubprocess(gc)) {
903  auto index = gc.runIndex();
905  run_transition_[index].reset();
906  run_summary_[index].reset();
907 
908  // book the DQM plots
909  if (enable_dqm_) {
910  // define a callback to book the MonitorElements
911  auto bookTransactionCallback = [&, this](dqm::reco::DQMStore::IBooker& booker, dqm::reco::DQMStore::IGetter&) {
912  auto scope = dqm::reco::DQMStore::IBooker::UseRunScope(booker);
913  // we should really do this, but only DQMStore is allowed to touch it
914  // We could move to postGlobalBeginRun, then the DQMStore has sure set it up.
915  //booker.setRunLumi(gc.luminosityBlockID());
916  booker.setCurrentFolder(dqm_path_);
917  plots_->book(booker,
918  callgraph_,
928  };
929 
930  // book MonitorElements for this stream
931  edm::Service<dqm::legacy::DQMStore>()->meBookerGetter(bookTransactionCallback);
932  }
933  }
934 }
const PlotRanges dqm_event_ranges_
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
std::vector< GroupOfModules > highlight_modules_
bool isFirstSubprocess(edm::StreamContext const &)
std::unique_ptr< std::atomic< unsigned int >[]> subprocess_global_run_check_
const bool enable_dqm_bypath_
const PlotRanges dqm_path_ranges_
std::vector< ResourcesPerJob > run_summary_
const unsigned int dqm_lumisections_range_
std::string dqm_path_
const bool enable_dqm_transitions_
const bool enable_dqm_bymodule_
const PlotRanges dqm_module_ranges_
const bool enable_dqm_byls_
std::vector< AtomicResources > run_transition_
void ignoredSignal(const std::string &signal) const
std::unique_ptr< PlotsPerJob > plots_
UseScope< MonitorElementData::Scope::RUN > UseRunScope
Definition: DQMStore.h:464
ProcessCallGraph callgraph_
void FastTimerService::preGlobalEndLumi ( edm::GlobalContext const &  gc)
private

Definition at line 1040 of file FastTimerService.cc.

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

Definition at line 1069 of file FastTimerService.cc.

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

Definition at line 1552 of file FastTimerService.cc.

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

Referenced by highlight_modules_().

1552  {
1553  unsigned int sid = sc.streamID().value();
1554  auto& stream = streams_[sid];
1555  thread().measure_and_accumulate(stream.overhead);
1556 }
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
void FastTimerService::preModuleEventAcquire ( edm::StreamContext const &  sc,
edm::ModuleCallingContext const &  mcc 
)
private

Definition at line 1535 of file FastTimerService.cc.

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

Referenced by highlight_modules_().

1535  {
1536  unsigned int sid = sc.streamID().value();
1537  auto& stream = streams_[sid];
1538  thread().measure_and_accumulate(stream.overhead);
1539 }
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
void FastTimerService::preModuleEventDelayedGet ( edm::StreamContext const &  sc,
edm::ModuleCallingContext const &  mcc 
)
private

Definition at line 1573 of file FastTimerService.cc.

Referenced by highlight_modules_().

1573  {
1574  unsupportedSignal(__func__);
1575 }
void unsupportedSignal(const std::string &signal) const
void FastTimerService::preModuleEventPrefetching ( edm::StreamContext const &  sc,
edm::ModuleCallingContext const &  mcc 
)
private

Definition at line 1581 of file FastTimerService.cc.

1581  {
1582  ignoredSignal(__func__);
1583 }
void ignoredSignal(const std::string &signal) const
void FastTimerService::preModuleGlobalBeginLumi ( edm::GlobalContext const &  gc,
edm::ModuleCallingContext const &  mcc 
)
private

Definition at line 1615 of file FastTimerService.cc.

Referenced by highlight_modules_().

1615  {
1617 }
AtomicResources overhead_
Measurement & thread()
void measure_and_accumulate(Resources &store) noexcept
void FastTimerService::preModuleGlobalBeginRun ( edm::GlobalContext const &  gc,
edm::ModuleCallingContext const &  mcc 
)
private

Definition at line 1597 of file FastTimerService.cc.

Referenced by highlight_modules_().

1597  {
1599 }
AtomicResources overhead_
Measurement & thread()
void measure_and_accumulate(Resources &store) noexcept
void FastTimerService::preModuleGlobalEndLumi ( edm::GlobalContext const &  gc,
edm::ModuleCallingContext const &  mcc 
)
private

Definition at line 1624 of file FastTimerService.cc.

Referenced by highlight_modules_().

1624  {
1626 }
AtomicResources overhead_
Measurement & thread()
void measure_and_accumulate(Resources &store) noexcept
void FastTimerService::preModuleGlobalEndRun ( edm::GlobalContext const &  gc,
edm::ModuleCallingContext const &  mcc 
)
private

Definition at line 1606 of file FastTimerService.cc.

Referenced by highlight_modules_().

1606  {
1608 }
AtomicResources overhead_
Measurement & thread()
void measure_and_accumulate(Resources &store) noexcept
void FastTimerService::preModuleStreamBeginLumi ( edm::StreamContext const &  sc,
edm::ModuleCallingContext const &  mcc 
)
private

Definition at line 1651 of file FastTimerService.cc.

Referenced by highlight_modules_().

1651  {
1653 }
AtomicResources overhead_
Measurement & thread()
void measure_and_accumulate(Resources &store) noexcept
void FastTimerService::preModuleStreamBeginRun ( edm::StreamContext const &  sc,
edm::ModuleCallingContext const &  mcc 
)
private

Definition at line 1633 of file FastTimerService.cc.

Referenced by highlight_modules_().

1633  {
1635 }
AtomicResources overhead_
Measurement & thread()
void measure_and_accumulate(Resources &store) noexcept
void FastTimerService::preModuleStreamEndLumi ( edm::StreamContext const &  sc,
edm::ModuleCallingContext const &  mcc 
)
private

Definition at line 1660 of file FastTimerService.cc.

Referenced by highlight_modules_().

1660  {
1662 }
AtomicResources overhead_
Measurement & thread()
void measure_and_accumulate(Resources &store) noexcept
void FastTimerService::preModuleStreamEndRun ( edm::StreamContext const &  sc,
edm::ModuleCallingContext const &  mcc 
)
private

Definition at line 1642 of file FastTimerService.cc.

Referenced by highlight_modules_().

1642  {
1644 }
AtomicResources overhead_
Measurement & thread()
void measure_and_accumulate(Resources &store) noexcept
void FastTimerService::prePathEvent ( edm::StreamContext const &  sc,
edm::PathContext const &  pc 
)
private

Definition at line 1501 of file FastTimerService.cc.

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

Referenced by highlight_modules_().

1501  {
1502  unsigned int sid = sc.streamID().value();
1503  unsigned int pid = callgraph_.processId(*sc.processContext());
1504  unsigned int id = pc.pathID();
1505  auto& stream = streams_[sid];
1506  auto& data = pc.isEndPath() ? stream.processes[pid].endpaths[id] : stream.processes[pid].paths[id];
1507  data.status = false;
1508  data.last = 0;
1509 }
uint16_t *__restrict__ id
unsigned int processId(edm::ProcessContext const &) const
std::vector< ResourcesPerJob > streams_
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t stream
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
ProcessCallGraph callgraph_
void FastTimerService::preSourceConstruction ( edm::ModuleDescription const &  module)
private

Definition at line 973 of file FastTimerService.cc.

Referenced by highlight_modules_().

973  {
975 }
void preSourceConstruction(edm::ModuleDescription const &)
ProcessCallGraph callgraph_
tuple module
Definition: callgraph.py:69
void FastTimerService::preSourceEvent ( edm::StreamID  sid)
private

Definition at line 1477 of file FastTimerService.cc.

References cms::cuda::stream.

Referenced by highlight_modules_().

1477  {
1478  // clear the event counters
1479  auto& stream = streams_[sid];
1480  stream.reset();
1481  ++stream.events;
1482 
1483  subprocess_event_check_[sid] = 0;
1484 
1485  // reuse the same measurement for the Source module and for the explicit begin of the Event
1486  auto& measurement = thread();
1487  measurement.measure_and_accumulate(stream.overhead);
1488  stream.event_measurement = measurement;
1489 }
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_
void FastTimerService::preSourceLumi ( edm::LuminosityBlockIndex  index)
private

Definition at line 1096 of file FastTimerService.cc.

Referenced by highlight_modules_().

AtomicResources overhead_
Measurement & thread()
void measure_and_accumulate(Resources &store) noexcept
void FastTimerService::preSourceRun ( edm::RunIndex  index)
private

Definition at line 1092 of file FastTimerService.cc.

Referenced by highlight_modules_().

AtomicResources overhead_
Measurement & thread()
void measure_and_accumulate(Resources &store) noexcept
void FastTimerService::preStreamBeginLumi ( edm::StreamContext const &  sc)
private

Definition at line 1061 of file FastTimerService.cc.

Referenced by highlight_modules_().

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

Definition at line 938 of file FastTimerService.cc.

Referenced by highlight_modules_().

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

Definition at line 1065 of file FastTimerService.cc.

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

Definition at line 1023 of file FastTimerService.cc.

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

Definition at line 1155 of file FastTimerService.cc.

References watchdog::group, FastTimerService::ResourcesPerJob::highlight, highlight_modules_(), mps_fire::i, visualization-live-secondInstance_cfg::m, callgraph::module, TrackingSourceConfig_Tier0_Cosmic_cff::modules, FastTimerService::ResourcesPerJob::modules, mergeVDriftHistosByStation::name, AlCaHLTBitMon_ParallelJobs::p, fed_dqm_sourceclient-live_cfg::path, ValidateTausOnZEEFastSim_cff::proc, FastTimerService::ResourcesPerJob::processes, source, and FastTimerService::ResourcesPerJob::total.

1155  {
1156  printHeader(out, "Event");
1157  printEventHeader(out, "Modules");
1158  auto const& source_d = callgraph_.source();
1159  auto const& source = data.modules[source_d.id()];
1160  printEventLine(out, source.total, source_d.moduleLabel());
1161  for (unsigned int i = 0; i < callgraph_.processes().size(); ++i) {
1162  auto const& proc_d = callgraph_.processDescription(i);
1163  auto const& proc = data.processes[i];
1164  printEventLine(out, proc.total, "process " + proc_d.name_);
1165  for (unsigned int m : proc_d.modules_) {
1166  auto const& module_d = callgraph_.module(m);
1167  auto const& module = data.modules[m];
1168  printEventLine(out, module.total, " " + module_d.moduleLabel());
1169  }
1170  }
1171  printEventLine(out, data.total, "total");
1172  out << '\n';
1173  printEventHeader(out, "Processes and Paths");
1174  printEventLine(out, source.total, source_d.moduleLabel());
1175  for (unsigned int i = 0; i < callgraph_.processes().size(); ++i) {
1176  auto const& proc_d = callgraph_.processDescription(i);
1177  auto const& proc = data.processes[i];
1178  printEventLine(out, proc.total, "process " + proc_d.name_);
1179  for (unsigned int p = 0; p < proc.paths.size(); ++p) {
1180  auto const& name = proc_d.paths_[p].name_;
1181  auto const& path = proc.paths[p];
1182  printEventLine(out, path.active, name + " (only scheduled modules)");
1183  printEventLine(out, path.total, name + " (including dependencies)");
1184  }
1185  for (unsigned int p = 0; p < proc.endpaths.size(); ++p) {
1186  auto const& name = proc_d.endPaths_[p].name_;
1187  auto const& path = proc.endpaths[p];
1188  printEventLine(out, path.active, name + " (only scheduled modules)");
1189  printEventLine(out, path.total, name + " (including dependencies)");
1190  }
1191  }
1192  printEventLine(out, data.total, "total");
1193  out << '\n';
1194  for (unsigned int group : boost::irange(0ul, highlight_modules_.size())) {
1195  printEventHeader(out, "Highlighted modules");
1196  for (unsigned int m : highlight_modules_[group].modules) {
1197  auto const& module_d = callgraph_.module(m);
1198  auto const& module = data.modules[m];
1199  printEventLine(out, module.total, " " + module_d.moduleLabel());
1200  }
1201  printEventLine(out, data.highlight[group], highlight_modules_[group].label);
1202  out << '\n';
1203  }
1204 }
std::vector< GroupOfModules > highlight_modules_
edm::ModuleDescription const & source() const
void printHeader(T &out, std::string const &label) const
void printEventHeader(T &out, std::string const &label) const
std::vector< ProcessType > const & processes() const
ProcessType const & processDescription(unsigned int) const
void printEventLine(T &out, Resources const &data, std::string const &label) const
tuple group
Definition: watchdog.py:82
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
edm::ModuleDescription const & module(unsigned int module) const
ProcessCallGraph callgraph_
static std::string const source
Definition: EdmProvDump.cc:46
tuple module
Definition: callgraph.py:69
template<typename T >
void FastTimerService::printEventHeader ( T out,
std::string const &  label 
) const
private
template<typename T >
void FastTimerService::printEventHeader ( T out,
std::string const &  label 
) const

Definition at line 1129 of file FastTimerService.cc.

1129  {
1130  out << "FastReport CPU time Real time Allocated Deallocated " << label << "\n";
1131  // FastReport ########.# ms ########.# ms +######### kB -######### kB ...
1132 }
char const * label
template<typename T >
void FastTimerService::printEventLine ( T out,
Resources const &  data,
std::string const &  label 
) const
private
template<typename T >
void FastTimerService::printEventLine ( T out,
AtomicResources const &  data,
std::string const &  label 
) const
private
template<typename T >
void FastTimerService::printEventLine ( T out,
Resources const &  data,
std::string const &  label 
) const

Definition at line 1135 of file FastTimerService.cc.

References FastTimerService::Resources::allocated, FastTimerService::Resources::deallocated, FastTimerService::Resources::time_real, and FastTimerService::Resources::time_thread.

1135  {
1136  out << fmt::sprintf("FastReport %10.1f ms %10.1f ms %+10d kB %+10d kB %s\n",
1137  ms(data.time_thread),
1138  ms(data.time_real),
1139  +static_cast<int64_t>(kB(data.allocated)),
1140  -static_cast<int64_t>(kB(data.deallocated)),
1141  label);
1142 }
char const * label
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
template<typename T >
void FastTimerService::printEventLine ( T out,
AtomicResources const &  data,
std::string const &  label 
) const

Definition at line 1145 of file FastTimerService.cc.

References FastTimerService::AtomicResources::allocated, FastTimerService::AtomicResources::deallocated, FastTimerService::AtomicResources::time_real, and FastTimerService::AtomicResources::time_thread.

1145  {
1146  out << fmt::sprintf("FastReport %10.1f ms %10.1f ms %+10d kB %+10d kB %s\n",
1147  ms(boost::chrono::nanoseconds(data.time_thread.load())),
1148  ms(boost::chrono::nanoseconds(data.time_real.load())),
1149  +static_cast<int64_t>(kB(data.allocated)),
1150  -static_cast<int64_t>(kB(data.deallocated)),
1151  label);
1152 }
boost::date_time::subsecond_duration< boost::posix_time::time_duration, 1000000000 > nanoseconds
char const * label
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
template<typename T >
void FastTimerService::printHeader ( T out,
std::string const &  label 
) const
private
template<typename T >
void FastTimerService::printHeader ( T out,
std::string const &  label 
) const

Definition at line 1116 of file FastTimerService.cc.

References mps_fire::i.

1116  {
1117  out << "FastReport ";
1118  if (label.size() < 60)
1119  for (unsigned int i = (60 - label.size()) / 2; i > 0; --i)
1120  out << '-';
1121  out << ' ' << label << " Summary ";
1122  if (label.size() < 60)
1123  for (unsigned int i = (59 - label.size()) / 2; i > 0; --i)
1124  out << '-';
1125  out << '\n';
1126 }
char const * label
template<typename T >
void FastTimerService::printPathSummaryHeader ( T out,
std::string const &  label 
) const
private
template<typename T >
void FastTimerService::printPathSummaryHeader ( T out,
std::string const &  label 
) const

Definition at line 1220 of file FastTimerService.cc.

1220  {
1221  // clang-format off
1222  out << "FastReport CPU time sched. / depend. Real time sched. / depend. Alloc. sched. / depend. Dealloc. sched. / depend. ";
1223  // FastReport ########.# ms ########.# ms ########.# ms ########.# ms +######### kB +######### kB -######### kB -######### kB ...
1224  out << label << '\n';
1225  // clang-format on
1226 }
char const * label
template<typename T >
void FastTimerService::printPathSummaryLine ( T out,
Resources const &  data,
Resources const &  total,
uint64_t  events,
std::string const &  label 
) const
private
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 1292 of file FastTimerService.cc.

References FastTimerService::Resources::allocated, FastTimerService::Resources::deallocated, FastTimerService::Resources::time_real, and FastTimerService::Resources::time_thread.

1293  {
1294  out << fmt::sprintf(
1295  "FastReport %10.1f ms %10.1f ms %10.1f ms %10.1f ms %+10d kB %+10d kB %+10d kB %+10d kB %s\n",
1296  (events ? ms(data.time_thread) / events : 0),
1297  (events ? ms(total.time_thread) / events : 0),
1298  (events ? ms(data.time_real) / events : 0),
1299  (events ? ms(total.time_real) / events : 0),
1300  (events ? +static_cast<int64_t>(kB(data.allocated) / events) : 0),
1301  (events ? +static_cast<int64_t>(kB(total.allocated) / events) : 0),
1302  (events ? -static_cast<int64_t>(kB(data.deallocated) / events) : 0),
1303  (events ? -static_cast<int64_t>(kB(total.deallocated) / events) : 0),
1304  label);
1305 }
char const * label
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
tuple events
Definition: patZpeak.py:20
template<typename T >
void FastTimerService::printSummary ( T out,
ResourcesPerJob const &  data,
std::string const &  label 
) const
private
template<typename T >
void FastTimerService::printSummary ( T out,
ResourcesPerJob const &  data,
std::string const &  label 
) const

Definition at line 1308 of file FastTimerService.cc.

References FastTimerService::ResourcesPerJob::events, watchdog::group, FastTimerService::ResourcesPerJob::highlight, highlight_modules_(), mps_fire::i, visualization-live-secondInstance_cfg::m, callgraph::module, TrackingSourceConfig_Tier0_Cosmic_cff::modules, FastTimerService::ResourcesPerJob::modules, mergeVDriftHistosByStation::name, FastTimerService::ResourcesPerJob::overhead, AlCaHLTBitMon_ParallelJobs::p, fed_dqm_sourceclient-live_cfg::path, ValidateTausOnZEEFastSim_cff::proc, FastTimerService::ResourcesPerJob::processes, source, and FastTimerService::ResourcesPerJob::total.

1308  {
1309  printHeader(out, label);
1310  printSummaryHeader(out, "Modules", true);
1311  auto const& source_d = callgraph_.source();
1312  auto const& source = data.modules[source_d.id()];
1313  printSummaryLine(out, source.total, data.events, source.events, source_d.moduleLabel());
1314  for (unsigned int i = 0; i < callgraph_.processes().size(); ++i) {
1315  auto const& proc_d = callgraph_.processDescription(i);
1316  auto const& proc = data.processes[i];
1317  printSummaryLine(out, proc.total, data.events, "process " + proc_d.name_);
1318  for (unsigned int m : proc_d.modules_) {
1319  auto const& module_d = callgraph_.module(m);
1320  auto const& module = data.modules[m];
1321  printSummaryLine(out, module.total, data.events, module.events, " " + module_d.moduleLabel());
1322  }
1323  }
1324  printSummaryLine(out, data.total, data.events, "total");
1325  printSummaryLine(out, data.overhead, data.events, "other");
1326  out << '\n';
1327  printPathSummaryHeader(out, "Processes and Paths");
1328  printSummaryLine(out, source.total, data.events, source_d.moduleLabel());
1329  for (unsigned int i = 0; i < callgraph_.processes().size(); ++i) {
1330  auto const& proc_d = callgraph_.processDescription(i);
1331  auto const& proc = data.processes[i];
1332  printSummaryLine(out, proc.total, data.events, "process " + proc_d.name_);
1333  for (unsigned int p = 0; p < proc.paths.size(); ++p) {
1334  auto const& name = proc_d.paths_[p].name_;
1335  auto const& path = proc.paths[p];
1336  printPathSummaryLine(out, path.active, path.total, data.events, " " + name);
1337  }
1338  for (unsigned int p = 0; p < proc.endpaths.size(); ++p) {
1339  auto const& name = proc_d.endPaths_[p].name_;
1340  auto const& path = proc.endpaths[p];
1341  printPathSummaryLine(out, path.active, path.total, data.events, " " + name);
1342  }
1343  }
1344  printSummaryLine(out, data.total, data.events, "total");
1345  printSummaryLine(out, data.overhead, data.events, "other");
1346  out << '\n';
1347  for (unsigned int group : boost::irange(0ul, highlight_modules_.size())) {
1348  printSummaryHeader(out, "Highlighted modules", true);
1349  for (unsigned int m : highlight_modules_[group].modules) {
1350  auto const& module_d = callgraph_.module(m);
1351  auto const& module = data.modules[m];
1352  printSummaryLine(out, module.total, data.events, module.events, module_d.moduleLabel());
1353  }
1354  printSummaryLine(out, data.highlight[group], data.events, highlight_modules_[group].label);
1355  out << '\n';
1356  }
1357 }
std::vector< GroupOfModules > highlight_modules_
edm::ModuleDescription const & source() const
char const * label
void printHeader(T &out, std::string const &label) const
void printPathSummaryHeader(T &out, std::string const &label) const
void printSummaryHeader(T &out, std::string const &label, bool detailed) const
std::vector< ProcessType > const & processes() const
ProcessType const & processDescription(unsigned int) const
void printSummaryLine(T &out, Resources const &data, uint64_t events, std::string const &label) const
void printPathSummaryLine(T &out, Resources const &data, Resources const &total, uint64_t events, std::string const &label) const
tuple group
Definition: watchdog.py:82
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
edm::ModuleDescription const & module(unsigned int module) const
ProcessCallGraph callgraph_
static std::string const source
Definition: EdmProvDump.cc:46
tuple module
Definition: callgraph.py:69
template<typename T >
void FastTimerService::printSummaryHeader ( T out,
std::string const &  label,
bool  detailed 
) const
private
template<typename T >
void FastTimerService::printSummaryHeader ( T out,
std::string const &  label,
bool  detailed 
) const

Definition at line 1207 of file FastTimerService.cc.

1207  {
1208  // clang-format off
1209  if (detailed)
1210  out << "FastReport CPU time avg. when run Real time avg. when run Alloc. avg. when run Dealloc. avg. when run ";
1211  // FastReport ########.# ms ########.# ms ########.# ms ########.# ms +######### kB +######### kB -######### kB -######### kB ...
1212  else
1213  out << "FastReport CPU time avg. Real time avg. Alloc. avg. Dealloc. avg. ";
1214  // FastReport ########.# ms ########.# ms +######### kB -######### kB ...
1215  out << label << '\n';
1216  // clang-format on
1217 }
char const * label
template<typename T >
void FastTimerService::printSummaryLine ( T out,
Resources const &  data,
uint64_t  events,
std::string const &  label 
) const
private
template<typename T >
void FastTimerService::printSummaryLine ( T out,
Resources const &  data,
uint64_t  events,
uint64_t  active,
std::string const &  label 
) const
private
template<typename T >
void FastTimerService::printSummaryLine ( T out,
AtomicResources const &  data,
uint64_t  events,
std::string const &  label 
) const
private
template<typename T >
void FastTimerService::printSummaryLine ( T out,
AtomicResources const &  data,
uint64_t  events,
uint64_t  active,
std::string const &  label 
) const
private
template<typename T >
void FastTimerService::printSummaryLine ( T out,
Resources const &  data,
uint64_t  events,
std::string const &  label 
) const

Definition at line 1229 of file FastTimerService.cc.

References FastTimerService::Resources::allocated, FastTimerService::Resources::deallocated, FastTimerService::Resources::time_real, and FastTimerService::Resources::time_thread.

1229  {
1230  out << fmt::sprintf(
1231  // clang-format off
1232  "FastReport %10.1f ms %10.1f ms %+10d kB %+10d kB %s\n",
1233  // clang-format on
1234  (events ? ms(data.time_thread) / events : 0),
1235  (events ? ms(data.time_real) / events : 0),
1236  (events ? +static_cast<int64_t>(kB(data.allocated) / events) : 0),
1237  (events ? -static_cast<int64_t>(kB(data.deallocated) / events) : 0),
1238  label);
1239 }
char const * label
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
tuple events
Definition: patZpeak.py:20
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 1242 of file FastTimerService.cc.

References FastTimerService::AtomicResources::allocated, FastTimerService::AtomicResources::deallocated, FastTimerService::AtomicResources::time_real, and FastTimerService::AtomicResources::time_thread.

1243  {
1244  out << fmt::sprintf(
1245  // clang-format off
1246  "FastReport %10.1f ms %10.1f ms %10.1f ms %10.1f ms %+10d kB %+10d kB %+10d kB %+10d kB %s\n",
1247  // clang-format on
1248  (events ? ms(data.time_thread) / events : 0),
1249  (active ? ms(data.time_thread) / active : 0),
1250  (events ? ms(data.time_real) / events : 0),
1251  (active ? ms(data.time_real) / active : 0),
1252  (events ? +static_cast<int64_t>(kB(data.allocated) / events) : 0),
1253  (active ? +static_cast<int64_t>(kB(data.allocated) / active) : 0),
1254  (events ? -static_cast<int64_t>(kB(data.deallocated) / events) : 0),
1255  (active ? -static_cast<int64_t>(kB(data.deallocated) / active) : 0),
1256  label);
1257 }
char const * label
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
tuple events
Definition: patZpeak.py:20
template<typename T >
void FastTimerService::printSummaryLine ( T out,
AtomicResources const &  data,
uint64_t  events,
std::string const &  label 
) const

Definition at line 1260 of file FastTimerService.cc.

References FastTimerService::AtomicResources::allocated, FastTimerService::AtomicResources::deallocated, FastTimerService::AtomicResources::time_real, and FastTimerService::AtomicResources::time_thread.

1263  {
1264  out << fmt::sprintf(
1265  // clang-format off
1266  "FastReport %10.1f ms %10.1f ms %+10d kB %+10d kB %s\n",
1267  // clang-format on
1268  (events ? ms(data.time_thread) / events : 0),
1269  (events ? ms(data.time_real) / events : 0),
1270  (events ? +static_cast<int64_t>(kB(data.allocated) / events) : 0),
1271  (events ? -static_cast<int64_t>(kB(data.deallocated) / events) : 0),
1272  label);
1273 }
char const * label
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
tuple events
Definition: patZpeak.py:20
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 1276 of file FastTimerService.cc.

References FastTimerService::Resources::allocated, FastTimerService::Resources::deallocated, FastTimerService::Resources::time_real, and FastTimerService::Resources::time_thread.

1277  {
1278  out << fmt::sprintf(
1279  "FastReport %10.1f ms %10.1f ms %10.1f ms %10.1f ms %+10d kB %+10d kB %+10d kB %+10d kB %s\n",
1280  (events ? ms(data.time_thread) / events : 0),
1281  (active ? ms(data.time_thread) / active : 0),
1282  (events ? ms(data.time_real) / events : 0),
1283  (active ? ms(data.time_real) / active : 0),
1284  (events ? +static_cast<int64_t>(kB(data.allocated) / events) : 0),
1285  (active ? +static_cast<int64_t>(kB(data.allocated) / active) : 0),
1286  (events ? -static_cast<int64_t>(kB(data.deallocated) / events) : 0),
1287  (active ? -static_cast<int64_t>(kB(data.deallocated) / active) : 0),
1288  label);
1289 }
char const * label
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
tuple events
Definition: patZpeak.py:20
template<typename T >
void FastTimerService::printTransition ( T out,
AtomicResources const &  data,
std::string const &  label 
) const
private
template<typename T >
void FastTimerService::printTransition ( T out,
AtomicResources const &  data,
std::string const &  label 
) const

Definition at line 1360 of file FastTimerService.cc.

1360  {
1361  printEventHeader(out, "Transition");
1363 }
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:79
FastTimerService::Measurement & FastTimerService::thread ( )
private

Definition at line 1730 of file FastTimerService.cc.

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

Referenced by on_scheduler_entry().

1730 { return guard_.thread(); }
void FastTimerService::unsupportedSignal ( const std::string &  signal) const
private

Definition at line 890 of file FastTimerService.cc.

890  {
891  // warn about each signal only once per job
892  if (unsupported_signals_.insert(signal).second)
893  edm::LogWarning("FastTimerService") << "The FastTimerService received the unsupported signal \"" << signal
894  << "\".\n"
895  << "Please report how to reproduce the issue to cms-hlt@cern.ch .";
896 }
tbb::concurrent_unordered_set< std::string > unsupported_signals_
void FastTimerService::writeSummaryJSON ( ResourcesPerJob const &  data,
std::string const &  filename 
) const
private

Definition at line 1383 of file FastTimerService.cc.

References mps_check::array, FastTimerService::ResourcesPerJob::events, mps_fire::i, dqmiolumiharvest::j, FastTimerService::ResourcesPerJob::modules, submitPVResolutionJobs::out, FastTimerService::ResourcesPerJob::overhead, and FastTimerService::ResourcesPerJob::total.

1383  {
1384  json j;
1385 
1386  // write a description of the resources
1387  j["resources"] = json::array({json{{"time_real", "real time"}},
1388  json{{"time_thread", "cpu time"}},
1389  json{{"mem_alloc", "allocated memory"}},
1390  json{{"mem_free", "deallocated memory"}}});
1391 
1392  // write the resources used by the job
1393  j["total"] = encodeToJSON("Job", callgraph_.processDescription(0).name_, data.events, data.total + data.overhead);
1394 
1395  // write the resources used by every module
1396  j["modules"] = json::array();
1397  for (unsigned int i = 0; i < callgraph_.size(); ++i) {
1398  auto const& module = callgraph_.module(i);
1399  auto const& data_m = data.modules[i];
1400  j["modules"].push_back(encodeToJSON(module, data_m));
1401  }
1402 
1403  // add an entry for the "overhead"
1404  j["modules"].push_back(encodeToJSON("other", "other", data.events, data.overhead));
1405 
1406  std::ofstream out(filename);
1407  out << std::setw(2) << j << std::flush;
1408 }
tuple array
Definition: mps_check.py:216
nlohmann::json json
ProcessType const & processDescription(unsigned int) const
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
tuple filename
Definition: lut2db_cfg.py:20
unsigned int size() const
edm::ModuleDescription const & module(unsigned int module) const
ProcessCallGraph callgraph_
tuple module
Definition: callgraph.py:69
json encodeToJSON(std::string const &type, std::string const &label, unsigned int events, T const &data) const

Member Data Documentation

ProcessCallGraph FastTimerService::callgraph_
private

Definition at line 441 of file FastTimerService.h.

unsigned int FastTimerService::concurrent_lumis_
private

Definition at line 496 of file FastTimerService.h.

unsigned int FastTimerService::concurrent_runs_
private

Definition at line 497 of file FastTimerService.h.

unsigned int FastTimerService::concurrent_streams_
private

Definition at line 498 of file FastTimerService.h.

unsigned int FastTimerService::concurrent_threads_
private

Definition at line 499 of file FastTimerService.h.

const PlotRanges FastTimerService::dqm_event_ranges_
private

Definition at line 521 of file FastTimerService.h.

const unsigned int FastTimerService::dqm_lumisections_range_
private

Definition at line 524 of file FastTimerService.h.

const PlotRanges FastTimerService::dqm_module_ranges_
private

Definition at line 523 of file FastTimerService.h.

std::string FastTimerService::dqm_path_
private

Definition at line 525 of file FastTimerService.h.

const PlotRanges FastTimerService::dqm_path_ranges_
private

Definition at line 522 of file FastTimerService.h.

bool FastTimerService::enable_dqm_
private

Definition at line 514 of file FastTimerService.h.

const bool FastTimerService::enable_dqm_byls_
private

Definition at line 517 of file FastTimerService.h.

const bool FastTimerService::enable_dqm_bymodule_
private

Definition at line 515 of file FastTimerService.h.

const bool FastTimerService::enable_dqm_bynproc_
private

Definition at line 518 of file FastTimerService.h.

const bool FastTimerService::enable_dqm_bypath_
private

Definition at line 516 of file FastTimerService.h.

const bool FastTimerService::enable_dqm_transitions_
private

Definition at line 519 of file FastTimerService.h.

ThreadGuard FastTimerService::guard_
private

Definition at line 485 of file FastTimerService.h.

Referenced by on_scheduler_entry(), and thread().

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

Definition at line 527 of file FastTimerService.h.

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

Definition at line 528 of file FastTimerService.h.

ResourcesPerJob FastTimerService::job_summary_
private

Definition at line 455 of file FastTimerService.h.

const std::string FastTimerService::json_filename_
private

Definition at line 511 of file FastTimerService.h.

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

Definition at line 450 of file FastTimerService.h.

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

Definition at line 447 of file FastTimerService.h.

const bool FastTimerService::print_event_summary_
private

Definition at line 502 of file FastTimerService.h.

const bool FastTimerService::print_job_summary_
private

Definition at line 504 of file FastTimerService.h.

const bool FastTimerService::print_run_summary_
private

Definition at line 503 of file FastTimerService.h.

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

Definition at line 456 of file FastTimerService.h.

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

Definition at line 451 of file FastTimerService.h.

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

Definition at line 444 of file FastTimerService.h.

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

Definition at line 488 of file FastTimerService.h.

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

Definition at line 489 of file FastTimerService.h.

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

Definition at line 490 of file FastTimerService.h.

std::mutex FastTimerService::summary_mutex_
private

Definition at line 457 of file FastTimerService.h.

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

Definition at line 531 of file FastTimerService.h.

const bool FastTimerService::write_json_summary_
private

Definition at line 510 of file FastTimerService.h.