mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-02-17 16:10:24 +08:00
Renamed get/set_time() calls in the tools library to avoid name
clash when building static parallel HDF5 w/ static linking to OpenMPI.
This commit is contained in:
parent
911b1ca67f
commit
a6930a2bcf
@ -123,17 +123,17 @@ get_timer_type(io_time_t *pt)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Function: set_time
|
||||
* Function: io_time_set
|
||||
* Purpose: Set the time in a ``io_time_t'' object.
|
||||
* Return: Pointer to the passed in ``io_time_t'' object if SUCCEED; Null otherwise.
|
||||
* Programmer: Bill Wendling, 01. October 2001
|
||||
* Modifications:
|
||||
*/
|
||||
io_time_t *
|
||||
set_time(io_time_t *pt, timer_type t, int start_stop)
|
||||
io_time_set(io_time_t *pt, timer_type t, int start_stop)
|
||||
{
|
||||
/* sanity check */
|
||||
assert(pt);
|
||||
HDassert(pt);
|
||||
|
||||
switch(pt->type){
|
||||
#ifdef H5_HAVE_PARALLEL
|
||||
@ -207,15 +207,18 @@ set_time(io_time_t *pt, timer_type t, int start_stop)
|
||||
}
|
||||
|
||||
/*
|
||||
* Function: get_time
|
||||
* Function: io_time_get
|
||||
* Purpose: Get the time from a ``io_time_t'' object.
|
||||
* Return: The number of seconds as a DOUBLE.
|
||||
* Programmer: Bill Wendling, 01. October 2001
|
||||
* Modifications:
|
||||
*/
|
||||
H5_ATTR_PURE double
|
||||
get_time(io_time_t *pt, timer_type t)
|
||||
io_time_get(io_time_t *pt, timer_type t)
|
||||
{
|
||||
/* sanity check */
|
||||
HDassert(pt);
|
||||
|
||||
return pt->total_time[t];
|
||||
}
|
||||
|
||||
|
@ -72,8 +72,8 @@ extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
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 *set_time(io_time_t *pt, timer_type t, int start_stop);
|
||||
H5TOOLS_DLL double get_time(io_time_t *pt, timer_type t);
|
||||
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);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
@ -311,21 +311,21 @@ do_pio(parameters param)
|
||||
/* Need barrier to make sure everyone starts at the same time */
|
||||
MPI_Barrier(pio_comm_g);
|
||||
|
||||
set_time(res.timers, HDF5_GROSS_WRITE_FIXED_DIMS, TSTART);
|
||||
io_time_set(res.timers, HDF5_GROSS_WRITE_FIXED_DIMS, TSTART);
|
||||
hrc = do_fopen(¶m, fname, &fd, PIO_CREATE | PIO_WRITE);
|
||||
|
||||
VRFY((hrc == SUCCESS), "do_fopen failed");
|
||||
|
||||
set_time(res.timers, HDF5_FINE_WRITE_FIXED_DIMS, TSTART);
|
||||
io_time_set(res.timers, HDF5_FINE_WRITE_FIXED_DIMS, TSTART);
|
||||
hrc = do_write(&res, &fd, ¶m, ndsets, nbytes, buf_size, buffer);
|
||||
set_time(res.timers, HDF5_FINE_WRITE_FIXED_DIMS, TSTOP);
|
||||
io_time_set(res.timers, HDF5_FINE_WRITE_FIXED_DIMS, TSTOP);
|
||||
|
||||
VRFY((hrc == SUCCESS), "do_write failed");
|
||||
|
||||
/* Close file for write */
|
||||
hrc = do_fclose(iot, &fd);
|
||||
|
||||
set_time(res.timers, HDF5_GROSS_WRITE_FIXED_DIMS, TSTOP);
|
||||
io_time_set(res.timers, HDF5_GROSS_WRITE_FIXED_DIMS, TSTOP);
|
||||
VRFY((hrc == SUCCESS), "do_fclose failed");
|
||||
|
||||
if (!param.h5_write_only) {
|
||||
@ -339,20 +339,20 @@ do_pio(parameters param)
|
||||
MPI_Barrier(pio_comm_g);
|
||||
|
||||
/* Open file for read */
|
||||
set_time(res.timers, HDF5_GROSS_READ_FIXED_DIMS, TSTART);
|
||||
io_time_set(res.timers, HDF5_GROSS_READ_FIXED_DIMS, TSTART);
|
||||
hrc = do_fopen(¶m, fname, &fd, PIO_READ);
|
||||
|
||||
VRFY((hrc == SUCCESS), "do_fopen failed");
|
||||
|
||||
set_time(res.timers, HDF5_FINE_READ_FIXED_DIMS, TSTART);
|
||||
io_time_set(res.timers, HDF5_FINE_READ_FIXED_DIMS, TSTART);
|
||||
hrc = do_read(&res, &fd, ¶m, ndsets, nbytes, buf_size, buffer);
|
||||
set_time(res.timers, HDF5_FINE_READ_FIXED_DIMS, TSTOP);
|
||||
io_time_set(res.timers, HDF5_FINE_READ_FIXED_DIMS, TSTOP);
|
||||
VRFY((hrc == SUCCESS), "do_read failed");
|
||||
|
||||
/* Close file for read */
|
||||
hrc = do_fclose(iot, &fd);
|
||||
|
||||
set_time(res.timers, HDF5_GROSS_READ_FIXED_DIMS, TSTOP);
|
||||
io_time_set(res.timers, HDF5_GROSS_READ_FIXED_DIMS, TSTOP);
|
||||
VRFY((hrc == SUCCESS), "do_fclose failed");
|
||||
}
|
||||
|
||||
@ -958,7 +958,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
|
||||
} /* end else */
|
||||
|
||||
/* Start "raw data" write timer */
|
||||
set_time(res->timers, HDF5_RAW_WRITE_FIXED_DIMS, TSTART);
|
||||
io_time_set(res->timers, HDF5_RAW_WRITE_FIXED_DIMS, TSTART);
|
||||
|
||||
while (nbytes_xfer < bytes_count){
|
||||
/* Write */
|
||||
@ -1389,7 +1389,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
|
||||
} /* end while */
|
||||
|
||||
/* Stop "raw data" write timer */
|
||||
set_time(res->timers, HDF5_RAW_WRITE_FIXED_DIMS, TSTOP);
|
||||
io_time_set(res->timers, HDF5_RAW_WRITE_FIXED_DIMS, TSTOP);
|
||||
|
||||
/* Calculate write time */
|
||||
|
||||
@ -1889,7 +1889,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
|
||||
} /* end else */
|
||||
|
||||
/* Start "raw data" read timer */
|
||||
set_time(res->timers, HDF5_RAW_READ_FIXED_DIMS, TSTART);
|
||||
io_time_set(res->timers, HDF5_RAW_READ_FIXED_DIMS, TSTART);
|
||||
|
||||
while (nbytes_xfer < bytes_count){
|
||||
/* Read */
|
||||
@ -2344,7 +2344,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
|
||||
} /* end while */
|
||||
|
||||
/* Stop "raw data" read timer */
|
||||
set_time(res->timers, HDF5_RAW_READ_FIXED_DIMS, TSTOP);
|
||||
io_time_set(res->timers, HDF5_RAW_READ_FIXED_DIMS, TSTOP);
|
||||
|
||||
/* Calculate read time */
|
||||
|
||||
@ -2639,9 +2639,9 @@ int MPI_File_read_at(MPI_File fh, MPI_Offset offset, void *buf,
|
||||
int count, MPI_Datatype datatype, MPI_Status *status)
|
||||
{
|
||||
int err;
|
||||
set_time(timer_g, HDF5_MPI_READ, TSTART);
|
||||
io_time_set(timer_g, HDF5_MPI_READ, TSTART);
|
||||
err=PMPI_File_read_at(fh, offset, buf, count, datatype, status);
|
||||
set_time(timer_g, HDF5_MPI_READ, TSTOP);
|
||||
io_time_set(timer_g, HDF5_MPI_READ, TSTOP);
|
||||
return err;
|
||||
}
|
||||
|
||||
@ -2650,9 +2650,9 @@ int MPI_File_read_at_all(MPI_File fh, MPI_Offset offset, void *buf,
|
||||
int count, MPI_Datatype datatype, MPI_Status *status)
|
||||
{
|
||||
int err;
|
||||
set_time(timer_g, HDF5_MPI_READ, TSTART);
|
||||
io_time_set(timer_g, HDF5_MPI_READ, TSTART);
|
||||
err=PMPI_File_read_at_all(fh, offset, buf, count, datatype, status);
|
||||
set_time(timer_g, HDF5_MPI_READ, TSTOP);
|
||||
io_time_set(timer_g, HDF5_MPI_READ, TSTOP);
|
||||
return err;
|
||||
}
|
||||
|
||||
@ -2660,9 +2660,9 @@ int MPI_File_write_at(MPI_File fh, MPI_Offset offset, void *buf,
|
||||
int count, MPI_Datatype datatype, MPI_Status *status)
|
||||
{
|
||||
int err;
|
||||
set_time(timer_g, HDF5_MPI_WRITE, TSTART);
|
||||
io_time_set(timer_g, HDF5_MPI_WRITE, TSTART);
|
||||
err=PMPI_File_write_at(fh, offset, buf, count, datatype, status);
|
||||
set_time(timer_g, HDF5_MPI_WRITE, TSTOP);
|
||||
io_time_set(timer_g, HDF5_MPI_WRITE, TSTOP);
|
||||
return err;
|
||||
}
|
||||
|
||||
@ -2670,9 +2670,9 @@ int MPI_File_write_at_all(MPI_File fh, MPI_Offset offset, void *buf,
|
||||
int count, MPI_Datatype datatype, MPI_Status *status)
|
||||
{
|
||||
int err;
|
||||
set_time(timer_g, HDF5_MPI_WRITE, TSTART);
|
||||
io_time_set(timer_g, HDF5_MPI_WRITE, TSTART);
|
||||
err=PMPI_File_write_at_all(fh, offset, buf, count, datatype, status);
|
||||
set_time(timer_g, HDF5_MPI_WRITE, TSTOP);
|
||||
io_time_set(timer_g, HDF5_MPI_WRITE, TSTOP);
|
||||
return err;
|
||||
}
|
||||
|
||||
|
@ -587,74 +587,74 @@ run_test(iotype iot, parameters parms, struct options *opts)
|
||||
res = do_pio(parms);
|
||||
|
||||
/* gather all of the "mpi write" times */
|
||||
t = get_time(res.timers, HDF5_MPI_WRITE);
|
||||
t = io_time_get(res.timers, HDF5_MPI_WRITE);
|
||||
get_minmax(&write_mpi_mm, t);
|
||||
|
||||
write_mpi_mm_table[i] = write_mpi_mm;
|
||||
|
||||
/* gather all of the "write" times */
|
||||
t = get_time(res.timers, HDF5_FINE_WRITE_FIXED_DIMS);
|
||||
t = io_time_get(res.timers, HDF5_FINE_WRITE_FIXED_DIMS);
|
||||
get_minmax(&write_mm, t);
|
||||
|
||||
write_mm_table[i] = write_mm;
|
||||
|
||||
/* gather all of the "write" times from open to close */
|
||||
t = get_time(res.timers, HDF5_GROSS_WRITE_FIXED_DIMS);
|
||||
t = io_time_get(res.timers, HDF5_GROSS_WRITE_FIXED_DIMS);
|
||||
get_minmax(&write_gross_mm, t);
|
||||
|
||||
write_gross_mm_table[i] = write_gross_mm;
|
||||
|
||||
/* gather all of the raw "write" times */
|
||||
t = get_time(res.timers, HDF5_RAW_WRITE_FIXED_DIMS);
|
||||
t = io_time_get(res.timers, HDF5_RAW_WRITE_FIXED_DIMS);
|
||||
get_minmax(&write_raw_mm, t);
|
||||
|
||||
write_raw_mm_table[i] = write_raw_mm;
|
||||
|
||||
/* gather all of the file open times (time from open to first write) */
|
||||
t = get_time(res.timers, HDF5_FILE_WRITE_OPEN);
|
||||
t = io_time_get(res.timers, HDF5_FILE_WRITE_OPEN);
|
||||
get_minmax(&write_open_mm, t);
|
||||
|
||||
write_open_mm_table[i] = write_open_mm;
|
||||
|
||||
/* gather all of the file close times (time from last write to close) */
|
||||
t = get_time(res.timers, HDF5_FILE_WRITE_CLOSE);
|
||||
t = io_time_get(res.timers, HDF5_FILE_WRITE_CLOSE);
|
||||
get_minmax(&write_close_mm, t);
|
||||
|
||||
write_close_mm_table[i] = write_close_mm;
|
||||
|
||||
if (!parms.h5_write_only) {
|
||||
/* gather all of the "mpi read" times */
|
||||
t = get_time(res.timers, HDF5_MPI_READ);
|
||||
t = io_time_get(res.timers, HDF5_MPI_READ);
|
||||
get_minmax(&read_mpi_mm, t);
|
||||
|
||||
read_mpi_mm_table[i] = read_mpi_mm;
|
||||
|
||||
/* gather all of the "read" times */
|
||||
t = get_time(res.timers, HDF5_FINE_READ_FIXED_DIMS);
|
||||
t = io_time_get(res.timers, HDF5_FINE_READ_FIXED_DIMS);
|
||||
get_minmax(&read_mm, t);
|
||||
|
||||
read_mm_table[i] = read_mm;
|
||||
|
||||
/* gather all of the "read" times from open to close */
|
||||
t = get_time(res.timers, HDF5_GROSS_READ_FIXED_DIMS);
|
||||
t = io_time_get(res.timers, HDF5_GROSS_READ_FIXED_DIMS);
|
||||
get_minmax(&read_gross_mm, t);
|
||||
|
||||
read_gross_mm_table[i] = read_gross_mm;
|
||||
|
||||
/* gather all of the raw "read" times */
|
||||
t = get_time(res.timers, HDF5_RAW_READ_FIXED_DIMS);
|
||||
t = io_time_get(res.timers, HDF5_RAW_READ_FIXED_DIMS);
|
||||
get_minmax(&read_raw_mm, t);
|
||||
|
||||
read_raw_mm_table[i] = read_raw_mm;
|
||||
|
||||
/* gather all of the file open times (time from open to first read) */
|
||||
t = get_time(res.timers, HDF5_FILE_READ_OPEN);
|
||||
t = io_time_get(res.timers, HDF5_FILE_READ_OPEN);
|
||||
get_minmax(&read_open_mm, t);
|
||||
|
||||
read_open_mm_table[i] = read_open_mm;
|
||||
|
||||
/* gather all of the file close times (time from last read to close) */
|
||||
t = get_time(res.timers, HDF5_FILE_READ_CLOSE);
|
||||
t = io_time_get(res.timers, HDF5_FILE_READ_CLOSE);
|
||||
get_minmax(&read_close_mm, t);
|
||||
|
||||
read_close_mm_table[i] = read_close_mm;
|
||||
|
@ -212,18 +212,18 @@ do_sio(parameters param, results *res)
|
||||
HDfprintf(output, "data filename=%s\n",
|
||||
fname);
|
||||
|
||||
set_time(res->timers, HDF5_GROSS_WRITE_FIXED_DIMS, TSTART);
|
||||
io_time_set(res->timers, HDF5_GROSS_WRITE_FIXED_DIMS, TSTART);
|
||||
hrc = do_fopen(¶m, fname, &fd, SIO_CREATE | SIO_WRITE);
|
||||
VRFY((hrc == SUCCESS), "do_fopen failed");
|
||||
|
||||
set_time(res->timers, HDF5_FINE_WRITE_FIXED_DIMS, TSTART);
|
||||
io_time_set(res->timers, HDF5_FINE_WRITE_FIXED_DIMS, TSTART);
|
||||
hrc = do_write(res, &fd, ¶m, buffer);
|
||||
set_time(res->timers, HDF5_FINE_WRITE_FIXED_DIMS, TSTOP);
|
||||
io_time_set(res->timers, HDF5_FINE_WRITE_FIXED_DIMS, TSTOP);
|
||||
VRFY((hrc == SUCCESS), "do_write failed");
|
||||
|
||||
/* Close file for write */
|
||||
hrc = do_fclose(iot, &fd);
|
||||
set_time(res->timers, HDF5_GROSS_WRITE_FIXED_DIMS, TSTOP);
|
||||
io_time_set(res->timers, HDF5_GROSS_WRITE_FIXED_DIMS, TSTOP);
|
||||
VRFY((hrc == SUCCESS), "do_fclose failed");
|
||||
|
||||
if (!param.h5_write_only) {
|
||||
@ -232,19 +232,19 @@ do_sio(parameters param, results *res)
|
||||
*/
|
||||
|
||||
/* Open file for read */
|
||||
set_time(res->timers, HDF5_GROSS_READ_FIXED_DIMS, TSTART);
|
||||
io_time_set(res->timers, HDF5_GROSS_READ_FIXED_DIMS, TSTART);
|
||||
hrc = do_fopen(¶m, fname, &fd, SIO_READ);
|
||||
VRFY((hrc == SUCCESS), "do_fopen failed");
|
||||
|
||||
set_time(res->timers, HDF5_FINE_READ_FIXED_DIMS, TSTART);
|
||||
io_time_set(res->timers, HDF5_FINE_READ_FIXED_DIMS, TSTART);
|
||||
hrc = do_read(res, &fd, ¶m, buffer);
|
||||
set_time(res->timers, HDF5_FINE_READ_FIXED_DIMS, TSTOP);
|
||||
io_time_set(res->timers, HDF5_FINE_READ_FIXED_DIMS, TSTOP);
|
||||
VRFY((hrc == SUCCESS), "do_read failed");
|
||||
|
||||
/* Close file for read */
|
||||
hrc = do_fclose(iot, &fd);
|
||||
|
||||
set_time(res->timers, HDF5_GROSS_READ_FIXED_DIMS, TSTOP);
|
||||
io_time_set(res->timers, HDF5_GROSS_READ_FIXED_DIMS, TSTOP);
|
||||
VRFY((hrc == SUCCESS), "do_fclose failed");
|
||||
}
|
||||
|
||||
@ -550,7 +550,7 @@ do_write(results *res, file_descr *fd, parameters *parms, void *buffer)
|
||||
}
|
||||
|
||||
/* Start "raw data" write timer */
|
||||
set_time(res->timers, HDF5_RAW_WRITE_FIXED_DIMS, TSTART);
|
||||
io_time_set(res->timers, HDF5_RAW_WRITE_FIXED_DIMS, TSTART);
|
||||
|
||||
/* Perform write */
|
||||
hrc = dset_write(rank-1, fd, parms, buffer);
|
||||
@ -562,7 +562,7 @@ do_write(results *res, file_descr *fd, parameters *parms, void *buffer)
|
||||
|
||||
|
||||
/* Stop "raw data" write timer */
|
||||
set_time(res->timers, HDF5_RAW_WRITE_FIXED_DIMS, TSTOP);
|
||||
io_time_set(res->timers, HDF5_RAW_WRITE_FIXED_DIMS, TSTOP);
|
||||
|
||||
/* Calculate write time */
|
||||
|
||||
@ -872,7 +872,7 @@ do_read(results *res, file_descr *fd, parameters *parms, void *buffer)
|
||||
} /* end switch */
|
||||
|
||||
/* Start "raw data" read timer */
|
||||
set_time(res->timers, HDF5_RAW_READ_FIXED_DIMS, TSTART);
|
||||
io_time_set(res->timers, HDF5_RAW_READ_FIXED_DIMS, TSTART);
|
||||
hrc = dset_read(rank-1, fd, parms, buffer, buffer2);
|
||||
|
||||
if (hrc < 0) {
|
||||
@ -881,7 +881,7 @@ do_read(results *res, file_descr *fd, parameters *parms, void *buffer)
|
||||
}
|
||||
|
||||
/* Stop "raw data" read timer */
|
||||
set_time(res->timers, HDF5_RAW_READ_FIXED_DIMS, TSTOP);
|
||||
io_time_set(res->timers, HDF5_RAW_READ_FIXED_DIMS, TSTOP);
|
||||
|
||||
/* Calculate read time */
|
||||
|
||||
|
@ -498,50 +498,50 @@ run_test(iotype iot, parameters parms, struct options *opts)
|
||||
do_sio(parms, &res);
|
||||
|
||||
/* gather all of the "sys write" times */
|
||||
t = get_time(res.timers, HDF5_MPI_WRITE);
|
||||
t = io_time_get(res.timers, HDF5_MPI_WRITE);
|
||||
get_minmax(&write_sys_mm, t);
|
||||
|
||||
write_sys_mm_table[i] = write_sys_mm;
|
||||
|
||||
/* gather all of the "write" times */
|
||||
t = get_time(res.timers, HDF5_FINE_WRITE_FIXED_DIMS);
|
||||
t = io_time_get(res.timers, HDF5_FINE_WRITE_FIXED_DIMS);
|
||||
get_minmax(&write_mm, t);
|
||||
|
||||
write_mm_table[i] = write_mm;
|
||||
|
||||
/* gather all of the "write" times from open to close */
|
||||
t = get_time(res.timers, HDF5_GROSS_WRITE_FIXED_DIMS);
|
||||
t = io_time_get(res.timers, HDF5_GROSS_WRITE_FIXED_DIMS);
|
||||
get_minmax(&write_gross_mm, t);
|
||||
|
||||
write_gross_mm_table[i] = write_gross_mm;
|
||||
|
||||
/* gather all of the raw "write" times */
|
||||
t = get_time(res.timers, HDF5_RAW_WRITE_FIXED_DIMS);
|
||||
t = io_time_get(res.timers, HDF5_RAW_WRITE_FIXED_DIMS);
|
||||
get_minmax(&write_raw_mm, t);
|
||||
|
||||
write_raw_mm_table[i] = write_raw_mm;
|
||||
|
||||
if (!parms.h5_write_only) {
|
||||
/* gather all of the "mpi read" times */
|
||||
t = get_time(res.timers, HDF5_MPI_READ);
|
||||
t = io_time_get(res.timers, HDF5_MPI_READ);
|
||||
get_minmax(&read_sys_mm, t);
|
||||
|
||||
read_sys_mm_table[i] = read_sys_mm;
|
||||
|
||||
/* gather all of the "read" times */
|
||||
t = get_time(res.timers, HDF5_FINE_READ_FIXED_DIMS);
|
||||
t = io_time_get(res.timers, HDF5_FINE_READ_FIXED_DIMS);
|
||||
get_minmax(&read_mm, t);
|
||||
|
||||
read_mm_table[i] = read_mm;
|
||||
|
||||
/* gather all of the "read" times from open to close */
|
||||
t = get_time(res.timers, HDF5_GROSS_READ_FIXED_DIMS);
|
||||
t = io_time_get(res.timers, HDF5_GROSS_READ_FIXED_DIMS);
|
||||
get_minmax(&read_gross_mm, t);
|
||||
|
||||
read_gross_mm_table[i] = read_gross_mm;
|
||||
|
||||
/* gather all of the raw "read" times */
|
||||
t = get_time(res.timers, HDF5_RAW_READ_FIXED_DIMS);
|
||||
t = io_time_get(res.timers, HDF5_RAW_READ_FIXED_DIMS);
|
||||
get_minmax(&read_raw_mm, t);
|
||||
|
||||
read_raw_mm_table[i] = read_gross_mm;
|
||||
|
Loading…
Reference in New Issue
Block a user