00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 #ifndef SIO_TIMER__
00016 #define SIO_TIMER__
00017 
00018 #include "hdf5.h"
00019 
00020 #if defined(H5_TIME_WITH_SYS_TIME)
00021 #   include <sys/time.h>
00022 #   include <time.h>
00023 #elif defined(H5_HAVE_SYS_TIME_H)
00024 #   include <sys/time.h>
00025 #else
00026 #   include <time.h>
00027 #endif
00028 
00029 #ifdef _WIN32
00030 #       include <winsock.h>
00031 #endif 
00032 
00033 
00034 typedef enum timer_type_ {
00035     HDF5_FILE_OPENCLOSE,
00036     HDF5_DATASET_CREATE,
00037     HDF5_MPI_WRITE,
00038     HDF5_MPI_READ,
00039     HDF5_FILE_READ_OPEN,
00040     HDF5_FILE_READ_CLOSE,
00041     HDF5_FILE_WRITE_OPEN,
00042     HDF5_FILE_WRITE_CLOSE,
00043     HDF5_FINE_WRITE_FIXED_DIMS,
00044     HDF5_FINE_READ_FIXED_DIMS,
00045     HDF5_GROSS_WRITE_FIXED_DIMS,
00046     HDF5_GROSS_READ_FIXED_DIMS,
00047     HDF5_RAW_WRITE_FIXED_DIMS,
00048     HDF5_RAW_READ_FIXED_DIMS,
00049     NUM_TIMERS
00050 } timer_type;
00051 
00052 
00053 
00054 enum {
00055     START,          
00056     STOP            
00057 };
00058 
00059 
00060 typedef struct sio_time_ {
00061     double total_time[NUM_TIMERS];
00062     struct timeval sys_timer[NUM_TIMERS];
00063 } sio_time;
00064 
00065 
00066 #ifdef __cplusplus
00067 extern "C" {
00068 #endif  
00069 extern sio_time    *sio_time_new(void);
00070 extern void         sio_time_destroy(sio_time *pt);
00071 extern void         set_timer_type(sio_time *pt);
00072 extern sio_time    *set_time(sio_time *pt, timer_type t, int start_stop);
00073 extern double       get_time(sio_time *pt, timer_type t);
00074 #ifdef __cplusplus
00075 }
00076 #endif  
00077 
00078 #endif