escript Revision_
performance.h
Go to the documentation of this file.
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
37namespace 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
56{
57#ifdef ESYS_HAVE_PAPI
59 int event_set;
61 int num_events;
63 int events[PERFORMANCE_NUM_EVENTS];
67 long_long cycles[PERFORMANCE_NUM_MONITORS];
69#else
70 int dummy;
71#endif
72};
73
74void Performance_open(Performance* pp, int verbose);
75int Performance_getEventIndex(Performance* pp, int event_id);
76void Performance_close(Performance* pp, int verbose);
77void Performance_startMonitor(Performance* pp, int monitor);
78void Performance_stopMonitor(Performance* pp, int monitor);
79
80} // namespace paso
81
82#endif // __PASO_PERFORMANCE_H__
83
Definition: BiCGStab.cpp:25
void Performance_startMonitor(Performance *pp, int monitor)
switches on a monitor
Definition: performance.cpp:163
void Performance_open(Performance *pp, int verbose)
sets up the monitoring process
Definition: performance.cpp:36
void Performance_close(Performance *pp, int verbose)
shuts down the monitoring process
Definition: performance.cpp:93
int Performance_getEventIndex(Performance *pp, int event_id)
find the index of an event in the list of monitored events
Definition: performance.cpp:82
void Performance_stopMonitor(Performance *pp, int monitor)
switches off a monitor
Definition: performance.cpp:182
#define PERFORMANCE_NUM_MONITORS
Definition: performance.h:49
#define PERFORMANCE_NUM_EVENTS
Definition: performance.h:40
Definition: performance.h:56
int dummy
Definition: performance.h:70