|
|
Go to the documentation of this file.
7 #include <fmt/printf.h>
19 desc.addUntracked<uint32_t>(
"eventRange", 10000)->setComment(
"Preallocate a buffer for N events");
20 desc.addUntracked<uint32_t>(
"eventResolution", 1)->setComment(
"Sample the processing time every N events");
21 desc.addUntracked<
bool>(
"printEventSummary",
false);
30 descriptions.
add(
"ThroughputService",
desc);
35 m_startup(
std::chrono::system_clock::
now()),
37 m_resolution(
config.getUntrackedParameter<uint32_t>(
"eventResolution")),
39 m_events(
config.getUntrackedParameter<uint32_t>(
"eventRange") / m_resolution),
40 m_print_event_summary(
config.getUntrackedParameter<
bool>(
"printEventSummary")),
41 m_enable_dqm(
config.getUntrackedParameter<
bool>(
"enableDQM")),
42 m_dqm_bynproc(m_enable_dqm ?
config.getUntrackedParameter<
bool>(
"dqmPathByProcesses") :
false),
43 m_dqm_path(m_enable_dqm ?
config.getUntrackedParameter<
std::
string>(
"dqmPath") :
""),
44 m_time_range(m_enable_dqm ?
config.getUntrackedParameter<double>(
"timeRange") : 0.),
45 m_time_resolution(m_enable_dqm ?
config.getUntrackedParameter<double>(
"timeResolution") : 0.) {
59 "/Running on %s with %d streams on %d threads",
processor_model, concurrent_streams, concurrent_threads);
68 edm::LogWarning(
"ThroughputService") <<
"The DQMStore is not avalable, the DQM plots will not be generated";
118 edm::LogWarning(
"ThroughputService") <<
"Not enough events to measure the throughput with a resolution of "
143 double throughput_avg = double(
m_resolution) / time_avg;
144 double throughput_dev = double(
m_resolution) * time_dev / time_avg / time_avg;
146 info <<
"Average throughput: " << throughput_avg <<
" ± " << throughput_dev <<
" ev/s";
const double m_time_range
dqm::reco::MonitorElement * m_sourced_events
const uint32_t m_resolution
#define DEFINE_FWK_SERVICE(type)
virtual void setCurrentFolder(std::string const &fullpath)
void postEvent(edm::StreamContext const &sc)
void preGlobalBeginRun(edm::GlobalContext const &gc)
dqm::reco::MonitorElement * m_retired_events
Log< level::Warning, false > LogWarning
void preSourceEvent(edm::StreamID sid)
bool m_print_event_summary
tbb::concurrent_vector< std::chrono::system_clock::time_point > m_events
void watchPostEndJob(PostEndJob::slot_type const &iSlot)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
virtual void setXTitle(std::string const &title)
void watchPostEvent(PostEvent::slot_type const &iSlot)
unsigned int maxNumberOfThreads() const
virtual void setYTitle(std::string const &title)
unsigned int maxNumberOfStreams() const
std::atomic< uint32_t > m_counter
const double m_time_resolution
void watchPreSourceEvent(PreSourceEvent::slot_type const &iSlot)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
std::chrono::system_clock::time_point m_startup
void preallocate(edm::service::SystemBounds const &bounds)
void watchPreGlobalBeginRun(PreGlobalBeginRun::slot_type const &iSlot)
ThroughputService(const edm::ParameterSet &, edm::ActivityRegistry &)
const std::string processor_model
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())