CMS 3D CMS Logo

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

Public Member Functions

void measure () noexcept
 
void measure_and_accumulate (AtomicResources &store) noexcept
 
void measure_and_accumulate (Resources &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 188 of file FastTimerService.h.

Constructor & Destructor Documentation

◆ Measurement()

FastTimerService::Measurement::Measurement ( )
noexcept

Definition at line 306 of file FastTimerService.cc.

306 { measure(); }

Member Function Documentation

◆ measure()

void FastTimerService::Measurement::measure ( )
noexcept

Definition at line 308 of file FastTimerService.cc.

308  {
309 #ifdef DEBUG_THREAD_CONCURRENCY
310  id = std::this_thread::get_id();
311 #endif // DEBUG_THREAD_CONCURRENCY
316 }

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

◆ measure_and_accumulate() [1/2]

void FastTimerService::Measurement::measure_and_accumulate ( AtomicResources store)
noexcept

Definition at line 354 of file FastTimerService.cc.

354  {
355 #ifdef DEBUG_THREAD_CONCURRENCY
356  assert(std::this_thread::get_id() == id);
357 #endif // DEBUG_THREAD_CONCURRENCY
358  auto new_time_thread = boost::chrono::thread_clock::now();
359  auto new_time_real = boost::chrono::high_resolution_clock::now();
360  auto new_allocated = memory_usage::allocated();
361  auto new_deallocated = memory_usage::deallocated();
362  store.time_thread += boost::chrono::duration_cast<boost::chrono::nanoseconds>(new_time_thread - time_thread).count();
363  store.time_real += boost::chrono::duration_cast<boost::chrono::nanoseconds>(new_time_real - time_real).count();
364  store.allocated += new_allocated - allocated;
365  store.deallocated += new_deallocated - deallocated;
366  time_thread = new_time_thread;
367  time_real = new_time_real;
368  allocated = new_allocated;
369  deallocated = new_deallocated;
370 }

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

◆ measure_and_accumulate() [2/2]

void FastTimerService::Measurement::measure_and_accumulate ( Resources store)
noexcept

Definition at line 336 of file FastTimerService.cc.

336  {
337 #ifdef DEBUG_THREAD_CONCURRENCY
338  assert(std::this_thread::get_id() == id);
339 #endif // DEBUG_THREAD_CONCURRENCY
340  auto new_time_thread = boost::chrono::thread_clock::now();
341  auto new_time_real = boost::chrono::high_resolution_clock::now();
342  auto new_allocated = memory_usage::allocated();
343  auto new_deallocated = memory_usage::deallocated();
344  store.time_thread += new_time_thread - time_thread;
345  store.time_real += new_time_real - time_real;
346  store.allocated += new_allocated - allocated;
347  store.deallocated += new_deallocated - deallocated;
348  time_thread = new_time_thread;
349  time_real = new_time_real;
350  allocated = new_allocated;
351  deallocated = new_deallocated;
352 }

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

◆ measure_and_store()

void FastTimerService::Measurement::measure_and_store ( Resources store)
noexcept

Definition at line 318 of file FastTimerService.cc.

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

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

Member Data Documentation

◆ allocated

uint64_t FastTimerService::Measurement::allocated

Definition at line 205 of file FastTimerService.h.

◆ deallocated

uint64_t FastTimerService::Measurement::deallocated

Definition at line 206 of file FastTimerService.h.

◆ time_real

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

Definition at line 204 of file FastTimerService.h.

◆ time_thread

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

Definition at line 203 of file FastTimerService.h.

FastTimerService::Measurement::measure
void measure() noexcept
Definition: FastTimerService.cc:308
submitPVValidationJobs.now
now
Definition: submitPVValidationJobs.py:639
cms::cuda::assert
assert(be >=bs)
FastTimerService::Measurement::deallocated
uint64_t deallocated
Definition: FastTimerService.h:206
FastTimerService::Measurement::allocated
uint64_t allocated
Definition: FastTimerService.h:205
memory_usage::deallocated
static uint64_t deallocated()
Definition: memory_usage.cc:88
memory_usage::allocated
static uint64_t allocated()
Definition: memory_usage.cc:86
FastTimerService::Measurement::time_real
boost::chrono::high_resolution_clock::time_point time_real
Definition: FastTimerService.h:204
FastTimerService::Measurement::time_thread
boost::chrono::thread_clock::time_point time_thread
Definition: FastTimerService.h:203