diff options
Diffstat (limited to 'perform')
-rw-r--r-- | perform/CMakeLists.txt | 76 | ||||
-rw-r--r-- | perform/Makefile.am | 25 | ||||
-rw-r--r-- | perform/Makefile.in | 28 | ||||
-rw-r--r-- | perform/iopipe.c | 135 | ||||
-rw-r--r-- | perform/overhead.c | 18 | ||||
-rw-r--r-- | perform/pio_standalone.h | 49 | ||||
-rw-r--r-- | perform/sio_engine.c | 40 | ||||
-rw-r--r-- | perform/sio_standalone.h | 33 | ||||
-rw-r--r-- | perform/sio_timer.h | 4 | ||||
-rw-r--r-- | perform/zip_perf.c | 4 |
10 files changed, 196 insertions, 216 deletions
diff --git a/perform/CMakeLists.txt b/perform/CMakeLists.txt index 2c0c517..578b5a6 100644 --- a/perform/CMakeLists.txt +++ b/perform/CMakeLists.txt @@ -11,6 +11,21 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib ) # Add Tests #----------------------------------------------------------------------------- +# Remove any output file left over from previous test run +ADD_TEST ( + NAME h5perform-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + chunk.h5 + iopipe.h5 + iopipe.raw + x-diag-rd.dat + x-diag-wr.dat + x-rowmaj-rd.dat + x-rowmaj-wr.dat + x-gnuplot +) + #-- Adding test for h5perf_serial SET (h5perf_serial_SRCS ${HDF5_PERFORM_SOURCE_DIR}/sio_timer.c @@ -18,19 +33,34 @@ SET (h5perf_serial_SRCS ${HDF5_PERFORM_SOURCE_DIR}/sio_engine.c ) ADD_EXECUTABLE (h5perf_serial ${h5perf_serial_SRCS}) -H5_NAMING (h5perf_serial) -TARGET_WIN_PROPERTIES (h5perf_serial) +H5_NAMING (h5perf_serial ${LIB_TYPE}) TARGET_LINK_LIBRARIES (h5perf_serial ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) ADD_TEST (NAME h5perf_serial COMMAND $<TARGET_FILE:h5perf_serial>) +IF (HDF5_BUILD_PERFORM_STANDALONE) + #-- Adding test for h5perf_serial_alone + SET (h5perf_serial_alone_SRCS + ${HDF5_PERFORM_SOURCE_DIR}/sio_timer.c + ${HDF5_PERFORM_SOURCE_DIR}/sio_perf.c + ${HDF5_PERFORM_SOURCE_DIR}/sio_engine.c + ) + ADD_EXECUTABLE (h5perf_serial_alone ${h5perf_serial_alone_SRCS}) + SET_PROPERTY (TARGET h5perf_serial_alone + APPEND PROPERTY COMPILE_DEFINITIONS STANDALONE + ) + H5_NAMING (h5perf_serial_alone ${LIB_TYPE}) + TARGET_LINK_LIBRARIES (h5perf_serial_alone ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + + ADD_TEST (NAME h5perf_serial_alone COMMAND $<TARGET_FILE:h5perf_serial_alone>) +ENDIF (HDF5_BUILD_PERFORM_STANDALONE) + #-- Adding test for chunk SET (chunk_SRCS ${HDF5_PERFORM_SOURCE_DIR}/chunk.c ) ADD_EXECUTABLE(chunk ${chunk_SRCS}) -H5_NAMING (chunk) -TARGET_WIN_PROPERTIES (chunk) +H5_NAMING (chunk ${LIB_TYPE}) TARGET_LINK_LIBRARIES(chunk ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) ADD_TEST (NAME chunk COMMAND $<TARGET_FILE:chunk>) @@ -40,8 +70,7 @@ SET (iopipe_SRCS ${HDF5_PERFORM_SOURCE_DIR}/iopipe.c ) ADD_EXECUTABLE (iopipe ${iopipe_SRCS}) -H5_NAMING (iopipe) -TARGET_WIN_PROPERTIES (iopipe) +H5_NAMING (iopipe ${LIB_TYPE}) TARGET_LINK_LIBRARIES (iopipe ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) ADD_TEST (NAME iopipe COMMAND $<TARGET_FILE:iopipe>) @@ -51,8 +80,7 @@ SET (overhead_SRCS ${HDF5_PERFORM_SOURCE_DIR}/overhead.c ) ADD_EXECUTABLE (overhead ${overhead_SRCS}) -H5_NAMING (overhead) -TARGET_WIN_PROPERTIES (overhead) +H5_NAMING (overhead ${LIB_TYPE}) TARGET_LINK_LIBRARIES (overhead ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) ADD_TEST (NAME overhead COMMAND $<TARGET_FILE:overhead>) @@ -62,8 +90,7 @@ SET (perf_meta_SRCS ${HDF5_PERFORM_SOURCE_DIR}/perf_meta.c ) ADD_EXECUTABLE (perf_meta ${perf_meta_SRCS}) -H5_NAMING (perf_meta) -TARGET_WIN_PROPERTIES (perf_meta) +H5_NAMING (perf_meta ${LIB_TYPE}) TARGET_LINK_LIBRARIES (perf_meta ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) ADD_TEST (NAME perf_meta COMMAND $<TARGET_FILE:perf_meta>) @@ -73,8 +100,7 @@ SET (zip_perf_SRCS ${HDF5_PERFORM_SOURCE_DIR}/zip_perf.c ) ADD_EXECUTABLE (zip_perf ${zip_perf_SRCS}) -H5_NAMING (zip_perf) -TARGET_WIN_PROPERTIES (zip_perf) +H5_NAMING (zip_perf ${LIB_TYPE}) TARGET_LINK_LIBRARIES (zip_perf ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) ADD_TEST (NAME zip_perf COMMAND $<TARGET_FILE:zip_perf> "-h") @@ -87,19 +113,34 @@ IF (H5_HAVE_PARALLEL) ${HDF5_PERFORM_SOURCE_DIR}/pio_engine.c ) ADD_EXECUTABLE (h5perf ${h5perf_SRCS}) - H5_NAMING (h5perf) - TARGET_WIN_PROPERTIESS (h5perf) + H5_NAMING (h5perf ${LIB_TYPE}) TARGET_LINK_LIBRARIES (h5perf ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) ADD_TEST (NAME h5perf COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $<TARGET_FILE:h5perf>) + IF (HDF5_BUILD_PERFORM_STANDALONE) + #-- Adding test for h5perf + SET (h5perf_alone_SRCS + ${HDF5_PERFORM_SOURCE_DIR}/pio_timer.c + ${HDF5_PERFORM_SOURCE_DIR}/pio_perf.c + ${HDF5_PERFORM_SOURCE_DIR}/pio_engine.c + ) + ADD_EXECUTABLE (h5perf_alone ${h5perf_alone_SRCS}) + SET_PROPERTY (TARGET h5perf_alone + APPEND PROPERTY COMPILE_DEFINITIONS STANDALONE + ) + H5_NAMING (h5perf_alone ${LIB_TYPE}) + TARGET_LINK_LIBRARIES (h5perf_alone ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) + + ADD_TEST (NAME h5perf_alone COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $<TARGET_FILE:h5perf_alone>) + ENDIF (HDF5_BUILD_PERFORM_STANDALONE) + #-- Adding test for benchpar SET (benchpar_SRCS ${HDF5_PERFORM_SOURCE_DIR}/benchpar.c ) ADD_EXECUTABLE (benchpar ${benchpar_SRCS}) - H5_NAMING (benchpar) - TARGET_WIN_PROPERTIES (benchpar) + H5_NAMING (benchpar ${LIB_TYPE}) TARGET_LINK_LIBRARIES (benchpar ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) ADD_TEST (NAME benchpar COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $<TARGET_FILE:benchpar>) @@ -109,8 +150,7 @@ IF (H5_HAVE_PARALLEL) ${HDF5_PERFORM_SOURCE_DIR}/mpi-perf.c ) ADD_EXECUTABLE (mpi-perf ${mpi-perf_SRCS}) - H5_NAMING (mpi-perf) - TARGET_WIN_PROPERTIES (mpi-perf) + H5_NAMING (mpi-perf ${LIB_TYPE}) TARGET_LINK_LIBRARIES (mpi-perf ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) ADD_TEST (NAME mpi-perf COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $<TARGET_FILE:mpi-perf>) diff --git a/perform/Makefile.am b/perform/Makefile.am index 6836a2b..4b44b43 100644 --- a/perform/Makefile.am +++ b/perform/Makefile.am @@ -23,11 +23,11 @@ include $(top_srcdir)/config/commence.am INCLUDES=-I$(top_srcdir)/src -I$(top_srcdir)/test -I$(top_srcdir)/tools/lib +# bin_PROGRAMS will be installed. if BUILD_PARALLEL_CONDITIONAL - bin_PROGRAMS=h5perf - TEST_PROG_PARA=h5perf perf + bin_PROGRAMS=h5perf_serial h5perf else - bin_PROGRAMS=h5perf_serial + bin_PROGRAMS=h5perf_serial endif # Add h5perf and h5perf_serial specific linker flags here @@ -38,16 +38,25 @@ h5perf_serial_LDFLAGS = $(LT_STATIC_EXEC) $(AM_LDFLAGS) # specifying --enable-build-all at configure time. # Also, some of these programs should only be built in parallel. if BUILD_PARALLEL_CONDITIONAL - PARA_BUILD_ALL=benchpar mpi-perf + PARA_BUILD_ALL=benchpar mpi-perf endif if BUILD_ALL_CONDITIONAL - BUILD_ALL_PROGS=$(PARA_BUILD_ALL) + BUILD_ALL_PROGS=$(PARA_BUILD_ALL) endif -# These are the programs that `make all' or `make tests' will build and which -# `make check' will run. List them in the order they should be run. +# Define programs that will be run in 'make check' +# List them in the order they should be run. +# Parallel test programs. +if BUILD_PARALLEL_CONDITIONAL + TEST_PROG_PARA=h5perf perf +endif +# Serial test programs. TEST_PROG = iopipe chunk overhead zip_perf perf_meta h5perf_serial $(BUILD_ALL_PROGS) -check_PROGRAMS=$(TEST_PROG_PARA) $(TEST_PROG) + +# check_PROGRAMS will be built but not installed. Do not any executable +# that is in bin_PROGRAMS already. Otherwise, it will be removed twice in +# "make clean" and some systems, e.g., AIX, do not like it. +check_PROGRAMS= iopipe chunk overhead zip_perf perf_meta $(BUILD_ALL_PROGS) perf h5perf_SOURCES=pio_perf.c pio_engine.c pio_timer.c h5perf_serial_SOURCES=sio_perf.c sio_engine.c sio_timer.c diff --git a/perform/Makefile.in b/perform/Makefile.in index e2e05b8..d79c2de 100644 --- a/perform/Makefile.in +++ b/perform/Makefile.in @@ -56,8 +56,12 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/config/conclude.am COPYING @BUILD_PARALLEL_CONDITIONAL_FALSE@bin_PROGRAMS = \ @BUILD_PARALLEL_CONDITIONAL_FALSE@ h5perf_serial$(EXEEXT) -@BUILD_PARALLEL_CONDITIONAL_TRUE@bin_PROGRAMS = h5perf$(EXEEXT) -check_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_4) +@BUILD_PARALLEL_CONDITIONAL_TRUE@bin_PROGRAMS = \ +@BUILD_PARALLEL_CONDITIONAL_TRUE@ h5perf_serial$(EXEEXT) \ +@BUILD_PARALLEL_CONDITIONAL_TRUE@ h5perf$(EXEEXT) +check_PROGRAMS = iopipe$(EXEEXT) chunk$(EXEEXT) overhead$(EXEEXT) \ + zip_perf$(EXEEXT) perf_meta$(EXEEXT) $(am__EXEEXT_2) \ + perf$(EXEEXT) TESTS = $(check_PROGRAMS) subdir = perform ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -69,14 +73,9 @@ CONFIG_HEADER = $(top_builddir)/src/H5config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" -@BUILD_PARALLEL_CONDITIONAL_TRUE@am__EXEEXT_1 = h5perf$(EXEEXT) \ -@BUILD_PARALLEL_CONDITIONAL_TRUE@ perf$(EXEEXT) -@BUILD_PARALLEL_CONDITIONAL_TRUE@am__EXEEXT_2 = benchpar$(EXEEXT) \ +@BUILD_PARALLEL_CONDITIONAL_TRUE@am__EXEEXT_1 = benchpar$(EXEEXT) \ @BUILD_PARALLEL_CONDITIONAL_TRUE@ mpi-perf$(EXEEXT) -@BUILD_ALL_CONDITIONAL_TRUE@am__EXEEXT_3 = $(am__EXEEXT_2) -am__EXEEXT_4 = iopipe$(EXEEXT) chunk$(EXEEXT) overhead$(EXEEXT) \ - zip_perf$(EXEEXT) perf_meta$(EXEEXT) h5perf_serial$(EXEEXT) \ - $(am__EXEEXT_3) +@BUILD_ALL_CONDITIONAL_TRUE@am__EXEEXT_2 = $(am__EXEEXT_1) PROGRAMS = $(bin_PROGRAMS) benchpar_SOURCES = benchpar.c benchpar_OBJECTS = benchpar.$(OBJEXT) @@ -190,6 +189,7 @@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPRECATED_SYMBOLS = @DEPRECATED_SYMBOLS@ DIRECT_VFD = @DIRECT_VFD@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ DYNAMIC_DIRS = @DYNAMIC_DIRS@ @@ -251,6 +251,7 @@ LTLIBOBJS = @LTLIBOBJS@ LT_STATIC_EXEC = @LT_STATIC_EXEC@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MPE = @MPE@ MPI_GET_SIZE = @MPI_GET_SIZE@ @@ -307,6 +308,7 @@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -414,7 +416,6 @@ TRACE = perl $(top_srcdir)/bin/trace # *.clog are from the MPE option. CHECK_CLEANFILES = *.chkexe *.chklog *.clog INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/test -I$(top_srcdir)/tools/lib -@BUILD_PARALLEL_CONDITIONAL_TRUE@TEST_PROG_PARA = h5perf perf # Add h5perf and h5perf_serial specific linker flags here h5perf_LDFLAGS = $(LT_STATIC_EXEC) $(AM_LDFLAGS) @@ -426,8 +427,11 @@ h5perf_serial_LDFLAGS = $(LT_STATIC_EXEC) $(AM_LDFLAGS) @BUILD_PARALLEL_CONDITIONAL_TRUE@PARA_BUILD_ALL = benchpar mpi-perf @BUILD_ALL_CONDITIONAL_TRUE@BUILD_ALL_PROGS = $(PARA_BUILD_ALL) -# These are the programs that `make all' or `make tests' will build and which -# `make check' will run. List them in the order they should be run. +# Define programs that will be run in 'make check' +# List them in the order they should be run. +# Parallel test programs. +@BUILD_PARALLEL_CONDITIONAL_TRUE@TEST_PROG_PARA = h5perf perf +# Serial test programs. TEST_PROG = iopipe chunk overhead zip_perf perf_meta h5perf_serial $(BUILD_ALL_PROGS) h5perf_SOURCES = pio_perf.c pio_engine.c pio_timer.c h5perf_serial_SOURCES = sio_perf.c sio_engine.c sio_timer.c diff --git a/perform/iopipe.c b/perform/iopipe.c index 77d4fc8..c72e3aa 100644 --- a/perform/iopipe.c +++ b/perform/iopipe.c @@ -21,15 +21,6 @@ /* See H5private.h for how to include headers */ #include "hdf5.h" -#if defined (__MWERKS__) -#ifdef H5_HAVE_SYS_TIMEB -#undef H5_HAVE_SYS_TIMEB -#endif -#ifdef H5_HAVE_SYSTEM -#undef H5_HAVE_SYSTEM -#endif -#endif /* __MWERKS__*/ - #include "H5private.h" #ifdef H5_HAVE_SYS_TIMEB @@ -142,18 +133,10 @@ synchronize (void) { #ifdef H5_HAVE_SYSTEM #if defined(_WIN32) && ! defined(__CYGWIN__) - _flushall(); + _flushall(); #else - HDsystem ("sync"); - HDsystem ("df >/dev/null"); -#endif -#if 0 - /* - * This works well on Linux to get rid of all cached disk buffers. The - * number should be approximately the amount of RAM in MB. Do not - * include swap space in that amount or the command will fail. - */ - system ("/sbin/swapout 128"); + HDsystem("sync"); + HDsystem("df >/dev/null"); #endif #endif } @@ -179,10 +162,10 @@ int main (void) { static hsize_t size[2] = {REQUEST_SIZE_X, REQUEST_SIZE_Y}; - static int nread=NREAD_REQUESTS, nwrite=NWRITE_REQUESTS; + static unsigned nread = NREAD_REQUESTS, nwrite = NWRITE_REQUESTS; unsigned char *the_data = NULL; - hid_t file, dset, file_space=-1; + hid_t file, dset, file_space = -1; herr_t status; #ifdef H5_HAVE_GETRUSAGE struct rusage r_start, r_stop; @@ -190,7 +173,8 @@ main (void) struct timeval r_start, r_stop; #endif struct timeval t_start, t_stop; - int i, fd; + int fd; + unsigned u; hssize_t n; off_t offset; hsize_t start[2]; @@ -220,35 +204,34 @@ main (void) assert(file_space >= 0); dset = H5Dcreate2(file, "dset", H5T_NATIVE_UCHAR, file_space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); assert(dset >= 0); - the_data = malloc((size_t)(size[0] * size[1])); + the_data = (unsigned char *)malloc((size_t)(size[0] * size[1])); /* initial fill for lazy malloc */ - memset(the_data, 0xAA, (size_t)(size[0] * size[1])); + HDmemset(the_data, 0xAA, (size_t)(size[0] * size[1])); /* Fill raw */ synchronize (); #ifdef H5_HAVE_GETRUSAGE -printf("Before getrusage() call\n"); - getrusage (RUSAGE_SELF, &r_start); + HDgetrusage(RUSAGE_SELF, &r_start); #endif #ifdef H5_HAVE_GETTIMEOFDAY - gettimeofday (&t_start, NULL); + HDgettimeofday(&t_start, NULL); #else #ifdef H5_HAVE_SYS_TIMEB _ftime(tbstart); #endif #endif fprintf (stderr, HEADING, "fill raw"); - for (i=0; i<nwrite; i++) { + for(u = 0; u < nwrite; u++) { putc (PROGRESS, stderr); - fflush (stderr); - memset (the_data, 0xAA, (size_t)(size[0]*size[1])); + HDfflush(stderr); + HDmemset(the_data, 0xAA, (size_t)(size[0]*size[1])); } #ifdef H5_HAVE_GETRUSAGE - getrusage (RUSAGE_SELF, &r_stop); + HDgetrusage(RUSAGE_SELF, &r_stop); #endif #ifdef H5_HAVE_GETTIMEOFDAY - gettimeofday (&t_stop, NULL); + HDgettimeofday(&t_stop, NULL); #else #ifdef H5_HAVE_SYS_TIMEB _ftime(tbstop); @@ -267,28 +250,28 @@ printf("Before getrusage() call\n"); /* Fill hdf5 */ synchronize (); #ifdef H5_HAVE_GETRUSAGE - getrusage (RUSAGE_SELF, &r_start); + HDgetrusage(RUSAGE_SELF, &r_start); #endif #ifdef H5_HAVE_GETTIMEOFDAY - gettimeofday (&t_start, NULL); + HDgettimeofday(&t_start, NULL); #else #ifdef H5_HAVE_SYS_TIMEB _ftime(tbstart); #endif #endif fprintf (stderr, HEADING, "fill hdf5"); - for (i=0; i<nread; i++) { + for(u = 0; u < nread; u++) { putc (PROGRESS, stderr); - fflush (stderr); + HDfflush(stderr); status = H5Dread (dset, H5T_NATIVE_UCHAR, file_space, file_space, H5P_DEFAULT, the_data); assert (status>=0); } #ifdef H5_HAVE_GETRUSAGE - getrusage (RUSAGE_SELF, &r_stop); + HDgetrusage(RUSAGE_SELF, &r_stop); #endif #ifdef H5_HAVE_GETTIMEOFDAY - gettimeofday (&t_stop, NULL); + HDgettimeofday(&t_stop, NULL); #else #ifdef H5_HAVE_SYS_TIMEB _ftime(tbstop); @@ -306,29 +289,29 @@ printf("Before getrusage() call\n"); /* Write the raw dataset */ synchronize (); #ifdef H5_HAVE_GETRUSAGE - getrusage (RUSAGE_SELF, &r_start); + HDgetrusage(RUSAGE_SELF, &r_start); #endif #ifdef H5_HAVE_GETTIMEOFDAY - gettimeofday (&t_start, NULL); + HDgettimeofday(&t_start, NULL); #else #ifdef H5_HAVE_SYS_TIMEB _ftime(tbstart); #endif #endif fprintf (stderr, HEADING, "out raw"); - for (i=0; i<nwrite; i++) { + for(u = 0; u < nwrite; u++) { putc (PROGRESS, stderr); - fflush (stderr); + HDfflush(stderr); offset = HDlseek (fd, (off_t)0, SEEK_SET); assert (0==offset); n = HDwrite (fd, the_data, (size_t)(size[0]*size[1])); assert (n>=0 && (size_t)n==size[0]*size[1]); } #ifdef H5_HAVE_GETRUSAGE - getrusage (RUSAGE_SELF, &r_stop); + HDgetrusage(RUSAGE_SELF, &r_stop); #endif #ifdef H5_HAVE_GETTIMEOFDAY - gettimeofday (&t_stop, NULL); + HDgettimeofday(&t_stop, NULL); #else #ifdef H5_HAVE_SYS_TIMEB _ftime(tbstop); @@ -346,28 +329,28 @@ printf("Before getrusage() call\n"); /* Write the hdf5 dataset */ synchronize (); #ifdef H5_HAVE_GETRUSAGE - getrusage (RUSAGE_SELF, &r_start); + HDgetrusage(RUSAGE_SELF, &r_start); #endif #ifdef H5_HAVE_GETTIMEOFDAY - gettimeofday (&t_start, NULL); + HDgettimeofday(&t_start, NULL); #else #ifdef H5_HAVE_SYS_TIMEB _ftime(tbstart); #endif #endif fprintf (stderr, HEADING, "out hdf5"); - for (i=0; i<nwrite; i++) { + for(u = 0; u < nwrite; u++) { putc (PROGRESS, stderr); - fflush (stderr); + HDfflush(stderr); status = H5Dwrite (dset, H5T_NATIVE_UCHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT, the_data); assert (status>=0); } #ifdef H5_HAVE_GETRUSAGE - getrusage (RUSAGE_SELF, &r_stop); + HDgetrusage(RUSAGE_SELF, &r_stop); #endif #ifdef H5_HAVE_GETTIMEOFDAY - gettimeofday (&t_stop, NULL); + HDgettimeofday(&t_stop, NULL); #else #ifdef H5_HAVE_SYS_TIMEB _ftime(tbstop); @@ -385,29 +368,29 @@ printf("Before getrusage() call\n"); /* Read the raw dataset */ synchronize (); #ifdef H5_HAVE_GETRUSAGE - getrusage (RUSAGE_SELF, &r_start); + HDgetrusage(RUSAGE_SELF, &r_start); #endif #ifdef H5_HAVE_GETTIMEOFDAY - gettimeofday (&t_start, NULL); + HDgettimeofday(&t_start, NULL); #else #ifdef H5_HAVE_SYS_TIMEB _ftime(tbstart); #endif #endif fprintf (stderr, HEADING, "in raw"); - for (i=0; i<nread; i++) { + for(u = 0; u < nread; u++) { putc (PROGRESS, stderr); - fflush (stderr); + HDfflush(stderr); offset = HDlseek (fd, (off_t)0, SEEK_SET); assert (0==offset); n = HDread (fd, the_data, (size_t)(size[0]*size[1])); assert (n>=0 && (size_t)n==size[0]*size[1]); } #ifdef H5_HAVE_GETRUSAGE - getrusage (RUSAGE_SELF, &r_stop); + HDgetrusage(RUSAGE_SELF, &r_stop); #endif #ifdef H5_HAVE_GETTIMEOFDAY - gettimeofday (&t_stop, NULL); + HDgettimeofday(&t_stop, NULL); #else #ifdef H5_HAVE_SYS_TIMEB _ftime(tbstop); @@ -426,28 +409,28 @@ printf("Before getrusage() call\n"); /* Read the hdf5 dataset */ synchronize (); #ifdef H5_HAVE_GETRUSAGE - getrusage (RUSAGE_SELF, &r_start); + HDgetrusage(RUSAGE_SELF, &r_start); #endif #ifdef H5_HAVE_GETTIMEOFDAY - gettimeofday (&t_start, NULL); + HDgettimeofday(&t_start, NULL); #else #ifdef H5_HAVE_SYS_TIMEB _ftime(tbstart); #endif #endif fprintf (stderr, HEADING, "in hdf5"); - for (i=0; i<nread; i++) { + for(u = 0; u < nread; u++) { putc (PROGRESS, stderr); - fflush (stderr); + HDfflush(stderr); status = H5Dread (dset, H5T_NATIVE_UCHAR, file_space, file_space, H5P_DEFAULT, the_data); assert (status>=0); } #ifdef H5_HAVE_GETRUSAGE - getrusage (RUSAGE_SELF, &r_stop); + HDgetrusage(RUSAGE_SELF, &r_stop); #endif #ifdef H5_HAVE_GETTIMEOFDAY - gettimeofday (&t_stop, NULL); + HDgettimeofday(&t_stop, NULL); #else #ifdef H5_HAVE_SYS_TIMEB _ftime(tbstop); @@ -470,28 +453,28 @@ printf("Before getrusage() call\n"); assert (status>=0); synchronize (); #ifdef H5_HAVE_GETRUSAGE - getrusage (RUSAGE_SELF, &r_start); + HDgetrusage(RUSAGE_SELF, &r_start); #endif #ifdef H5_HAVE_GETTIMEOFDAY - gettimeofday (&t_start, NULL); + HDgettimeofday(&t_start, NULL); #else #ifdef H5_HAVE_SYS_TIMEB _ftime(tbstart); #endif #endif fprintf (stderr, HEADING, "in hdf5 partial"); - for (i=0; i<nread; i++) { + for(u = 0; u < nread; u++) { putc (PROGRESS, stderr); - fflush (stderr); + HDfflush(stderr); status = H5Dread (dset, H5T_NATIVE_UCHAR, file_space, file_space, H5P_DEFAULT, the_data); assert (status>=0); } #ifdef H5_HAVE_GETRUSAGE - getrusage (RUSAGE_SELF, &r_stop); + HDgetrusage(RUSAGE_SELF, &r_stop); #endif #ifdef H5_HAVE_GETTIMEOFDAY - gettimeofday (&t_stop, NULL); + HDgettimeofday(&t_stop, NULL); #else #ifdef H5_HAVE_SYS_TIMEB _ftime(tbstop); @@ -501,18 +484,20 @@ printf("Before getrusage() call\n"); t_stop.tv_usec = tbstop->millitm; #endif #endif - putc ('\n', stderr); - print_stats ("in hdf5 partial", + putc('\n', stderr); + print_stats("in hdf5 partial", &r_start, &r_stop, &t_start, &t_stop, (size_t)(nread*count[0]*count[1])); /* Close everything */ - HDclose (fd); - H5Dclose (dset); - H5Sclose (file_space); - H5Fclose (file); + HDclose(fd); + H5Dclose(dset); + H5Sclose(file_space); + H5Fclose(file); + free(the_data); return 0; } + diff --git a/perform/overhead.c b/perform/overhead.c index 5076103..cfd96b8 100644 --- a/perform/overhead.c +++ b/perform/overhead.c @@ -220,15 +220,8 @@ test(fill_t fill_style, const double splits[], if((fspace = H5Screate_simple(1, cur_size, max_size)) < 0) goto error; if((mspace = H5Screate_simple(1, ch_size, ch_size)) < 0) goto error; if((dset = H5Dcreate2(file, "chunked", H5T_NATIVE_INT, - fspace, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error; - -#if !defined( __MWERKS__) - - /* - workaround for a bug in the Metrowerks version 6.0 open function - */ + fspace, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error; if ((fd=HDopen(FILE_NAME_1, O_RDONLY, 0666)) < 0) goto error; -#endif for (i=1; i<=cur_size[0]; i++) { @@ -264,8 +257,6 @@ test(fill_t fill_style, const double splits[], } -#if !defined( __MWERKS__) - /* Determine overhead */ if (verbose) { if (H5Fflush(file, H5F_SCOPE_LOCAL) < 0) goto error; @@ -279,7 +270,6 @@ test(fill_t fill_style, const double splits[], (unsigned long)i, (double)(hssize_t)(sb.st_size-i*sizeof(int))/(hssize_t)i); } -#endif } @@ -312,20 +302,14 @@ test(fill_t fill_style, const double splits[], abort(); } -#if !defined( __MWERKS__) - if (HDfstat(fd, &sb) < 0) goto error; printf("%-7s %8.3f\n", sname, (double)(hssize_t)(sb.st_size-cur_size[0]*sizeof(int))/ (hssize_t)cur_size[0]); -#endif - } -#if !defined( __MWERKS__) HDclose(fd); -#endif return 0; diff --git a/perform/pio_standalone.h b/perform/pio_standalone.h index ab4ee94..a4bc8b5 100644 --- a/perform/pio_standalone.h +++ b/perform/pio_standalone.h @@ -60,62 +60,41 @@ extern char *strdup(const char *s); #endif /* _WIN32 */ H5_DLL int HDfprintf (FILE *stream, const char *fmt, ...); -#define HDstrcmp(S,T) strcmp(S,T) -#define HDstrlen(S) strlen(S) -#define HDstrncmp(S,T,L) strncmp(S,T,L) -#define HDstrncpy(X,Y,Z) strncpy(X,Y,Z) -#define HDstrchr(S,C) strchr(S,C) -#define HDfree(M) free(M) +#define HDstrcmp(S,T) strcmp(S,T) +#define HDstrlen(S) strlen(S) +#define HDstrncmp(S,T,L) strncmp(S,T,L) +#define HDstrncpy(X,Y,Z) strncpy(X,Y,Z) +#define HDstrchr(S,C) strchr(S,C) +#define HDfree(M) free(M) #ifdef _O_BINARY -#define HDopen(S,F,M) open(S,F|_O_BINARY,M) +#define HDopen(S,F,M) open(S,F|_O_BINARY,M) #else -#define HDopen(S,F,M) open(S,F,M) +#define HDopen(S,F,M) open(S,F,M) #endif -#define HDclose(F) close(F) +#define HDclose(F) close(F) #ifdef _WIN32 - #ifdef __MWERKS__ - #define HDlseek(F,O,W) lseek(F,O,W) - #else /*MSVS */ - #define HDlseek(F,O,W) _lseeki64(F,O,W) - #endif +#define HDlseek(F,O,W) _lseeki64(F,O,W) #else -#define HDlseek(F,O,W) lseek(F,O,W) +#define HDlseek(F,O,W) lseek(F,O,W) #endif -#if defined (__MWERKS__) -/* workaround for a bug in the Metrowerks version 6.0 header file for write - which is not defined as const void* - */ -#define HDwrite(F,M,Z) write(F,(void*)M,Z) -#else #define HDwrite(F,M,Z) write(F,M,Z) -#endif #define HDread(F,M,Z) read(F,M,Z) #ifdef _WIN32 - #ifdef __MWERKS__ - #define HDstat(S,B) stat(S,B) - #else /*MSVC*/ #define HDstat(S,B) _stati64(S,B) - #endif #else #define HDstat(S,B) stat(S,B) #endif #ifdef _WIN32 - #ifdef __MWERKS__ - #define HDfstat(F,B) fstat(F,B) - typedef struct stat h5_stat_t; - typedef off_t h5_stat_size_t; - #else /*MSVC*/ - #define HDfstat(F,B) _fstati64(F,B) - typedef struct _stati64 h5_stat_t; - typedef __int64 h5_stat_size_t; - #endif +#define HDfstat(F,B) _fstati64(F,B) +typedef struct _stati64 h5_stat_t; +typedef __int64 h5_stat_size_t; #else #define HDfstat(F,B) fstat(F,B) typedef struct stat h5_stat_t; diff --git a/perform/sio_engine.c b/perform/sio_engine.c index 978ac03..e892bcc 100644 --- a/perform/sio_engine.c +++ b/perform/sio_engine.c @@ -98,7 +98,7 @@ static herr_t do_write(results *res, file_descr *fd, parameters *parms, void *bu static herr_t do_read(results *res, file_descr *fd, parameters *parms, void *buffer); static herr_t dset_write(int local_dim, file_descr *fd, parameters *parms, void *buffer); static herr_t posix_buffer_write(int local_dim, file_descr *fd, parameters *parms, void *buffer); -static herr_t dset_read(int localrank, file_descr *fd, parameters *parms, void *buffer); +static herr_t dset_read(int localrank, file_descr *fd, parameters *parms, void *buffer, const char *buffer2); static herr_t posix_buffer_read(int local_dim, file_descr *fd, parameters *parms, void *buffer); static herr_t do_fopen(parameters *param, char *fname, file_descr *fd /*out*/, int flags); @@ -130,7 +130,6 @@ static size_t cont_size; /* size of contiguous POSIX access */ static hid_t fapl; /* file access list */ static unsigned char *buf_p; /* buffer pointer */ static const char *multi_letters = "msbrglo"; /* string for multi driver */ -static char *buffer2=NULL; /* buffer for data verification */ /* HDF5 global variables */ static hsize_t h5count[MAX_DIMS]; /*selection count */ @@ -212,10 +211,8 @@ do_sio(parameters param) } /* Allocate transfer buffer */ - buffer2 = malloc(linear_buf_size); if ((buffer = malloc(linear_buf_size)) == NULL){ - HDfprintf(stderr, "malloc for transfer buffer size (%Hd) failed\n", - (long long)(linear_buf_size)); + HDfprintf(stderr, "malloc for transfer buffer size (%Hd) failed\n", (long long)(linear_buf_size)); GOTOERROR(FAIL); } @@ -404,10 +401,10 @@ sio_create_filename(iotype iot, const char *base_name, char *fullname, size_t si /* Remove any double slashes in the filename */ for (ptr = fullname, i = j = 0; ptr && (i < size); i++, ptr++) { - if (*ptr != '/' || last != '/') - fullname[j++] = *ptr; + if (*ptr != '/' || last != '/') + fullname[j++] = *ptr; - last = *ptr; + last = *ptr; } return fullname; @@ -766,6 +763,7 @@ done: static herr_t do_read(results *res, file_descr *fd, parameters *parms, void *buffer) { + char *buffer2 = NULL; /* Buffer for data verification */ int ret_code = SUCCESS; char dname[64]; long i; @@ -777,14 +775,19 @@ do_read(results *res, file_descr *fd, parameters *parms, void *buffer) hsize_t h5start[MAX_DIMS]; /*selection start */ int rank; - /* Prepare buffer for verifying data */ - for (i=0; i < linear_buf_size; i++) - buffer2[i]=i%128; + /* Allocate data verification buffer */ + if(NULL == (buffer2 = (char *)malloc(linear_buf_size))) { + HDfprintf(stderr, "malloc for data verification buffer size (%Zu) failed\n", linear_buf_size); + GOTOERROR(FAIL); + } /* end if */ + + /* Prepare buffer for verifying data */ + for(i = 0; i < linear_buf_size; i++) + buffer2[i] = i % 128; rank = parms->rank; - for (i=0; i<rank; i++) { + for(i = 0; i < rank; i++) h5offset[i] = offset[i] = 0; - } /* I/O Access specific setup */ switch (parms->io_type) { @@ -853,7 +856,7 @@ do_read(results *res, file_descr *fd, parameters *parms, void *buffer) /* Start "raw data" read timer */ set_time(res->timers, HDF5_RAW_READ_FIXED_DIMS, START); - hrc = dset_read(rank-1, fd, parms, buffer); + hrc = dset_read(rank-1, fd, parms, buffer, buffer2); if (hrc < 0) { fprintf(stderr, "Error in dataset read\n"); @@ -910,6 +913,10 @@ done: } } + /* release generic resources */ + if(buffer2) + free(buffer2); + return ret_code; } @@ -921,7 +928,8 @@ done: * Modifications: */ -static herr_t dset_read(int local_dim, file_descr *fd, parameters *parms, void *buffer) +static herr_t dset_read(int local_dim, file_descr *fd, parameters *parms, + void *buffer, const char *buffer2) { int cur_dim = order[local_dim]-1; int ret_code = SUCCESS; @@ -936,7 +944,7 @@ static herr_t dset_read(int local_dim, file_descr *fd, parameters *parms, void * /* if traverse in order array is incomplete, recurse */ if (local_dim > 0){ - ret_code = dset_read(local_dim-1, fd, parms, buffer); + ret_code = dset_read(local_dim-1, fd, parms, buffer, buffer2); /* otherwise, write buffer into dataset */ }else{ diff --git a/perform/sio_standalone.h b/perform/sio_standalone.h index 7c4810b..77bb7f8 100644 --- a/perform/sio_standalone.h +++ b/perform/sio_standalone.h @@ -114,12 +114,7 @@ #define HDexecve(S,AV,E) execve(S,AV,E) #define HDexecvp(S,AV) execvp(S,AV) #define HDexit(N) exit(N) -#if defined __MWERKS__ -#include <abort_exit.h> -#define HD_exit(N) __exit(N) -#else /* __MWERKS __ */ #define HD_exit(N) _exit(N) -#endif /* __MWERKS __ */ #define HDexp(X) exp(X) #define HDfabs(X) fabs(X) /* use ABS() because fabsf() fabsl() are not common yet. */ @@ -175,19 +170,11 @@ H5_DLL int HDfprintf (FILE *stream, const char *fmt, ...); * xxx64 versions if available. */ #ifdef _WIN32 - #ifdef __MWERKS__ - #define HDfstat(F,B) fstat(F,B) - #define HDlstat(S,B) lstat(S,B) - #define HDstat(S,B) stat(S,B) - typedef struct stat h5_stat_t; - typedef off_t h5_stat_size_t; - #else /*MSVC*/ #define HDfstat(F,B) _fstati64(F,B) #define HDlstat(S,B) _lstati64(S,B) #define HDstat(S,B) _stati64(S,B) typedef struct _stati64 h5_stat_t; typedef __int64 h5_stat_size_t; - #endif #elif H5_SIZEOF_OFF_T!=8 && H5_SIZEOF_OFF64_T==8 && defined(H5_HAVE_STAT64) #define HDfstat(F,B) fstat64(F,B) #define HDlstat(S,B) lstat64(S,B) @@ -249,17 +236,13 @@ H5_DLL int HDfprintf (FILE *stream, const char *fmt, ...); #define HDlog10(X) log10(X) #define HDlongjmp(J,N) longjmp(J,N) #ifdef _WIN32 - #ifdef __MWERKS__ - #define HDlseek(F,O,W) lseek(F,O,W) - #else /*MSVS */ - #define HDlseek(F,O,W) _lseeki64(F,O,W) - #endif + #define HDlseek(F,O,W) _lseeki64(F,O,W) #else - #ifdef H5_HAVE_LSEEK64 + #ifdef H5_HAVE_LSEEK64 #define HDlseek(F,O,W) lseek64(F,O,W) - #else + #else #define HDlseek(F,O,W) lseek(F,O,W) - #endif + #endif #endif #define HDmalloc(Z) malloc(Z) #define HDposix_memalign(P,A,Z) posix_memalign(P,A,Z) @@ -454,15 +437,7 @@ H5_DLL int64_t HDstrtoll (const char *s, const char **rest, int base); #define HDwaitpid(P,W,O) waitpid(P,W,O) #define HDwcstombs(S,P,Z) wcstombs(S,P,Z) #define HDwctomb(S,C) wctomb(S,C) - -#if defined (__MWERKS__) -/* workaround for a bug in the Metrowerks version 6.0 header file for write - which is not defined as const void* - */ -#define HDwrite(F,M,Z) write(F,(void*)M,Z) -#else #define HDwrite(F,M,Z) write(F,M,Z) -#endif /* * And now for a couple non-Posix functions... Watch out for systems that diff --git a/perform/sio_timer.h b/perform/sio_timer.h index 82f053d..1fa880d 100644 --- a/perform/sio_timer.h +++ b/perform/sio_timer.h @@ -26,9 +26,9 @@ # include <time.h> #endif -#ifdef _WIN32 +#ifdef H5_HAVE_WINSOCK_H # include <winsock2.h> -#endif /* _WIN32 */ +#endif /* H5_HAVE_WINSOCK_H */ /* The different types of timers we can have */ typedef enum timer_type_ { diff --git a/perform/zip_perf.c b/perform/zip_perf.c index 7d96405..08177d8 100644 --- a/perform/zip_perf.c +++ b/perform/zip_perf.c @@ -62,10 +62,6 @@ # define fileno(file) file->__file #endif /* RISCOS */ -#if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os -# include <unix.h> /* for fileno */ -#endif /* __MWERKS__ ... */ - #ifndef GZ_SUFFIX # define GZ_SUFFIX ".gz" #endif /* GZ_SUFFIX */ |