Definition at line 30 of file ConcurrentModuleTimer.cc.
◆ ConcurrentModuleTimer()
Definition at line 73 of file ConcurrentModuleTimer.cc.
74 :
m_modulesToExclude(iConfig.getUntrackedParameter<std::vector<std::string>>(
"modulesToExclude")),
77 m_padding(iConfig.getUntrackedParameter<
unsigned int>(
"padding")),
83 iReg.watchPreModuleConstruction([
this](ModuleDescription
const& iMod) {
85 if (iMod.moduleLabel() ==
name) {
91 iReg.watchPreModuleDestruction([
this](ModuleDescription
const& iMod) {
97 iReg.watchPreModuleEvent([
this](StreamContext
const&, ModuleCallingContext
const& iContext) {
102 iReg.watchPostModuleEvent([
this](StreamContext
const&, ModuleCallingContext
const& iContext) {
108 iReg.watchPreModuleEventDelayedGet([
this](StreamContext
const&, ModuleCallingContext
const& iContext) {
115 iReg.watchPostModuleEventDelayedGet([
this](StreamContext
const&, ModuleCallingContext
const& iContext) {
125 iReg.watchPreModuleEvent([
this](StreamContext
const&, ModuleCallingContext
const&) {
start(); });
126 iReg.watchPostModuleEvent([
this](StreamContext
const&, ModuleCallingContext
const&) {
stop(); });
128 iReg.watchPreModuleEventDelayedGet([
this](StreamContext
const&, ModuleCallingContext
const& iContext) {
133 iReg.watchPostModuleEventDelayedGet([
this](StreamContext
const&, ModuleCallingContext
const& iContext) {
139 iReg.watchPreModuleGlobalBeginRun([
this](GlobalContext
const&, ModuleCallingContext
const&) {
147 iReg.watchPostModuleGlobalBeginRun([
this](GlobalContext
const&, ModuleCallingContext
const&) {
stop(); });
159 iReg.watchPreSourceEvent([
this](StreamID) {
169 iReg.watchPostSourceEvent([
this](StreamID) {
stop(); });
◆ ~ConcurrentModuleTimer()
ConcurrentModuleTimer::~ConcurrentModuleTimer |
( |
| ) |
|
◆ fillDescriptions()
Definition at line 262 of file ConcurrentModuleTimer.cc.
264 desc.addUntracked<std::vector<std::string>>(
"modulesToExclude", std::vector<std::string>{})
265 ->setComment(
"Module labels to exclude from the timing measurements");
266 desc.addUntracked<
bool>(
"excludeSource",
false)->setComment(
"Exclude the time the source is running");
267 desc.addUntracked<
unsigned int>(
"padding", 0)
269 "[Expert use only] Extra possible concurrent modules beyond thread count.\n Only useful in debugging "
270 "possible framework scheduling problems.");
271 desc.addUntracked<
bool>(
"trackGlobalBeginRun",
false)
272 ->setComment(
"Check for concurrent modules during global begin run");
273 descriptions.
add(
"ConcurrentModuleTimer",
desc);
References edm::ConfigurationDescriptions::add(), and submitPVResolutionJobs::desc.
◆ start()
void ConcurrentModuleTimer::start |
( |
| ) |
|
|
private |
Definition at line 201 of file ConcurrentModuleTimer.cc.
203 std::chrono::high_resolution_clock::time_point oldTime;
204 bool expected =
false;
205 unsigned int nModules;
206 while (not
m_spinLock.compare_exchange_strong(expected,
true, std::memory_order_acq_rel)) {
216 m_spinLock.store(
false, std::memory_order_release);
219 auto diff = newTime - oldTime;
220 for (
unsigned int i = 0;
i < nModules; ++
i) {
References cms::cuda::assert(), change_name::diff, mps_fire::i, m_maxNModules, m_nModules, m_nTimeSums, m_spinLock, m_time, m_timeSums, and submitPVValidationJobs::now.
Referenced by progressbar.ProgressBar::__next__().
◆ stop()
void ConcurrentModuleTimer::stop |
( |
| ) |
|
|
private |
Definition at line 225 of file ConcurrentModuleTimer.cc.
227 std::chrono::high_resolution_clock::time_point oldTime;
228 bool expected =
false;
229 unsigned int nModules;
230 while (not
m_spinLock.compare_exchange_weak(expected,
true, std::memory_order_acq_rel)) {
237 m_spinLock.store(
false, std::memory_order_release);
240 auto diff = newTime - oldTime;
241 for (
unsigned int i = 0;
i <= nModules; ++
i) {
References cms::cuda::assert(), change_name::diff, mps_fire::i, m_nModules, m_nTimeSums, m_spinLock, m_time, m_timeSums, and submitPVValidationJobs::now.
◆ trackModule()
◆ m_excludedModuleIds
std::vector<unsigned int> edm::service::ConcurrentModuleTimer::m_excludedModuleIds |
|
private |
◆ m_excludeSource
const bool edm::service::ConcurrentModuleTimer::m_excludeSource |
|
private |
◆ m_maxNModules
unsigned int edm::service::ConcurrentModuleTimer::m_maxNModules = 0 |
|
private |
◆ m_modulesToExclude
std::vector<std::string> edm::service::ConcurrentModuleTimer::m_modulesToExclude |
|
private |
◆ m_nModules
unsigned int edm::service::ConcurrentModuleTimer::m_nModules |
|
private |
◆ m_nTimeSums
unsigned int edm::service::ConcurrentModuleTimer::m_nTimeSums = 0 |
|
private |
◆ m_padding
const unsigned int edm::service::ConcurrentModuleTimer::m_padding |
|
private |
◆ m_spinLock
std::atomic<bool> edm::service::ConcurrentModuleTimer::m_spinLock |
|
private |
◆ m_startedTiming
bool edm::service::ConcurrentModuleTimer::m_startedTiming |
|
private |
◆ m_time
std::chrono::high_resolution_clock::time_point edm::service::ConcurrentModuleTimer::m_time |
|
private |
◆ m_timeSums
std::unique_ptr<std::atomic<std::chrono::high_resolution_clock::rep>[]> edm::service::ConcurrentModuleTimer::m_timeSums |
|
private |
◆ m_trackGlobalBeginRun
const bool edm::service::ConcurrentModuleTimer::m_trackGlobalBeginRun |
|
private |