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 
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  int event_set;
61  int num_events;
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 
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:61
paso::N
static dim_t N
Definition: SparseMatrix_saveHB.cpp:50
PASO_ONE
#define PASO_ONE
Definition: Paso.h:67
PERFORMANCE_MVM
#define PERFORMANCE_MVM
Definition: performance.h:58
paso::Performance_startMonitor
void Performance_startMonitor(Performance *pp, int monitor)
switches on a monitor
Definition: performance.cpp:176
performance.h
escript::reducerstatus
Definition: AbstractReducer.h:41
IS_IN_MIS
#define IS_IN_MIS
Definition: Pattern_mis.cpp:58
paso::DegreeAndIdx::deg
dim_t deg
Definition: Pattern_reduceBandwidth.cpp:80
IS_CONNECTED_TO_MIS
#define IS_CONNECTED_TO_MIS
Definition: Pattern_mis.cpp:59
paso::SystemMatrix_ptr
boost::shared_ptr< SystemMatrix > SystemMatrix_ptr
Definition: SystemMatrix.h:53
MPI_SUM
#define MPI_SUM
Definition: EsysMPI.h:51
paso::comparDegreeAndIdx
int comparDegreeAndIdx(const void *arg1, const void *arg2)
Definition: Pattern_reduceBandwidth.cpp:84
PERFORMANCE_PRECONDITIONER_INIT
#define PERFORMANCE_PRECONDITIONER_INIT
Definition: performance.h:56
PERFORMANCE_ALL
#define PERFORMANCE_ALL
Definition: performance.h:54
paso::Pattern::numInput
dim_t numInput
Definition: Pattern.h:122
paso::Pattern::numOutput
dim_t numOutput
Definition: Pattern.h:120
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:95
PERFORMANCE_OPENED
#define PERFORMANCE_OPENED
Definition: performance.h:65
MATRIX_FORMAT_OFFSET1
#define MATRIX_FORMAT_OFFSET1
Definition: Paso.h:64
paso::Performance_close
void Performance_close(Performance *pp, int verbose)
shuts down the monitoring process
Definition: performance.cpp:106
Solver.h
paso::Breakdown
Definition: Paso.h:73
Paso.h
paso::Performance::dummy
int dummy
Definition: performance.h:82
PERFORMANCE_CLOSED
#define PERFORMANCE_CLOSED
Definition: performance.h:64
escript::DataTypes::dim_t
index_t dim_t
Definition: DataTypes.h:90
paso::Solver_PCG
SolverResult Solver_PCG(SystemMatrix_ptr A, double *r, double *x, dim_t *iter, double *tolerance, Performance *pp)
Definition: PCG.cpp:75
PERFORMANCE_SOLVER
#define PERFORMANCE_SOLVER
Definition: performance.h:55
PERFORMANCE_PRECONDITIONER
#define PERFORMANCE_PRECONDITIONER
Definition: performance.h:57
paso::SolverResult
SolverResult
Definition: Paso.h:55
SystemMatrix.h
paso::Pattern::reduceBandwidth
void reduceBandwidth(index_t *oldToNew)
Definition: Pattern_reduceBandwidth.cpp:157
paso::MaxIterReached
Definition: Paso.h:70
paso::DegreeAndIdx::idx
index_t idx
Definition: Pattern_reduceBandwidth.cpp:81
PERFORMANCE_UNUSED
#define PERFORMANCE_UNUSED
Definition: performance.h:63
PERFORMANCE_NUM_EVENTS
#define PERFORMANCE_NUM_EVENTS
Definition: performance.h:52
paso::Pattern::index
index_t * index
Definition: Pattern.h:128
Pattern.h
paso::Performance_open
void Performance_open(Performance *pp, int verbose)
sets up the monitoring process
Definition: performance.cpp:49
PERFORMANCE_NUM_MONITORS
#define PERFORMANCE_NUM_MONITORS
Definition: performance.h:61
TOLERANCE_FOR_SCALARS
#define TOLERANCE_FOR_SCALARS
Definition: Solver.h:41
MPI_DOUBLE
#define MPI_DOUBLE
Definition: EsysMPI.h:46
PERFORMANCE_UNMONITORED_EVENT
#define PERFORMANCE_UNMONITORED_EVENT
Definition: performance.h:51
escript::DataTypes::index_t
int index_t
type for array/matrix indices used both globally and on each rank
Definition: DataTypes.h:85
paso::Performance_stopMonitor
void Performance_stopMonitor(Performance *pp, int monitor)
switches off a monitor
Definition: performance.cpp:195
PERFORMANCE_ASSEMBLAGE
#define PERFORMANCE_ASSEMBLAGE
Definition: performance.h:59
PasoUtil.h
IS_AVAILABLE
#define IS_AVAILABLE
Definition: Pattern_mis.cpp:56
PasoException.h
IS_IN_MIS_NOW
#define IS_IN_MIS_NOW
Definition: Pattern_mis.cpp:57
paso::Pattern::type
int type
Definition: Pattern.h:118
paso::util::isAny
bool isAny(dim_t N, const index_t *array, index_t value)
returns true if array contains value
Definition: PasoUtil.cpp:56
paso
Definition: BiCGStab.cpp:26
paso::NoError
Definition: Paso.h:69
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:78
paso::DegreeAndIdx
Definition: Pattern_reduceBandwidth.cpp:78
paso::Pattern::getBandwidth
dim_t getBandwidth(index_t *label) const
Definition: Pattern_reduceBandwidth.cpp:55
paso::Performance
Definition: performance.h:67
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:115
PASO_ZERO
#define PASO_ZERO
Definition: Paso.h:68
paso::Pattern::ptr
index_t * ptr
Definition: Pattern.h:126
paso::Pattern_mis_seed
static double Pattern_mis_seed
Definition: Pattern_mis.cpp:54