summaryrefslogtreecommitdiffstats
path: root/tools/lib
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2020-01-17 22:18:21 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2020-01-17 22:18:21 (GMT)
commit7697305e3bc1e5e317451d15a1a498706a372dbf (patch)
tree94fa3f341a45ccb6ec5a2ec553d5b27e56797b16 /tools/lib
parented86880694a41fe57b3252c7b1388927ff9aee7c (diff)
downloadhdf5-7697305e3bc1e5e317451d15a1a498706a372dbf.zip
hdf5-7697305e3bc1e5e317451d15a1a498706a372dbf.tar.gz
hdf5-7697305e3bc1e5e317451d15a1a498706a372dbf.tar.bz2
Bring perform tools changes from develop
Diffstat (limited to 'tools/lib')
-rw-r--r--tools/lib/io_timer.c85
-rw-r--r--tools/lib/io_timer.h10
2 files changed, 49 insertions, 46 deletions
diff --git a/tools/lib/io_timer.c b/tools/lib/io_timer.c
index ed843d9..86e71de 100644
--- a/tools/lib/io_timer.c
+++ b/tools/lib/io_timer.c
@@ -138,43 +138,43 @@ io_time_set(io_time_t *pt, timer_type t, int start_stop)
switch(pt->type){
#ifdef H5_HAVE_PARALLEL
case MPI_CLOCK:
- if (start_stop == TSTART) {
- pt->mpi_timer[t] = MPI_Wtime();
-
- /* When we start the timer for HDF5_FINE_WRITE_FIXED_DIMS or HDF5_FINE_READ_FIXED_DIMS
- * we compute the time it took to only open the file */
- if(t == HDF5_FINE_WRITE_FIXED_DIMS)
- pt->total_time[HDF5_FILE_WRITE_OPEN] += pt->mpi_timer[t] - pt->mpi_timer[HDF5_GROSS_WRITE_FIXED_DIMS];
- else if(t == HDF5_FINE_READ_FIXED_DIMS)
- pt->total_time[HDF5_FILE_READ_OPEN] += pt->mpi_timer[t] - pt->mpi_timer[HDF5_GROSS_READ_FIXED_DIMS];
-
- } else {
- pt->total_time[t] += MPI_Wtime() - pt->mpi_timer[t];
- pt->mpi_timer[t] = MPI_Wtime();
-
- /* When we stop the timer for HDF5_GROSS_WRITE_FIXED_DIMS or HDF5_GROSS_READ_FIXED_DIMS
- * we compute the time it took to close the file after the last read/write finished */
- if(t == HDF5_GROSS_WRITE_FIXED_DIMS)
- pt->total_time[HDF5_FILE_WRITE_CLOSE] += pt->mpi_timer[t] - pt->mpi_timer[HDF5_FINE_WRITE_FIXED_DIMS];
- else if(t == HDF5_GROSS_READ_FIXED_DIMS)
- pt->total_time[HDF5_FILE_READ_CLOSE] += pt->mpi_timer[t] - pt->mpi_timer[HDF5_FINE_READ_FIXED_DIMS];
- }
- break;
+ if (start_stop == TSTART) {
+ pt->mpi_timer[t] = MPI_Wtime();
+
+ /* When we start the timer for HDF5_FINE_WRITE_FIXED_DIMS or HDF5_FINE_READ_FIXED_DIMS
+ * we compute the time it took to only open the file */
+ if(t == HDF5_FINE_WRITE_FIXED_DIMS)
+ pt->total_time[HDF5_FILE_WRITE_OPEN] += pt->mpi_timer[t] - pt->mpi_timer[HDF5_GROSS_WRITE_FIXED_DIMS];
+ else if(t == HDF5_FINE_READ_FIXED_DIMS)
+ pt->total_time[HDF5_FILE_READ_OPEN] += pt->mpi_timer[t] - pt->mpi_timer[HDF5_GROSS_READ_FIXED_DIMS];
+
+ } else {
+ pt->total_time[t] += MPI_Wtime() - pt->mpi_timer[t];
+ pt->mpi_timer[t] = MPI_Wtime();
+
+ /* When we stop the timer for HDF5_GROSS_WRITE_FIXED_DIMS or HDF5_GROSS_READ_FIXED_DIMS
+ * we compute the time it took to close the file after the last read/write finished */
+ if(t == HDF5_GROSS_WRITE_FIXED_DIMS)
+ pt->total_time[HDF5_FILE_WRITE_CLOSE] += pt->mpi_timer[t] - pt->mpi_timer[HDF5_FINE_WRITE_FIXED_DIMS];
+ else if(t == HDF5_GROSS_READ_FIXED_DIMS)
+ pt->total_time[HDF5_FILE_READ_CLOSE] += pt->mpi_timer[t] - pt->mpi_timer[HDF5_FINE_READ_FIXED_DIMS];
+ }
+ break;
#else
case MPI_CLOCK:
- HDfprintf(stderr, "MPI clock set in serial library\n");
- return NULL;
+ HDfprintf(stderr, "MPI clock set in serial library\n");
+ return NULL;
#endif /* H5_HAVE_PARALLEL */
case SYS_CLOCK:
if (start_stop == TSTART) {
HDgettimeofday(&pt->sys_timer[t], NULL);
- /* When we start the timer for HDF5_FINE_WRITE_FIXED_DIMS or HDF5_FINE_READ_FIXED_DIMS
- * we compute the time it took to only open the file */
- if(t == HDF5_FINE_WRITE_FIXED_DIMS)
- pt->total_time[HDF5_FILE_WRITE_OPEN] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_GROSS_WRITE_FIXED_DIMS]));
- else if(t == HDF5_FINE_READ_FIXED_DIMS)
- pt->total_time[HDF5_FILE_READ_OPEN] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_GROSS_READ_FIXED_DIMS]));
+ /* When we start the timer for HDF5_FINE_WRITE_FIXED_DIMS or HDF5_FINE_READ_FIXED_DIMS
+ * we compute the time it took to only open the file */
+ if(t == HDF5_FINE_WRITE_FIXED_DIMS)
+ pt->total_time[HDF5_FILE_WRITE_OPEN] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_GROSS_WRITE_FIXED_DIMS]));
+ else if(t == HDF5_FINE_READ_FIXED_DIMS)
+ pt->total_time[HDF5_FILE_READ_OPEN] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_GROSS_READ_FIXED_DIMS]));
} else {
@@ -183,19 +183,19 @@ io_time_set(io_time_t *pt, timer_type t, int start_stop)
HDgettimeofday(&sys_t, NULL);
pt->total_time[t] += sub_time(&sys_t, &(pt->sys_timer[t]));
- /* When we stop the timer for HDF5_GROSS_WRITE_FIXED_DIMS or HDF5_GROSS_READ_FIXED_DIMS
- * we compute the time it took to close the file after the last read/write finished */
- if(t == HDF5_GROSS_WRITE_FIXED_DIMS)
- pt->total_time[HDF5_FILE_WRITE_CLOSE] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_FINE_WRITE_FIXED_DIMS]));
- else if(t == HDF5_GROSS_READ_FIXED_DIMS)
- pt->total_time[HDF5_FILE_READ_CLOSE] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_FINE_READ_FIXED_DIMS]));
+ /* When we stop the timer for HDF5_GROSS_WRITE_FIXED_DIMS or HDF5_GROSS_READ_FIXED_DIMS
+ * we compute the time it took to close the file after the last read/write finished */
+ if(t == HDF5_GROSS_WRITE_FIXED_DIMS)
+ pt->total_time[HDF5_FILE_WRITE_CLOSE] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_FINE_WRITE_FIXED_DIMS]));
+ else if(t == HDF5_GROSS_READ_FIXED_DIMS)
+ pt->total_time[HDF5_FILE_READ_CLOSE] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_FINE_READ_FIXED_DIMS]));
}
- break;
+ break;
default:
- HDfprintf(stderr, "Unknown time clock type (%d)\n", pt->type);
- return NULL;
+ HDfprintf(stderr, "Unknown time clock type (%d)\n", pt->type);
+ return NULL;
} /* end switch */
#if 0
@@ -221,10 +221,3 @@ io_time_get(io_time_t *pt, timer_type t)
return pt->total_time[t];
}
-
-#if 0
-/* standalone is not working yet. Need fix later. -AKC- */
-#ifdef STANDALONE
-#include "pio_standalone.c"
-#endif
-#endif
diff --git a/tools/lib/io_timer.h b/tools/lib/io_timer.h
index 78bf676..c1fa58e 100644
--- a/tools/lib/io_timer.h
+++ b/tools/lib/io_timer.h
@@ -28,6 +28,7 @@
#ifdef H5_HAVE_WINSOCK2_H
# include <winsock2.h>
#endif /* H5_HAVE_WINSOCK2_H */
+
/* The different types of timers we can have */
typedef enum timer_type_ {
HDF5_FILE_OPENCLOSE,
@@ -70,10 +71,19 @@ typedef struct io_time_t {
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
+
+#ifdef STANDALONE
+io_time_t *io_time_new(clock_type t);
+void io_time_destroy(io_time_t *pt);
+io_time_t *io_time_set(io_time_t *pt, timer_type t, int start_stop);
+double io_time_get(io_time_t *pt, timer_type t);
+#else
H5TOOLS_DLL io_time_t *io_time_new(clock_type t);
H5TOOLS_DLL void io_time_destroy(io_time_t *pt);
H5TOOLS_DLL io_time_t *io_time_set(io_time_t *pt, timer_type t, int start_stop);
H5TOOLS_DLL double io_time_get(io_time_t *pt, timer_type t);
+#endif
+
#ifdef __cplusplus
}
#endif /* __cplusplus */