Definition at line 28 of file ConcurrentModuleTimer.cc.
◆ ConcurrentModuleTimer()
Definition at line 71 of file ConcurrentModuleTimer.cc.
72 :
m_modulesToExclude(iConfig.getUntrackedParameter<std::vector<std::string>>(
"modulesToExclude")),
75 m_padding(iConfig.getUntrackedParameter<
unsigned int>(
"padding")),
81 iReg.watchPreModuleConstruction([
this](ModuleDescription
const& iMod) {
83 if (iMod.moduleLabel() ==
name) {
89 iReg.watchPreModuleEvent([
this](StreamContext
const&, ModuleCallingContext
const& iContext) {
94 iReg.watchPostModuleEvent([
this](StreamContext
const&, ModuleCallingContext
const& iContext) {
100 iReg.watchPreModuleEventDelayedGet([
this](StreamContext
const&, ModuleCallingContext
const& iContext) {
107 iReg.watchPostModuleEventDelayedGet([
this](StreamContext
const&, ModuleCallingContext
const& iContext) {
117 iReg.watchPreModuleEvent([
this](StreamContext
const&, ModuleCallingContext
const&) {
start(); });
118 iReg.watchPostModuleEvent([
this](StreamContext
const&, ModuleCallingContext
const&) {
stop(); });
120 iReg.watchPreModuleEventDelayedGet([
this](StreamContext
const&, ModuleCallingContext
const& iContext) {
125 iReg.watchPostModuleEventDelayedGet([
this](StreamContext
const&, ModuleCallingContext
const& iContext) {
131 iReg.watchPreModuleGlobalBeginRun([
this](GlobalContext
const&, ModuleCallingContext
const&) {
139 iReg.watchPostModuleGlobalBeginRun([
this](GlobalContext
const&, ModuleCallingContext
const&) {
stop(); });
151 iReg.watchPreSourceEvent([
this](StreamID) {
161 iReg.watchPostSourceEvent([
this](StreamID) {
stop(); });
◆ ~ConcurrentModuleTimer()
ConcurrentModuleTimer::~ConcurrentModuleTimer |
( |
| ) |
|
◆ fillDescriptions()
Definition at line 254 of file ConcurrentModuleTimer.cc.
256 desc.addUntracked<std::vector<std::string>>(
"modulesToExclude", std::vector<std::string>{})
257 ->setComment(
"Module labels to exclude from the timing measurements");
258 desc.addUntracked<
bool>(
"excludeSource",
false)->setComment(
"Exclude the time the source is running");
259 desc.addUntracked<
unsigned int>(
"padding", 0)
261 "[Expert use only] Extra possible concurrent modules beyond thread count.\n Only useful in debugging "
262 "possible framework scheduling problems.");
263 desc.addUntracked<
bool>(
"trackGlobalBeginRun",
false)
264 ->setComment(
"Check for concurrent modules during global begin run");
265 descriptions.
add(
"ConcurrentModuleTimer",
desc);
References edm::ConfigurationDescriptions::add(), and submitPVResolutionJobs::desc.
◆ start()
void ConcurrentModuleTimer::start |
( |
| ) |
|
|
private |
Definition at line 193 of file ConcurrentModuleTimer.cc.
195 std::chrono::high_resolution_clock::time_point oldTime;
196 bool expected =
false;
197 unsigned int nModules;
198 while (not
m_spinLock.compare_exchange_strong(expected,
true, std::memory_order_acq_rel)) {
208 m_spinLock.store(
false, std::memory_order_release);
211 auto diff = newTime - oldTime;
212 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 217 of file ConcurrentModuleTimer.cc.
219 std::chrono::high_resolution_clock::time_point oldTime;
220 bool expected =
false;
221 unsigned int nModules;
222 while (not
m_spinLock.compare_exchange_weak(expected,
true, std::memory_order_acq_rel)) {
229 m_spinLock.store(
false, std::memory_order_release);
232 auto diff = newTime - oldTime;
233 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 |