37 std::unique_ptr<std::atomic<std::chrono::high_resolution_clock::rep>[]>
m_timeSums;
38 std::chrono::high_resolution_clock::time_point
m_time;
47 using namespace edm::service;
67 m_startedTiming(
false)
76 iReg.watchPreModuleEventDelayedGet([
this](StreamContext
const&, ModuleCallingContext
const& iContext){
81 iReg.watchPostModuleEventDelayedGet([
this](StreamContext
const&, ModuleCallingContext
const& iContext){
89 m_timeSums.reset(
new std::atomic<std::chrono::high_resolution_clock::rep>[m_nTimeSums]);
90 for(
unsigned int i=0;
i<m_nTimeSums;++
i) {
95 iReg.watchPreSourceEvent([
this](StreamID){
96 if(not m_startedTiming) {
102 iReg.watchPostSourceEvent([
this](StreamID){
109 std::cout <<
"Fraction of time running n Modules simultaneously"<<std::endl;
140 std::chrono::high_resolution_clock::time_point oldTime;
141 bool expected =
false;
142 unsigned int nModules;
143 while (not
m_spinLock.compare_exchange_strong(expected,
true,std::memory_order_acq_rel)){
150 m_spinLock.store(
false,std::memory_order_release);
152 assert(nModules <m_nTimeSums);
153 auto diff = newTime - oldTime;
154 for(
unsigned int i=0;
i<nModules;++
i) {
163 std::chrono::high_resolution_clock::time_point oldTime;
164 bool expected =
false;
165 unsigned int nModules;
166 while (not
m_spinLock.compare_exchange_weak(expected,
true,std::memory_order_acq_rel)){
173 m_spinLock.store(
false,std::memory_order_release);
175 assert(nModules <m_nTimeSums);
176 auto diff = newTime - oldTime;
177 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