00001 
00002 
00003 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 #ifndef AD_BGL_TUNING_H_
00017 #define AD_BGL_TUNING_H_
00018 
00019 #include "adio.h"
00020 
00021 #define AD_BGL_assert( a ) if (!(a)) { \
00022                                 fprintf( stderr, "AD_BGL_assert, file=%s, line=%d\n", __FILE__, __LINE__ ); \
00023                                 MPI_Abort( MPI_COMM_WORLD, 1 ); \
00024                            }
00025 
00026 
00027 
00028 
00029 
00030 
00031 
00032 
00033 enum {
00034     BGLMPIO_CIO_DATA_SIZE=0,    
00035     BGLMPIO_CIO_T_SEEK,     
00036     BGLMPIO_CIO_T_LCOMP,    
00037     BGLMPIO_CIO_T_GATHER,   
00038     BGLMPIO_CIO_T_PATANA,   
00039     BGLMPIO_CIO_T_FD_PART,  
00040     BGLMPIO_CIO_T_MYREQ,    
00041     BGLMPIO_CIO_T_OTHREQ,   
00042     BGLMPIO_CIO_T_DEXCH,    
00043     BGLMPIO_CIO_T_POSI_RW,
00044     BGLMPIO_CIO_B_POSI_RW,
00045     BGLMPIO_CIO_T_MPIO_RW,  
00046     BGLMPIO_CIO_B_MPIO_RW,
00047     BGLMPIO_CIO_T_MPIO_CRW, 
00048     BGLMPIO_CIO_B_MPIO_CRW,
00049     BGLMPIO_CIO_LAST
00050 };
00051 
00052 extern double   bglmpio_prof_cw    [BGLMPIO_CIO_LAST];
00053 extern double   bglmpio_prof_cr    [BGLMPIO_CIO_LAST];
00054 
00055 
00056 
00057 extern int  bglmpio_timing;
00058 extern int  bglmpio_timing2;
00059 extern int  bglmpio_comm;
00060 extern int  bglmpio_tunegather;
00061 extern int  bglmpio_tuneblocking;
00062 extern long     bglocklessmpio_f_type;
00063 
00064 
00065 
00066 void ad_bgl_get_env_vars();
00067 
00068 
00069 void ad_bgl_timing_crw_report( int rw, ADIO_File fd, int myrank, int nprocs );
00070 
00071 
00072 
00073 
00074 
00075 #define BGLMPIO_T_CIO_RESET( LEVEL, RW ) \
00076     if (bglmpio_timing_cw_level >= LEVEL) { \
00077       int i; \
00078       for ( i = 0; i < BGLMPIO_T_LAST; i ++ ) \
00079         bglmpio_prof_c##RW [ i ] = 0; \
00080     }
00081 
00082 #define BGLMPIO_T_CIO_REPORT( LEVEL, RW, FD, MYRANK, NPROCS ) \
00083     if (bglmpio_timing_cw_level >= LEVEL) { \
00084       ad_bgl_timing_crw_report ( RW, FD, MYRANK, NPROCS ); \
00085     }
00086 
00087 #define BGLMPIO_T_CIO_SET_GET( LEVEL, RW, DOBAR, ISSET, ISGET, VAR1, VAR2 ) \
00088     if (bglmpio_timing_cw_level >= LEVEL) { \
00089       if ( DOBAR ) MPI_Barrier( fd->comm ); \
00090       double temp = MPI_Wtime(); \
00091       if ( ISSET ) bglmpio_prof_c##RW [ VAR1 ] = temp; \
00092       if ( ISGET ) bglmpio_prof_c##RW [ VAR2 ] = temp - bglmpio_prof_c##RW [ VAR2 ] ; \
00093     }
00094 
00095 #endif