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 
56 {
57 #ifdef ESYS_HAVE_PAPI
58  int event_set;
61  int num_events;
63  int events[PERFORMANCE_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:48
paso::N
static dim_t N
Definition: SparseMatrix_saveHB.cpp:37
PASO_ONE
#define PASO_ONE
Definition: Paso.h:68
PERFORMANCE_MVM
#define PERFORMANCE_MVM
Definition: performance.h:46
paso::Performance_startMonitor
void Performance_startMonitor(Performance *pp, int monitor)
switches on a monitor
Definition: performance.cpp:163
performance.h
escript::reducerstatus
Definition: AbstractReducer.h:31
IS_IN_MIS
#define IS_IN_MIS
Definition: Pattern_mis.cpp:45
paso::DegreeAndIdx::deg
dim_t deg
Definition: Pattern_reduceBandwidth.cpp:67
IS_CONNECTED_TO_MIS
#define IS_CONNECTED_TO_MIS
Definition: Pattern_mis.cpp:46
MPI_SUM
#define MPI_SUM
Definition: EsysMPI.h:54
paso::comparDegreeAndIdx
int comparDegreeAndIdx(const void *arg1, const void *arg2)
Definition: Pattern_reduceBandwidth.cpp:71
PERFORMANCE_PRECONDITIONER_INIT
#define PERFORMANCE_PRECONDITIONER_INIT
Definition: performance.h:44
PERFORMANCE_ALL
#define PERFORMANCE_ALL
Definition: performance.h:42
paso::Pattern::numInput
dim_t numInput
Definition: Pattern.h:135
paso::Pattern::numOutput
dim_t numOutput
Definition: Pattern.h:133
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:82
PERFORMANCE_OPENED
#define PERFORMANCE_OPENED
Definition: performance.h:53
MATRIX_FORMAT_OFFSET1
#define MATRIX_FORMAT_OFFSET1
Definition: Paso.h:64
paso::SystemMatrix_ptr
boost::shared_ptr< SystemMatrix< T > > SystemMatrix_ptr
Definition: SystemMatrix.h:42
paso::Pattern
Definition: Pattern.h:44
paso::Performance_close
void Performance_close(Performance *pp, int verbose)
shuts down the monitoring process
Definition: performance.cpp:93
Solver.h
paso::Breakdown
@ Breakdown
Definition: Paso.h:49
Paso.h
paso::Performance::dummy
int dummy
Definition: performance.h:70
PERFORMANCE_CLOSED
#define PERFORMANCE_CLOSED
Definition: performance.h:52
escript::DataTypes::dim_t
index_t dim_t
Definition: DataTypes.h:66
PERFORMANCE_SOLVER
#define PERFORMANCE_SOLVER
Definition: performance.h:43
PERFORMANCE_PRECONDITIONER
#define PERFORMANCE_PRECONDITIONER
Definition: performance.h:45
paso::SolverResult
SolverResult
Definition: Paso.h:44
SystemMatrix.h
paso::Pattern::reduceBandwidth
void reduceBandwidth(index_t *oldToNew)
Definition: Pattern_reduceBandwidth.cpp:144
paso::MaxIterReached
@ MaxIterReached
Definition: Paso.h:46
paso::Solver_PCG
SolverResult Solver_PCG(SystemMatrix_ptr< double > A, double *r, double *x, dim_t *iter, double *tolerance, Performance *pp)
Definition: PCG.cpp:62
paso::DegreeAndIdx::idx
index_t idx
Definition: Pattern_reduceBandwidth.cpp:68
PERFORMANCE_UNUSED
#define PERFORMANCE_UNUSED
Definition: performance.h:51
PERFORMANCE_NUM_EVENTS
#define PERFORMANCE_NUM_EVENTS
Definition: performance.h:40
paso::Pattern::index
index_t * index
Definition: Pattern.h:141
Pattern.h
paso::Performance_open
void Performance_open(Performance *pp, int verbose)
sets up the monitoring process
Definition: performance.cpp:36
PERFORMANCE_NUM_MONITORS
#define PERFORMANCE_NUM_MONITORS
Definition: performance.h:49
TOLERANCE_FOR_SCALARS
#define TOLERANCE_FOR_SCALARS
Definition: Solver.h:29
MPI_DOUBLE
#define MPI_DOUBLE
Definition: EsysMPI.h:49
PERFORMANCE_UNMONITORED_EVENT
#define PERFORMANCE_UNMONITORED_EVENT
Definition: performance.h:39
paso::PasoException
PasoException exception class.
Definition: PasoException.h:34
escript::DataTypes::index_t
int index_t
type for array/matrix indices used both globally and on each rank
Definition: DataTypes.h:61
paso::Performance_stopMonitor
void Performance_stopMonitor(Performance *pp, int monitor)
switches off a monitor
Definition: performance.cpp:182
PERFORMANCE_ASSEMBLAGE
#define PERFORMANCE_ASSEMBLAGE
Definition: performance.h:47
PasoUtil.h
IS_AVAILABLE
#define IS_AVAILABLE
Definition: Pattern_mis.cpp:43
PasoException.h
IS_IN_MIS_NOW
#define IS_IN_MIS_NOW
Definition: Pattern_mis.cpp:44
paso::Pattern::type
int type
Definition: Pattern.h:131
paso::util::isAny
bool isAny(dim_t N, const index_t *array, index_t value)
returns true if array contains value
Definition: PasoUtil.cpp:30
paso
Definition: BiCGStab.cpp:25
paso::NoError
@ NoError
Definition: Paso.h:45
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:79
paso::DegreeAndIdx
Definition: Pattern_reduceBandwidth.cpp:66
paso::Pattern::getBandwidth
dim_t getBandwidth(index_t *label) const
Definition: Pattern_reduceBandwidth.cpp:42
paso::Performance
Definition: performance.h:56
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:102
PASO_ZERO
#define PASO_ZERO
Definition: Paso.h:69
paso::Pattern::ptr
index_t * ptr
Definition: Pattern.h:139
paso::Pattern_mis_seed
static double Pattern_mis_seed
Definition: Pattern_mis.cpp:41