Escript  Revision_4320
performance.h
Go to the documentation of this file.
1 
2 /*****************************************************************************
3 *
4 * Copyright (c) 2003-2013 by University of Queensland
5 * http://www.uq.edu.au
6 *
7 * Primary Business: Queensland, Australia
8 * Licensed under the Open Software License version 3.0
9 * http://www.opensource.org/licenses/osl-3.0.php
10 *
11 * Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12 * Development since 2012 by School of Earth Sciences
13 *
14 *****************************************************************************/
15 
16 
17 /************************************************************************************/
18 
19 /* Paso: perfomance monitor interface using papi */
20 
21 /************************************************************************************/
22 
23 /* Copyrights by ACcESS Australia 2006 */
24 /* Author: Lutz Gross, l.gross@uq.edu.au */
25 
26 /************************************************************************************/
27 
28 #ifndef INC_PASO_PERFORMANCE
29 #define INC_PASO_PERFORMANCE
30 
31 #define PERFORMANCE_UNMONITORED_EVENT -1
32 #define PERFORMANCE_NUM_EVENTS 10 /* maximum number of events handled by PAPI */
33 
34 #define PERFORMANCE_ALL 0
35 #define PERFORMANCE_SOLVER 1
36 #define PERFORMANCE_PRECONDITIONER_INIT 2
37 #define PERFORMANCE_PRECONDITIONER 3
38 #define PERFORMANCE_MVM 4
39 #define PERFORMANCE_ASSEMBLAGE 5
40 #define PERFORMANCE_UNKNOWN 6 /* more can be added here */
41 #define PERFORMANCE_NUM_MONITORS PERFORMANCE_UNKNOWN+1
42 
43 #define PERFORMANCE_UNUSED -1
44 #define PERFORMANCE_CLOSED 0
45 #define PERFORMANCE_OPENED 1
46 
47 #ifdef PAPI
48 #include <papi.h>
49 struct Paso_Performance {
50  int event_set; /* papi event sets for the monitors */
51  int num_events; /* number of events tracked by the monitors */
52  int events[PERFORMANCE_NUM_EVENTS]; /* the event tracked by the monitors */
53  long_long values[PERFORMANCE_NUM_MONITORS][PERFORMANCE_NUM_EVENTS]; /* counter accumulator */
54  long_long cycles[PERFORMANCE_NUM_MONITORS]; /* cycle accumulator */
55  int set[PERFORMANCE_NUM_MONITORS];
56 };
57 #else
59  int none;
60 };
61 #endif
63 
64 
65 void Performance_open(Paso_Performance* pp,int verbose);
66 int Performance_getEventIndex(Paso_Performance* pp, int event_id);
67 void Performance_close(Paso_Performance* pp,int verbose);
68 void Performance_startMonitor(Paso_Performance* pp,int monitor);
69 void Performance_stopMonitor(Paso_Performance* pp,int monitor);
70 
71 #endif
72 
73 /*
74  * $Log$
75 */