CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Public Attributes
FastTimerService::Measurement Struct Reference

Public Member Functions

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

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 189 of file FastTimerService.h.

Constructor & Destructor Documentation

FastTimerService::Measurement::Measurement ( )
noexcept

Definition at line 307 of file FastTimerService.cc.

307 { measure(); }

Member Function Documentation

void FastTimerService::Measurement::measure ( )
noexcept

Definition at line 309 of file FastTimerService.cc.

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

Referenced by FastTimerService::on_scheduler_entry().

309  {
310 #ifdef DEBUG_THREAD_CONCURRENCY
311  id = std::this_thread::get_id();
312 #endif // DEBUG_THREAD_CONCURRENCY
317 }
boost::chrono::thread_clock::time_point time_thread
static uint64_t deallocated()
Definition: memory_usage.cc:88
boost::chrono::high_resolution_clock::time_point time_real
static uint64_t allocated()
Definition: memory_usage.cc:86
void FastTimerService::Measurement::measure_and_accumulate ( Resources store)
noexcept

Definition at line 337 of file FastTimerService.cc.

References memory_usage::allocated(), cms::cuda::assert(), memory_usage::deallocated(), and submitPVValidationJobs::now.

337  {
338 #ifdef DEBUG_THREAD_CONCURRENCY
339  assert(std::this_thread::get_id() == id);
340 #endif // DEBUG_THREAD_CONCURRENCY
341  auto new_time_thread = boost::chrono::thread_clock::now();
342  auto new_time_real = boost::chrono::high_resolution_clock::now();
343  auto new_allocated = memory_usage::allocated();
344  auto new_deallocated = memory_usage::deallocated();
345  store.time_thread += new_time_thread - time_thread;
346  store.time_real += new_time_real - time_real;
347  store.allocated += new_allocated - allocated;
348  store.deallocated += new_deallocated - deallocated;
349  time_thread = new_time_thread;
350  time_real = new_time_real;
351  allocated = new_allocated;
352  deallocated = new_deallocated;
353 }
assert(be >=bs)
boost::chrono::thread_clock::time_point time_thread
static uint64_t deallocated()
Definition: memory_usage.cc:88
boost::chrono::high_resolution_clock::time_point time_real
static uint64_t allocated()
Definition: memory_usage.cc:86
void FastTimerService::Measurement::measure_and_accumulate ( AtomicResources store)
noexcept

Definition at line 355 of file FastTimerService.cc.

References memory_usage::allocated(), cms::cuda::assert(), submitPVResolutionJobs::count, memory_usage::deallocated(), and submitPVValidationJobs::now.

355  {
356 #ifdef DEBUG_THREAD_CONCURRENCY
357  assert(std::this_thread::get_id() == id);
358 #endif // DEBUG_THREAD_CONCURRENCY
359  auto new_time_thread = boost::chrono::thread_clock::now();
360  auto new_time_real = boost::chrono::high_resolution_clock::now();
361  auto new_allocated = memory_usage::allocated();
362  auto new_deallocated = memory_usage::deallocated();
363  store.time_thread += boost::chrono::duration_cast<boost::chrono::nanoseconds>(new_time_thread - time_thread).count();
364  store.time_real += boost::chrono::duration_cast<boost::chrono::nanoseconds>(new_time_real - time_real).count();
365  store.allocated += new_allocated - allocated;
366  store.deallocated += new_deallocated - deallocated;
367  time_thread = new_time_thread;
368  time_real = new_time_real;
369  allocated = new_allocated;
370  deallocated = new_deallocated;
371 }
boost::date_time::subsecond_duration< boost::posix_time::time_duration, 1000000000 > nanoseconds
assert(be >=bs)
boost::chrono::thread_clock::time_point time_thread
static uint64_t deallocated()
Definition: memory_usage.cc:88
boost::chrono::high_resolution_clock::time_point time_real
static uint64_t allocated()
Definition: memory_usage.cc:86
void FastTimerService::Measurement::measure_and_store ( Resources store)
noexcept

Definition at line 319 of file FastTimerService.cc.

References memory_usage::allocated(), cms::cuda::assert(), memory_usage::deallocated(), and submitPVValidationJobs::now.

319  {
320 #ifdef DEBUG_THREAD_CONCURRENCY
321  assert(std::this_thread::get_id() == id);
322 #endif // DEBUG_THREAD_CONCURRENCY
323  auto new_time_thread = boost::chrono::thread_clock::now();
324  auto new_time_real = boost::chrono::high_resolution_clock::now();
325  auto new_allocated = memory_usage::allocated();
326  auto new_deallocated = memory_usage::deallocated();
327  store.time_thread = new_time_thread - time_thread;
328  store.time_real = new_time_real - time_real;
329  store.allocated = new_allocated - allocated;
330  store.deallocated = new_deallocated - deallocated;
331  time_thread = new_time_thread;
332  time_real = new_time_real;
333  allocated = new_allocated;
334  deallocated = new_deallocated;
335 }
assert(be >=bs)
boost::chrono::thread_clock::time_point time_thread
static uint64_t deallocated()
Definition: memory_usage.cc:88
boost::chrono::high_resolution_clock::time_point time_real
static uint64_t allocated()
Definition: memory_usage.cc:86

Member Data Documentation

uint64_t FastTimerService::Measurement::allocated

Definition at line 206 of file FastTimerService.h.

uint64_t FastTimerService::Measurement::deallocated

Definition at line 207 of file FastTimerService.h.

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

Definition at line 205 of file FastTimerService.h.

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

Definition at line 204 of file FastTimerService.h.