36 std::unique_ptr<std::atomic<std::chrono::high_resolution_clock::rep>[]>
m_timeSums;
37 std::chrono::high_resolution_clock::time_point
m_time;
46 using namespace edm::service;
66 m_startedTiming(
false)
75 iReg.watchPreModuleEventDelayedGet([
this](StreamContext
const&, ModuleCallingContext
const&){
78 iReg.watchPostModuleEventDelayedGet([
this](StreamContext
const&, ModuleCallingContext
const&){
84 m_timeSums.reset(
new std::atomic<std::chrono::high_resolution_clock::rep>[m_nTimeSums]);
85 for(
unsigned int i=0;
i<m_nTimeSums;++
i) {
90 iReg.watchPreSourceEvent([
this](StreamID){
91 if(not m_startedTiming) {
97 iReg.watchPostSourceEvent([
this](StreamID){
104 std::cout <<
"Fraction of time running n Modules simultaneously"<<std::endl;
135 std::chrono::high_resolution_clock::time_point oldTime;
136 bool expected =
false;
137 unsigned int nModules;
138 while (not
m_spinLock.compare_exchange_strong(expected,
true,std::memory_order_acq_rel)){
145 m_spinLock.store(
false,std::memory_order_release);
147 assert(nModules <m_nTimeSums);
148 auto diff = newTime - oldTime;
149 for(
unsigned int i=0;
i<nModules;++
i) {
158 std::chrono::high_resolution_clock::time_point oldTime;
159 bool expected =
false;
160 unsigned int nModules;
161 while (not
m_spinLock.compare_exchange_weak(expected,
true,std::memory_order_acq_rel)){
168 m_spinLock.store(
false,std::memory_order_release);
170 assert(nModules <m_nTimeSums);
171 auto diff = newTime - oldTime;
172 for(
unsigned int i=0;
i<=nModules;++
i) {
unsigned int maxNumberOfThreads() const
tuple start
Check for commandline option errors.
ConcurrentModuleTimer(edm::ParameterSet const &iConfig, edm::ActivityRegistry &iAR)
std::chrono::high_resolution_clock::time_point m_time
#define DEFINE_FWK_SERVICE(type)
std::atomic< bool > m_spinLock
std::unique_ptr< std::atomic< std::chrono::high_resolution_clock::rep >[]> m_timeSums