MACSio  0.9
Multi-purpose, Application-Centric, Scalable I/O Proxy App
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
macsio_timing.c File Reference
#include <macsio_timing.h>
#include <macsio_utils.h>
#include <mpi.h>
#include <cfloat>
#include <climits>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/time.h>

Go to the source code of this file.

Data Structures

struct  _timerInfo_t
 

Macros

#define MACSIO_TIMING_HASH_TABLE_SIZE   10007
 

Typedefs

typedef struct _timerInfo_t timerInfo_t
 

Functions

static double get_current_time ()
 
static MACSIO_TIMING_GroupMask_t group_mask_from_name (char const *grpName)
 
MACSIO_TIMING_GroupMask_t MACSIO_TIMING_GroupMask (char const *grpName)
 Create a group name and mask. More...
 
MACSIO_TIMING_TimerId_t MACSIO_TIMING_StartTimer (char const *label, MACSIO_TIMING_GroupMask_t gmask, int iter_num, char const *__file__, int __line__)
 Create/Start a timer. More...
 
double MACSIO_TIMING_StopTimer (MACSIO_TIMING_TimerId_t tid)
 Stop a timer. More...
 
static double get_timer (timerInfo_t const *table, MACSIO_TIMING_TimerId_t tid, char const *field)
 
double MACSIO_TIMING_GetTimer (MACSIO_TIMING_TimerId_t tid, char const *field)
 Get data from a specific timer. More...
 
double MACSIO_TIMING_GetReducedTimer (MACSIO_TIMING_TimerId_t tid, char const *field)
 Get data from a specific reduced timer. More...
 
static void clear_timers (timerInfo_t *table, MACSIO_TIMING_GroupMask_t gmask)
 
static void reduce_a_timerinfo (void *a, void *b, int *len, MPI_Datatype *type)
 
void MACSIO_TIMING_ReduceTimers (MPI_Comm comm, int root)
 Reduce timers across MPI tasks. More...
 
static void dump_timers_to_strings (timerInfo_t const *table, MACSIO_TIMING_GroupMask_t gmask, char ***strs, int *nstrs, int *maxlen)
 
void MACSIO_TIMING_DumpTimersToStrings (MACSIO_TIMING_GroupMask_t gmask, char ***strs, int *nstrs, int *maxlen)
 Dump timers to ascii strings. More...
 
void MACSIO_TIMING_DumpReducedTimersToStrings (MACSIO_TIMING_GroupMask_t gmask, char ***strs, int *nstrs, int *maxlen)
 Dump reduced timers to ascii strings. More...
 
void MACSIO_TIMING_ClearTimers (MACSIO_TIMING_GroupMask_t gmask)
 Clear a group of timers. More...
 
double MACSIO_TIMING_GetCurrentTime (void)
 Get current time. More...
 

Variables

int MACSIO_TIMING_UseMPI_Wtime = 1
 Integer variable to control function used to get timer values. More...
 
static int const maxTimerGroups = sizeof(MACSIO_TIMING_GroupMask_t)*8
 
static char * timerGroupNames [maxTimerGroups]
 
static int timerGroupCount = 0
 
static timerInfo_t timerHashTable [MACSIO_TIMING_HASH_TABLE_SIZE]
 
static timerInfo_t reducedTimerTable [MACSIO_TIMING_HASH_TABLE_SIZE]
 

Data Structure Documentation

struct _timerInfo_t

Definition at line 168 of file macsio_timing.c.

Data Fields
int __line__

Source file line # of StartTimer call

int iter_count

Total number of iterations this timer was invoked.

int min_iter

Iteration at which min time was seen

int max_iter

Iteration at which max time was seen

int min_rank

MPI rank of processor with minimum time (only used in reductions)

int max_rank

MPI rank of processor with maximum time (only used in reductions)

int iter_num

Iteration number of current timer

int depth

Depth of this timer relative to other active timers

int is_restart

Is this timer restarting the current iteration

double total_time

Total cummulative time spent in this timer over all iterations

double min_time

Min over all iterations this timer ran

double max_time

Mix over all iterations this timer ran

double running_mean

Running mean of timer iterations

double running_var

Running variance of timer iterations

double start_time

Time at which current iteration of this timer was started

double total_time_this_iter

Cummulative time spent in the current iteration (for restarts)

MACSIO_TIMING_GroupMask_t gmask

User defined bit mask for group membership of this timer.

char __file__[32]

Source file name for StartTimer call

char label[64]

User defined label given to the timer

Macro Definition Documentation

#define MACSIO_TIMING_HASH_TABLE_SIZE   10007

Definition at line 42 of file macsio_timing.c.

Typedef Documentation

typedef struct _timerInfo_t timerInfo_t

Function Documentation

static double get_current_time ( )
static

Definition at line 46 of file macsio_timing.c.

static MACSIO_TIMING_GroupMask_t group_mask_from_name ( char const *  grpName)
static

Definition at line 124 of file macsio_timing.c.

static double get_timer ( timerInfo_t const *  table,
MACSIO_TIMING_TimerId_t  tid,
char const *  field 
)
static

Definition at line 332 of file macsio_timing.c.

static void clear_timers ( timerInfo_t table,
MACSIO_TIMING_GroupMask_t  gmask 
)
static

Definition at line 377 of file macsio_timing.c.

static void reduce_a_timerinfo ( void *  a,
void *  b,
int *  len,
MPI_Datatype *  type 
)
static
Parameters
[in]afirst input for MPI_User_function
[in,out]bsecond input arg for MPI_User_function and reduced output
[in]lennumber of values in A and B buffers
[in]typetype of values in A and B buffers

Definition at line 410 of file macsio_timing.c.

static void dump_timers_to_strings ( timerInfo_t const *  table,
MACSIO_TIMING_GroupMask_t  gmask,
char ***  strs,
int *  nstrs,
int *  maxlen 
)
static

Definition at line 573 of file macsio_timing.c.

Variable Documentation

int const maxTimerGroups = sizeof(MACSIO_TIMING_GroupMask_t)*8
static

Definition at line 120 of file macsio_timing.c.

char* timerGroupNames[maxTimerGroups]
static

Definition at line 121 of file macsio_timing.c.

int timerGroupCount = 0
static

Definition at line 122 of file macsio_timing.c.

Definition at line 197 of file macsio_timing.c.

timerInfo_t reducedTimerTable[MACSIO_TIMING_HASH_TABLE_SIZE]
static

Definition at line 199 of file macsio_timing.c.