10 #include <unordered_map>
11 #include <unordered_set>
14 #include <boost/format.hpp>
15 #include <boost/range/irange.hpp>
18 #include <nlohmann/json.hpp>
40 using namespace std::literals;
47 template <
class Rep,
class Period>
48 double ms(std::chrono::duration<Rep, Period> duration) {
49 return std::chrono::duration_cast<std::chrono::duration<double, std::milli>>(duration).
count();
53 template <
class Rep,
class Period>
54 double ms(boost::chrono::duration<Rep, Period> duration) {
55 return boost::chrono::duration_cast<boost::chrono::duration<double, boost::milli>>(duration).
count();
59 double ms(std::atomic<boost::chrono::nanoseconds::rep>
const& duration) {
60 return boost::chrono::duration_cast<boost::chrono::duration<double, boost::milli>>(
69 uint64_t kB(std::atomic<uint64_t>
const& bytes) {
return bytes.load() / 1024; }
86 time_thread = boost::chrono::nanoseconds::zero();
87 time_real = boost::chrono::nanoseconds::zero();
93 time_thread +=
other.time_thread;
94 time_real +=
other.time_real;
95 allocated +=
other.allocated;
96 deallocated +=
other.deallocated;
103 allocated +=
other.allocated.load();
104 deallocated +=
other.deallocated.load();
126 : time_thread(0ul), time_real(0ul), allocated(0ul), deallocated(0ul) {}
142 time_thread =
other.time_thread.load();
143 time_real =
other.time_real.load();
144 allocated =
other.allocated.load();
145 deallocated =
other.deallocated.load();
150 time_thread +=
other.time_thread.load();
151 time_real +=
other.time_real.load();
152 allocated +=
other.allocated.load();
153 deallocated +=
other.deallocated.load();
158 time_thread +=
other.time_thread.count();
159 time_real +=
other.time_real.count();
160 allocated +=
other.allocated;
161 deallocated +=
other.deallocated;
172 return other + *
this;
188 has_acquire = has_acquire
or other.has_acquire;
209 active +=
other.active;
231 for (
auto&
path : endpaths)
239 for (
unsigned int i : boost::irange(0ul,
paths.size()))
242 for (
unsigned int i : boost::irange(0ul, endpaths.size()))
243 endpaths[
i] +=
other.endpaths[
i];
257 std::vector<GroupOfModules>
const& groups)
268 for (
auto&
module : highlight)
279 overhead +=
other.overhead;
280 event +=
other.event;
281 assert(highlight.size() ==
other.highlight.size());
282 for (
unsigned int i : boost::irange(0ul, highlight.size()))
283 highlight[
i] +=
other.highlight[
i];
285 for (
unsigned int i : boost::irange(0ul,
modules.size()))
288 for (
unsigned int i : boost::irange(0ul,
processes.size()))
307 #ifdef DEBUG_THREAD_CONCURRENCY
308 id = std::this_thread::get_id();
309 #endif // DEBUG_THREAD_CONCURRENCY
317 #ifdef DEBUG_THREAD_CONCURRENCY
318 assert(std::this_thread::get_id() ==
id);
319 #endif // DEBUG_THREAD_CONCURRENCY
324 store.time_thread = new_time_thread - time_thread;
325 store.time_real = new_time_real - time_real;
326 store.allocated = new_allocated - allocated;
327 store.deallocated = new_deallocated - deallocated;
328 time_thread = new_time_thread;
329 time_real = new_time_real;
330 allocated = new_allocated;
331 deallocated = new_deallocated;
335 #ifdef DEBUG_THREAD_CONCURRENCY
336 assert(std::this_thread::get_id() ==
id);
337 #endif // DEBUG_THREAD_CONCURRENCY
342 store.time_thread += new_time_thread - time_thread;
343 store.time_real += new_time_real - time_real;
344 store.allocated += new_allocated - allocated;
345 store.deallocated += new_deallocated - deallocated;
346 time_thread = new_time_thread;
347 time_real = new_time_real;
348 allocated = new_allocated;
349 deallocated = new_deallocated;
353 #ifdef DEBUG_THREAD_CONCURRENCY
354 assert(std::this_thread::get_id() ==
id);
355 #endif // DEBUG_THREAD_CONCURRENCY
360 store.time_thread += boost::chrono::duration_cast<boost::chrono::nanoseconds>(new_time_thread - time_thread).count();
361 store.time_real += boost::chrono::duration_cast<boost::chrono::nanoseconds>(new_time_real - time_real).count();
362 store.allocated += new_allocated - allocated;
363 store.deallocated += new_deallocated - deallocated;
364 time_thread = new_time_thread;
365 time_real = new_time_real;
366 allocated = new_allocated;
367 deallocated = new_deallocated;
376 unsigned int lumisections,
384 booker.
book1D(
name +
" time_thread",
title +
" processing time (cpu)", time_bins, 0.,
ranges.time_range);
385 time_thread_->
setXTitle(
"processing time [ms]");
386 time_thread_->setYTitle(y_title_ms);
388 time_real_ = booker.
book1D(
name +
" time_real",
title +
" processing time (real)", time_bins, 0.,
ranges.time_range);
389 time_real_->
setXTitle(
"processing time [ms]");
390 time_real_->setYTitle(y_title_ms);
393 allocated_ = booker.
book1D(
name +
" allocated",
title +
" allocated memory", mem_bins, 0.,
ranges.memory_range);
395 allocated_->setYTitle(y_title_kB);
398 booker.
book1D(
name +
" deallocated",
title +
" deallocated memory", mem_bins, 0.,
ranges.memory_range);
400 deallocated_->setYTitle(y_title_kB);
407 title +
" processing time (cpu) vs. lumisection",
415 time_thread_byls_->
setXTitle(
"lumisection");
416 time_thread_byls_->setYTitle(
"processing time [ms]");
419 title +
" processing time (real) vs. lumisection",
427 time_real_byls_->
setXTitle(
"lumisection");
428 time_real_byls_->setYTitle(
"processing time [ms]");
432 title +
" allocated memory vs. lumisection",
440 allocated_byls_->
setXTitle(
"lumisection");
441 allocated_byls_->setYTitle(
"memory [kB]");
444 title +
" deallocated memory vs. lumisection",
452 deallocated_byls_->
setXTitle(
"lumisection");
453 deallocated_byls_->setYTitle(
"memory [kB]");
459 TH1::StatOverflows(
true);
462 time_thread_->Fill(ms(
data.time_thread));
464 if (time_thread_byls_)
465 time_thread_byls_->Fill(lumisection, ms(
data.time_thread));
468 time_real_->Fill(ms(
data.time_real));
471 time_real_byls_->Fill(lumisection, ms(
data.time_real));
474 allocated_->Fill(kB(
data.allocated));
477 allocated_byls_->Fill(lumisection, kB(
data.allocated));
480 deallocated_->Fill(kB(
data.deallocated));
482 if (deallocated_byls_)
483 deallocated_byls_->Fill(lumisection, kB(
data.deallocated));
488 TH1::StatOverflows(
true);
493 if (time_thread_byls_)
503 allocated_->Fill(kB(
data.allocated));
506 allocated_byls_->Fill(lumisection, kB(
data.allocated));
509 deallocated_->Fill(kB(
data.deallocated));
511 if (deallocated_byls_)
512 deallocated_byls_->Fill(lumisection, kB(
data.deallocated));
517 unsigned int lumisection) {
519 TH1::StatOverflows(
true);
529 if (time_thread_byls_)
553 if (deallocated_byls_)
562 unsigned int lumisections,
568 total_.book(booker,
"path",
path.name_,
ranges, lumisections, byls);
570 unsigned int bins =
path.modules_and_dependencies_.size();
571 module_counter_ = booker.
book1DD(
"module_counter",
"module counter",
bins + 1, -0.5,
bins + 0.5);
573 module_time_thread_total_ =
574 booker.
book1DD(
"module_time_thread_total",
"total module time (cpu)",
bins, -0.5,
bins - 0.5);
575 module_time_thread_total_->
setYTitle(
"processing time [ms]");
576 module_time_real_total_ =
577 booker.
book1DD(
"module_time_real_total",
"total module time (real)",
bins, -0.5,
bins - 0.5);
578 module_time_real_total_->
setYTitle(
"processing time [ms]");
580 module_allocated_total_ =
581 booker.
book1DD(
"module_allocated_total",
"total allocated memory",
bins, -0.5,
bins - 0.5);
582 module_allocated_total_->
setYTitle(
"memory [kB]");
583 module_deallocated_total_ =
584 booker.
book1DD(
"module_deallocated_total",
"total deallocated memory",
bins, -0.5,
bins - 0.5);
585 module_deallocated_total_->
setYTitle(
"memory [kB]");
587 for (
unsigned int bin : boost::irange(0u,
bins)) {
588 auto const&
module = job[
path.modules_and_dependencies_[
bin]];
590 module.scheduled_ ?
module.module_.moduleLabel() :
module.module_.moduleLabel() +
" (unscheduled)";
591 module_counter_->setBinLabel(
bin + 1,
label);
592 module_time_thread_total_->setBinLabel(
bin + 1,
label);
593 module_time_real_total_->setBinLabel(
bin + 1,
label);
595 module_allocated_total_->setBinLabel(
bin + 1,
label);
596 module_deallocated_total_->setBinLabel(
bin + 1,
label);
599 module_counter_->setBinLabel(
bins + 1,
"");
609 total_.fill(
path.total,
ls);
612 for (
unsigned int i = 0;
i <
path.last; ++
i) {
615 module_counter_->Fill(
i);
617 if (module_time_thread_total_)
618 module_time_thread_total_->Fill(
i, ms(
module.total.time_thread));
620 if (module_time_real_total_)
621 module_time_real_total_->Fill(
i, ms(
module.total.time_real));
623 if (module_allocated_total_)
624 module_allocated_total_->Fill(
i, kB(
module.total.allocated));
626 if (module_deallocated_total_)
627 module_deallocated_total_->Fill(
i, kB(
module.total.deallocated));
629 if (module_counter_ and
path.status)
630 module_counter_->Fill(
path.last);
641 unsigned int lumisections,
645 event_.book(booker,
"process " +
process.name_,
"process " +
process.name_, event_ranges, lumisections, byls);
648 for (
unsigned int id : boost::irange(0ul, paths_.size())) {
649 paths_[
id].book(booker,
"path ", job,
process.paths_[
id], path_ranges, lumisections, byls);
651 for (
unsigned int id : boost::irange(0ul, endpaths_.size())) {
652 endpaths_[
id].book(booker,
"endpath ", job,
process.endPaths_[
id], path_ranges, lumisections, byls);
666 for (
unsigned int id : boost::irange(0ul, paths_.size()))
670 for (
unsigned int id : boost::irange(0ul, endpaths_.size()))
683 std::vector<GroupOfModules>
const& groups,
687 unsigned int lumisections,
695 event_.book(booker,
"event",
"Event", event_ranges, lumisections, byls);
697 event_ex_.book(booker,
"explicit",
"Event (explicit)", event_ranges, lumisections, byls);
699 overhead_.book(booker,
"overhead",
"Overhead", event_ranges, lumisections, byls);
701 modules_[job.
source().
id()].book(booker,
"source",
"Source", module_ranges, lumisections, byls);
704 lumi_.book(booker,
"lumi",
"LumiSection transitions", event_ranges, lumisections, byls);
706 run_.book(booker,
"run",
"Run transtions", event_ranges, lumisections,
false);
710 for (
unsigned int group : boost::irange(0ul, groups.size())) {
712 highlight_[
group].book(booker,
"highlight " +
label,
"Highlight " +
label, event_ranges, lumisections, byls);
716 for (
unsigned int pid : boost::irange(0ul, job.
processes().size())) {
718 processes_[pid].book(booker, job,
process, event_ranges, path_ranges, lumisections, bypath, byls);
722 for (
unsigned int id :
process.modules_) {
734 event_ex_.fill(
data.event,
ls);
738 for (
unsigned int group : boost::irange(0ul, highlight_.size()))
742 for (
unsigned int id : boost::irange(0ul, modules_.size()))
743 modules_[
id].fill(
data.modules[
id].total,
ls);
745 for (
unsigned int pid : boost::irange(0ul, processes_.size()))
786 config.getUntrackedParameter<
double>(
"dqmTimeResolution"),
787 config.getUntrackedParameter<
double>(
"dqmMemoryRange"),
788 config.getUntrackedParameter<
double>(
"dqmMemoryResolution")}),
789 dqm_path_ranges_({
config.getUntrackedParameter<
double>(
"dqmPathTimeRange"),
790 config.getUntrackedParameter<
double>(
"dqmPathTimeResolution"),
791 config.getUntrackedParameter<
double>(
"dqmPathMemoryRange"),
792 config.getUntrackedParameter<
double>(
"dqmPathMemoryResolution")}),
793 dqm_module_ranges_({
config.getUntrackedParameter<
double>(
"dqmModuleTimeRange"),
794 config.getUntrackedParameter<
double>(
"dqmModuleTimeResolution"),
795 config.getUntrackedParameter<
double>(
"dqmModuleMemoryRange"),
796 config.getUntrackedParameter<
double>(
"dqmModuleMemoryResolution")}),
797 dqm_lumisections_range_(
config.getUntrackedParameter<
unsigned int>(
"dqmLumiSectionsRange")),
800 highlight_module_psets_(
config.getUntrackedParameter<std::vector<edm::ParameterSet>>(
"highlightModules")),
801 highlight_modules_(highlight_module_psets_.size())
804 tbb::task_scheduler_observer::observe();
878 LogDebug(
"FastTimerService") <<
"The FastTimerService received is currently not monitoring the signal \"" << signal
884 if (unsupported_signals_.insert(signal).second)
885 edm::LogWarning(
"FastTimerService") <<
"The FastTimerService received the unsupported signal \"" << signal
887 <<
"Please report how to reproduce the issue to cms-hlt@cern.ch .";
891 ignoredSignal(__func__);
894 if (isFirstSubprocess(gc)) {
896 subprocess_global_run_check_[
index] = 0;
897 run_transition_[
index].reset();
898 run_summary_[
index].reset();
915 dqm_lumisections_range_,
916 enable_dqm_bymodule_,
919 enable_dqm_transitions_);
938 if (enable_dqm_bynproc_)
940 concurrent_streams_ % concurrent_threads_)
945 auto safe_for_dqm =
"/ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+=_()# "s;
946 for (
auto&
c : dqm_path_)
947 if (safe_for_dqm.find(
c) == std::string::npos)
951 subprocess_event_check_ = std::make_unique<std::atomic<unsigned int>[]>(concurrent_streams_);
952 for (
unsigned int i = 0;
i < concurrent_streams_; ++
i)
953 subprocess_event_check_[
i] = 0;
954 subprocess_global_run_check_ = std::make_unique<std::atomic<unsigned int>[]>(concurrent_runs_);
955 for (
unsigned int i = 0;
i < concurrent_runs_; ++
i)
956 subprocess_global_run_check_[
i] = 0;
957 subprocess_global_lumi_check_ = std::make_unique<std::atomic<unsigned int>[]>(concurrent_lumis_);
958 for (
unsigned int i = 0;
i < concurrent_lumis_; ++
i)
959 subprocess_global_lumi_check_[
i] = 0;
962 lumi_transition_.resize(concurrent_lumis_);
963 run_transition_.resize(concurrent_runs_);
967 callgraph_.preSourceConstruction(
module);
972 callgraph_.preBeginJob(pathsAndConsumes, context);
976 unsigned int modules = callgraph_.size();
979 for (
unsigned int group : boost::irange(0ul, highlight_module_psets_.size())) {
981 auto labels = highlight_module_psets_[
group].getUntrackedParameter<std::vector<std::string>>(
"modules");
984 highlight_modules_[
group].label = highlight_module_psets_[
group].getUntrackedParameter<
std::string>(
"label");
985 highlight_modules_[
group].modules.reserve(
labels.size());
988 auto const&
label = callgraph_.module(
i).moduleLabel();
990 highlight_modules_[
group].modules.push_back(
i);
993 highlight_module_psets_.clear();
997 streams_.resize(concurrent_streams_,
temp);
998 run_summary_.resize(concurrent_runs_,
temp);
1004 enable_dqm_ =
false;
1005 edm::LogWarning(
"FastTimerService") <<
"The DQMStore is not avalable, the DQM plots will not be generated";
1010 plots_ = std::make_unique<PlotsPerJob>(callgraph_, highlight_modules_);
1021 ignoredSignal(__func__);
1024 if (isFirstSubprocess(gc)) {
1026 subprocess_global_lumi_check_[
index] = 0;
1027 lumi_transition_[
index].reset();
1036 ignoredSignal(__func__);
1040 bool last = isLastSubprocess(subprocess_global_lumi_check_[
index]);
1050 if (enable_dqm_transitions_) {
1066 ignoredSignal(__func__);
1070 bool last = isLastSubprocess(subprocess_global_run_check_[
index]);
1076 if (print_run_summary_) {
1081 if (enable_dqm_transitions_) {
1082 plots_->fill_run(run_transition_[
index]);
1093 thread().measure_and_accumulate(lumi_transition_[
index]);
1097 if (print_job_summary_) {
1101 if (write_json_summary_) {
1102 writeSummaryJSON(job_summary_, json_filename_);
1106 template <
typename T>
1108 out <<
"FastReport ";
1109 if (
label.size() < 60)
1110 for (
unsigned int i = (60 -
label.size()) / 2;
i > 0; --
i)
1112 out <<
' ' <<
label <<
" Summary ";
1113 if (
label.size() < 60)
1114 for (
unsigned int i = (59 -
label.size()) / 2;
i > 0; --
i)
1119 template <
typename T>
1121 out <<
"FastReport CPU time Real time Allocated Deallocated " <<
label <<
"\n";
1125 template <
typename T>
1127 out <<
boost::format(
"FastReport %10.1f ms %10.1f ms %+10d kB %+10d kB %s\n") % ms(
data.time_thread) %
1128 ms(
data.time_real) % +static_cast<int64_t>(kB(
data.allocated)) %
1129 -static_cast<int64_t>(kB(
data.deallocated)) %
label;
1132 template <
typename T>
1134 out <<
boost::format(
"FastReport %10.1f ms %10.1f ms %+10d kB %+10d kB %s\n") %
1137 -static_cast<int64_t>(kB(
data.deallocated)) %
label;
1140 template <
typename T>
1142 printHeader(
out,
"Event");
1143 printEventHeader(
out,
"Modules");
1144 auto const& source_d = callgraph_.source();
1145 auto const&
source =
data.modules[source_d.id()];
1146 printEventLine(
out,
source.total, source_d.moduleLabel());
1147 for (
unsigned int i = 0;
i < callgraph_.processes().size(); ++
i) {
1148 auto const& proc_d = callgraph_.processDescription(
i);
1150 printEventLine(
out,
proc.total,
"process " + proc_d.name_);
1151 for (
unsigned int m : proc_d.modules_) {
1152 auto const& module_d = callgraph_.module(
m);
1154 printEventLine(
out,
module.total,
" " + module_d.moduleLabel());
1157 printEventLine(
out,
data.total,
"total");
1159 printEventHeader(
out,
"Processes and Paths");
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);
1164 printEventLine(
out,
proc.total,
"process " + proc_d.name_);
1165 for (
unsigned int p = 0;
p <
proc.paths.size(); ++
p) {
1166 auto const&
name = proc_d.paths_[
p].name_;
1168 printEventLine(
out,
path.active,
name +
" (only scheduled modules)");
1169 printEventLine(
out,
path.total,
name +
" (including dependencies)");
1171 for (
unsigned int p = 0;
p <
proc.endpaths.size(); ++
p) {
1172 auto const&
name = proc_d.endPaths_[
p].name_;
1174 printEventLine(
out,
path.active,
name +
" (only scheduled modules)");
1175 printEventLine(
out,
path.total,
name +
" (including dependencies)");
1178 printEventLine(
out,
data.total,
"total");
1180 for (
unsigned int group : boost::irange(0ul, highlight_modules_.size())) {
1181 printEventHeader(
out,
"Highlighted modules");
1183 auto const& module_d = callgraph_.module(
m);
1185 printEventLine(
out,
module.total,
" " + module_d.moduleLabel());
1192 template <
typename T>
1195 out <<
"FastReport CPU time avg. when run Real time avg. when run Alloc. avg. when run "
1196 "Dealloc. avg. when run ";
1199 out <<
"FastReport CPU time avg. Real time avg. Alloc. avg. "
1205 template <
typename T>
1207 out <<
"FastReport CPU time sched. / depend. Real time sched. / depend. Alloc. sched. / depend. "
1208 "Dealloc. sched. / depend. ";
1213 template <
typename T>
1216 "FastReport %10.1f ms %10.1f ms %+10d kB %+10d kB "
1223 template <
typename T>
1227 "FastReport %10.1f ms %10.1f ms %10.1f ms %10.1f ms %+10d kB %+10d kB %+10d kB %+10d kB %s\n") %
1231 (active ? +static_cast<int64_t>(kB(
data.allocated) / active) : 0) %
1233 (active ? -static_cast<int64_t>(kB(
data.deallocated) / active) : 0) %
label;
1236 template <
typename T>
1242 "FastReport %10.1f ms %10.1f ms %+10d kB %+10d kB "
1249 template <
typename T>
1253 "FastReport %10.1f ms %10.1f ms %10.1f ms %10.1f ms %+10d kB %+10d kB %+10d kB %+10d kB %s\n") %
1257 (active ? +static_cast<int64_t>(kB(
data.allocated) / active) : 0) %
1259 (active ? -static_cast<int64_t>(kB(
data.deallocated) / active) : 0) %
label;
1262 template <
typename T>
1266 "FastReport %10.1f ms %10.1f ms %10.1f ms %10.1f ms %+10d kB %+10d kB %+10d kB %+10d kB %s\n") %
1275 template <
typename T>
1278 printSummaryHeader(
out,
"Modules",
true);
1279 auto const& source_d = callgraph_.source();
1280 auto const&
source =
data.modules[source_d.id()];
1282 for (
unsigned int i = 0;
i < callgraph_.processes().size(); ++
i) {
1283 auto const& proc_d = callgraph_.processDescription(
i);
1285 printSummaryLine(
out,
proc.total,
data.events,
"process " + proc_d.name_);
1286 for (
unsigned int m : proc_d.modules_) {
1287 auto const& module_d = callgraph_.module(
m);
1289 printSummaryLine(
out,
module.total,
data.events,
module.events,
" " + module_d.moduleLabel());
1292 printSummaryLine(
out,
data.total,
data.events,
"total");
1293 printSummaryLine(
out,
data.overhead,
data.events,
"other");
1295 printPathSummaryHeader(
out,
"Processes and Paths");
1296 printSummaryLine(
out,
source.total,
data.events, source_d.moduleLabel());
1297 for (
unsigned int i = 0;
i < callgraph_.processes().size(); ++
i) {
1298 auto const& proc_d = callgraph_.processDescription(
i);
1300 printSummaryLine(
out,
proc.total,
data.events,
"process " + proc_d.name_);
1301 for (
unsigned int p = 0;
p <
proc.paths.size(); ++
p) {
1302 auto const&
name = proc_d.paths_[
p].name_;
1306 for (
unsigned int p = 0;
p <
proc.endpaths.size(); ++
p) {
1307 auto const&
name = proc_d.endPaths_[
p].name_;
1312 printSummaryLine(
out,
data.total,
data.events,
"total");
1313 printSummaryLine(
out,
data.overhead,
data.events,
"other");
1315 for (
unsigned int group : boost::irange(0ul, highlight_modules_.size())) {
1316 printSummaryHeader(
out,
"Highlighted modules",
true);
1318 auto const& module_d = callgraph_.module(
m);
1327 template <
typename T>
1329 printEventHeader(
out,
"Transition");
1333 template <
typename T>
1337 T const&
data)
const {
1341 {
"time_thread", ms(
data.time_thread)},
1342 {
"time_real", ms(
data.time_real)},
1343 {
"mem_alloc", kB(
data.allocated)},
1344 {
"mem_free", kB(
data.deallocated)}};
1356 json{{
"time_thread",
"cpu time"}},
1357 json{{
"mem_alloc",
"allocated memory"}},
1358 json{{
"mem_free",
"deallocated memory"}}});
1361 j[
"total"] = encodeToJSON(
"Job", callgraph_.processDescription(0).name_,
data.events,
data.total +
data.overhead);
1365 for (
unsigned int i = 0;
i < callgraph_.size(); ++
i) {
1367 auto const& data_m =
data.modules[
i];
1368 j[
"modules"].push_back(encodeToJSON(
module, data_m));
1372 j[
"modules"].push_back(encodeToJSON(
"other",
"other",
data.events,
data.overhead));
1375 out << std::setw(2) <<
j << std::flush;
1391 unsigned int old_value =
check.fetch_add(1, std::memory_order_acq_rel);
1392 return (old_value == callgraph_.processes().size() - 1);
1398 ignoredSignal(__func__);
1402 auto&
stream = streams_[sid];
1403 auto&
process = callgraph_.processDescription(pid);
1407 for (
unsigned int id :
process.modules_)
1412 bool last = isLastSubprocess(subprocess_event_check_[sid]);
1417 stream.event_measurement.measure_and_store(
stream.event);
1420 unsigned int id = 0;
1424 for (
unsigned int group : boost::irange(0ul, highlight_modules_.size()))
1430 std::lock_guard<std::mutex> guard(summary_mutex_);
1435 if (print_event_summary_) {
1447 auto&
stream = streams_[sid];
1451 subprocess_event_check_[sid] = 0;
1454 auto& measurement = thread();
1455 measurement.measure_and_accumulate(
stream.overhead);
1456 stream.event_measurement = measurement;
1461 unsigned int id = md.
id();
1462 auto&
stream = streams_[sid];
1465 thread().measure_and_store(
module.total);
1472 unsigned int id = pc.
pathID();
1473 auto&
stream = streams_[sid];
1475 data.status =
false;
1484 unsigned int id = pc.
pathID();
1485 auto&
stream = streams_[sid];
1489 pc.
isEndPath() ? callgraph_.processDescription(pid).endPaths_[
id] : callgraph_.processDescription(pid).paths_[
id];
1490 unsigned int index =
path.modules_on_path_.empty() ? 0 :
status.index() + 1;
1491 data.last =
path.modules_on_path_.empty() ? 0 :
path.last_dependency_of_module_[
status.index()];
1493 for (
unsigned int i = 0;
i <
index; ++
i) {
1497 for (
unsigned int i = 0;
i <
data.last; ++
i) {
1505 auto&
stream = streams_[sid];
1506 thread().measure_and_accumulate(
stream.overhead);
1511 unsigned int id = md.
id();
1513 auto&
stream = streams_[sid];
1516 module.has_acquire =
true;
1517 thread().measure_and_store(
module.total);
1522 auto&
stream = streams_[sid];
1523 thread().measure_and_accumulate(
stream.overhead);
1528 unsigned int id = md.
id();
1530 auto&
stream = streams_[sid];
1533 if (
module.has_acquire) {
1534 thread().measure_and_accumulate(
module.total);
1536 thread().measure_and_store(
module.total);
1542 unsupportedSignal(__func__);
1546 unsupportedSignal(__func__);
1550 ignoredSignal(__func__);
1554 ignoredSignal(__func__);
1558 ignoredSignal(__func__);
1562 ignoredSignal(__func__);
1566 thread().measure_and_accumulate(overhead_);
1571 thread().measure_and_accumulate(run_transition_[
index]);
1575 thread().measure_and_accumulate(overhead_);
1580 thread().measure_and_accumulate(run_transition_[
index]);
1584 thread().measure_and_accumulate(overhead_);
1589 thread().measure_and_accumulate(lumi_transition_[
index]);
1593 thread().measure_and_accumulate(overhead_);
1598 thread().measure_and_accumulate(lumi_transition_[
index]);
1602 thread().measure_and_accumulate(overhead_);
1607 thread().measure_and_accumulate(run_transition_[
index]);
1611 thread().measure_and_accumulate(overhead_);
1616 thread().measure_and_accumulate(run_transition_[
index]);
1620 thread().measure_and_accumulate(overhead_);
1625 thread().measure_and_accumulate(lumi_transition_[
index]);
1629 thread().measure_and_accumulate(overhead_);
1634 thread().measure_and_accumulate(lumi_transition_[
index]);
1644 thread().measure_and_accumulate(overhead_);
1665 desc.
addUntracked<
bool>(
"enableDQMbyLumiSection",
false);
1666 desc.
addUntracked<
bool>(
"enableDQMbyProcesses",
false);
1667 desc.
addUntracked<
bool>(
"enableDQMTransitions",
false);
1671 desc.
addUntracked<
double>(
"dqmMemoryResolution", 5000.);
1673 desc.
addUntracked<
double>(
"dqmPathTimeResolution", 0.5);
1674 desc.
addUntracked<
double>(
"dqmPathMemoryRange", 1000000.);
1675 desc.
addUntracked<
double>(
"dqmPathMemoryResolution", 5000.);
1677 desc.
addUntracked<
double>(
"dqmModuleTimeResolution", 0.2);
1678 desc.
addUntracked<
double>(
"dqmModuleMemoryRange", 100000.);
1679 desc.
addUntracked<
double>(
"dqmModuleMemoryResolution", 500.);
1680 desc.
addUntracked<
unsigned>(
"dqmLumiSectionsRange", 2500);
1684 highlightModulesDescription.
addUntracked<std::vector<std::string>>(
"modules", {});
1685 highlightModulesDescription.addUntracked<
std::string>(
"label",
"producers");
1691 ->
setComment(
"This parameter is obsolete and will be ignored.");
1693 ->
setComment(
"This parameter is obsolete and will be ignored.");
1695 ->
setComment(
"This parameter is obsolete and will be ignored.");
1697 ->
setComment(
"This parameter is obsolete and will be ignored.");
1699 ->
setComment(
"This parameter is obsolete and will be ignored.");
1701 ->
setComment(
"This parameter is obsolete and will be ignored.");
1703 ->
setComment(
"This parameter is obsolete and will be ignored.");
1705 ->
setComment(
"This parameter is obsolete and will be ignored.");
1707 ->
setComment(
"This parameter is obsolete and will be ignored.");
1709 ->
setComment(
"This parameter is obsolete and will be ignored.");
1711 ->
setComment(
"This parameter is obsolete and will be ignored.");
1713 ->
setComment(
"This parameter is obsolete and will be ignored.");
1715 ->
setComment(
"This parameter is obsolete and will be ignored.");
1717 ->
setComment(
"This parameter is obsolete and will be ignored.");
1719 descriptions.
add(
"FastTimerService", desc);