/[escript]/trunk/paso/src/performance.h
ViewVC logotype

Contents of /trunk/paso/src/performance.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4869 - (show annotations)
Mon Apr 14 10:39:22 2014 UTC (5 years, 5 months ago) by caltinay
File MIME type: text/plain
File size: 2470 byte(s)
all of paso now lives in its own namespace.

1
2 /*****************************************************************************
3 *
4 * Copyright (c) 2003-2014 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 2012-2013 by School of Earth Sciences
13 * Development from 2014 by Centre for Geoscience Computing (GeoComp)
14 *
15 *****************************************************************************/
16
17
18 /****************************************************************************/
19
20 /* Paso: perfomance monitor interface using PAPI */
21
22 /****************************************************************************/
23
24 /* Copyrights by ACcESS Australia 2006 */
25 /* Author: Lutz Gross, l.gross@uq.edu.au */
26
27 /****************************************************************************/
28
29 #ifndef __PASO_PERFORMANCE_H__
30 #define __PASO_PERFORMANCE_H__
31
32 #ifdef PAPI
33 #include <papi.h>
34 #endif
35
36 namespace paso {
37
38 #define PERFORMANCE_UNMONITORED_EVENT -1
39 #define PERFORMANCE_NUM_EVENTS 10 // maximum number of events handled by PAPI
40
41 #define PERFORMANCE_ALL 0
42 #define PERFORMANCE_SOLVER 1
43 #define PERFORMANCE_PRECONDITIONER_INIT 2
44 #define PERFORMANCE_PRECONDITIONER 3
45 #define PERFORMANCE_MVM 4
46 #define PERFORMANCE_ASSEMBLAGE 5
47 #define PERFORMANCE_UNKNOWN 6 // more can be added here
48 #define PERFORMANCE_NUM_MONITORS PERFORMANCE_UNKNOWN+1
49
50 #define PERFORMANCE_UNUSED -1
51 #define PERFORMANCE_CLOSED 0
52 #define PERFORMANCE_OPENED 1
53
54 struct Performance
55 {
56 #ifdef PAPI
57 /// PAPI event sets for the monitors
58 int event_set;
59 /// number of events tracked by the monitors
60 int num_events;
61 /// the events tracked by the monitors
62 int events[PERFORMANCE_NUM_EVENTS];
63 /// counter accumulator
64 long_long values[PERFORMANCE_NUM_MONITORS][PERFORMANCE_NUM_EVENTS];
65 /// cycle accumulator
66 long_long cycles[PERFORMANCE_NUM_MONITORS];
67 int set[PERFORMANCE_NUM_MONITORS];
68 #else
69 int dummy;
70 #endif
71 };
72
73 void Performance_open(Performance* pp, int verbose);
74 int Performance_getEventIndex(Performance* pp, int event_id);
75 void Performance_close(Performance* pp, int verbose);
76 void Performance_startMonitor(Performance* pp, int monitor);
77 void Performance_stopMonitor(Performance* pp, int monitor);
78
79 } // namespace paso
80
81 #endif // __PASO_PERFORMANCE_H__
82

  ViewVC Help
Powered by ViewVC 1.1.26