escript  Revision_
performance.h
Go to the documentation of this file.
1 
2 /*****************************************************************************
3 *
4 * Copyright (c) 2003-2016 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 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 ESYS_HAVE_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 
55 {
56 #ifdef ESYS_HAVE_PAPI
57  int event_set;
60  int num_events;
62  int events[PERFORMANCE_NUM_EVENTS];
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 
#define PERFORMANCE_NUM_EVENTS
Definition: performance.h:39
void Performance_open(Performance *pp, int verbose)
sets up the monitoring process
Definition: performance.cpp:35
int Performance_getEventIndex(Performance *pp, int event_id)
find the index of an event in the list of monitored events
Definition: performance.cpp:81
Definition: performance.h:54
Definition: AMG.cpp:45
#define PERFORMANCE_NUM_MONITORS
Definition: performance.h:48
void Performance_startMonitor(Performance *pp, int monitor)
switches on a monitor
Definition: performance.cpp:162
void Performance_close(Performance *pp, int verbose)
shuts down the monitoring process
Definition: performance.cpp:92
int dummy
Definition: performance.h:69
void Performance_stopMonitor(Performance *pp, int monitor)
switches off a monitor
Definition: performance.cpp:181