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

Constructor & Destructor Documentation

◆ Measurement()

FastTimerService::Measurement::Measurement ( )
noexcept

Definition at line 307 of file FastTimerService.cc.

307 { measure(); }

Member Function Documentation

◆ measure()

void FastTimerService::Measurement::measure ( )
noexcept

Definition at line 309 of file FastTimerService.cc.

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

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

Referenced by FastTimerService::on_scheduler_entry().

◆ measure_and_accumulate() [1/2]

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

Definition at line 355 of file FastTimerService.cc.

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 }

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 337 of file FastTimerService.cc.

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 }

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 319 of file FastTimerService.cc.

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 }

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

◆ deallocated

uint64_t FastTimerService::Measurement::deallocated

Definition at line 207 of file FastTimerService.h.

◆ time_real

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

Definition at line 205 of file FastTimerService.h.

◆ time_thread

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

Definition at line 204 of file FastTimerService.h.

FastTimerService::Measurement::measure
void measure() noexcept
Definition: FastTimerService.cc:309
submitPVValidationJobs.now
now
Definition: submitPVValidationJobs.py:639
cms::cuda::assert
assert(be >=bs)
FastTimerService::Measurement::deallocated
uint64_t deallocated
Definition: FastTimerService.h:207
FastTimerService::Measurement::allocated
uint64_t allocated
Definition: FastTimerService.h:206
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:205
FastTimerService::Measurement::time_thread
boost::chrono::thread_clock::time_point time_thread
Definition: FastTimerService.h:204