CoMD
A Mini-app for Co-Design of Classical Molecular Dynamics.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
performanceTimers.h File Reference

Performance timer functions. More...

#include <stdio.h>
Include dependency graph for performanceTimers.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define startTimer(handle)
 Use the startTimer and stopTimer macros for timers in code regions that may be performance sensitive. More...
 
#define stopTimer(handle)
 

Enumerations

enum  TimerHandle {
  totalTimer, loopTimer, timestepTimer, positionTimer,
  velocityTimer, redistributeTimer, atomHaloTimer, computeForceTimer,
  eamHaloTimer, commHaloTimer, commReduceTimer, numberOfTimers
}
 Timer handles. More...
 

Functions

void profileStart (const enum TimerHandle handle)
 Use profileStart and profileStop only for timers that should never be turned off. More...
 
void profileStop (const enum TimerHandle handle)
 
double getElapsedTime (const enum TimerHandle handle)
 Use to get elapsed time (lap timer). More...
 
void printPerformanceResults (int nGlobalAtoms)
 Print timing results. More...
 
void printPerformanceResultsYaml (FILE *file)
 Print timing results to Yaml file. More...
 

Detailed Description

Performance timer functions.

Definition in file performanceTimers.h.

Macro Definition Documentation

#define startTimer (   handle)
Value:
do \
{ \
profileStart(handle); \
} while(0)

Use the startTimer and stopTimer macros for timers in code regions that may be performance sensitive.

These can be compiled away by defining NTIMING. If you are placing a timer anywere outside of a tight loop, consider calling profileStart and profileStop instead.

Place calls as follows to collect time for code pieces. Time is collected everytime this portion of code is executed.

...
startTimer(computeForceTimer);
computeForce(sim);
stopTimer(computeForceTimer);
...

Definition at line 29 of file performanceTimers.h.

#define stopTimer (   handle)
Value:
do \
{ \
profileStop(handle); \
} while(0)

Definition at line 34 of file performanceTimers.h.

Enumeration Type Documentation

Timer handles.

Enumerator
totalTimer 
loopTimer 
timestepTimer 
positionTimer 
velocityTimer 
redistributeTimer 
atomHaloTimer 
computeForceTimer 
eamHaloTimer 
commHaloTimer 
commReduceTimer 
numberOfTimers 

Definition at line 9 of file performanceTimers.h.

Function Documentation

double getElapsedTime ( const enum TimerHandle  handle)

Use to get elapsed time (lap timer).

Return elapsed time (in seconds) since last call with this handle and clear for next lap.

Definition at line 99 of file performanceTimers.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void printPerformanceResults ( int  nGlobalAtoms)

Print timing results.

The report contains two blocks. The upper block is performance information for the printRank. The lower block is statistical information over all ranks.

Definition at line 111 of file performanceTimers.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void printPerformanceResultsYaml ( FILE *  file)

Print timing results to Yaml file.

Definition at line 159 of file performanceTimers.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void profileStart ( const enum TimerHandle  handle)

Use profileStart and profileStop only for timers that should never be turned off.

Typically this means they are outside the main simulation loop. If the timer is inside the main loop use startTimer and stopTimer instead.

Definition at line 83 of file performanceTimers.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void profileStop ( const enum TimerHandle  handle)

Definition at line 88 of file performanceTimers.c.

Here is the call graph for this function:

Here is the caller graph for this function: