ESYS13  Revision_
performance.h
Go to the documentation of this file.
00001 
00002 /*******************************************************
00003 *
00004 * Copyright (c) 2003-2012 by University of Queensland
00005 * Earth Systems Science Computational Center (ESSCC)
00006 * http://www.uq.edu.au/esscc
00007 *
00008 * Primary Business: Queensland, Australia
00009 * Licensed under the Open Software License version 3.0
00010 * http://www.opensource.org/licenses/osl-3.0.php
00011 *
00012 *******************************************************/
00013 
00014 
00015 /**************************************************************/
00016 
00017 /* Paso: perfomance monitor interface using papi              */
00018 
00019 /**************************************************************/
00020 
00021 /* Copyrights by ACcESS Australia 2006 */
00022 /* Author: Lutz Gross, l.gross@uq.edu.au */
00023 
00024 /**************************************************************/
00025 
00026 #ifndef INC_PASO_PERFORMANCE
00027 #define INC_PASO_PERFORMANCE
00028 
00029 #define PERFORMANCE_UNMONITORED_EVENT -1
00030 #define PERFORMANCE_NUM_EVENTS 10                         /* maximum number of events handled by PAPI */
00031 
00032 #define PERFORMANCE_ALL 0
00033 #define PERFORMANCE_SOLVER 1
00034 #define PERFORMANCE_PRECONDITIONER_INIT 2
00035 #define PERFORMANCE_PRECONDITIONER 3
00036 #define PERFORMANCE_MVM 4
00037 #define PERFORMANCE_ASSEMBLAGE 5
00038 #define PERFORMANCE_UNKNOWN 6                             /* more can be added here */
00039 #define PERFORMANCE_NUM_MONITORS PERFORMANCE_UNKNOWN+1
00040 
00041 #define PERFORMANCE_UNUSED -1
00042 #define PERFORMANCE_CLOSED 0
00043 #define PERFORMANCE_OPENED 1
00044 
00045 #ifdef PAPI
00046 #include <papi.h>
00047 struct Paso_Performance {
00048     int event_set;                                                       /* papi event sets for the monitors */
00049     int num_events;                                                     /* number of events tracked by the monitors */
00050     int events[PERFORMANCE_NUM_EVENTS];                                 /* the event tracked by the monitors */
00051     long_long values[PERFORMANCE_NUM_MONITORS][PERFORMANCE_NUM_EVENTS]; /* counter accumulator */
00052     long_long cycles[PERFORMANCE_NUM_MONITORS];                         /* cycle accumulator */
00053     int set[PERFORMANCE_NUM_MONITORS];
00054 };
00055 #else
00056 struct Paso_Performance {
00057     int none;
00058 };
00059 #endif
00060 typedef struct Paso_Performance Paso_Performance;
00061 
00062 
00063 void Performance_open(Paso_Performance* pp,int verbose);
00064 int  Performance_getEventIndex(Paso_Performance* pp, int event_id);
00065 void Performance_close(Paso_Performance* pp,int verbose);
00066 void Performance_startMonitor(Paso_Performance* pp,int monitor);
00067 void Performance_stopMonitor(Paso_Performance* pp,int monitor);
00068 
00069 #endif
00070 
00071 /*
00072  * $Log$
00073 */