forked from jmrosinski/GPTL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gptl.h.template
134 lines (120 loc) · 5.58 KB
/
gptl.h.template
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
/*
** $Id: gptl.h.template,v 1.3 2011-03-28 20:55:19 rosinski Exp $
**
** Author: Jim Rosinski
**
** GPTL header file to be included in user code
*/
#ifndef GPTL_H
#define GPTL_H
/*
** Options settable by a call to GPTLsetoption() (default in parens)
** These numbers need to be small integers because GPTLsetoption can
** be passed PAPI counters, and we need to avoid collisions in that
** integer space. PAPI presets are big negative integers, and PAPI
** native events are big positive integers.
*/
typedef enum {
GPTLsync_mpi = #GPTLsync_mpi, /* Synchronize before certain MPI calls (PMPI-mode only) */
GPTLwall = #GPTLwall, /* Collect wallclock stats (true) */
GPTLcpu = #GPTLcpu, /* Collect CPU stats (false)*/
GPTLabort_on_error = #GPTLabort_on_error, /* Abort on failure (false) */
GPTLoverhead = #GPTLoverhead, /* Estimate overhead of underlying timing routine (true) */
GPTLdepthlimit = #GPTLdepthlimit, /* Only print timers this depth or less in the tree (inf) */
GPTLverbose = #GPTLverbose, /* Verbose output (false) */
GPTLnarrowprint = #GPTLnarrowprint, /* Print PAPI and derived stats in 8 columns not 16 (true) */
GPTLpercent = #GPTLpercent, /* Add a column for percent of first timer (false) */
GPTLpersec = #GPTLpersec, /* Add a PAPI column that prints "per second" stats (true) */
GPTLmultiplex = #GPTLmultiplex, /* Allow PAPI multiplexing (false) */
GPTLdopr_preamble = #GPTLdopr_preamble, /* Print preamble info (true) */
GPTLdopr_threadsort = #GPTLdopr_threadsort, /* Print sorted thread stats (true) */
GPTLdopr_multparent = #GPTLdopr_multparent, /* Print multiple parent info (true) */
GPTLdopr_collision = #GPTLdopr_collision, /* Print hastable collision info (true) */
GPTLdopr_memusage = #GPTLdopr_memusage, /* Call GPTLprint_memusage when auto-instrumented */
GPTLprint_method = #GPTLprint_method, /* Tree print method: first parent, last parent
most frequent, or full tree (most frequent) */
GPTLtablesize = #GPTLtablesize, /* per-thread size of hash table */
GPTLmaxthreads = #GPTLmaxthreads, /* maximum number of threads */
/*
** These are derived counters based on PAPI counters. All default to false
*/
GPTL_IPC = #GPTL_IPC, /* Instructions per cycle */
GPTL_CI = #GPTL_CI, /* Computational intensity */
GPTL_FPC = #GPTL_FPC, /* FP ops per cycle */
GPTL_FPI = #GPTL_FPI, /* FP ops per instruction */
GPTL_LSTPI = #GPTL_LSTPI, /* Load-store instruction fraction */
GPTL_DCMRT = #GPTL_DCMRT, /* L1 miss rate (fraction) */
GPTL_LSTPDCM = #GPTL_LSTPDCM, /* Load-stores per L1 miss */
GPTL_L2MRT = #GPTL_L2MRT, /* L2 miss rate (fraction) */
GPTL_LSTPL2M = #GPTL_LSTPL2M, /* Load-stores per L2 miss */
GPTL_L3MRT = #GPTL_L3MRT /* L3 read miss rate (fraction) */
} Option;
/*
** Underlying wallclock timer: optimize for best granularity with least overhead.
** These numbers need not be distinct from the above because these are passed
** to GPTLsetutr() and the above are passed to GPTLsetoption()
*/
typedef enum {
GPTLgettimeofday = #GPTLgettimeofday, /* the default */
GPTLnanotime = #GPTLnanotime, /* only available on x86 */
GPTLmpiwtime = #GPTLmpiwtime, /* MPI_Wtime */
GPTLclockgettime = #GPTLclockgettime, /* clock_gettime */
GPTLpapitime = #GPTLpapitime, /* only if PAPI is available */
GPTLplacebo = #GPTLplacebo, /* do-nothing */
GPTLread_real_time = #GPTLread_real_time /* AIX only */
} Funcoption;
/*
** How to report parent/child relationships at print time (for children with multiple parents)
*/
typedef enum {
GPTLfirst_parent = #GPTLfirst_parent, /* first parent found */
GPTLlast_parent = #GPTLlast_parent, /* last parent found */
GPTLmost_frequent = #GPTLmost_frequent, /* most frequent parent (default) */
GPTLfull_tree = #GPTLfull_tree /* complete call tree */
} Method;
/*
** Function prototypes
*/
#ifdef __cplusplus
extern "C" {
#endif
extern int GPTLsetoption (const int, const int);
extern int GPTLinitialize (void);
extern int GPTLstart (const char *);
extern int GPTLinit_handle (const char *, int *);
extern int GPTLstart_handle (const char *, int *);
extern int GPTLstop (const char *);
extern int GPTLstop_handle (const char *, int *);
extern int GPTLstamp (double *, double *, double *);
extern int GPTLpr (const int);
extern int GPTLpr_file (const char *);
/*
** Use K&R prototype for these 2 because they require MPI
*/
extern int GPTLpr_summary ();
extern int GPTLbarrier ();
extern int GPTLreset (void);
extern int GPTLfinalize (void);
extern int GPTLget_memusage (int *, int *, int *, int *, int *);
extern int GPTLprint_memusage (const char *);
extern int GPTLprint_rusage (const char *);
extern int GPTLenable (void);
extern int GPTLdisable (void);
extern int GPTLsetutr (const int);
extern int GPTLquery (const char *, int, int *, int *, double *, double *, double *,
long long *, const int);
extern int GPTLquerycounters (const char *, int, long long *);
extern int GPTLget_wallclock (const char *, int, double *);
extern int GPTLget_eventvalue (const char *, const char *, int, double *);
extern int GPTLget_nregions (int, int *);
extern int GPTLget_regionname (int, int, char *, int);
extern int GPTL_PAPIlibraryinit (void);
extern int GPTLevent_name_to_code (const char *, int *);
extern int GPTLevent_code_to_name (const int, char *);
extern int GPTLnum_errors (void);
extern int GPTLnum_warn (void);
extern int GPTLget_count (const char *, int, int *);
#ifdef __cplusplus
};
#endif
#endif