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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 6939 - (hide annotations)
Mon Jan 20 03:37:18 2020 UTC (4 weeks, 6 days ago) by uqaeller
File MIME type: text/plain
File size: 2560 byte(s)
Updated the copyright header.


1 ksteube 1312
2 jfenwick 3981 /*****************************************************************************
3 ksteube 1811 *
4 uqaeller 6939 * Copyright (c) 2003-2020 by The University of Queensland
5 jfenwick 3981 * http://www.uq.edu.au
6 ksteube 1811 *
7     * Primary Business: Queensland, Australia
8 jfenwick 6112 * Licensed under the Apache License, version 2.0
9     * http://www.apache.org/licenses/LICENSE-2.0
10 ksteube 1811 *
11 jfenwick 3981 * Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12 jfenwick 4657 * Development 2012-2013 by School of Earth Sciences
13 uqaeller 6939 * Development from 2014-2017 by Centre for Geoscience Computing (GeoComp)
14     * Development from 2019 by School of Earth and Environmental Sciences
15     **
16 jfenwick 3981 *****************************************************************************/
17 dhawcroft 631
18 ksteube 1811
19 caltinay 4869 /****************************************************************************/
20 gross 494
21 caltinay 4869 /* Paso: perfomance monitor interface using PAPI */
22 gross 494
23 caltinay 4869 /****************************************************************************/
24 gross 494
25 gross 495 /* Copyrights by ACcESS Australia 2006 */
26 jfenwick 2608 /* Author: Lutz Gross, l.gross@uq.edu.au */
27 gross 494
28 caltinay 4869 /****************************************************************************/
29 gross 494
30 caltinay 4869 #ifndef __PASO_PERFORMANCE_H__
31     #define __PASO_PERFORMANCE_H__
32 gross 494
33 caltinay 6144 #ifdef ESYS_HAVE_PAPI
34 caltinay 4869 #include <papi.h>
35     #endif
36    
37     namespace paso {
38    
39 gross 495 #define PERFORMANCE_UNMONITORED_EVENT -1
40 caltinay 4869 #define PERFORMANCE_NUM_EVENTS 10 // maximum number of events handled by PAPI
41 gross 494
42 gross 495 #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 caltinay 4869 #define PERFORMANCE_UNKNOWN 6 // more can be added here
49 gross 495 #define PERFORMANCE_NUM_MONITORS PERFORMANCE_UNKNOWN+1
50 gross 494
51 gross 495 #define PERFORMANCE_UNUSED -1
52     #define PERFORMANCE_CLOSED 0
53     #define PERFORMANCE_OPENED 1
54 gross 494
55 caltinay 4869 struct Performance
56     {
57 caltinay 6144 #ifdef ESYS_HAVE_PAPI
58 caltinay 4869 /// 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 gross 495 int set[PERFORMANCE_NUM_MONITORS];
69     #else
70 caltinay 4869 int dummy;
71     #endif
72 gross 494 };
73    
74 caltinay 4869 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 gross 494
80 caltinay 4869 } // namespace paso
81 gross 494
82 caltinay 4869 #endif // __PASO_PERFORMANCE_H__
83 gross 494

  ViewVC Help
Powered by ViewVC 1.1.26