13 #include <unordered_set>
14 #include <unordered_map>
17 #include <boost/format.hpp>
20 #include <tbb/concurrent_vector.h>
44 m_use_realtime( config.getUntrackedParameter<bool>(
"useRealTimeClock" ) ),
45 m_enable_timing_paths( config.getUntrackedParameter<bool>(
"enableTimingPaths" ) ),
46 m_enable_timing_modules( config.getUntrackedParameter<bool>(
"enableTimingModules" ) ),
47 m_enable_timing_exclusive( config.getUntrackedParameter<bool>(
"enableTimingExclusive" ) ),
48 m_enable_timing_summary( config.getUntrackedParameter<bool>(
"enableTimingSummary" ) ),
49 m_skip_first_path( config.getUntrackedParameter<bool>(
"skipFirstPath" ) ),
51 m_enable_dqm( config.getUntrackedParameter<bool>(
"enableDQM" ) ),
52 m_enable_dqm_bypath_active( config.getUntrackedParameter<bool>(
"enableDQMbyPathActive" ) ),
53 m_enable_dqm_bypath_total( config.getUntrackedParameter<bool>(
"enableDQMbyPathTotal" ) ),
54 m_enable_dqm_bypath_overhead( config.getUntrackedParameter<bool>(
"enableDQMbyPathOverhead" ) ),
55 m_enable_dqm_bypath_details( config.getUntrackedParameter<bool>(
"enableDQMbyPathDetails" ) ),
56 m_enable_dqm_bypath_counters( config.getUntrackedParameter<bool>(
"enableDQMbyPathCounters" ) ),
57 m_enable_dqm_bypath_exclusive( config.getUntrackedParameter<bool>(
"enableDQMbyPathExclusive" ) ),
58 m_enable_dqm_bymodule( config.getUntrackedParameter<bool>(
"enableDQMbyModule" ) ),
59 m_enable_dqm_bymoduletype( config.getUntrackedParameter<bool>(
"enableDQMbyModuleType" ) ),
60 m_enable_dqm_summary( config.getUntrackedParameter<bool>(
"enableDQMSummary" ) ),
61 m_enable_dqm_byls( config.getUntrackedParameter<bool>(
"enableDQMbyLumiSection" ) ),
62 m_enable_dqm_bynproc( config.getUntrackedParameter<bool>(
"enableDQMbyProcesses" ) ),
64 m_concurrent_runs( 0 ),
65 m_concurrent_streams( 0 ),
66 m_concurrent_threads( 0 ),
67 m_module_id( edm::ModuleDescription::invalidID() ),
68 m_dqm_eventtime_range( config.getUntrackedParameter<double>(
"dqmTimeRange" ) ),
69 m_dqm_eventtime_resolution( config.getUntrackedParameter<double>(
"dqmTimeResolution" ) ),
70 m_dqm_pathtime_range( config.getUntrackedParameter<double>(
"dqmPathTimeRange" ) ),
71 m_dqm_pathtime_resolution( config.getUntrackedParameter<double>(
"dqmPathTimeResolution" ) ),
72 m_dqm_moduletime_range( config.getUntrackedParameter<double>(
"dqmModuleTimeRange" ) ),
73 m_dqm_moduletime_resolution( config.getUntrackedParameter<double>(
"dqmModuleTimeResolution" ) ),
74 m_dqm_path( config.getUntrackedParameter<std::
string>(
"dqmPath" ) ),
84 m_run_summary_perprocess(),
85 m_job_summary_perprocess()
188 uint32_t
size = size_p + size_e;
191 if (stream.paths.size() <=
pid)
192 stream.paths.resize(pid+1);
193 for (uint32_t
i = 0;
i < size_p; ++
i) {
195 for (
auto & stream: m_stream)
198 for (uint32_t
i = 0;
i < size_e; ++
i) {
200 for (
auto & stream: m_stream)
201 stream.paths[
pid][
label].index = size_p +
i;
203 for (
auto & stream: m_stream) {
205 if (stream.timing_perprocess.size() <=
pid)
206 stream.timing_perprocess.resize(pid+1);
207 stream.timing_perprocess[
pid].paths_interpaths.assign(size + 1, 0.);
209 if (stream.dqm_perprocess.size() <=
pid)
210 stream.dqm_perprocess.resize(pid+1);
211 if (stream.dqm_perprocess_byluminosity.size() <=
pid)
212 stream.dqm_perprocess_byluminosity.resize(pid+1);
213 if (stream.dqm_paths.size() <=
pid)
214 stream.dqm_paths.resize(pid+1);
219 summary[
pid].paths_interpaths.assign(size + 1, 0);
228 m_run_summary_perprocess[rid][
pid].reset();
256 m_enable_dqm =
false;
263 uint32_t
size = size_p + size_e;
277 stream.dqm.presource = booker.book1D(
"presource",
"Pre-Source processing time", modulebins, 0.,
m_dqm_moduletime_range)->getTH1F();
278 stream.dqm.presource ->StatOverflows(
true);
279 stream.dqm.presource ->SetXTitle(
"processing time [ms]");
280 stream.dqm.source = booker.book1D(
"source",
"Source processing time", modulebins, 0.,
m_dqm_moduletime_range)->getTH1F();
281 stream.dqm.source ->StatOverflows(
true);
282 stream.dqm.source ->SetXTitle(
"processing time [ms]");
283 stream.dqm.preevent = booker.book1D(
"preevent",
"Pre-Event processing time", modulebins, 0.,
m_dqm_moduletime_range)->getTH1F();
284 stream.dqm.preevent ->StatOverflows(
true);
285 stream.dqm.preevent ->SetXTitle(
"processing time [ms]");
286 stream.dqm.event = booker.book1D(
"event",
"Event processing time", eventbins, 0.,
m_dqm_eventtime_range)->getTH1F();
287 stream.dqm.event ->StatOverflows(
true);
288 stream.dqm.event ->SetXTitle(
"processing time [ms]");
292 booker.setCurrentFolder(
m_dqm_path +
"/process " + process_name);
293 stream.dqm_perprocess[
pid].preevent = booker.book1D(
"preevent",
"Pre-Event processing time", modulebins, 0.,
m_dqm_moduletime_range)->getTH1F();
294 stream.dqm_perprocess[
pid].preevent ->StatOverflows(
true);
295 stream.dqm_perprocess[
pid].preevent ->SetXTitle(
"processing time [ms]");
296 stream.dqm_perprocess[
pid].event = booker.book1D(
"event",
"Event processing time", eventbins, 0.,
m_dqm_eventtime_range)->getTH1F();
297 stream.dqm_perprocess[
pid].event ->StatOverflows(
true);
298 stream.dqm_perprocess[
pid].event ->SetXTitle(
"processing time [ms]");
299 stream.dqm_perprocess[
pid].all_paths = booker.book1D(
"all_paths",
"Paths processing time", eventbins, 0.,
m_dqm_eventtime_range)->getTH1F();
300 stream.dqm_perprocess[
pid].all_paths ->StatOverflows(
true);
301 stream.dqm_perprocess[
pid].all_paths ->SetXTitle(
"processing time [ms]");
302 stream.dqm_perprocess[
pid].all_endpaths = booker.book1D(
"all_endpaths",
"EndPaths processing time", pathbins, 0.,
m_dqm_pathtime_range)->getTH1F();
303 stream.dqm_perprocess[
pid].all_endpaths ->StatOverflows(
true);
304 stream.dqm_perprocess[
pid].all_endpaths ->SetXTitle(
"processing time [ms]");
305 stream.dqm_perprocess[
pid].interpaths = booker.book1D(
"interpaths",
"Time spent between paths", pathbins, 0.,
m_dqm_eventtime_range)->getTH1F();
306 stream.dqm_perprocess[
pid].interpaths ->StatOverflows(
true);
307 stream.dqm_perprocess[
pid].interpaths ->SetXTitle(
"processing time [ms]");
312 booker.setCurrentFolder(
m_dqm_path +
"/process " + process_name);
313 stream.dqm_paths[
pid].active_time = booker.bookProfile(
"paths_active_time",
"Additional time spent in each path", size, -0.5, size-0.5, pathbins, 0.,
std::numeric_limits<double>::infinity(),
" ")->getTProfile();
314 stream.dqm_paths[
pid].active_time ->StatOverflows(
true);
315 stream.dqm_paths[
pid].active_time ->SetYTitle(
"processing time [ms]");
316 stream.dqm_paths[
pid].total_time = booker.bookProfile(
"paths_total_time",
"Total time spent in each path", size, -0.5, size-0.5, pathbins, 0.,
std::numeric_limits<double>::infinity(),
" ")->getTProfile();
317 stream.dqm_paths[
pid].total_time ->StatOverflows(
true);
318 stream.dqm_paths[
pid].total_time ->SetYTitle(
"processing time [ms]");
319 stream.dqm_paths[
pid].exclusive_time = booker.bookProfile(
"paths_exclusive_time",
"Exclusive time spent in each path", size, -0.5, size-0.5, pathbins, 0.,
std::numeric_limits<double>::infinity(),
" ")->getTProfile();
320 stream.dqm_paths[
pid].exclusive_time ->StatOverflows(
true);
321 stream.dqm_paths[
pid].exclusive_time ->SetYTitle(
"processing time [ms]");
322 stream.dqm_paths[
pid].interpaths = booker.bookProfile(
"paths_interpaths",
"Time spent between each path", size+1, -0.5, size+0.5, pathbins, 0.,
std::numeric_limits<double>::infinity(),
" ")->getTProfile();
323 stream.dqm_paths[
pid].interpaths ->StatOverflows(
true);
324 stream.dqm_paths[
pid].interpaths ->SetYTitle(
"processing time [ms]");
326 for (uint32_t
i = 0;
i < size_p; ++
i) {
328 stream.dqm_paths[
pid].active_time ->GetXaxis()->SetBinLabel(
i + 1, label.c_str());
329 stream.dqm_paths[
pid].total_time ->GetXaxis()->SetBinLabel(
i + 1, label.c_str());
330 stream.dqm_paths[
pid].exclusive_time ->GetXaxis()->SetBinLabel(
i + 1, label.c_str());
331 stream.dqm_paths[
pid].interpaths ->GetXaxis()->SetBinLabel(
i + 1, label.c_str());
333 for (uint32_t
i = 0;
i < size_e; ++
i) {
335 stream.dqm_paths[
pid].active_time ->GetXaxis()->SetBinLabel(
i + size_p + 1, label.c_str());
336 stream.dqm_paths[
pid].total_time ->GetXaxis()->SetBinLabel(
i + size_p + 1, label.c_str());
337 stream.dqm_paths[
pid].exclusive_time ->GetXaxis()->SetBinLabel(
i + size_p + 1, label.c_str());
338 stream.dqm_paths[
pid].interpaths ->GetXaxis()->SetBinLabel(
i + size_p + 1, label.c_str());
340 stream.dqm_paths[
pid].interpaths ->GetXaxis()->SetBinLabel(size+1,
"");
352 auto &
plots = stream.dqm_byluminosity[
i];
355 plots.presource ->StatOverflows(
true);
357 plots.presource ->SetYTitle(
"processing time [ms]");
359 plots.source ->StatOverflows(
true);
361 plots.source ->SetYTitle(
"processing time [ms]");
363 plots.preevent ->StatOverflows(
true);
365 plots.preevent ->SetYTitle(
"processing time [ms]");
367 plots.event ->StatOverflows(
true);
369 plots.event ->SetYTitle(
"processing time [ms]");
377 booker.setCurrentFolder(
m_dqm_path +
"/process " + process_name);
379 auto &
plots = stream.dqm_perprocess_byluminosity[
pid][
i];
382 plots.preevent ->StatOverflows(
true);
384 plots.preevent ->SetYTitle(
"processing time [ms]");
386 plots.event ->StatOverflows(
true);
388 plots.event ->SetYTitle(
"processing time [ms]");
390 plots.all_paths ->StatOverflows(
true);
392 plots.all_paths ->SetYTitle(
"processing time [ms]");
394 plots.all_endpaths ->StatOverflows(
true);
396 plots.all_endpaths ->SetYTitle(
"processing time [ms]");
398 plots.interpaths ->StatOverflows(
true);
400 plots.interpaths ->SetYTitle(
"processing time [ms]");
406 booker.setCurrentFolder(
m_dqm_path +
"/process " + process_name +
"/Paths");
407 for (
auto & keyval: stream.paths[pid]) {
409 PathInfo & pathinfo = keyval.second;
414 pathinfo.
dqm_active ->SetXTitle(
"processing time [ms]");
419 pathinfo.
dqm_total ->StatOverflows(
true);
420 pathinfo.
dqm_total ->SetXTitle(
"processing time [ms]");
435 pathinfo.
dqm_overhead ->SetXTitle(
"processing time [ms]");
445 std::vector<std::string>();
450 static tbb::concurrent_vector<std::string> dup;
453 std::lock_guard<std::mutex>
lock(dup_mutex);
456 for (
unsigned int i = 0;
i < 32; ++
i)
461 if (modules.size() > dup.size()) {
462 std::lock_guard<std::mutex>
lock(dup_mutex);
463 unsigned int old_size = dup.size();
464 unsigned int new_size = modules.size();
465 if (new_size > old_size) {
466 dup.resize(new_size);
467 for (
unsigned int i = old_size;
i < new_size; ++
i)
472 std::vector<const char *>
labels(modules.size(),
nullptr);
473 for (uint32_t
i = 0;
i < modules.size(); ++
i)
477 if (m_enable_dqm_bypath_counters) {
478 pathinfo.
dqm_module_counter = booker.book1D(pathname +
"_module_counter", pathname +
" module counter", modules.size() + 1, -0.5, modules.size() + 0.5)->getTH1F();
480 for (uint32_t
i = 0;
i < modules.size(); ++
i)
486 pathinfo.
dqm_module_active = booker.book1D(pathname +
"_module_active", pathname +
" module active", modules.size(), -0.5, modules.size() - 0.5)->getTH1F();
488 pathinfo.
dqm_module_total = booker.book1D(pathname +
"_module_total", pathname +
" module total", modules.size(), -0.5, modules.size() - 0.5)->getTH1F();
491 for (uint32_t
i = 0;
i < modules.size(); ++
i) {
509 booker.setCurrentFolder(
m_dqm_path +
"/Modules");
510 for (
auto & keyval: stream.modules) {
515 module.
dqm_active->SetXTitle(
"processing time [ms]");
520 booker.setCurrentFolder(
m_dqm_path +
"/ModuleTypes");
521 for (
auto & keyval: stream.moduletypes) {
526 module.
dqm_active->SetXTitle(
"processing time [ms]");
555 stream.fast_moduletypes.resize(
m_module_id,
nullptr);
559 for (
auto & stream: m_stream)
640 std::ostringstream
out;
641 out << std::fixed << std::setprecision(6);
642 out <<
"FastReport for " << label <<
", process " << process <<
'\n';
644 out <<
"FastReport " << std::right << std::setw(10) << summary.
preevent / (double) total.
count <<
" Pre-Event" <<
'\n';
645 out <<
"FastReport " << std::right << std::setw(10) << summary.
event / (double) total.
count <<
" Event" <<
'\n';
646 out <<
"FastReport " << std::right << std::setw(10) << summary.
all_paths / (double) total.
count <<
" all Paths" <<
'\n';
647 out <<
"FastReport " << std::right << std::setw(10) << summary.
all_endpaths / (double) total.
count <<
" all EndPaths" <<
'\n';
648 out <<
"FastReport " << std::right << std::setw(10) << summary.
interpaths / (double) total.
count <<
" between paths" <<
'\n';
658 std::ostringstream
out;
659 out << std::fixed << std::setprecision(6);
660 out <<
"FastReport for " << label <<
", over all subprocesses" <<
'\n';
662 out <<
"FastReport " << std::right << std::setw(10) << summary.
presource / (double) summary.
count <<
" Pre-Source" <<
'\n';
663 out <<
"FastReport " << std::right << std::setw(10) << summary.
source / (double) summary.
count <<
" Source" <<
'\n';
664 out <<
"FastReport " << std::right << std::setw(10) << summary.
preevent / (double) summary.
count <<
" Pre-Event" <<
'\n';
665 out <<
"FastReport " << std::right << std::setw(10) << summary.
event / (double) summary.
count <<
" Event" <<
'\n';
737 if (module.
id() >= stream.fast_modules.size())
738 stream.fast_modules.resize(module.
id() + 1,
nullptr);
739 if (module.
id() >= stream.fast_moduletypes.size())
740 stream.fast_moduletypes.resize(module.
id() + 1,
nullptr);
742 stream.fast_modules[module.
id()] = & stream.modules[module.
moduleLabel()];;
743 stream.fast_moduletypes[module.
id()] = & stream.moduletypes[module.
moduleName()];
753 stream.timer_event.start();
756 stream.timing_perprocess[
pid].preevent =
delta(stream.timer_last_transition, stream.timer_event.getStartTime());
759 stream.timing_perprocess[
pid].event = 0;
760 stream.timing_perprocess[
pid].all_paths = 0;
761 stream.timing_perprocess[
pid].all_endpaths = 0;
762 stream.timing_perprocess[
pid].interpaths = 0;
763 stream.timing_perprocess[
pid].paths_interpaths.assign(stream.paths[pid].size() + 1, 0);
764 for (
auto & keyval : stream.paths[pid]) {
765 keyval.second.timer.reset();
766 keyval.second.time_active = 0.;
767 keyval.second.time_exclusive = 0.;
768 keyval.second.time_premodules = 0.;
769 keyval.second.time_intermodules = 0.;
770 keyval.second.time_postmodules = 0.;
771 keyval.second.time_total = 0.;
776 stream.timer_last_path = stream.timer_event.getStartTime();
790 stream.timer_event.stop();
791 stream.timer_last_transition = stream.timer_event.getStopTime();
792 stream.timing_perprocess[
pid].event = stream.timer_event.seconds();
795 double interpaths =
delta(stream.timer_last_path, stream.timer_event.getStopTime());
796 stream.timing_perprocess[
pid].interpaths += interpaths;
797 stream.timing_perprocess[
pid].paths_interpaths.back() = interpaths;
809 stream.timing.count = 1;
810 stream.timing.preevent = stream.timing_perprocess[0].preevent;
811 stream.timing.event = stream.timing_perprocess[0].event;
813 stream.timing.event += stream.timing_perprocess[
i].preevent;
814 stream.timing.event += stream.timing_perprocess[
i].event;
823 for (
auto & keyval: stream.paths[pid]) {
824 PathInfo & pathinfo = keyval.second;
842 for (
unsigned int i = 0;
i < stream.fast_modules.size(); ++
i)
844 if (stream.fast_modules[
i]) {
845 double active = stream.fast_modules[
i]->time_active;
846 ModuleInfo & moduletype = * stream.fast_moduletypes[
i];
859 for (
auto & keyval: stream.paths[pid]) {
860 PathInfo & pathinfo = keyval.second;
887 if (module ==
nullptr)
913 for (
auto & keyval : stream.modules) {
922 for (
auto & keyval : stream.moduletypes) {
930 for (
unsigned int i = 0;
i <= stream.paths[
pid].size(); ++
i)
931 stream.dqm_paths[pid].interpaths->Fill(
i, stream.timing_perprocess[pid].paths_interpaths[
i] * 1000.);
935 stream.dqm.fill(stream.timing);
936 stream.dqm_perprocess[
pid].fill(stream.timing_perprocess[pid]);
942 stream.dqm_byluminosity[i].fill(stream.luminosity[i], stream.timing);
944 stream.dqm_perprocess_byluminosity[pid][i].fill(stream.luminosity[i], stream.timing_perprocess[pid]);
953 stream.timing.reset();
954 stream.timer_source.start();
958 for (
auto & keyval : stream.modules) {
959 keyval.second.timer.reset();
960 keyval.second.time_active = 0.;
961 keyval.second.run_in_path =
nullptr;
962 keyval.second.counter = 0;
964 for (
auto & keyval : stream.moduletypes) {
965 keyval.second.timer.reset();
966 keyval.second.time_active = 0.;
967 keyval.second.run_in_path =
nullptr;
968 keyval.second.counter = 0;
972 stream.timing.presource =
delta(stream.timer_last_transition, stream.timer_source.getStartTime());
977 stream.timer_source.stop();
978 stream.timer_last_transition = stream.timer_source.getStopTime();
981 stream.timing.source = stream.timer_source.seconds();
991 auto keyval = stream.paths[
pid].find(path);
992 if (keyval != stream.paths[pid].end()) {
993 stream.current_path = & keyval->second;
996 stream.current_path =
nullptr;
997 edm::LogError(
"FastTimerService") <<
"FastTimerService::prePathEvent: unexpected path " <<
path;
1002 stream.current_path->first_module =
nullptr;
1005 stream.current_path->timer.start();
1007 if (path ==
m_process[pid].first_path) {
1009 stream.timer_paths.setStartTime(stream.current_path->timer.getStartTime());
1010 }
else if (path ==
m_process[pid].first_endpath) {
1012 stream.timer_endpaths.setStartTime(stream.current_path->timer.getStartTime());
1017 double interpaths =
delta(stream.timer_last_path, stream.current_path->timer.getStartTime());
1018 stream.timing_perprocess[
pid].interpaths += interpaths;
1019 stream.timing_perprocess[
pid].paths_interpaths[stream.current_path->index] = interpaths;
1029 if (stream.current_path ==
nullptr) {
1030 edm::LogError(
"FastTimerService") <<
"FastTimerService::postPathEvent: unexpected path " <<
path;
1035 stream.current_path->timer.stop();
1036 stream.current_path->time_active = stream.current_path->timer.seconds();
1037 stream.timer_last_path = stream.current_path->timer.getStopTime();
1039 double active = stream.current_path->time_active;
1044 PathInfo & pathinfo = * stream.current_path;
1052 double overhead = 0.;
1054 double total = active;
1062 uint32_t last_run = 0;
1064 last_run = status.
index() + 1;
1065 for (uint32_t
i = 0;
i < last_run; ++
i) {
1081 if (stream.current_path->first_module ==
nullptr) {
1089 pre =
delta(stream.current_path->timer.getStartTime(), stream.current_path->first_module->timer.getStartTime());
1090 post =
delta(stream.current_module->timer.getStopTime(), stream.current_path->timer.getStopTime());
1091 inter = active - pre - current - post;
1118 stream.timer_paths.setStopTime(stream.current_path->timer.getStopTime());
1119 stream.timing_perprocess[
pid].all_paths = stream.timer_paths.seconds();
1120 }
else if (path ==
m_process[pid].last_endpath) {
1122 stream.timer_endpaths.setStopTime(stream.current_path->timer.getStopTime());
1123 stream.timing_perprocess[
pid].all_endpaths = stream.timer_endpaths.seconds();
1133 edm::LogError(
"FastTimerService") <<
"FastTimerService::postModuleEventDelayedGet: invalid module";
1142 if (md.
id() < stream.fast_modules.size()) {
1146 stream.current_module = &
module;
1148 if (stream.current_path->first_module ==
nullptr)
1149 stream.current_path->first_module = &
module;
1161 edm::LogError(
"FastTimerService") <<
"FastTimerService::postModuleEventDelayedGet: invalid module";
1172 if (md.
id() < stream.fast_modules.size()) {
1190 edm::LogError(
"FastTimerService") <<
"FastTimerService::postModuleEventDelayedGet: invalid module";
1209 if (md.
id() < stream.fast_modules.size()) {
1214 edm::LogError(
"FastTimerService") <<
"FastTimerService::preModuleEventDelayedGet: unexpected module " << md.
moduleLabel();
1225 edm::LogError(
"FastTimerService") <<
"FastTimerService::postModuleEventDelayedGet: invalid module";
1235 if (md.
id() < stream.fast_modules.size()) {
1240 edm::LogError(
"FastTimerService") <<
"FastTimerService::postModuleEventDelayedGet: unexpected module " << md.
moduleLabel();
1250 std::vector<ModuleInfo *> & pathmap = stream.paths[
pid][
name].modules;
1252 pathmap.reserve( modules.size() );
1253 std::unordered_set<ModuleInfo const *>
pool;
1254 for (
auto const &
module: modules) {
1258 auto const & it = stream.modules.find(label);
1259 if (it == stream.modules.end()) {
1261 pathmap.push_back( 0 );
1262 }
else if (pool.insert(& it->second).second) {
1264 pathmap.push_back(& it->second);
1267 pathmap.push_back( 0 );
1276 std::vector<std::string const *>
p(paths.size(),
nullptr);
1282 std::transform(paths.begin(), paths.end(),
p.begin(), address_if_non_empty);
1285 if (skip and not
p.empty())
1293 return std::make_pair(*
p.front(), *
p.back());
1303 return m_stream[sid].current_module->timer.secondsUntilNow();
1308 return m_stream[sid].current_path->timer.secondsUntilNow();
1313 return m_stream[sid].timer_event.secondsUntilNow();
1318 if (module.
id() <
m_stream[sid].fast_modules.size()) {
1319 return m_stream[sid].fast_modules[module.
id()]->time_active;
1321 edm::LogError(
"FastTimerService") <<
"FastTimerService::queryModuleTime: unexpected module " << module.
moduleLabel();
1328 if (
id <
m_stream[sid].fast_modules.size()) {
1329 return m_stream[sid].fast_modules[id]->time_active;
1331 edm::LogError(
"FastTimerService") <<
"FastTimerService::queryModuleTime: unexpected module id " << id;
1338 auto const & keyval =
m_stream[sid].modules.find(label);
1340 return keyval->second.time_active;
1343 edm::LogError(
"FastTimerService") <<
"FastTimerService::queryModuleTimeByLabel: unexpected module " <<
label;
1350 auto const & keyval =
m_stream[sid].moduletypes.find(type);
1351 if (keyval !=
m_stream[sid].moduletypes.end()) {
1352 return keyval->second.time_active;
1355 edm::LogError(
"FastTimerService") <<
"FastTimerService::queryModuleTimeByType: unexpected module type " <<
type;
1397 return m_stream[sid].timing.source;
1423 desc.
addUntracked<
bool>(
"enableTimingExclusive",
false);
1424 desc.
addUntracked<
bool>(
"enableTimingSummary",
false);
1427 desc.
addUntracked<
bool>(
"enableDQMbyPathActive",
false);
1428 desc.
addUntracked<
bool>(
"enableDQMbyPathTotal",
true);
1429 desc.
addUntracked<
bool>(
"enableDQMbyPathOverhead",
false);
1430 desc.
addUntracked<
bool>(
"enableDQMbyPathDetails",
false);
1431 desc.
addUntracked<
bool>(
"enableDQMbyPathCounters",
true);
1432 desc.
addUntracked<
bool>(
"enableDQMbyPathExclusive",
false);
1434 desc.
addUntracked<
bool>(
"enableDQMbyModuleType",
false);
1436 desc.
addUntracked<
bool>(
"enableDQMbyLumiSection",
false);
1437 desc.
addUntracked<
bool>(
"enableDQMbyProcesses",
false);
1441 desc.
addUntracked<
double>(
"dqmPathTimeResolution", 0.5);
1442 desc.
addUntracked<
double>(
"dqmModuleTimeRange", 40. );
1443 desc.
addUntracked<
double>(
"dqmModuleTimeResolution", 0.2);
1444 desc.
addUntracked<uint32_t>(
"dqmLumiSectionsRange", 2500 );
1446 descriptions.
add(
"FastTimerService", desc);
1452 unsigned int pid = 0;
void preGlobalBeginRun(edm::GlobalContext const &)
void preModuleEventDelayedGet(edm::StreamContext const &, edm::ModuleCallingContext const &)
std::string const & pathName() const
unsigned int maxNumberOfThreads() const
T getUntrackedParameter(std::string const &, T const &) const
void postStreamBeginRun(edm::StreamContext const &)
void watchPreEvent(PreEvent::slot_type const &iSlot)
double queryEventTime(edm::StreamID) const
const double m_dqm_eventtime_resolution
Strings const & getTrigPathModules(std::string const &name) const
void postStreamEndLumi(edm::StreamContext const &)
std::string const & processName() const
std::string const & getTrigPath(size_type const i) const
void watchPrePathEvent(PrePathEvent::slot_type const &iSlot)
void watchPreallocate(Preallocate::slot_type const &iSlot)
static double delta(FastTimer::Clock::time_point const &first, FastTimer::Clock::time_point const &second)
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
bool m_enable_timing_modules
void watchPostEndJob(PostEndJob::slot_type const &iSlot)
Strings const & getEndPaths() const
unsigned int m_concurrent_streams
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::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
void postModuleEvent(edm::StreamContext const &, edm::ModuleCallingContext const &)
bool wasrun() const
was this path run?
static boost::mutex mutex
void watchPreModuleEvent(PreModuleEvent::slot_type const &iSlot)
double summary_postmodules
const bool m_enable_dqm_bypath_counters
const bool m_skip_first_path
void watchPostEvent(PostEvent::slot_type const &iSlot)
const bool m_enable_dqm_bypath_exclusive
LuminosityBlockID const & luminosityBlockID() const
void printSummary(Timing const &summary, std::string const &label) const
std::vector< ProcessDescription > m_process
void watchPostStreamEndLumi(PostStreamEndLumi::slot_type const &iSlot)
const double m_dqm_pathtime_range
std::string const & moduleName() const
void watchPostPathEvent(PostPathEvent::slot_type const &iSlot)
void watchPostModuleEvent(PostModuleEvent::slot_type const &iSlot)
double currentPathTime(edm::StreamID) const
void watchPostSourceEvent(PostSourceEvent::slot_type const &iSlot)
std::vector< TimingPerProcess > m_job_summary_perprocess
RunIndex const & runIndex() const
string format
Some error handling for the usage.
void postPathEvent(edm::StreamContext const &, edm::PathContext const &, edm::HLTPathStatus const &)
unsigned int m_concurrent_threads
LuminosityBlockNumber_t luminosityBlock() const
std::string const & moduleLabel() const
static unsigned int getUniqueID()
Returns a unique id each time called. Intended to be passed to ModuleDescription's constructor's modI...
ProcessContext const & parentProcessContext() const
unsigned int m_concurrent_runs
void postStreamBeginLumi(edm::StreamContext const &)
RunIndex const & runIndex() const
unsigned int maxNumberOfStreams() const
void preModuleBeginJob(edm::ModuleDescription const &)
const bool m_enable_dqm_bynproc
Strings const & getEndPathModules(std::string const &name) const
bool m_enable_timing_paths
size_type findTrigPath(std::string const &name) const
std::vector< LuminosityDescription > m_dqm_luminosity
void prePathEvent(edm::StreamContext const &, edm::PathContext const &)
const bool m_enable_dqm_byls
void watchPostStreamBeginLumi(PostStreamBeginLumi::slot_type const &iSlot)
const double m_dqm_moduletime_resolution
std::mutex m_summary_mutex
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
FastTimerService(const edm::ParameterSet &, edm::ActivityRegistry &)
double queryModuleTimeByLabel(edm::StreamID, const std::string &) const
double currentEventTime(edm::StreamID) const
void watchPreModuleEventDelayedGet(PreModuleEventDelayedGet::slot_type const &iSlot)
void postEvent(edm::StreamContext const &)
void postGlobalEndRun(edm::GlobalContext const &)
void setLuminosity(unsigned int stream_id, unsigned int luminosity_id, double value)
ModuleDescription const * moduleDescription() const
std::vector< std::vector< TimingPerProcess > > m_run_summary_perprocess
void postStreamEndRun(edm::StreamContext const &)
void preModuleEvent(edm::StreamContext const &, edm::ModuleCallingContext const &)
Abs< T >::type abs(const T &t)
const bool m_enable_dqm_bypath_details
std::vector< Timing > m_run_summary
void fillPathMap(unsigned int pid, std::string const &name, std::vector< std::string > const &modules)
ProcessContext const * processContext() const
const bool m_enable_dqm_bypath_overhead
size_type findEndPath(std::string const &name) const
void watchPreModuleBeginJob(PreModuleBeginJob::slot_type const &iSlot)
void watchPostStreamEndRun(PostStreamEndRun::slot_type const &iSlot)
void mergeAndResetMEsRunSummaryCache(uint32_t run, uint32_t streamId, uint32_t moduleId)
StreamID const & streamID() const
void watchPreGlobalBeginRun(PreGlobalBeginRun::slot_type const &iSlot)
const bool m_enable_dqm_bymodule
void postModuleEventDelayedGet(edm::StreamContext const &, edm::ModuleCallingContext const &)
const double m_dqm_moduletime_range
unsigned int value() const
void watchPostModuleEventDelayedGet(PostModuleEventDelayedGet::slot_type const &iSlot)
bool m_enable_timing_exclusive
double querySourceTime(edm::StreamID) const
void watchPostGlobalEndRun(PostGlobalEndRun::slot_type const &iSlot)
void preSourceEvent(edm::StreamID)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void preEvent(edm::StreamContext const &)
const bool m_enable_timing_summary
bool accept() const
has this path accepted the event?
ProcessContext const * processContext() const
void postSourceEvent(edm::StreamID)
const bool m_enable_dqm_bymoduletype
const bool m_enable_dqm_summary
void watchPostStreamBeginRun(PostStreamBeginRun::slot_type const &iSlot)
double queryModuleTimeByType(edm::StreamID, const std::string &) const
double summary_premodules
std::string const & getEndPath(size_type const i) const
const bool m_enable_dqm_bypath_total
void watchPreStreamBeginRun(PreStreamBeginRun::slot_type const &iSlot)
Strings const & getTrigPaths() const
double queryModuleTime(edm::StreamID, const edm::ModuleDescription &) const
const bool m_enable_dqm_bypath_active
unsigned int maxNumberOfConcurrentRuns() const
std::vector< ModuleInfo * > modules
double summary_intermodules
EventID const & eventID() const
void watchPreSourceEvent(PreSourceEvent::slot_type const &iSlot)
TH1F * dqm_module_counter
static unsigned int processID(edm::ProcessContext const *)
double currentModuleTime(edm::StreamID) const
void mergeAndResetMEsLuminositySummaryCache(uint32_t run, uint32_t lumi, uint32_t streamId, uint32_t moduleId)
void preStreamBeginRun(edm::StreamContext const &)
std::vector< StreamData > m_stream
bool isSubProcess() const
tuple size
Write out results.
unsigned int reserveLuminosityPlots(std::string const &name, std::string const &title, std::string const &label, double range, double resolution)
void printProcessSummary(Timing const &total, TimingPerProcess const &summary, std::string const &label, std::string const &process) const
void preallocate(edm::service::SystemBounds const &)
std::pair< std::string, std::string > findFirstLast(unsigned int pid, std::vector< std::string > const &paths, bool skip=false)
const double m_dqm_eventtime_range
const double m_dqm_pathtime_resolution
unsigned int index() const