performance.h
Go to the documentation of this file.
/*****************************************************************************
*
* Copyright (c) 2003-2020 by The University of Queensland
* http://www.uq.edu.au
*
* Primary Business: Queensland, Australia
* Licensed under the Apache License, version 2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Development until 2012 by Earth Systems Science Computational Center (ESSCC)
* Development 2012-2013 by School of Earth Sciences
* Development from 2014-2017 by Centre for Geoscience Computing (GeoComp)
* Development from 2019 by School of Earth and Environmental Sciences
**
*****************************************************************************/
/****************************************************************************/
/* Paso: perfomance monitor interface using PAPI */
/****************************************************************************/
/* Copyrights by ACcESS Australia 2006 */
/* Author: Lutz Gross, l.gross@uq.edu.au */
/****************************************************************************/
#ifndef __PASO_PERFORMANCE_H__
#define __PASO_PERFORMANCE_H__
#ifdef ESYS_HAVE_PAPI
#include <papi.h>
#endif
namespace paso {
#define PERFORMANCE_UNMONITORED_EVENT -1
#define PERFORMANCE_NUM_EVENTS 10 // maximum number of events handled by PAPI
#define PERFORMANCE_ALL 0
#define PERFORMANCE_SOLVER 1
#define PERFORMANCE_PRECONDITIONER_INIT 2
#define PERFORMANCE_PRECONDITIONER 3
#define PERFORMANCE_MVM 4
#define PERFORMANCE_ASSEMBLAGE 5
#define PERFORMANCE_UNKNOWN 6 // more can be added here
#define PERFORMANCE_NUM_MONITORS PERFORMANCE_UNKNOWN+1
#define PERFORMANCE_UNUSED -1
#define PERFORMANCE_CLOSED 0
#define PERFORMANCE_OPENED 1
struct Performance
{
#ifdef ESYS_HAVE_PAPI
int event_set;
int num_events;
int events[PERFORMANCE_NUM_EVENTS];
long_long values[PERFORMANCE_NUM_MONITORS][PERFORMANCE_NUM_EVENTS];
long_long cycles[PERFORMANCE_NUM_MONITORS];
int set[PERFORMANCE_NUM_MONITORS];
#else
int dummy;
#endif
};
void Performance_open(Performance* pp, int verbose);
int Performance_getEventIndex(Performance* pp, int event_id);
void Performance_close(Performance* pp, int verbose);
void Performance_startMonitor(Performance* pp, int monitor);
void Performance_stopMonitor(Performance* pp, int monitor);
} // namespace paso
#endif // __PASO_PERFORMANCE_H__
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:63
paso::N
static dim_t N
Definition: SparseMatrix_saveHB.cpp:52
PASO_ONE
#define PASO_ONE
Definition: Paso.h:68
PERFORMANCE_MVM
#define PERFORMANCE_MVM
Definition: performance.h:60
paso::Performance_startMonitor
void Performance_startMonitor(Performance *pp, int monitor)
switches on a monitor
Definition: performance.cpp:178
performance.h
escript::reducerstatus
Definition: AbstractReducer.h:43
IS_IN_MIS
#define IS_IN_MIS
Definition: Pattern_mis.cpp:60
paso::DegreeAndIdx::deg
dim_t deg
Definition: Pattern_reduceBandwidth.cpp:82
IS_CONNECTED_TO_MIS
#define IS_CONNECTED_TO_MIS
Definition: Pattern_mis.cpp:61
paso::SystemMatrix_ptr
boost::shared_ptr< SystemMatrix > SystemMatrix_ptr
Definition: SystemMatrix.h:55
MPI_SUM
#define MPI_SUM
Definition: EsysMPI.h:52
paso::comparDegreeAndIdx
int comparDegreeAndIdx(const void *arg1, const void *arg2)
Definition: Pattern_reduceBandwidth.cpp:86
PERFORMANCE_PRECONDITIONER_INIT
#define PERFORMANCE_PRECONDITIONER_INIT
Definition: performance.h:58
PERFORMANCE_ALL
#define PERFORMANCE_ALL
Definition: performance.h:56
paso::Pattern::numInput
dim_t numInput
Definition: Pattern.h:124
paso::Pattern::numOutput
dim_t numOutput
Definition: Pattern.h:122
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:97
PERFORMANCE_OPENED
#define PERFORMANCE_OPENED
Definition: performance.h:67
MATRIX_FORMAT_OFFSET1
#define MATRIX_FORMAT_OFFSET1
Definition: Paso.h:65
paso::Performance_close
void Performance_close(Performance *pp, int verbose)
shuts down the monitoring process
Definition: performance.cpp:108
Solver.h
paso::Breakdown
@ Breakdown
Definition: Paso.h:76
Paso.h
paso::Performance::dummy
int dummy
Definition: performance.h:84
PERFORMANCE_CLOSED
#define PERFORMANCE_CLOSED
Definition: performance.h:66
escript::DataTypes::dim_t
index_t dim_t
Definition: DataTypes.h:93
paso::Solver_PCG
SolverResult Solver_PCG(SystemMatrix_ptr A, double *r, double *x, dim_t *iter, double *tolerance, Performance *pp)
Definition: PCG.cpp:77
PERFORMANCE_SOLVER
#define PERFORMANCE_SOLVER
Definition: performance.h:57
PERFORMANCE_PRECONDITIONER
#define PERFORMANCE_PRECONDITIONER
Definition: performance.h:59
paso::SolverResult
SolverResult
Definition: Paso.h:57
SystemMatrix.h
paso::Pattern::reduceBandwidth
void reduceBandwidth(index_t *oldToNew)
Definition: Pattern_reduceBandwidth.cpp:159
paso::MaxIterReached
@ MaxIterReached
Definition: Paso.h:73
paso::DegreeAndIdx::idx
index_t idx
Definition: Pattern_reduceBandwidth.cpp:83
PERFORMANCE_UNUSED
#define PERFORMANCE_UNUSED
Definition: performance.h:65
PERFORMANCE_NUM_EVENTS
#define PERFORMANCE_NUM_EVENTS
Definition: performance.h:54
paso::Pattern::index
index_t * index
Definition: Pattern.h:130
Pattern.h
paso::Performance_open
void Performance_open(Performance *pp, int verbose)
sets up the monitoring process
Definition: performance.cpp:51
PERFORMANCE_NUM_MONITORS
#define PERFORMANCE_NUM_MONITORS
Definition: performance.h:63
TOLERANCE_FOR_SCALARS
#define TOLERANCE_FOR_SCALARS
Definition: Solver.h:43
MPI_DOUBLE
#define MPI_DOUBLE
Definition: EsysMPI.h:47
PERFORMANCE_UNMONITORED_EVENT
#define PERFORMANCE_UNMONITORED_EVENT
Definition: performance.h:53
paso::PasoException
PasoException exception class.
Definition: PasoException.h:47
escript::DataTypes::index_t
int index_t
type for array/matrix indices used both globally and on each rank
Definition: DataTypes.h:88
paso::Performance_stopMonitor
void Performance_stopMonitor(Performance *pp, int monitor)
switches off a monitor
Definition: performance.cpp:197
PERFORMANCE_ASSEMBLAGE
#define PERFORMANCE_ASSEMBLAGE
Definition: performance.h:61
PasoUtil.h
IS_AVAILABLE
#define IS_AVAILABLE
Definition: Pattern_mis.cpp:58
PasoException.h
IS_IN_MIS_NOW
#define IS_IN_MIS_NOW
Definition: Pattern_mis.cpp:59
paso::Pattern::type
int type
Definition: Pattern.h:120
paso::util::isAny
bool isAny(dim_t N, const index_t *array, index_t value)
returns true if array contains value
Definition: PasoUtil.cpp:59
paso
Definition: BiCGStab.cpp:26
paso::NoError
@ NoError
Definition: Paso.h:72
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:80
paso::Pattern::getBandwidth
dim_t getBandwidth(index_t *label) const
Definition: Pattern_reduceBandwidth.cpp:57
paso::Performance
Definition: performance.h:69
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:117
PASO_ZERO
#define PASO_ZERO
Definition: Paso.h:69
paso::Pattern::ptr
index_t * ptr
Definition: Pattern.h:128
paso::Pattern_mis_seed
static double Pattern_mis_seed
Definition: Pattern_mis.cpp:56