/[escript]/trunk/paso/src/performance.h
ViewVC logotype

Diff of /trunk/paso/src/performance.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

trunk/paso/src/performance.h revision 494 by gross, Fri Feb 3 07:35:49 2006 UTC temp/paso/src/performance.h revision 1387 by trankine, Fri Jan 11 07:45:26 2008 UTC
# Line 1  Line 1 
1    
2  /* $Id$ */  /* $Id$ */
3    
4    /*******************************************************
5     *
6     *           Copyright 2003-2007 by ACceSS MNRF
7     *       Copyright 2007 by University of Queensland
8     *
9     *                http://esscc.uq.edu.au
10     *        Primary Business: Queensland, Australia
11     *  Licensed under the Open Software License version 3.0
12     *     http://www.opensource.org/licenses/osl-3.0.php
13     *
14     *******************************************************/
15    
16  /**************************************************************/  /**************************************************************/
17    
18  /* Paso: perfomance monitor interface using papi*/  /* Paso: perfomance monitor interface using papi              */
19    
20  /**************************************************************/  /**************************************************************/
21    
22  /* Copyrights by ACcESS Australia 2003/04 */  /* Copyrights by ACcESS Australia 2006 */
23  /* Author: gross@access.edu.au */  /* Author: gross@access.edu.au */
24    
25  /**************************************************************/  /**************************************************************/
# Line 14  Line 27 
27  #ifndef INC_PASO_PERFORMANCE  #ifndef INC_PASO_PERFORMANCE
28  #define INC_PASO_PERFORMANCE  #define INC_PASO_PERFORMANCE
29    
30  #ifdef PAPI  #define PERFORMANCE_UNMONITORED_EVENT -1
31    #define PERFORMANCE_NUM_EVENTS 10                         /* maximum number of events handeled by PAPI */
 #include <papi.h>  
32    
33  Paso_Performance* Performance_init();  #define PERFORMANCE_ALL 0
34  void Performance_start_solver(Paso_Performance&);  #define PERFORMANCE_SOLVER 1
35  void Performance_start_preconditioner_init(Paso_Performance&);  #define PERFORMANCE_PRECONDITIONER_INIT 2
36  void Performance_start_preconditioner(Paso_Performance&);  #define PERFORMANCE_PRECONDITIONER 3
37  void Performance_start_mvm(Paso_Performance&);  #define PERFORMANCE_MVM 4
38  void Performance_end_preconditioner(Paso_Performance&);  #define PERFORMANCE_ASSEMBLAGE 5
39  void Performance_end_preconditioner_init(Paso_Performance&);  #define PERFORMANCE_UNKNOWN 6                             /* more can be added here */
40  void Performance_end_mvm(Paso_Performance&);  #define PERFORMANCE_NUM_MONITORS PERFORMANCE_UNKNOWN+1
41  void Performance_end_solver(Paso_Performance&);  
42  void Performance_finalized(Paso_Performance&);  #define PERFORMANCE_UNUSED -1
43    #define PERFORMANCE_CLOSED 0
44    #define PERFORMANCE_OPENED 1
45    
46    #ifdef PAPI
47    #include <papi.h>
48  struct Paso_Performance {  struct Paso_Performance {
49        int event_set;                                                       /* papi event sets for the monitors */
50        int num_events;                                                     /* number of events tracked by the monitors */
51        int events[PERFORMANCE_NUM_EVENTS];                                 /* the event tracked by the monitors */
52        long_long values[PERFORMANCE_NUM_MONITORS][PERFORMANCE_NUM_EVENTS]; /* counter accummulator */
53        long_long cycles[PERFORMANCE_NUM_MONITORS];                         /* cycle accumulator */
54        int set[PERFORMANCE_NUM_MONITORS];
55    };
56    #else
57    struct Paso_Performance {
58        int none;
59  };  };
 typedef Paso_Performance struct Paso_Performance;  
   
60  #endif  #endif
61    typedef struct Paso_Performance Paso_Performance;
62    
63    
64  void Performance_init(void*) {  void Performance_open(Paso_Performance* pp,int verbose);
65     #ifdef PAPI  int  Performance_getEventIndex(Paso_Performance* pp, int event_id);
66        /* Initialize the PAPI library */  void Performance_close(Paso_Performance* pp,int verbose);
67        retval = PAPI_library_init(PAPI_VER_CURRENT);  void Performance_startMonitor(Paso_Performance* pp,int monitor);
68        if (retval != PAPI_VER_CURRENT && retval > 0) {  void Performance_stopMonitor(Paso_Performance* pp,int monitor);
         fprintf(stderr,"PAPI library version mismatch!\n");  
         exit(1);  
       }  
       if (retval < 0) {  
         fprintf(stderr, “Initialization error!\n”);  
         exit(1);  
       }  
    #endif  
    NUM_EVENTS=5;  
    events={PAPI_FP_OPS,PAPI_L1_DCM,PAPI_L2_DCM,PAPI_L3_DCM};  
   
    out->all  
    out->solver  
    out->preconditioner_init  
    out->preconditioner  
    out->mvm  
 }  
   
 Performance_start(Paso_Performance& pp) {  
     pp->  
   
69    
70    #endif
71    
72  }  /*
73     * $Log$
74    */

Legend:
Removed from v.494  
changed lines
  Added in v.1387

  ViewVC Help
Powered by ViewVC 1.1.26