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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 6939 - (show annotations)
Mon Jan 20 03:37:18 2020 UTC (21 months ago) by uqaeller
File MIME type: text/plain
File size: 2560 byte(s)
Updated the copyright header.


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

  ViewVC Help
Powered by ViewVC 1.1.26