CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes
FastTimerService::Measurement Struct Reference

Public Member Functions

void measure ()
 
void measure_and_accumulate (Resources &store)
 
void measure_and_accumulate (AtomicResources &store)
 
void measure_and_store (Resources &store)
 
 Measurement ()
 

Public Attributes

uint64_t allocated
 
uint64_t deallocated
 
boost::chrono::high_resolution_clock::time_point time_real
 
boost::chrono::thread_clock::time_point time_thread
 

Detailed Description

Definition at line 187 of file FastTimerService.h.

Constructor & Destructor Documentation

FastTimerService::Measurement::Measurement ( )

Definition at line 310 of file FastTimerService.cc.

310  {
311  measure();
312 }

Member Function Documentation

void FastTimerService::Measurement::measure ( )

Definition at line 315 of file FastTimerService.cc.

References memory_usage::allocated(), memory_usage::deallocated(), and cmsPerfSuiteHarvest::now.

Referenced by FastTimerService::on_scheduler_entry().

315  {
316  #ifdef DEBUG_THREAD_CONCURRENCY
317  id = std::this_thread::get_id();
318  #endif // DEBUG_THREAD_CONCURRENCY
323 }
boost::chrono::thread_clock::time_point time_thread
static uint64_t deallocated()
Definition: memory_usage.cc:75
boost::chrono::high_resolution_clock::time_point time_real
static uint64_t allocated()
Definition: memory_usage.cc:70
void FastTimerService::Measurement::measure_and_accumulate ( Resources store)

Definition at line 345 of file FastTimerService.cc.

References memory_usage::allocated(), memory_usage::deallocated(), and cmsPerfSuiteHarvest::now.

Referenced by FastTimerService::on_scheduler_exit(), FastTimerService::postModuleEvent(), FastTimerService::postModuleGlobalBeginLumi(), FastTimerService::postModuleGlobalBeginRun(), FastTimerService::postModuleGlobalEndLumi(), FastTimerService::postModuleGlobalEndRun(), FastTimerService::postModuleStreamBeginLumi(), FastTimerService::postModuleStreamBeginRun(), FastTimerService::postModuleStreamEndLumi(), FastTimerService::postModuleStreamEndRun(), FastTimerService::postSourceLumi(), FastTimerService::postSourceRun(), FastTimerService::preModuleEvent(), FastTimerService::preModuleEventAcquire(), FastTimerService::preModuleGlobalBeginLumi(), FastTimerService::preModuleGlobalBeginRun(), FastTimerService::preModuleGlobalEndLumi(), FastTimerService::preModuleGlobalEndRun(), FastTimerService::preModuleStreamBeginLumi(), FastTimerService::preModuleStreamBeginRun(), FastTimerService::preModuleStreamEndLumi(), FastTimerService::preModuleStreamEndRun(), FastTimerService::preSourceLumi(), and FastTimerService::preSourceRun().

345  {
346  #ifdef DEBUG_THREAD_CONCURRENCY
347  assert(std::this_thread::get_id() == id);
348  #endif // DEBUG_THREAD_CONCURRENCY
349  auto new_time_thread = boost::chrono::thread_clock::now();
350  auto new_time_real = boost::chrono::high_resolution_clock::now();
351  auto new_allocated = memory_usage::allocated();
352  auto new_deallocated = memory_usage::deallocated();
353  store.time_thread += new_time_thread - time_thread;
354  store.time_real += new_time_real - time_real;
355  store.allocated += new_allocated - allocated;
356  store.deallocated += new_deallocated - deallocated;
357  time_thread = new_time_thread;
358  time_real = new_time_real;
359  allocated = new_allocated;
360  deallocated = new_deallocated;
361 }
boost::chrono::thread_clock::time_point time_thread
static uint64_t deallocated()
Definition: memory_usage.cc:75
boost::chrono::high_resolution_clock::time_point time_real
static uint64_t allocated()
Definition: memory_usage.cc:70
void FastTimerService::Measurement::measure_and_accumulate ( AtomicResources store)

Definition at line 364 of file FastTimerService.cc.

References memory_usage::allocated(), KineDebug3::count(), memory_usage::deallocated(), and cmsPerfSuiteHarvest::now.

364  {
365  #ifdef DEBUG_THREAD_CONCURRENCY
366  assert(std::this_thread::get_id() == id);
367  #endif // DEBUG_THREAD_CONCURRENCY
368  auto new_time_thread = boost::chrono::thread_clock::now();
369  auto new_time_real = boost::chrono::high_resolution_clock::now();
370  auto new_allocated = memory_usage::allocated();
371  auto new_deallocated = memory_usage::deallocated();
372  store.time_thread += boost::chrono::duration_cast<boost::chrono::nanoseconds>(new_time_thread - time_thread).count();
373  store.time_real += boost::chrono::duration_cast<boost::chrono::nanoseconds>(new_time_real - time_real).count();
374  store.allocated += new_allocated - allocated;
375  store.deallocated += new_deallocated - deallocated;
376  time_thread = new_time_thread;
377  time_real = new_time_real;
378  allocated = new_allocated;
379  deallocated = new_deallocated;
380 }
boost::chrono::thread_clock::time_point time_thread
static uint64_t deallocated()
Definition: memory_usage.cc:75
boost::chrono::high_resolution_clock::time_point time_real
static uint64_t allocated()
Definition: memory_usage.cc:70
boost::date_time::subsecond_duration< boost::posix_time::time_duration, 1000000000 > nanoseconds
void FastTimerService::Measurement::measure_and_store ( Resources store)

Definition at line 326 of file FastTimerService.cc.

References memory_usage::allocated(), memory_usage::deallocated(), and cmsPerfSuiteHarvest::now.

Referenced by FastTimerService::postModuleEvent(), FastTimerService::postModuleEventAcquire(), and FastTimerService::postSourceEvent().

326  {
327  #ifdef DEBUG_THREAD_CONCURRENCY
328  assert(std::this_thread::get_id() == id);
329  #endif // DEBUG_THREAD_CONCURRENCY
330  auto new_time_thread = boost::chrono::thread_clock::now();
331  auto new_time_real = boost::chrono::high_resolution_clock::now();
332  auto new_allocated = memory_usage::allocated();
333  auto new_deallocated = memory_usage::deallocated();
334  store.time_thread = new_time_thread - time_thread;
335  store.time_real = new_time_real - time_real;
336  store.allocated = new_allocated - allocated;
337  store.deallocated = new_deallocated - deallocated;
338  time_thread = new_time_thread;
339  time_real = new_time_real;
340  allocated = new_allocated;
341  deallocated = new_deallocated;
342 }
boost::chrono::thread_clock::time_point time_thread
static uint64_t deallocated()
Definition: memory_usage.cc:75
boost::chrono::high_resolution_clock::time_point time_real
static uint64_t allocated()
Definition: memory_usage.cc:70

Member Data Documentation

uint64_t FastTimerService::Measurement::allocated

Definition at line 204 of file FastTimerService.h.

uint64_t FastTimerService::Measurement::deallocated

Definition at line 205 of file FastTimerService.h.

boost::chrono::high_resolution_clock::time_point FastTimerService::Measurement::time_real

Definition at line 203 of file FastTimerService.h.

boost::chrono::thread_clock::time_point FastTimerService::Measurement::time_thread

Definition at line 202 of file FastTimerService.h.