diff --git a/DataFormats/EgammaReco/src/classes_def.xml b/DataFormats/EgammaReco/src/classes_def.xml
index aefb655ddc69e..e084c7b362ad4 100644
--- a/DataFormats/EgammaReco/src/classes_def.xml
+++ b/DataFormats/EgammaReco/src/classes_def.xml
@@ -119,6 +119,7 @@
+
diff --git a/DataFormats/MuonReco/src/classes_def.xml b/DataFormats/MuonReco/src/classes_def.xml
index 72d188c92a51f..60cabf897b650 100644
--- a/DataFormats/MuonReco/src/classes_def.xml
+++ b/DataFormats/MuonReco/src/classes_def.xml
@@ -48,6 +48,7 @@ initial version number of a class which has never been stored before.
+
diff --git a/DataFormats/ParticleFlowCandidate/src/classes_def.xml b/DataFormats/ParticleFlowCandidate/src/classes_def.xml
index 0933eefe648b8..56d679e130058 100644
--- a/DataFormats/ParticleFlowCandidate/src/classes_def.xml
+++ b/DataFormats/ParticleFlowCandidate/src/classes_def.xml
@@ -22,6 +22,7 @@
+
diff --git a/DataFormats/ParticleFlowReco/src/classes_def_2.xml b/DataFormats/ParticleFlowReco/src/classes_def_2.xml
index 7da5424d59bdf..be152902bc09f 100644
--- a/DataFormats/ParticleFlowReco/src/classes_def_2.xml
+++ b/DataFormats/ParticleFlowReco/src/classes_def_2.xml
@@ -156,6 +156,7 @@
+
diff --git a/DataFormats/TauReco/src/classes_def_2.xml b/DataFormats/TauReco/src/classes_def_2.xml
index 8a1a6083861fa..7e7c6b85b920b 100644
--- a/DataFormats/TauReco/src/classes_def_2.xml
+++ b/DataFormats/TauReco/src/classes_def_2.xml
@@ -26,6 +26,7 @@
+
diff --git a/DataFormats/TauReco/src/classes_def_3.xml b/DataFormats/TauReco/src/classes_def_3.xml
index 054a68fa17b49..e2f1f3b6c5d1a 100644
--- a/DataFormats/TauReco/src/classes_def_3.xml
+++ b/DataFormats/TauReco/src/classes_def_3.xml
@@ -97,6 +97,7 @@
+
@@ -136,6 +137,7 @@
+
diff --git a/DataFormats/TrackReco/src/classes_def.xml b/DataFormats/TrackReco/src/classes_def.xml
index 986af210ec2ea..bef46cb3793af 100644
--- a/DataFormats/TrackReco/src/classes_def.xml
+++ b/DataFormats/TrackReco/src/classes_def.xml
@@ -383,6 +383,7 @@
+
diff --git a/HLTrigger/Timer/plugins/FastTimerService.cc b/HLTrigger/Timer/plugins/FastTimerService.cc
index 57fdd5e98ae74..0ed0f94763e89 100644
--- a/HLTrigger/Timer/plugins/FastTimerService.cc
+++ b/HLTrigger/Timer/plugins/FastTimerService.cc
@@ -261,6 +261,7 @@ void FastTimerService::ResourcesPerJob::reset() {
idle.reset();
source.reset();
eventsetup.reset();
+ cleanup.reset();
event.reset();
for (auto& module : highlight)
module.reset();
@@ -276,6 +277,7 @@ FastTimerService::ResourcesPerJob& FastTimerService::ResourcesPerJob::operator+=
idle += other.idle;
source += other.source;
eventsetup += other.eventsetup;
+ cleanup += other.cleanup;
event += other.event;
assert(highlight.size() == other.highlight.size());
for (unsigned int i : boost::irange(0ul, highlight.size()))
@@ -697,6 +699,7 @@ void FastTimerService::PlotsPerJob::book(dqm::reco::DQMStore::IBooker& booker,
overhead_.book(booker, "overhead", "Overhead", event_ranges, lumisections, byls);
idle_.book(booker, "idle", "Idle", event_ranges, lumisections, byls);
source_.book(booker, "source", "Source", event_ranges, lumisections, byls);
+ cleanup_.book(booker, "cleanup", "Cleanup", event_ranges, lumisections, byls);
if (transitions) {
lumi_.book(booker, "lumi", "LumiSection transitions", event_ranges, lumisections, byls);
@@ -733,6 +736,7 @@ void FastTimerService::PlotsPerJob::fill(ProcessCallGraph const& job, ResourcesP
overhead_.fill(data.overhead, ls);
idle_.fill(data.idle, ls);
source_.fill(data.source, ls);
+ cleanup_.fill(data.cleanup, ls);
// fill highltight plots
for (unsigned int group : boost::irange(0ul, highlight_.size()))
@@ -834,6 +838,13 @@ FastTimerService::FastTimerService(const edm::ParameterSet& config, edm::Activit
registry.watchPostSourceLumi(this, &FastTimerService::postSourceLumi);
registry.watchPreSourceEvent(this, &FastTimerService::preSourceEvent);
registry.watchPostSourceEvent(this, &FastTimerService::postSourceEvent);
+ // transform signals
+ //registry.watchPreModuleTransformPrefetching(this, &FastTimerService::preModuleTransformPrefetching);
+ //registry.watchPostModuleTransformPrefetching(this, &FastTimerService::postModuleTransformPrefetching);
+ registry.watchPreModuleTransform(this, &FastTimerService::preModuleTransform);
+ registry.watchPostModuleTransform(this, &FastTimerService::postModuleTransform);
+ registry.watchPreModuleTransformAcquiring(this, &FastTimerService::preModuleTransformAcquiring);
+ registry.watchPostModuleTransformAcquiring(this, &FastTimerService::postModuleTransformAcquiring);
//registry.watchPreModuleConstruction( this, & FastTimerService::preModuleConstruction);
//registry.watchPostModuleConstruction( this, & FastTimerService::postModuleConstruction);
//registry.watchPreModuleBeginJob( this, & FastTimerService::preModuleBeginJob );
@@ -868,6 +879,9 @@ FastTimerService::FastTimerService(const edm::ParameterSet& config, edm::Activit
registry.watchPostModuleEvent(this, &FastTimerService::postModuleEvent);
registry.watchPreModuleEventDelayedGet(this, &FastTimerService::preModuleEventDelayedGet);
registry.watchPostModuleEventDelayedGet(this, &FastTimerService::postModuleEventDelayedGet);
+ // cleanup signals
+ registry.watchPreClearEvent(this, &FastTimerService::preClearEvent);
+ registry.watchPostClearEvent(this, &FastTimerService::postClearEvent);
registry.watchPreEventReadFromSource(this, &FastTimerService::preEventReadFromSource);
registry.watchPostEventReadFromSource(this, &FastTimerService::postEventReadFromSource);
registry.watchPreESModule(this, &FastTimerService::preESModule);
@@ -887,6 +901,45 @@ void FastTimerService::unsupportedSignal(const std::string& signal) const {
<< "Please report how to reproduce the issue to cms-hlt@cern.ch .";
}
+void FastTimerService::finalizeEventMeasurement(edm::StreamContext const& sc) {
+ unsigned int sid = sc.streamID();
+ auto& stream = streams_[sid];
+
+ stream.total += stream.cleanup;
+
+ auto& process = callgraph_.processDescription();
+ // measure the event resources as the sum of all modules' resources
+ auto& data = stream.process.total;
+ for (unsigned int id : process.modules_) {
+ data += stream.modules[id].total;
+ }
+ stream.total += data;
+
+ // add to the event resources those used by source (which is not part of any process)
+ stream.total += stream.source;
+
+ // highlighted modules
+ for (unsigned int group : boost::irange(0ul, highlight_modules_.size()))
+ for (unsigned int i : highlight_modules_[group].modules)
+ stream.highlight[group] += stream.modules[i].total;
+
+ // avoid concurrent access to the summary objects
+ {
+ std::lock_guard guard(summary_mutex_);
+ job_summary_ += stream;
+ run_summary_[sc.runIndex()] += stream;
+ }
+
+ if (print_event_summary_) {
+ edm::LogVerbatim out("FastReport");
+ printEvent(out, stream);
+ }
+
+ if (enable_dqm_) {
+ plots_->fill(callgraph_, stream, sc.eventID().luminosityBlock());
+ }
+}
+
void FastTimerService::preGlobalBeginRun(edm::GlobalContext const& gc) {
ignoredSignal(__func__);
@@ -1291,6 +1344,7 @@ void FastTimerService::printSummary(T& out, ResourcesPerJob const& data, std::st
}
printSummaryLine(out, data.total, data.events, "total");
printSummaryLine(out, data.eventsetup, data.events, "eventsetup");
+ printSummaryLine(out, data.cleanup, data.events, "cleanup");
printSummaryLine(out, data.overhead, data.events, "other");
printSummaryLine(out, data.idle, data.events, "idle");
out << '\n';
@@ -1309,6 +1363,7 @@ void FastTimerService::printSummary(T& out, ResourcesPerJob const& data, std::st
}
printSummaryLine(out, data.total, data.events, "total");
printSummaryLine(out, data.eventsetup, data.events, "eventsetup");
+ printSummaryLine(out, data.cleanup, data.events, "cleanup");
printSummaryLine(out, data.overhead, data.events, "other");
printSummaryLine(out, data.idle, data.events, "idle");
out << '\n';
@@ -1378,6 +1433,7 @@ void FastTimerService::writeSummaryJSON(ResourcesPerJob const& data, std::string
}
// add an entry for the non-event transitions, modules, and idle states
+ j["modules"].push_back(encodeToJSON("cleanup", "cleanup", data.events, data.cleanup));
j["modules"].push_back(encodeToJSON("other", "other", data.events, data.overhead));
j["modules"].push_back(encodeToJSON("eventsetup", "eventsetup", data.events, data.eventsetup));
j["modules"].push_back(encodeToJSON("idle", "idle", data.events, data.idle));
@@ -1388,49 +1444,7 @@ void FastTimerService::writeSummaryJSON(ResourcesPerJob const& data, std::string
void FastTimerService::preEvent(edm::StreamContext const& sc) { ignoredSignal(__func__); }
-void FastTimerService::postEvent(edm::StreamContext const& sc) {
- ignoredSignal(__func__);
-
- unsigned int sid = sc.streamID();
- auto& stream = streams_[sid];
- auto& process = callgraph_.processDescription();
-
- // measure the event resources as the sum of all modules' resources
- auto& data = stream.process.total;
- for (unsigned int id : process.modules_) {
- data += stream.modules[id].total;
- }
- stream.total += data;
-
- // handle the summaries and fill the plots
-
- // measure the event resources explicitly
- stream.event_measurement.measure_and_store(stream.event);
-
- // add to the event resources those used by source (which is not part of any process)
- stream.total += stream.source;
-
- // highlighted modules
- for (unsigned int group : boost::irange(0ul, highlight_modules_.size()))
- for (unsigned int i : highlight_modules_[group].modules)
- stream.highlight[group] += stream.modules[i].total;
-
- // avoid concurrent access to the summary objects
- {
- std::lock_guard guard(summary_mutex_);
- job_summary_ += stream;
- run_summary_[sc.runIndex()] += stream;
- }
-
- if (print_event_summary_) {
- edm::LogVerbatim out("FastReport");
- printEvent(out, stream);
- }
-
- if (enable_dqm_) {
- plots_->fill(callgraph_, stream, sc.eventID().luminosityBlock());
- }
-}
+void FastTimerService::postEvent(edm::StreamContext const& sc) { ignoredSignal(__func__); }
void FastTimerService::preSourceEvent(edm::StreamID sid) {
// clear the event counters
@@ -1438,10 +1452,7 @@ void FastTimerService::preSourceEvent(edm::StreamID sid) {
stream.reset();
++stream.events;
- // reuse the same measurement for the Source module and for the explicit begin of the Event
- auto& measurement = thread();
- measurement.measure_and_accumulate(stream.overhead);
- stream.event_measurement = measurement;
+ thread().measure_and_accumulate(stream.overhead);
}
void FastTimerService::postSourceEvent(edm::StreamID sid) {
@@ -1498,6 +1509,50 @@ void FastTimerService::postModuleEventAcquire(edm::StreamContext const& sc, edm:
thread().measure_and_store(module.total);
}
+// transform signals
+void FastTimerService::preModuleTransformPrefetching(edm::StreamContext const& sc,
+ edm::ModuleCallingContext const& mcc) {
+ ignoredSignal(__func__);
+}
+
+void FastTimerService::postModuleTransformPrefetching(edm::StreamContext const& sc,
+ edm::ModuleCallingContext const& mcc) {
+ ignoredSignal(__func__);
+}
+
+void FastTimerService::preModuleTransformAcquiring(edm::StreamContext const& sc, edm::ModuleCallingContext const& mcc) {
+ unsigned int sid = sc.streamID().value();
+ auto& stream = streams_[sid];
+ thread().measure_and_accumulate(stream.overhead);
+}
+
+void FastTimerService::postModuleTransformAcquiring(edm::StreamContext const& sc,
+ edm::ModuleCallingContext const& mcc) {
+ edm::ModuleDescription const& md = *mcc.moduleDescription();
+ unsigned int id = md.id();
+ unsigned int sid = sc.streamID().value();
+ auto& stream = streams_[sid];
+ auto& module = stream.modules[id];
+
+ thread().measure_and_accumulate(module.total);
+}
+
+void FastTimerService::preModuleTransform(edm::StreamContext const& sc, edm::ModuleCallingContext const& mcc) {
+ unsigned int sid = sc.streamID().value();
+ auto& stream = streams_[sid];
+ thread().measure_and_accumulate(stream.overhead);
+}
+
+void FastTimerService::postModuleTransform(edm::StreamContext const& sc, edm::ModuleCallingContext const& mcc) {
+ edm::ModuleDescription const& md = *mcc.moduleDescription();
+ unsigned int id = md.id();
+ unsigned int sid = sc.streamID().value();
+ auto& stream = streams_[sid];
+ auto& module = stream.modules[id];
+
+ thread().measure_and_accumulate(module.total);
+}
+
void FastTimerService::preModuleEvent(edm::StreamContext const& sc, edm::ModuleCallingContext const& mcc) {
unsigned int sid = sc.streamID().value();
auto& stream = streams_[sid];
@@ -1650,6 +1705,20 @@ void FastTimerService::postESModule(edm::eventsetup::EventSetupRecordKey const&,
}
}
+void FastTimerService::preClearEvent(edm::StreamContext const& sc) {
+ auto& stream = streams_[sc.streamID()];
+ thread().measure_and_accumulate(stream.overhead);
+}
+
+void FastTimerService::postClearEvent(edm::StreamContext const& sc) {
+ unsigned int sid = sc.streamID();
+ auto& stream = streams_[sid];
+ // measure the cleanup resources first
+ thread().measure_and_store(stream.cleanup);
+
+ finalizeEventMeasurement(sc);
+}
+
FastTimerService::ThreadGuard::ThreadGuard() {
auto err = ::pthread_key_create(&key_, retire_thread);
if (err) {
diff --git a/HLTrigger/Timer/plugins/FastTimerService.h b/HLTrigger/Timer/plugins/FastTimerService.h
index 6e446787554c0..8c9277907d96d 100644
--- a/HLTrigger/Timer/plugins/FastTimerService.h
+++ b/HLTrigger/Timer/plugins/FastTimerService.h
@@ -58,6 +58,8 @@ class FastTimerService : public tbb::task_scheduler_observer {
private:
void ignoredSignal(const std::string& signal) const;
void unsupportedSignal(const std::string& signal) const;
+ // helper function for event measurement finalization
+ void finalizeEventMeasurement(edm::StreamContext const&);
// these signal pairs are not guaranteed to happen in the same thread
@@ -168,12 +170,26 @@ class FastTimerService : public tbb::task_scheduler_observer {
void preModuleEventDelayedGet(edm::StreamContext const&, edm::ModuleCallingContext const&);
void postModuleEventDelayedGet(edm::StreamContext const&, edm::ModuleCallingContext const&);
+ // transform
+ void preModuleTransformPrefetching(edm::StreamContext const&, edm::ModuleCallingContext const&);
+ void postModuleTransformPrefetching(edm::StreamContext const&, edm::ModuleCallingContext const&);
+
+ void preModuleTransform(edm::StreamContext const&, edm::ModuleCallingContext const&);
+ void postModuleTransform(edm::StreamContext const&, edm::ModuleCallingContext const&);
+
+ void preModuleTransformAcquiring(edm::StreamContext const&, edm::ModuleCallingContext const&);
+ void postModuleTransformAcquiring(edm::StreamContext const&, edm::ModuleCallingContext const&);
+
void preEventReadFromSource(edm::StreamContext const&, edm::ModuleCallingContext const&);
void postEventReadFromSource(edm::StreamContext const&, edm::ModuleCallingContext const&);
void preESModule(edm::eventsetup::EventSetupRecordKey const&, edm::ESModuleCallingContext const&);
void postESModule(edm::eventsetup::EventSetupRecordKey const&, edm::ESModuleCallingContext const&);
+ // cleanup
+ void preClearEvent(edm::StreamContext const&);
+ void postClearEvent(edm::StreamContext const&);
+
// inherited from TBB task_scheduler_observer
void on_scheduler_entry(bool worker) final;
void on_scheduler_exit(bool worker) final;
@@ -311,8 +327,8 @@ class FastTimerService : public tbb::task_scheduler_observer {
AtomicResources eventsetup;
AtomicResources idle;
AtomicResources source;
- Resources event; // total time etc. spent between preSourceEvent and postEvent
- Measurement event_measurement;
+ Resources cleanup; // total time etc. spent between preClearEvent and postClearEvent
+ Resources event; // total time etc. spent between preSourceEvent and postEvent
std::vector highlight;
std::vector modules;
// Before the Framework SubProcess feature was removed, the following data
@@ -440,6 +456,7 @@ class FastTimerService : public tbb::task_scheduler_observer {
PlotsPerElement overhead_;
PlotsPerElement idle_;
PlotsPerElement source_;
+ PlotsPerElement cleanup_;
// resources spent in the modules' lumi and run transitions
PlotsPerElement lumi_;
PlotsPerElement run_;
diff --git a/L1Trigger/L1TGlobal/interface/CICADATemplate.h b/L1Trigger/L1TGlobal/interface/CICADATemplate.h
index c34574fde3f3d..2ad6c643f08e3 100644
--- a/L1Trigger/L1TGlobal/interface/CICADATemplate.h
+++ b/L1Trigger/L1TGlobal/interface/CICADATemplate.h
@@ -1,8 +1,9 @@
#ifndef L1Trigger_L1TGlobal_CICADATemplate_h
#define L1Trigger_L1TGlobal_CICADATemplate_h
+#include
#include
-#include
+#include
#include "L1Trigger/L1TGlobal/interface/GlobalCondition.h"
@@ -12,7 +13,7 @@ class CICADATemplate : public GlobalCondition {
CICADATemplate(const std::string&);
CICADATemplate(const std::string&, const l1t::GtConditionType&);
CICADATemplate(const CICADATemplate&);
- ~CICADATemplate() = default;
+ ~CICADATemplate() override = default;
CICADATemplate& operator=(const CICADATemplate&);
diff --git a/L1Trigger/L1TGlobal/src/CICADATemplate.cc b/L1Trigger/L1TGlobal/src/CICADATemplate.cc
index a33b30502f8a0..899862a358cb6 100644
--- a/L1Trigger/L1TGlobal/src/CICADATemplate.cc
+++ b/L1Trigger/L1TGlobal/src/CICADATemplate.cc
@@ -1,7 +1,6 @@
#include "L1Trigger/L1TGlobal/interface/CICADATemplate.h"
-#include
-#include
+#include
//TODO: Check the actual conditions name: "CondCICADA"
CICADATemplate::CICADATemplate() : GlobalCondition() { m_condCategory = l1t::CondCICADA; }
diff --git a/L1Trigger/L1THGCal/src/backend/HGCalHistoSeedingImpl.cc b/L1Trigger/L1THGCal/src/backend/HGCalHistoSeedingImpl.cc
index ba85d37ecebc1..11eb41a361509 100644
--- a/L1Trigger/L1THGCal/src/backend/HGCalHistoSeedingImpl.cc
+++ b/L1Trigger/L1THGCal/src/backend/HGCalHistoSeedingImpl.cc
@@ -88,7 +88,7 @@ HGCalHistoSeedingImpl::Histogram HGCalHistoSeedingImpl::fillHistoClusters(
double maxx2 = std::get<3>(bounds);
for (auto& clu : clustersPtrs) {
- float x1 = 0., x2 = 0;
+ double x1 = 0., x2 = 0;
switch (seedingSpace_) {
case RPhi:
x1 = sqrt(pow(clu->centreProj().x(), 2) + pow(clu->centreProj().y(), 2));
@@ -100,12 +100,14 @@ HGCalHistoSeedingImpl::Histogram HGCalHistoSeedingImpl::fillHistoClusters(
break;
};
if (x1 < minx1 || x1 >= maxx1) {
- throw cms::Exception("OutOfBound") << "TC X1 = " << x1 << " out of the seeding histogram bounds " << minx1
- << " - " << maxx1;
+ edm::LogWarning("OutOfBound") << "TC X1 = " << x1 << " out of the seeding histogram bounds " << minx1 << " - "
+ << maxx1;
+ x1 = std::clamp(x1, minx1, maxx1 - std::numeric_limits::epsilon());
}
if (x2 < minx2 || x2 >= maxx2) {
- throw cms::Exception("OutOfBound") << "TC X2 = " << x2 << " out of the seeding histogram bounds " << minx2
- << " - " << maxx2;
+ edm::LogWarning("OutOfBound") << "TC X2 = " << x2 << " out of the seeding histogram bounds " << minx2 << " - "
+ << maxx2;
+ x2 = std::clamp(x2, minx2, maxx2 - std::numeric_limits::epsilon());
}
unsigned bin1 = unsigned((x1 - minx1) * nBins1_ / (maxx1 - minx1));
unsigned bin2 = unsigned((x2 - minx2) * nBins2_ / (maxx2 - minx2));
diff --git a/PerfTools/AllocMonitor/README.md b/PerfTools/AllocMonitor/README.md
index 6d23fed98bca0..c4cbd6c7efc1c 100644
--- a/PerfTools/AllocMonitor/README.md
+++ b/PerfTools/AllocMonitor/README.md
@@ -110,6 +110,7 @@ list of module names, and an optional number of initial events to skip are spec
service in the configuration. The parameters are
- `filename`: name of file to which to write reports
- `moduleNames`: list of modules which should have their information added to the file. An empty list specifies all modules should be included.
+- `skippedModuleNames`: list of module which should have their information skipped.
- `nEventsToSkip`: the number of initial events that must be processed before reporting happens.
The beginning of the file contains a description of the structure and contents of the file.
diff --git a/PerfTools/AllocMonitor/plugins/ModuleEventAllocMonitor.cc b/PerfTools/AllocMonitor/plugins/ModuleEventAllocMonitor.cc
index 07090887c7bfb..627d01b29214f 100644
--- a/PerfTools/AllocMonitor/plugins/ModuleEventAllocMonitor.cc
+++ b/PerfTools/AllocMonitor/plugins/ModuleEventAllocMonitor.cc
@@ -13,6 +13,7 @@
// system include files
#include
#include
+#include
// user include files
#include "PerfTools/AllocMonitor/interface/AllocMonitorBase.h"
@@ -209,9 +210,7 @@ namespace {
class ModuleEventAllocMonitor {
public:
ModuleEventAllocMonitor(edm::ParameterSet const& iPS, edm::ActivityRegistry& iAR)
- : moduleNames_(iPS.getUntrackedParameter>("moduleNames")),
- nEventsToSkip_(iPS.getUntrackedParameter("nEventsToSkip")),
- filter_(&moduleIDs_) {
+ : nEventsToSkip_(iPS.getUntrackedParameter("nEventsToSkip")), filter_(&moduleIDs_) {
(void)cms::perftools::AllocMonitorRegistry::instance().createAndRegisterMonitor();
if (nEventsToSkip_ > 0) {
@@ -239,17 +238,31 @@ class ModuleEventAllocMonitor {
"#D <# matched deallocations>\n";
file->write(s.str());
}
- if (not moduleNames_.empty()) {
+ auto skippedModuleNamesVec = iPS.getUntrackedParameter>("skippedModuleNames");
+ auto moduleNamesVec = iPS.getUntrackedParameter>("moduleNames");
+ moduleNamesSet_ = std::unordered_set(moduleNamesVec.begin(), moduleNamesVec.end());
+ skippedModuleNamesSet_ =
+ std::unordered_set(skippedModuleNamesVec.begin(), skippedModuleNamesVec.end());
+ if (not moduleNamesSet_.empty() or not skippedModuleNamesSet_.empty()) {
iAR.watchPreModuleConstruction([this, file](auto const& description) {
- auto found = std::find(moduleNames_.begin(), moduleNames_.end(), description.moduleLabel());
- if (found != moduleNames_.end()) {
+ bool shouldKeep = false;
+ if (not moduleNamesSet_.empty()) {
+ shouldKeep = moduleNamesSet_.contains(description.moduleLabel());
+ }
+ if (not skippedModuleNamesSet_.empty()) {
+ shouldKeep = not skippedModuleNamesSet_.contains(description.moduleLabel());
+ }
+ std::stringstream s;
+ if (shouldKeep) {
+ s << "@ " << description.moduleLabel() << " " << description.moduleName() << " " << description.id() << "\n";
moduleIDs_.push_back(description.id());
nModules_ = moduleIDs_.size();
std::sort(moduleIDs_.begin(), moduleIDs_.end());
- std::stringstream s;
- s << "@ " << description.moduleLabel() << " " << description.moduleName() << " " << description.id() << "\n";
- file->write(s.str());
+ } else {
+ s << "# Skipping module" << description.moduleLabel() << " " << description.moduleName() << " "
+ << description.id() << " # skipped\n";
}
+ file->write(s.str());
});
} else {
iAR.watchPreModuleConstruction([this, file](auto const& description) {
@@ -414,6 +427,8 @@ class ModuleEventAllocMonitor {
->setComment(
"Module labels for modules which should have their allocations monitored. If empty all modules will be "
"monitored.");
+ ps.addUntracked>("skippedModuleNames", std::vector())
+ ->setComment("Module labels for modules which should have their allocations ignored.");
ps.addUntracked("nEventsToSkip", 0)
->setComment(
"Number of events to skip before turning on monitoring. If used in a multi-threaded application, "
@@ -433,7 +448,7 @@ class ModuleEventAllocMonitor {
}
bool forThisModule(unsigned int iID) const {
- return (moduleNames_.empty() or std::binary_search(moduleIDs_.begin(), moduleIDs_.end(), iID));
+ return (moduleNamesSet_.empty() or std::binary_search(moduleIDs_.begin(), moduleIDs_.end(), iID));
}
//The size is (#streams)*(#modules)
CMS_THREAD_GUARD(streamSync_) std::vector streamModuleAllocs_;
@@ -442,7 +457,8 @@ class ModuleEventAllocMonitor {
CMS_THREAD_GUARD(streamSync_) std::vector streamModuleFinishOrder_;
std::vector> streamNFinishedModules_;
std::vector> streamSync_;
- std::vector moduleNames_;
+ std::unordered_set moduleNamesSet_;
+ std::unordered_set skippedModuleNamesSet_;
std::vector moduleIDs_;
unsigned int nStreams_ = 0;
unsigned int nModules_ = 0;
diff --git a/PerfTools/AllocMonitor/python/ModuleEventAllocMonitor.py b/PerfTools/AllocMonitor/python/ModuleEventAllocMonitor.py
new file mode 100644
index 0000000000000..5b16a96ec6492
--- /dev/null
+++ b/PerfTools/AllocMonitor/python/ModuleEventAllocMonitor.py
@@ -0,0 +1,7 @@
+import FWCore.ParameterSet.Config as cms
+def customise(process):
+ process.ModuleEventAllocMonitor = cms.Service("ModuleEventAllocMonitor",
+ fileName=cms.untracked.string("moduleEventAllocMonitor.log"),
+ skippedModuleNames=cms.untracked.vstring(["mix"]),
+ )
+ return(process)
diff --git a/PerfTools/AllocMonitor/scripts/edmModuleEventAllocMonitorAnalyze.py b/PerfTools/AllocMonitor/scripts/edmModuleEventAllocMonitorAnalyze.py
index 5442e86045b35..f743e932ae7a3 100755
--- a/PerfTools/AllocMonitor/scripts/edmModuleEventAllocMonitorAnalyze.py
+++ b/PerfTools/AllocMonitor/scripts/edmModuleEventAllocMonitorAnalyze.py
@@ -245,7 +245,7 @@ def printReport(values, showEvents, summary, eventSummary, maxColumn):
if args.retained:
printReport(reportModuleRetainingMemory(fileParser, args.eventData, args.csv), args.eventData, "average retained", "retained each event", args.maxColumn)
if args.product:
- printReport(reportModuleDataProductMemory(fileParser, args.eventData), args.eventData, "average data products size", "data products size each event", args.maxColumn)
+ printReport(reportModuleDataProductMemory(fileParser, args.eventData, args.csv), args.eventData, "average data products size", "data products size each event", args.maxColumn)
if args.tempSize:
printReport(reportModuleTemporary(fileParser, args.eventData, args.csv), args.eventData, "average temporary allocation size", "temporary allocation size each event", args.maxColumn)
if args.nTemp: