1 |
/* $Id$ */ |
2 |
|
3 |
/**************************************************************/ |
4 |
|
5 |
/* Paso: perfomance monitor interface using papi*/ |
6 |
|
7 |
/**************************************************************/ |
8 |
|
9 |
/* Copyrights by ACcESS Australia 2003/04 */ |
10 |
/* Author: gross@access.edu.au */ |
11 |
|
12 |
/**************************************************************/ |
13 |
|
14 |
#ifndef INC_PASO_PERFORMANCE |
15 |
#define INC_PASO_PERFORMANCE |
16 |
|
17 |
#ifdef PAPI |
18 |
|
19 |
#include <papi.h> |
20 |
|
21 |
Paso_Performance* Performance_init(); |
22 |
void Performance_start_solver(Paso_Performance&); |
23 |
void Performance_start_preconditioner_init(Paso_Performance&); |
24 |
void Performance_start_preconditioner(Paso_Performance&); |
25 |
void Performance_start_mvm(Paso_Performance&); |
26 |
void Performance_end_preconditioner(Paso_Performance&); |
27 |
void Performance_end_preconditioner_init(Paso_Performance&); |
28 |
void Performance_end_mvm(Paso_Performance&); |
29 |
void Performance_end_solver(Paso_Performance&); |
30 |
void Performance_finalized(Paso_Performance&); |
31 |
|
32 |
struct Paso_Performance { |
33 |
|
34 |
|
35 |
}; |
36 |
typedef Paso_Performance struct Paso_Performance; |
37 |
|
38 |
#endif |
39 |
|
40 |
|
41 |
void Performance_init(void*) { |
42 |
#ifdef PAPI |
43 |
/* Initialize the PAPI library */ |
44 |
retval = PAPI_library_init(PAPI_VER_CURRENT); |
45 |
if (retval != PAPI_VER_CURRENT && retval > 0) { |
46 |
fprintf(stderr,"PAPI library version mismatch!\n"); |
47 |
exit(1); |
48 |
} |
49 |
if (retval < 0) { |
50 |
fprintf(stderr, “Initialization error!\n”); |
51 |
exit(1); |
52 |
} |
53 |
#endif |
54 |
NUM_EVENTS=5; |
55 |
events={PAPI_FP_OPS,PAPI_L1_DCM,PAPI_L2_DCM,PAPI_L3_DCM}; |
56 |
|
57 |
out->all |
58 |
out->solver |
59 |
out->preconditioner_init |
60 |
out->preconditioner |
61 |
out->mvm |
62 |
} |
63 |
|
64 |
Performance_start(Paso_Performance& pp) { |
65 |
pp-> |
66 |
|
67 |
|
68 |
|
69 |
} |