escript  Revision_
performance.h
Go to the documentation of this file.
1 
2 /*****************************************************************************
3 *
4 * Copyright (c) 2003-2018 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 
54 struct Performance
55 {
56 #ifdef ESYS_HAVE_PAPI
57  int event_set;
60  int 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 
paso::Pattern::mis
void mis(index_t *mis_marker) const
Searches for a maximal independent set MIS in the matrix pattern.
Definition: Pattern_mis.cpp:59
paso::N
static dim_t N
Definition: SparseMatrix_saveHB.cpp:48
PASO_ONE
#define PASO_ONE
Definition: Paso.h:66
PERFORMANCE_MVM
#define PERFORMANCE_MVM
Definition: performance.h:56
paso::Performance_startMonitor
void Performance_startMonitor(Performance *pp, int monitor)
switches on a monitor
Definition: performance.cpp:174
performance.h
escript::reducerstatus
Definition: AbstractReducer.h:39
IS_IN_MIS
#define IS_IN_MIS
Definition: Pattern_mis.cpp:56
paso::DegreeAndIdx::deg
dim_t deg
Definition: Pattern_reduceBandwidth.cpp:78
IS_CONNECTED_TO_MIS
#define IS_CONNECTED_TO_MIS
Definition: Pattern_mis.cpp:57
paso::SystemMatrix_ptr
boost::shared_ptr< SystemMatrix > SystemMatrix_ptr
Definition: SystemMatrix.h:51
MPI_SUM
#define MPI_SUM
Definition: EsysMPI.h:50
paso::comparDegreeAndIdx
int comparDegreeAndIdx(const void *arg1, const void *arg2)
Definition: Pattern_reduceBandwidth.cpp:82
PERFORMANCE_PRECONDITIONER_INIT
#define PERFORMANCE_PRECONDITIONER_INIT
Definition: performance.h:54
PERFORMANCE_ALL
#define PERFORMANCE_ALL
Definition: performance.h:52
paso::Pattern::numInput
dim_t numInput
Definition: Pattern.h:120
paso::Pattern::numOutput
dim_t numOutput
Definition: Pattern.h:118
paso::Performance_getEventIndex
int Performance_getEventIndex(Performance *pp, int event_id)
find the index of an event in the list of monitored events
Definition: performance.cpp:93
PERFORMANCE_OPENED
#define PERFORMANCE_OPENED
Definition: performance.h:63
MATRIX_FORMAT_OFFSET1
#define MATRIX_FORMAT_OFFSET1
Definition: Paso.h:63
paso::Performance_close
void Performance_close(Performance *pp, int verbose)
shuts down the monitoring process
Definition: performance.cpp:104
Solver.h
paso::Breakdown
Definition: Paso.h:70
Paso.h
paso::Performance::dummy
int dummy
Definition: performance.h:80
PERFORMANCE_CLOSED
#define PERFORMANCE_CLOSED
Definition: performance.h:62
escript::DataTypes::dim_t
index_t dim_t
Definition: DataTypes.h:87
paso::Solver_PCG
SolverResult Solver_PCG(SystemMatrix_ptr A, double *r, double *x, dim_t *iter, double *tolerance, Performance *pp)
Definition: PCG.cpp:73
PERFORMANCE_SOLVER
#define PERFORMANCE_SOLVER
Definition: performance.h:53
PERFORMANCE_PRECONDITIONER
#define PERFORMANCE_PRECONDITIONER
Definition: performance.h:55
paso::SolverResult
SolverResult
Definition: Paso.h:53
SystemMatrix.h
paso::Pattern::reduceBandwidth
void reduceBandwidth(index_t *oldToNew)
Definition: Pattern_reduceBandwidth.cpp:155
paso::MaxIterReached
Definition: Paso.h:67
paso::DegreeAndIdx::idx
index_t idx
Definition: Pattern_reduceBandwidth.cpp:79
PERFORMANCE_UNUSED
#define PERFORMANCE_UNUSED
Definition: performance.h:61
PERFORMANCE_NUM_EVENTS
#define PERFORMANCE_NUM_EVENTS
Definition: performance.h:50
paso::Pattern::index
index_t * index
Definition: Pattern.h:126
Pattern.h
paso::Performance_open
void Performance_open(Performance *pp, int verbose)
sets up the monitoring process
Definition: performance.cpp:47
PERFORMANCE_NUM_MONITORS
#define PERFORMANCE_NUM_MONITORS
Definition: performance.h:59
TOLERANCE_FOR_SCALARS
#define TOLERANCE_FOR_SCALARS
Definition: Solver.h:39
MPI_DOUBLE
#define MPI_DOUBLE
Definition: EsysMPI.h:45
PERFORMANCE_UNMONITORED_EVENT
#define PERFORMANCE_UNMONITORED_EVENT
Definition: performance.h:49
paso::PasoException
PasoException exception class.
Definition: PasoException.h:43
escript::DataTypes::index_t
int index_t
type for array/matrix indices used both globally and on each rank
Definition: DataTypes.h:82
paso::Performance_stopMonitor
void Performance_stopMonitor(Performance *pp, int monitor)
switches off a monitor
Definition: performance.cpp:193
PERFORMANCE_ASSEMBLAGE
#define PERFORMANCE_ASSEMBLAGE
Definition: performance.h:57
PasoUtil.h
IS_AVAILABLE
#define IS_AVAILABLE
Definition: Pattern_mis.cpp:54
PasoException.h
IS_IN_MIS_NOW
#define IS_IN_MIS_NOW
Definition: Pattern_mis.cpp:55
paso::Pattern::type
int type
Definition: Pattern.h:116
paso::util::isAny
bool isAny(dim_t N, const index_t *array, index_t value)
returns true if array contains value
Definition: PasoUtil.cpp:53
paso
Definition: BiCGStab.cpp:25
paso::NoError
Definition: Paso.h:66
ESYS_ASSERT
#define ESYS_ASSERT(a, b)
EsysAssert is a MACRO that will throw an exception if the boolean condition specified is false.
Definition: Assert.h:77
paso::DegreeAndIdx
Definition: Pattern_reduceBandwidth.cpp:76
paso::Pattern::getBandwidth
dim_t getBandwidth(index_t *label) const
Definition: Pattern_reduceBandwidth.cpp:53
paso::Performance
Definition: performance.h:65
paso::dropTree
bool dropTree(index_t root, const Pattern *pattern, index_t *AssignedLevel, index_t *VerticesInTree, dim_t *numLevels, index_t *firstVertexInLevel, dim_t max_LevelWidth_abort, dim_t N)
Definition: Pattern_reduceBandwidth.cpp:113
PASO_ZERO
#define PASO_ZERO
Definition: Paso.h:67
paso::Pattern::ptr
index_t * ptr
Definition: Pattern.h:124
paso::Pattern_mis_seed
static double Pattern_mis_seed
Definition: Pattern_mis.cpp:52