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