From 394f6f50bfaeef0a68b7c363db523305aa0882e2 Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Tue, 3 Mar 2015 00:08:02 -0500 Subject: [svn-r26345] Bring revisions #25902 - #25971 from trunk to revise_chunks. h5committested. --- CMakeLists.txt | 3 - MANIFEST | 18 +- Makefile.am | 4 +- Makefile.in | 4 +- README.txt | 2 +- c++/src/Makefile.in | 2 +- config/cmake/ConfigureChecks.cmake | 9 - config/lt_vers.am | 2 +- configure | 28 +-- configure.ac | 8 +- fortran/src/H5Af.c | 2 +- fortran/src/H5Aff_F03.f90 | 5 +- fortran/src/H5f90proto.h | 3 +- fortran/src/Makefile.in | 2 +- fortran/test/tH5P.f90 | 2 +- hl/c++/src/Makefile.in | 2 +- hl/fortran/src/Makefile.in | 2 +- hl/src/Makefile.in | 2 +- release_docs/RELEASE.txt | 9 +- src/H5F.c | 11 +- src/H5FD.c | 6 +- src/H5FDcore.c | 6 +- src/H5FDdirect.c | 6 +- src/H5FDfamily.c | 10 +- src/H5FDint.c | 11 +- src/H5FDlog.c | 6 +- src/H5FDmpio.c | 52 +++- src/H5FDmulti.c | 88 ++++--- src/H5FDprivate.h | 2 +- src/H5FDpublic.h | 4 +- src/H5FDsec2.c | 6 +- src/H5FDstdio.c | 6 +- src/H5Fint.c | 2 +- src/H5Fsuper_cache.c | 47 ++-- src/H5Ofill.c | 4 +- src/H5Smpio.c | 9 +- src/H5public.h | 4 +- src/Makefile.in | 2 +- test/testmeta.c | 8 +- testpar/t_chunk_alloc.c | 2 +- testpar/t_pflush2.c | 20 +- testpar/t_shapesame.c | 6 +- testpar/testphdf5.c | 6 +- tools/h5dump/CMakeTestsXML.cmake | 4 +- tools/lib/CMakeLists.txt | 1 + tools/lib/Makefile.am | 2 +- tools/lib/Makefile.in | 5 +- tools/lib/io_timer.c | 232 ++++++++++++++++++ tools/lib/io_timer.h | 83 +++++++ tools/perform/CMakeLists.txt | 38 +-- tools/perform/CMakeTests.cmake | 4 - tools/perform/Makefile.am | 4 +- tools/perform/Makefile.in | 12 +- tools/perform/benchpar.c | 488 ------------------------------------- tools/perform/pio_engine.c | 7 +- tools/perform/pio_perf.c | 54 +++- tools/perform/pio_perf.h | 6 +- tools/perform/pio_timer.c | 258 -------------------- tools/perform/pio_timer.h | 82 ------- tools/perform/sio_engine.c | 5 +- tools/perform/sio_perf.c | 49 +++- tools/perform/sio_perf.h | 6 +- tools/perform/sio_timer.c | 197 --------------- tools/perform/sio_timer.h | 78 ------ vms/src/h5pubconf.h | 6 +- 65 files changed, 692 insertions(+), 1362 deletions(-) create mode 100644 tools/lib/io_timer.c create mode 100644 tools/lib/io_timer.h delete mode 100644 tools/perform/benchpar.c delete mode 100644 tools/perform/pio_timer.c delete mode 100644 tools/perform/pio_timer.h delete mode 100644 tools/perform/sio_timer.c delete mode 100644 tools/perform/sio_timer.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 8edffdb..9a8b276 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -773,9 +773,6 @@ if (BUILD_TESTING) add_subdirectory (${HDF5_SOURCE_DIR}/tools/lib ${PROJECT_BINARY_DIR}/tools/lib) add_subdirectory (${HDF5_SOURCE_DIR}/test ${PROJECT_BINARY_DIR}/test) endif (EXISTS "${HDF5_SOURCE_DIR}/test" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/test") -# if (EXISTS "${HDF5_SOURCE_DIR}/perform" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/perform") -# add_subdirectory (${HDF5_SOURCE_DIR}/perform ${PROJECT_BINARY_DIR}/perform) -# endif (EXISTS "${HDF5_SOURCE_DIR}/perform" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/perform") if (H5_HAVE_PARALLEL) if (EXISTS "${HDF5_SOURCE_DIR}/testpar" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/testpar") add_subdirectory (${HDF5_SOURCE_DIR}/testpar ${PROJECT_BINARY_DIR}/testpar) diff --git a/MANIFEST b/MANIFEST index 48c5732..5ece5cb 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1338,6 +1338,8 @@ ./tools/lib/h5tools_type.c ./tools/lib/ph5diff.h ./tools/lib/h5tools_error.h +./tools/lib/io_timer.c +./tools/lib/io_timer.h ./tools/misc/Makefile.am ./tools/misc/Makefile.in @@ -2259,7 +2261,6 @@ ./tools/perform/COPYING ./tools/perform/Makefile.am ./tools/perform/Makefile.in -./tools/perform/benchpar.c ./tools/perform/build_h5perf_alone.sh ./tools/perform/build_h5perf_serial_alone.sh ./tools/perform/chunk.c @@ -2273,18 +2274,13 @@ ./tools/perform/pio_perf.h ./tools/perform/pio_standalone.c ./tools/perform/pio_standalone.h -./tools/perform/pio_timer.c -./tools/perform/pio_timer.h ./tools/perform/sio_engine.c ./tools/perform/sio_perf.c ./tools/perform/sio_perf.h ./tools/perform/sio_standalone.c ./tools/perform/sio_standalone.h -./tools/perform/sio_timer.c -./tools/perform/sio_timer.h ./tools/perform/zip_perf.c - # high level libraries ./hl/COPYING ./hl/Makefile.am @@ -2429,25 +2425,16 @@ ./hl/tools/testfiles/w-ext-cmpd.ddl ./hl/tools/testfiles/w-ext-cmpd-esc.ddl ./hl/tools/testfiles/w-ext-cmpd-esc-f1.ddl -./hl/tools/testfiles/w-ext-cmpd-esc-f2.ddl ./hl/tools/testfiles/w-ext-cmpd-esc-f3.ddl -./hl/tools/testfiles/w-ext-cmpd-esc-ff1.ddl ./hl/tools/testfiles/w-ext-cmpd-esc-ff2.ddl -./hl/tools/testfiles/w-ext-cmpd-esc-ff3.ddl ./hl/tools/testfiles/w-ext-cmpd-f1.ddl ./hl/tools/testfiles/w-ext-cmpd-f2.ddl -./hl/tools/testfiles/w-ext-cmpd-f3.ddl -./hl/tools/testfiles/w-ext-cmpd-ff1.ddl -./hl/tools/testfiles/w-ext-cmpd-ff2.ddl ./hl/tools/testfiles/w-ext-cmpd-ff3.ddl ./hl/tools/testfiles/w-ext-cmpd-label.ddl ./hl/tools/testfiles/w-ext-cmpd-two.ddl ./hl/tools/testfiles/w-ext-cmpd-two-f1.ddl -./hl/tools/testfiles/w-ext-cmpd-two-f2.ddl ./hl/tools/testfiles/w-ext-cmpd-two-f3.ddl -./hl/tools/testfiles/w-ext-cmpd-two-ff1.ddl ./hl/tools/testfiles/w-ext-cmpd-two-ff2.ddl -./hl/tools/testfiles/w-ext-cmpd-two-ff3.ddl ./hl/tools/testfiles/w-ext-early.ddl ./hl/tools/testfiles/w-ext-late.ddl ./hl/tools/testfiles/w-ext-one-d.ddl @@ -2457,7 +2444,6 @@ ./hl/tools/testfiles/w-ext-two.ddl ./hl/tools/testfiles/w-ext-two-width.ddl ./hl/tools/testfiles/w-help1.ddl -./hl/tools/testfiles/w-help2.ddl # # hl fortran diff --git a/Makefile.am b/Makefile.am index aaa3b9a..0bef022 100644 --- a/Makefile.am +++ b/Makefile.am @@ -79,7 +79,7 @@ DIST_SUBDIRS = src test testpar tools . c++ fortran hl examples # Some files generated during configure that should be cleaned DISTCLEANFILES=config/stamp1 config/stamp2 -# Some files/directories generated during checkperform that should be cleaned +# Some files/directories generated during check that should be cleaned CHECK_CLEANFILES+=*-tmp # Define rules for lib, progs, check, and tests. @@ -93,7 +93,7 @@ lib progs check-p check-s: fi; \ done -# Make all, tests, and (un)install also recurse into directory +# Make all, tests, and (un)install tests: @@SETX@; for d in $(SUBDIRS); do \ if test $$d != .; then \ diff --git a/Makefile.in b/Makefile.in index 10793bb..670bbde 100644 --- a/Makefile.in +++ b/Makefile.in @@ -503,7 +503,7 @@ TRACE = perl $(top_srcdir)/bin/trace # .chklog files are output from those tests. # *.clog are from the MPE option. -# Some files/directories generated during checkperform that should be cleaned +# Some files/directories generated during check that should be cleaned CHECK_CLEANFILES = *.chkexe *.chklog *.clog *-tmp @BUILD_PARALLEL_CONDITIONAL_FALSE@TESTPARALLEL_DIR = @@ -1017,7 +1017,7 @@ lib progs check-p check-s: fi; \ done -# Make all, tests, and (un)install also recurse into directory +# Make all, tests, and (un)install tests: @@SETX@; for d in $(SUBDIRS); do \ if test $$d != .; then \ diff --git a/README.txt b/README.txt index 977e5b0..07e4024 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.207-swmr0 currently under development +HDF5 version 1.9.210-swmr0 currently under development Please refer to the release_docs/INSTALL file for installation instructions. ------------------------------------------------------------------------------ diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in index 953e808..aaa8ceb 100644 --- a/c++/src/Makefile.in +++ b/c++/src/Makefile.in @@ -683,7 +683,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 197 +LT_VERS_REVISION = 200 LT_VERS_AGE = 0 # This is our main target diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake index 444ce0b..a709a4d 100644 --- a/config/cmake/ConfigureChecks.cmake +++ b/config/cmake/ConfigureChecks.cmake @@ -106,15 +106,6 @@ if (WINDOWS) set (H5_HAVE_WINDOW_PATH 1) endif (WINDOWS) -if (WINDOWS) - #----------------------------------------------------------------------------- - # These tests need to be manually SET for windows since there is currently - # something not quite correct with the actual test implementation. This affects - # the 'dt_arith' test and most likely lots of other code - # ---------------------------------------------------------------------------- - set (H5_FP_TO_ULLONG_RIGHT_MAXIMUM "" CACHE INTERNAL "") -endif (WINDOWS) - # ---------------------------------------------------------------------- # END of WINDOWS Hard code Values # ---------------------------------------------------------------------- diff --git a/config/lt_vers.am b/config/lt_vers.am index d86ce38..3fdac98 100644 --- a/config/lt_vers.am +++ b/config/lt_vers.am @@ -19,7 +19,7 @@ # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 197 +LT_VERS_REVISION = 200 LT_VERS_AGE = 0 ## If the API changes *at all*, increment LT_VERS_INTERFACE and diff --git a/configure b/configure index 8a885e0..bbd77bb 100755 --- a/configure +++ b/configure @@ -1,7 +1,7 @@ #! /bin/sh # From configure.ac Id: configure.ac 22697 2012-08-19 14:35:47Z hdftest . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for HDF5 1.9.207-swmr0. +# Generated by GNU Autoconf 2.69 for HDF5 1.9.210-swmr0. # # Report bugs to . # @@ -591,8 +591,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='HDF5' PACKAGE_TARNAME='hdf5' -PACKAGE_VERSION='1.9.207-swmr0' -PACKAGE_STRING='HDF5 1.9.207-swmr0' +PACKAGE_VERSION='1.9.210-swmr0' +PACKAGE_STRING='HDF5 1.9.210-swmr0' PACKAGE_BUGREPORT='help@hdfgroup.org' PACKAGE_URL='' @@ -1489,7 +1489,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures HDF5 1.9.207-swmr0 to adapt to many kinds of systems. +\`configure' configures HDF5 1.9.210-swmr0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1559,7 +1559,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of HDF5 1.9.207-swmr0:";; + short | recursive ) echo "Configuration of HDF5 1.9.210-swmr0:";; esac cat <<\_ACEOF @@ -1752,7 +1752,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -HDF5 configure 1.9.207-swmr0 +HDF5 configure 1.9.210-swmr0 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2846,7 +2846,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by HDF5 $as_me 1.9.207-swmr0, which was +It was created by HDF5 $as_me 1.9.210-swmr0, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3717,7 +3717,7 @@ fi # Define the identity of the package. PACKAGE='hdf5' - VERSION='1.9.207-swmr0' + VERSION='1.9.210-swmr0' cat >>confdefs.h <<_ACEOF @@ -4003,11 +4003,7 @@ AM_CFLAGS="${AM_CFLAGS}" AM_CXXFLAGS="${AM_CXXFLAGS}" AM_FCFLAGS="${AM_FCFLAGS}" AM_CPPFLAGS="${AM_CPPFLAGS}" -if test "x$prefix" = xNONE; then - AM_LDFLAGS="${AM_LDFLAGS} -L$ac_default_prefix/lib" -else - AM_LDFLAGS="$AM_LDFLAGS -L$prefix/lib" -fi +AM_LDFLAGS="${AM_LDFLAGS}" CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" FCFLAGS="${FCFLAGS}" @@ -31736,7 +31732,7 @@ Usage: $0 [OPTIONS] Report bugs to ." lt_cl_version="\ -HDF5 config.lt 1.9.207-swmr0 +HDF5 config.lt 1.9.210-swmr0 configured by $0, generated by GNU Autoconf 2.69. Copyright (C) 2011 Free Software Foundation, Inc. @@ -33878,7 +33874,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by HDF5 $as_me 1.9.207-swmr0, which was +This file was extended by HDF5 $as_me 1.9.210-swmr0, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -33944,7 +33940,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -HDF5 config.status 1.9.207-swmr0 +HDF5 config.status 1.9.210-swmr0 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index e99f5f4..7ae70c6 100644 --- a/configure.ac +++ b/configure.ac @@ -26,7 +26,7 @@ AC_PREREQ([2.69]) ## NOTE: Do not forget to change the version number here when we do a ## release!!! ## -AC_INIT([HDF5], [1.9.207-swmr0], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.9.210-swmr0], [help@hdfgroup.org]) AC_CONFIG_SRCDIR([src/H5.c]) AC_CONFIG_HEADER([src/H5config.h]) @@ -115,11 +115,7 @@ AM_CFLAGS="${AM_CFLAGS}" AM_CXXFLAGS="${AM_CXXFLAGS}" AM_FCFLAGS="${AM_FCFLAGS}" AM_CPPFLAGS="${AM_CPPFLAGS}" -if test "x$prefix" = xNONE; then - AM_LDFLAGS="${AM_LDFLAGS} -L$ac_default_prefix/lib" -else - AM_LDFLAGS="$AM_LDFLAGS -L$prefix/lib" -fi +AM_LDFLAGS="${AM_LDFLAGS}" CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" FCFLAGS="${FCFLAGS}" diff --git a/fortran/src/H5Af.c b/fortran/src/H5Af.c index 896736d..f7121d2 100644 --- a/fortran/src/H5Af.c +++ b/fortran/src/H5Af.c @@ -2099,7 +2099,7 @@ done: * SOURCE */ int_f -nh5awrite_f_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf) +h5awrite_f_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf) /******/ { int ret_value = -1; diff --git a/fortran/src/H5Aff_F03.f90 b/fortran/src/H5Aff_F03.f90 index 807f6fa..1c83320 100644 --- a/fortran/src/H5Aff_F03.f90 +++ b/fortran/src/H5Aff_F03.f90 @@ -143,12 +143,9 @@ MODULE H5A_PROVISIONAL ! to the C H5Awrite routine INTERFACE - INTEGER FUNCTION h5awrite_f_c(attr_id, mem_type_id, buf) + INTEGER FUNCTION h5awrite_f_c(attr_id, mem_type_id, buf) BIND(C, NAME='h5awrite_f_c') USE H5GLOBAL USE, INTRINSIC :: ISO_C_BINDING - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AWRITE_F_C'::h5awrite_f_c - !DEC$ENDIF INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: mem_type_id TYPE(C_PTR), VALUE :: buf diff --git a/fortran/src/H5f90proto.h b/fortran/src/H5f90proto.h index a0a4f64..fde5f20 100644 --- a/fortran/src/H5f90proto.h +++ b/fortran/src/H5f90proto.h @@ -490,7 +490,6 @@ H5_FCDLL int_f nh5gget_info_by_name_c(hid_t_f *loc_id, _fcd group_name, size_t_f #define nh5awritec_5_c H5_FC_FUNC_(h5awritec_5_c, H5AWRITEC_5_C) #define nh5awritec_6_c H5_FC_FUNC_(h5awritec_6_c, H5AWRITEC_6_C) #define nh5awritec_7_c H5_FC_FUNC_(h5awritec_7_c, H5AWRITEC_7_C) -#define nh5awrite_f_c H5_FC_FUNC_(h5awrite_f_c, H5AWRITE_F_C) #define nh5aread_c H5_FC_FUNC_(h5aread_c, H5AREAD_C) #define nh5aread_integer_s_c H5_FC_FUNC_(h5aread_integer_s_c, H5AREAD_INTEGER_S_C) #define nh5aread_integer_1_c H5_FC_FUNC_(h5aread_integer_1_c, H5AREAD_INTEGER_1_C) @@ -586,7 +585,7 @@ H5_FCDLL int_f nh5awrite_double_4_c (hid_t_f *attr_id, hid_t_f *mem_type_id, voi H5_FCDLL int_f nh5awrite_double_5_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void *dims); H5_FCDLL int_f nh5awrite_double_6_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void *dims); H5_FCDLL int_f nh5awrite_double_7_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void *dims); -H5_FCDLL int_f nh5awrite_f_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf); +H5_FCDLL int_f h5awrite_f_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf); H5_FCDLL int_f nh5areadc_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims); H5_FCDLL int_f nh5areadc_s_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims); H5_FCDLL int_f nh5areadc_1_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims); diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in index a1435be..bea4a2d 100644 --- a/fortran/src/Makefile.in +++ b/fortran/src/Makefile.in @@ -734,7 +734,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 197 +LT_VERS_REVISION = 200 LT_VERS_AGE = 0 AM_FCLIBS = $(LIBHDF5) diff --git a/fortran/test/tH5P.f90 b/fortran/test/tH5P.f90 index c94d564..8b48be6 100644 --- a/fortran/test/tH5P.f90 +++ b/fortran/test/tH5P.f90 @@ -306,7 +306,7 @@ SUBROUTINE multi_file_test(cleanup, total_error) ! CALL h5pcreate_f(H5P_FILE_ACCESS_F, fapl, error) CALL check("h5pcreate_f", error, total_error) - CALL h5pset_fapl_multi_f(fapl, relax, error) + CALL h5pset_fapl_multi_f(fapl, memb_map, memb_fapl, memb_name, memb_addr, relax, error) CALL check("h5pset_fapl_multi_f", error, total_error) CALL h5fopen_f (fix_filename, H5F_ACC_RDWR_F, file_id, error, access_prp = fapl) CALL check("h5fopen_f", error, total_error) diff --git a/hl/c++/src/Makefile.in b/hl/c++/src/Makefile.in index fa0c332..f78f404 100644 --- a/hl/c++/src/Makefile.in +++ b/hl/c++/src/Makefile.in @@ -675,7 +675,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 197 +LT_VERS_REVISION = 200 LT_VERS_AGE = 0 # This is our main target diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in index 401b637..1cacec0 100644 --- a/hl/fortran/src/Makefile.in +++ b/hl/fortran/src/Makefile.in @@ -690,7 +690,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 197 +LT_VERS_REVISION = 200 LT_VERS_AGE = 0 # Our main target, the high-level fortran library diff --git a/hl/src/Makefile.in b/hl/src/Makefile.in index 4aa2bc8..6233295 100644 --- a/hl/src/Makefile.in +++ b/hl/src/Makefile.in @@ -671,7 +671,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 197 +LT_VERS_REVISION = 200 LT_VERS_AGE = 0 # This library is our main target. diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 511c56a..99b1413 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,4 +1,5 @@ -HDF5 version 1.9.207-swmr0 currently under development +HDF5 version 1.9.210-swmr0 currently under development +================================================================================ INTRODUCTION @@ -1163,7 +1164,7 @@ Bug Fixes since HDF5-1.8.0 release Supported Platforms =================== - AIX 5.3 xlc 10.1.0.5 + AIX 6.1 xlc 10.1.0.5 (NASA G-ADA) xlC 10.1.0.5 xlf90 12.1.0.6 @@ -1271,7 +1272,7 @@ Mac OS X Lion 10.7.3 32-bit n y/y n y y n Mac OS X Lion 10.7.3 64-bit n y/y n y y y Mac OS X Mountain Lion 10.8.1 64-bit n y/y n y y y Mac OS X Mavericks 10.9.1 64-bit n y/y n y y ? -AIX 5.3 32- and 64-bit n y/n n y y y +AIX 6.1 32- and 64-bit n y/n n y y y CentOS 5.9 Linux 2.6.18-308 i686 GNU y y/y y y y y CentOS 5.9 Linux 2.6.18-308 i686 Intel n y/y n y y y CentOS 5.9 Linux 2.6.18-308 i686 PGI n y/y n y y y @@ -1297,7 +1298,7 @@ Mac OS X Lion 10.7.3 32-bit y n y y Mac OS X Lion 10.7.3 64-bit y n y y Mac OS X Mountain Lion 10.8.1 64-bit y n y y Mac OS X Mavericks 10.9.1 64-bit y n y y -AIX 5.3 32- and 64-bit y n n y +AIX 6.1 32- and 64-bit y n n y CentOS 5.9 Linux 2.6.18-308 i686 GNU y y y y CentOS 5.9 Linux 2.6.18-308 i686 Intel y y y n CentOS 5.9 Linux 2.6.18-308 i686 PGI y y y n diff --git a/src/H5F.c b/src/H5F.c index dd9e638..3056a92 100644 --- a/src/H5F.c +++ b/src/H5F.c @@ -980,6 +980,8 @@ H5Fget_filesize(hid_t file_id, hsize_t *size) { H5F_t *file; /* File object for file ID */ haddr_t eof; /* End of file address */ + haddr_t eoa; /* End of allocation address */ + haddr_t max_eof_eoa; /* Maximum of the EOA & EOF */ haddr_t base_addr; /* Base address for the file */ herr_t ret_value = SUCCEED; /* Return value */ @@ -991,12 +993,15 @@ H5Fget_filesize(hid_t file_id, hsize_t *size) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a file ID") /* Go get the actual file size */ - if(HADDR_UNDEF == (eof = H5FD_get_eof(file->shared->lf))) - HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to get file size") + eof = H5FD_get_eof(file->shared->lf, H5FD_MEM_DEFAULT); + eoa = H5FD_get_eoa(file->shared->lf, H5FD_MEM_DEFAULT); + max_eof_eoa = MAX(eof, eoa); + if(HADDR_UNDEF == max_eof_eoa) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "file get eof/eoa requests failed") base_addr = H5FD_get_base_addr(file->shared->lf); if(size) - *size = (hsize_t)(eof + base_addr); /* Convert relative base address for file to absolute address */ + *size = (hsize_t)(max_eof_eoa + base_addr); /* Convert relative base address for file to absolute address */ done: FUNC_LEAVE_API(ret_value) diff --git a/src/H5FD.c b/src/H5FD.c index c556cd0..bbadd33 100644 --- a/src/H5FD.c +++ b/src/H5FD.c @@ -1521,19 +1521,19 @@ done: *------------------------------------------------------------------------- */ haddr_t -H5FDget_eof(H5FD_t *file) +H5FDget_eof(H5FD_t *file, H5FD_mem_t type) { haddr_t ret_value; FUNC_ENTER_API(HADDR_UNDEF) - H5TRACE1("a", "*x", file); + H5TRACE2("a", "*xMt", file, type); /* Check arguments */ if(!file || !file->cls) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, HADDR_UNDEF, "invalid file pointer") /* The real work */ - if(HADDR_UNDEF == (ret_value = H5FD_get_eof(file))) + if(HADDR_UNDEF == (ret_value = H5FD_get_eof(file, type))) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, HADDR_UNDEF, "file get eof request failed") /* (Note compensating for base address subtraction in internal routine) */ diff --git a/src/H5FDcore.c b/src/H5FDcore.c index d604a8a..484c481 100644 --- a/src/H5FDcore.c +++ b/src/H5FDcore.c @@ -141,7 +141,7 @@ static int H5FD_core_cmp(const H5FD_t *_f1, const H5FD_t *_f2); static herr_t H5FD_core_query(const H5FD_t *_f1, unsigned long *flags); static haddr_t H5FD_core_get_eoa(const H5FD_t *_file, H5FD_mem_t type); static herr_t H5FD_core_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr); -static haddr_t H5FD_core_get_eof(const H5FD_t *_file); +static haddr_t H5FD_core_get_eof(const H5FD_t *_file, H5FD_mem_t type); static herr_t H5FD_core_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle); static herr_t H5FD_core_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size, void *buf); @@ -1133,13 +1133,13 @@ done: *------------------------------------------------------------------------- */ static haddr_t -H5FD_core_get_eof(const H5FD_t *_file) +H5FD_core_get_eof(const H5FD_t *_file, H5FD_mem_t UNUSED type) { const H5FD_core_t *file = (const H5FD_core_t*)_file; FUNC_ENTER_NOAPI_NOINIT_NOERR - FUNC_LEAVE_NOAPI(MAX(file->eof, file->eoa)) + FUNC_LEAVE_NOAPI(file->eof) } diff --git a/src/H5FDdirect.c b/src/H5FDdirect.c index 19f9bda..9a9d6df 100644 --- a/src/H5FDdirect.c +++ b/src/H5FDdirect.c @@ -140,7 +140,7 @@ static int H5FD_direct_cmp(const H5FD_t *_f1, const H5FD_t *_f2); static herr_t H5FD_direct_query(const H5FD_t *_f1, unsigned long *flags); static haddr_t H5FD_direct_get_eoa(const H5FD_t *_file, H5FD_mem_t type); static herr_t H5FD_direct_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr); -static haddr_t H5FD_direct_get_eof(const H5FD_t *_file); +static haddr_t H5FD_direct_get_eof(const H5FD_t *_file, H5FD_mem_t type); static herr_t H5FD_direct_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle); static herr_t H5FD_direct_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size, void *buf); @@ -817,13 +817,13 @@ H5FD_direct_set_eoa(H5FD_t *_file, H5FD_mem_t UNUSED type, haddr_t addr) *------------------------------------------------------------------------- */ static haddr_t -H5FD_direct_get_eof(const H5FD_t *_file) +H5FD_direct_get_eof(const H5FD_t *_file, H5FD_mem_t UNUSED type) { const H5FD_direct_t *file = (const H5FD_direct_t*)_file; FUNC_ENTER_NOAPI_NOINIT - FUNC_LEAVE_NOAPI(MAX(file->eof, file->eoa)) + FUNC_LEAVE_NOAPI(file->eof) } diff --git a/src/H5FDfamily.c b/src/H5FDfamily.c index 1728d13..ad703ef 100644 --- a/src/H5FDfamily.c +++ b/src/H5FDfamily.c @@ -99,7 +99,7 @@ static int H5FD_family_cmp(const H5FD_t *_f1, const H5FD_t *_f2); static herr_t H5FD_family_query(const H5FD_t *_f1, unsigned long *flags); static haddr_t H5FD_family_get_eoa(const H5FD_t *_file, H5FD_mem_t type); static herr_t H5FD_family_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t eoa); -static haddr_t H5FD_family_get_eof(const H5FD_t *_file); +static haddr_t H5FD_family_get_eof(const H5FD_t *_file, H5FD_mem_t type); static herr_t H5FD_family_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle); static herr_t H5FD_family_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size, void *_buf/*out*/); @@ -757,7 +757,7 @@ H5FD_family_open(const char *name, unsigned flags, hid_t fapl_id, * smaller than the size specified through H5Pset_fapl_family(). Update the actual * member size. */ - if ((eof=H5FDget_eof(file->memb[0]))) file->memb_size = eof; + if ((eof=H5FDget_eof(file->memb[0], H5FD_MEM_DEFAULT))) file->memb_size = eof; ret_value=(H5FD_t *)file; @@ -1047,7 +1047,7 @@ done: *------------------------------------------------------------------------- */ static haddr_t -H5FD_family_get_eof(const H5FD_t *_file) +H5FD_family_get_eof(const H5FD_t *_file, H5FD_mem_t type) { const H5FD_family_t *file = (const H5FD_family_t*)_file; haddr_t eof=0; @@ -1063,7 +1063,7 @@ H5FD_family_get_eof(const H5FD_t *_file) */ HDassert(file->nmembs > 0); for(i = (int)file->nmembs - 1; i >= 0; --i) { - if((eof = H5FD_get_eof(file->memb[i])) != 0) + if((eof = H5FD_get_eof(file->memb[i], type)) != 0) break; if(0 == i) break; @@ -1079,7 +1079,7 @@ H5FD_family_get_eof(const H5FD_t *_file) eof += ((unsigned)i)*file->memb_size; /* Set return value */ - ret_value = MAX(eof, file->eoa); + ret_value = eof; FUNC_LEAVE_NOAPI(ret_value) } diff --git a/src/H5FDint.c b/src/H5FDint.c index 9f02a25..4f3c234 100644 --- a/src/H5FDint.c +++ b/src/H5FDint.c @@ -120,7 +120,7 @@ H5FD_int_init_interface(void) herr_t H5FD_locate_signature(H5FD_t *file, const H5P_genplist_t *dxpl, haddr_t *sig_addr) { - haddr_t addr, eoa; + haddr_t addr, eoa, eof; uint8_t buf[H5F_SIGNATURE_LEN]; unsigned n, maxpow; herr_t ret_value = SUCCEED; /* Return value */ @@ -128,7 +128,10 @@ H5FD_locate_signature(H5FD_t *file, const H5P_genplist_t *dxpl, haddr_t *sig_add FUNC_ENTER_NOAPI_NOINIT /* Find the least N such that 2^N is larger than the file size */ - if(HADDR_UNDEF == (addr = H5FD_get_eof(file)) || HADDR_UNDEF == (eoa = H5FD_get_eoa(file, H5FD_MEM_SUPER))) + eof = H5FD_get_eof(file, H5FD_MEM_SUPER); + eoa = H5FD_get_eoa(file, H5FD_MEM_SUPER); + addr = MAX(eof, eoa); + if(HADDR_UNDEF == addr) HGOTO_ERROR(H5E_IO, H5E_CANTINIT, FAIL, "unable to obtain EOF/EOA value") for(maxpow = 0; addr; maxpow++) addr >>= 1; @@ -348,7 +351,7 @@ done: *------------------------------------------------------------------------- */ haddr_t -H5FD_get_eof(const H5FD_t *file) +H5FD_get_eof(const H5FD_t *file, H5FD_mem_t type) { haddr_t ret_value; @@ -358,7 +361,7 @@ H5FD_get_eof(const H5FD_t *file) /* Dispatch to driver */ if(file->cls->get_eof) { - if(HADDR_UNDEF == (ret_value = (file->cls->get_eof)(file))) + if(HADDR_UNDEF == (ret_value = (file->cls->get_eof)(file, type))) HGOTO_ERROR(H5E_VFL, H5E_CANTGET, HADDR_UNDEF, "driver get_eof request failed") } /* end if */ else diff --git a/src/H5FDlog.c b/src/H5FDlog.c index ca6cada..5d98955 100644 --- a/src/H5FDlog.c +++ b/src/H5FDlog.c @@ -183,7 +183,7 @@ static herr_t H5FD_log_query(const H5FD_t *_f1, unsigned long *flags); static haddr_t H5FD_log_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size); static haddr_t H5FD_log_get_eoa(const H5FD_t *_file, H5FD_mem_t type); static herr_t H5FD_log_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr); -static haddr_t H5FD_log_get_eof(const H5FD_t *_file); +static haddr_t H5FD_log_get_eof(const H5FD_t *_file, H5FD_mem_t type); static herr_t H5FD_log_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle); static herr_t H5FD_log_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size, void *buf); @@ -1071,13 +1071,13 @@ H5FD_log_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr) *------------------------------------------------------------------------- */ static haddr_t -H5FD_log_get_eof(const H5FD_t *_file) +H5FD_log_get_eof(const H5FD_t *_file, H5FD_mem_t UNUSED type) { const H5FD_log_t *file = (const H5FD_log_t *)_file; FUNC_ENTER_NOAPI_NOINIT_NOERR - FUNC_LEAVE_NOAPI(MAX(file->eof, file->eoa)) + FUNC_LEAVE_NOAPI(file->eof) } /* end H5FD_log_get_eof() */ diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c index 73237b7..70cf49a 100644 --- a/src/H5FDmpio.c +++ b/src/H5FDmpio.c @@ -69,6 +69,7 @@ typedef struct H5FD_mpio_t { haddr_t eof; /*end-of-file marker */ haddr_t eoa; /*end-of-address marker */ haddr_t last_eoa; /* Last known end-of-address marker */ + haddr_t local_eof; /* Local end-of-file address for each process */ } H5FD_mpio_t; /* Private Prototypes */ @@ -84,7 +85,7 @@ static herr_t H5FD_mpio_close(H5FD_t *_file); static herr_t H5FD_mpio_query(const H5FD_t *_f1, unsigned long *flags); static haddr_t H5FD_mpio_get_eoa(const H5FD_t *_file, H5FD_mem_t type); static herr_t H5FD_mpio_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr); -static haddr_t H5FD_mpio_get_eof(const H5FD_t *_file); +static haddr_t H5FD_mpio_get_eof(const H5FD_t *_file, H5FD_mem_t type); static herr_t H5FD_mpio_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle); static herr_t H5FD_mpio_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size, void *buf); @@ -1107,6 +1108,7 @@ H5FD_mpio_open(const char *name, unsigned flags, hid_t fapl_id, /* Set the size of the file (from library's perspective) */ file->eof = H5FD_mpi_MPIOff_to_haddr(size); + file->local_eof = file->eof; /* Set return value */ ret_value=(H5FD_t*)file; @@ -1331,7 +1333,7 @@ H5FD_mpio_set_eoa(H5FD_t *_file, H5FD_mem_t UNUSED type, haddr_t addr) *------------------------------------------------------------------------- */ static haddr_t -H5FD_mpio_get_eof(const H5FD_t *_file) +H5FD_mpio_get_eof(const H5FD_t *_file, H5FD_mem_t UNUSED type) { const H5FD_mpio_t *file = (const H5FD_mpio_t*)_file; @@ -1454,10 +1456,16 @@ H5FD_mpio_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t dxpl_id, haddr_t add int mpi_code; /* mpi return code */ MPI_Datatype buf_type = MPI_BYTE; /* MPI description of the selection in memory */ int size_i; /* Integer copy of 'size' to read */ +#if MPI_VERSION >= 3 MPI_Count bytes_read; /* Number of bytes read in */ - int n; MPI_Count type_size; /* MPI datatype used for I/O's size */ MPI_Count io_size; /* Actual number of bytes requested */ +#else + int bytes_read; /* Number of bytes read in */ + int type_size; /* MPI datatype used for I/O's size */ + int io_size; /* Actual number of bytes requested */ +#endif + int n; H5P_genplist_t *plist = NULL; /* Property list pointer */ hbool_t use_view_this_time = FALSE; herr_t ret_value = SUCCEED; @@ -1574,11 +1582,19 @@ H5FD_mpio_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t dxpl_id, haddr_t add } /* How many bytes were actually read? */ - if (MPI_SUCCESS != (mpi_code=MPI_Get_elements_x(&mpi_stat, buf_type, &bytes_read))) +#if MPI_VERSION >= 3 + if (MPI_SUCCESS != (mpi_code = MPI_Get_elements_x(&mpi_stat, buf_type, &bytes_read))) +#else + if (MPI_SUCCESS != (mpi_code = MPI_Get_elements(&mpi_stat, MPI_BYTE, &bytes_read))) +#endif HMPI_GOTO_ERROR(FAIL, "MPI_Get_elements failed", mpi_code) /* Get the type's size */ - if (MPI_SUCCESS != (mpi_code=MPI_Type_size_x(buf_type,&type_size))) +#if MPI_VERSION >= 3 + if (MPI_SUCCESS != (mpi_code = MPI_Type_size_x(buf_type, &type_size))) +#else + if (MPI_SUCCESS != (mpi_code = MPI_Type_size(buf_type, &type_size))) +#endif HMPI_GOTO_ERROR(FAIL, "MPI_Type_size failed", mpi_code) /* Compute the actual number of bytes requested */ @@ -1734,10 +1750,16 @@ H5FD_mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, MPI_Status mpi_stat; /* Status from I/O operation */ MPI_Datatype buf_type = MPI_BYTE; /* MPI description of the selection in memory */ int mpi_code; /* MPI return code */ +#if MPI_VERSION >= 3 MPI_Count bytes_written; - int size_i; MPI_Count type_size; /* MPI datatype used for I/O's size */ MPI_Count io_size; /* Actual number of bytes requested */ +#else + int bytes_written; + int type_size; /* MPI datatype used for I/O's size */ + int io_size; /* Actual number of bytes requested */ +#endif + int size_i; hbool_t use_view_this_time = FALSE; H5P_genplist_t *plist = NULL; /* Property list pointer */ herr_t ret_value = SUCCEED; @@ -1864,11 +1886,19 @@ H5FD_mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, } /* How many bytes were actually written? */ +#if MPI_VERSION >= 3 if(MPI_SUCCESS != (mpi_code = MPI_Get_elements_x(&mpi_stat, buf_type, &bytes_written))) +#else + if(MPI_SUCCESS != (mpi_code = MPI_Get_elements(&mpi_stat, MPI_BYTE, &bytes_written))) +#endif HMPI_GOTO_ERROR(FAIL, "MPI_Get_elements failed", mpi_code) /* Get the type's size */ +#if MPI_VERSION >= 3 if(MPI_SUCCESS != (mpi_code = MPI_Type_size_x(buf_type, &type_size))) +#else + if(MPI_SUCCESS != (mpi_code = MPI_Type_size(buf_type, &type_size))) +#endif HMPI_GOTO_ERROR(FAIL, "MPI_Type_size failed", mpi_code) /* Compute the actual number of bytes requested */ @@ -1878,9 +1908,17 @@ H5FD_mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, if(bytes_written != io_size) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "file write failed") - /* Forget the EOF value (see H5FD_mpio_get_eof()) --rpm 1999-08-06 */ + /* Each process will keep track of its perceived EOF value locally, and + * ultimately we will reduce this value to the maximum amongst all + * processes, but until then keep the actual eof at HADDR_UNDEF just in + * case something bad happens before that point. (rather have a value + * we know is wrong sitting around rather than one that could only + * potentially be wrong.) */ file->eof = HADDR_UNDEF; + if(bytes_written && ((bytes_written + addr) > file->local_eof)) + file->local_eof = addr + bytes_written; + done: #ifdef H5FDmpio_DEBUG if(H5FD_mpio_Debug[(int)'t']) diff --git a/src/H5FDmulti.c b/src/H5FDmulti.c index b7caa68..b1f094c 100644 --- a/src/H5FDmulti.c +++ b/src/H5FDmulti.c @@ -43,10 +43,6 @@ */ #define H5FD_MULTI_DEBUG -/* Our version of MAX */ -#undef MAX -#define MAX(X,Y) ((X)>(Y)?(X):(Y)) - #ifndef FALSE #define FALSE 0 #endif @@ -135,7 +131,7 @@ static herr_t H5FD_multi_query(const H5FD_t *_f1, unsigned long *flags); static herr_t H5FD_multi_get_type_map(const H5FD_t *file, H5FD_mem_t *type_map); static haddr_t H5FD_multi_get_eoa(const H5FD_t *_file, H5FD_mem_t type); static herr_t H5FD_multi_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t eoa); -static haddr_t H5FD_multi_get_eof(const H5FD_t *_file); +static haddr_t H5FD_multi_get_eof(const H5FD_t *_file, H5FD_mem_t type); static herr_t H5FD_multi_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle); static haddr_t H5FD_multi_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size); static herr_t H5FD_multi_free(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, @@ -1430,54 +1426,70 @@ H5FD_multi_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t eoa) *------------------------------------------------------------------------- */ static haddr_t -H5FD_multi_get_eof(const H5FD_t *_file) +H5FD_multi_get_eof(const H5FD_t *_file, H5FD_mem_t type) { const H5FD_multi_t *file = (const H5FD_multi_t*)_file; - haddr_t eof=0, tmp_eof; - haddr_t eoa=0, tmp_eoa; + haddr_t eof = 0; static const char *func="H5FD_multi_get_eof"; /* Function Name for error reporting */ /* Clear the error stack */ H5Eclear2(H5E_DEFAULT); - UNIQUE_MEMBERS(file->fa.memb_map, mt) { - if (file->memb[mt]) { - /* Retrieve EOF */ - H5E_BEGIN_TRY { - tmp_eof = H5FDget_eof(file->memb[mt]); - } H5E_END_TRY; + if(H5FD_MEM_DEFAULT == type) { + UNIQUE_MEMBERS(file->fa.memb_map, mt) { + haddr_t tmp_eof; + + if(file->memb[mt]) { + /* Retrieve EOF */ + H5E_BEGIN_TRY { + tmp_eof = H5FDget_eof(file->memb[mt], type); + } H5E_END_TRY; + + if(HADDR_UNDEF == tmp_eof) + H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "member file has unknown eof", HADDR_UNDEF) + if(tmp_eof > 0) + tmp_eof += file->fa.memb_addr[mt]; + } else if(file->fa.relax) { + /* + * The member is not open yet (maybe it doesn't exist). Make the + * best guess about the end-of-file. + */ + tmp_eof = file->memb_next[mt]; + assert(HADDR_UNDEF != tmp_eof); + } else { + H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "bad eof", HADDR_UNDEF) + } + if(tmp_eof > eof) + eof = tmp_eof; + } END_MEMBERS; + } else { + H5FD_mem_t mmt = file->fa.memb_map[type]; - if (HADDR_UNDEF==tmp_eof) - H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "member file has unknown eof", HADDR_UNDEF) - if (tmp_eof>0) tmp_eof += file->fa.memb_addr[mt]; + if(H5FD_MEM_DEFAULT == mmt) + mmt = type; - /* Retrieve EOA */ - H5E_BEGIN_TRY { - tmp_eoa = H5FDget_eoa(file->memb[mt], mt); - } H5E_END_TRY; + if(file->memb[mmt]) { + /* Retrieve EOF */ + H5E_BEGIN_TRY { + eof = H5FDget_eof(file->memb[mmt], mmt); + } H5E_END_TRY; - if (HADDR_UNDEF==tmp_eoa) - H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "member file has unknown eoa", HADDR_UNDEF) - if (tmp_eoa>0) tmp_eoa += file->fa.memb_addr[mt]; - } else if (file->fa.relax) { + if(HADDR_UNDEF == eof) + H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "member file has unknown eof", HADDR_UNDEF) + if(eof > 0) + eof += file->fa.memb_addr[mmt]; + } else if(file->fa.relax) { /* * The member is not open yet (maybe it doesn't exist). Make the * best guess about the end-of-file. */ - tmp_eof = file->memb_next[mt]; - assert(HADDR_UNDEF!=tmp_eof); - - tmp_eoa = file->memb_next[mt]; - assert(HADDR_UNDEF!=tmp_eoa); - } else { + eof = file->memb_next[mmt]; + assert(HADDR_UNDEF != eof); + } else { H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "bad eof", HADDR_UNDEF) - } - - if (tmp_eof>eof) eof = tmp_eof; - if (tmp_eoa>eoa) eoa = tmp_eoa; - } END_MEMBERS; - - return MAX(eoa, eof); + } + } + return eof; } diff --git a/src/H5FDprivate.h b/src/H5FDprivate.h index 33332d7..7c2a564 100644 --- a/src/H5FDprivate.h +++ b/src/H5FDprivate.h @@ -130,7 +130,7 @@ H5_DLL htri_t H5FD_try_extend(H5FD_t *file, H5FD_mem_t type, struct H5F_t *f, haddr_t blk_end, hsize_t extra_requested); H5_DLL haddr_t H5FD_get_eoa(const H5FD_t *file, H5FD_mem_t type); H5_DLL herr_t H5FD_set_eoa(H5FD_t *file, H5FD_mem_t type, haddr_t addr); -H5_DLL haddr_t H5FD_get_eof(const H5FD_t *file); +H5_DLL haddr_t H5FD_get_eof(const H5FD_t *file, H5FD_mem_t type); H5_DLL haddr_t H5FD_get_maxaddr(const H5FD_t *file); H5_DLL herr_t H5FD_get_feature_flags(const H5FD_t *file, unsigned long *feature_flags); H5_DLL herr_t H5FD_get_fs_type_map(const H5FD_t *file, H5FD_mem_t *type_map); diff --git a/src/H5FDpublic.h b/src/H5FDpublic.h index ed50bc7..87edf50 100644 --- a/src/H5FDpublic.h +++ b/src/H5FDpublic.h @@ -267,7 +267,7 @@ typedef struct H5FD_class_t { haddr_t addr, hsize_t size); haddr_t (*get_eoa)(const H5FD_t *file, H5FD_mem_t type); herr_t (*set_eoa)(H5FD_t *file, H5FD_mem_t type, haddr_t addr); - haddr_t (*get_eof)(const H5FD_t *file); + haddr_t (*get_eof)(const H5FD_t *file, H5FD_mem_t type); herr_t (*get_handle)(H5FD_t *file, hid_t fapl, void**file_handle); herr_t (*read)(H5FD_t *file, H5FD_mem_t type, hid_t dxpl, haddr_t addr, size_t size, void *buffer); @@ -348,7 +348,7 @@ H5_DLL herr_t H5FDfree(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t size); H5_DLL haddr_t H5FDget_eoa(H5FD_t *file, H5FD_mem_t type); H5_DLL herr_t H5FDset_eoa(H5FD_t *file, H5FD_mem_t type, haddr_t eoa); -H5_DLL haddr_t H5FDget_eof(H5FD_t *file); +H5_DLL haddr_t H5FDget_eof(H5FD_t *file, H5FD_mem_t type); H5_DLL herr_t H5FDget_vfd_handle(H5FD_t *file, hid_t fapl, void**file_handle); H5_DLL herr_t H5FDread(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size, void *buf/*out*/); diff --git a/src/H5FDsec2.c b/src/H5FDsec2.c index d7c3c81..b6cdef5 100644 --- a/src/H5FDsec2.c +++ b/src/H5FDsec2.c @@ -141,7 +141,7 @@ static int H5FD_sec2_cmp(const H5FD_t *_f1, const H5FD_t *_f2); static herr_t H5FD_sec2_query(const H5FD_t *_f1, unsigned long *flags); static haddr_t H5FD_sec2_get_eoa(const H5FD_t *_file, H5FD_mem_t type); static herr_t H5FD_sec2_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr); -static haddr_t H5FD_sec2_get_eof(const H5FD_t *_file); +static haddr_t H5FD_sec2_get_eof(const H5FD_t *_file, H5FD_mem_t type); static herr_t H5FD_sec2_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle); static herr_t H5FD_sec2_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size, void *buf); @@ -631,13 +631,13 @@ H5FD_sec2_set_eoa(H5FD_t *_file, H5FD_mem_t UNUSED type, haddr_t addr) *------------------------------------------------------------------------- */ static haddr_t -H5FD_sec2_get_eof(const H5FD_t *_file) +H5FD_sec2_get_eof(const H5FD_t *_file, H5FD_mem_t UNUSED type) { const H5FD_sec2_t *file = (const H5FD_sec2_t *)_file; FUNC_ENTER_NOAPI_NOINIT_NOERR - FUNC_LEAVE_NOAPI(MAX(file->eof, file->eoa)) + FUNC_LEAVE_NOAPI(file->eof) } /* end H5FD_sec2_get_eof() */ diff --git a/src/H5FDstdio.c b/src/H5FDstdio.c index 36c21e1..ee97929 100644 --- a/src/H5FDstdio.c +++ b/src/H5FDstdio.c @@ -188,7 +188,7 @@ static herr_t H5FD_stdio_query(const H5FD_t *_f1, unsigned long *flags); static haddr_t H5FD_stdio_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size); static haddr_t H5FD_stdio_get_eoa(const H5FD_t *_file, H5FD_mem_t type); static herr_t H5FD_stdio_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr); -static haddr_t H5FD_stdio_get_eof(const H5FD_t *_file); +static haddr_t H5FD_stdio_get_eof(const H5FD_t *_file, H5FD_mem_t type); static herr_t H5FD_stdio_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle); static herr_t H5FD_stdio_read(H5FD_t *lf, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size, void *buf); @@ -726,14 +726,14 @@ H5FD_stdio_set_eoa(H5FD_t *_file, H5FD_mem_t /*UNUSED*/ type, haddr_t addr) *------------------------------------------------------------------------- */ static haddr_t -H5FD_stdio_get_eof(const H5FD_t *_file) +H5FD_stdio_get_eof(const H5FD_t *_file, H5FD_mem_t /*UNUSED*/ type) { const H5FD_stdio_t *file = (const H5FD_stdio_t *)_file; /* Clear the error stack */ H5Eclear2(H5E_DEFAULT); - return MAX(file->eof, file->eoa); + return(file->eof); } /* end H5FD_stdio_get_eof() */ diff --git a/src/H5Fint.c b/src/H5Fint.c index 91a77af..02fedef 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -1074,7 +1074,7 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, * Read or write the file superblock, depending on whether the file is * empty or not. */ - if(0 == H5FD_get_eof(lf) && (flags & H5F_ACC_RDWR)) { + if(0 == (MAX(H5FD_get_eof(lf, H5FD_MEM_SUPER), H5FD_get_eoa(lf, H5FD_MEM_SUPER))) && (flags & H5F_ACC_RDWR)) { /* * We've just opened a fresh new file (or truncated one). We need * to create & write the superblock. diff --git a/src/H5Fsuper_cache.c b/src/H5Fsuper_cache.c index ddcc680..5fc1c7c 100644 --- a/src/H5Fsuper_cache.c +++ b/src/H5Fsuper_cache.c @@ -120,7 +120,7 @@ H5F_sblock_load(H5F_t *f, hid_t dxpl_id, haddr_t UNUSED addr, void *_udata) H5P_genplist_t *c_plist; /* File creation property list */ H5F_file_t *shared; /* shared part of `file' */ H5FD_t *lf; /* file driver part of `shared' */ - haddr_t stored_eoa; /*relative end-of-addr in file */ + haddr_t stored_eof; /* stored end-of-file address in file */ haddr_t eof; /* end of file address */ uint8_t sizeof_addr; /* Size of offsets in the file (in bytes) */ uint8_t sizeof_size; /* Size of lengths in the file (in bytes) */ @@ -288,7 +288,7 @@ H5F_sblock_load(H5F_t *f, hid_t dxpl_id, haddr_t UNUSED addr, void *_udata) /* Remainder of "variable-sized" portion of superblock */ H5F_addr_decode(f, (const uint8_t **)&p, &sblock->base_addr/*out*/); H5F_addr_decode(f, (const uint8_t **)&p, &sblock->ext_addr/*out*/); - H5F_addr_decode(f, (const uint8_t **)&p, &stored_eoa/*out*/); + H5F_addr_decode(f, (const uint8_t **)&p, &stored_eof/*out*/); H5F_addr_decode(f, (const uint8_t **)&p, &sblock->driver_addr/*out*/); /* Allocate space for the root group symbol table entry */ @@ -310,10 +310,10 @@ H5F_sblock_load(H5F_t *f, hid_t dxpl_id, haddr_t UNUSED addr, void *_udata) if(!H5F_addr_eq(base_addr, sblock->base_addr)) { /* Check if the superblock moved earlier in the file */ if(H5F_addr_lt(base_addr, sblock->base_addr)) - stored_eoa -= (sblock->base_addr - base_addr); + stored_eof -= (sblock->base_addr - base_addr); else /* The superblock moved later in the file */ - stored_eoa += (base_addr - sblock->base_addr); + stored_eof += (base_addr - sblock->base_addr); /* Adjust base address for offsets of the HDF5 data in the file */ sblock->base_addr = base_addr; @@ -420,7 +420,7 @@ H5F_sblock_load(H5F_t *f, hid_t dxpl_id, haddr_t UNUSED addr, void *_udata) /* Base, superblock extension, end of file & root group object header addresses */ H5F_addr_decode(f, (const uint8_t **)&p, &sblock->base_addr/*out*/); H5F_addr_decode(f, (const uint8_t **)&p, &sblock->ext_addr/*out*/); - H5F_addr_decode(f, (const uint8_t **)&p, &stored_eoa/*out*/); + H5F_addr_decode(f, (const uint8_t **)&p, &stored_eof/*out*/); H5F_addr_decode(f, (const uint8_t **)&p, &sblock->root_addr/*out*/); /* Compute checksum for superblock */ @@ -440,10 +440,10 @@ H5F_sblock_load(H5F_t *f, hid_t dxpl_id, haddr_t UNUSED addr, void *_udata) if(!H5F_addr_eq(base_addr, sblock->base_addr)) { /* Check if the superblock moved earlier in the file */ if(H5F_addr_lt(base_addr, sblock->base_addr)) - stored_eoa -= (sblock->base_addr - base_addr); + stored_eof -= (sblock->base_addr - base_addr); else /* The superblock moved later in the file */ - stored_eoa += (base_addr - sblock->base_addr); + stored_eof += (base_addr - sblock->base_addr); /* Adjust base address for offsets of the HDF5 data in the file */ sblock->base_addr = base_addr; @@ -480,12 +480,12 @@ H5F_sblock_load(H5F_t *f, hid_t dxpl_id, haddr_t UNUSED addr, void *_udata) * been flushed to disk by the single writer process.) */ if (!(H5F_INTENT(f) & H5F_ACC_SWMR_READ)) { - if(HADDR_UNDEF == (eof = H5FD_get_eof(lf))) + if(HADDR_UNDEF == (eof = H5FD_get_eof(lf, H5FD_MEM_DEFAULT))) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to determine file size") /* (Account for the stored EOA being absolute offset -QAK) */ - if((eof + sblock->base_addr) < stored_eoa) - HGOTO_ERROR(H5E_FILE, H5E_TRUNCATED, NULL, "truncated file: eof = %llu, sblock->base_addr = %llu, stored_eoa = %llu", (unsigned long long)eof, (unsigned long long)sblock->base_addr, (unsigned long long)stored_eoa) + if((eof + sblock->base_addr) < stored_eof) + HGOTO_ERROR(H5E_FILE, H5E_TRUNCATED, NULL, "truncated file: eof = %llu, sblock->base_addr = %llu, stored_eof = %llu", (unsigned long long)eof, (unsigned long long)sblock->base_addr, (unsigned long long)stored_eof) } /* end if */ /* @@ -493,7 +493,7 @@ H5F_sblock_load(H5F_t *f, hid_t dxpl_id, haddr_t UNUSED addr, void *_udata) * allocated so that it knows how to allocate additional memory. */ /* (Account for the stored EOA being absolute offset -NAF) */ - if(H5FD_set_eoa(lf, H5FD_MEM_SUPER, stored_eoa - sblock->base_addr) < 0) + if(H5FD_set_eoa(lf, H5FD_MEM_SUPER, stored_eof - sblock->base_addr) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to set end-of-address marker for file") /* Read the file's superblock extension, if there is one. */ @@ -512,7 +512,7 @@ H5F_sblock_load(H5F_t *f, hid_t dxpl_id, haddr_t UNUSED addr, void *_udata) /* Check for superblock extension being located "outside" the stored * 'eoa' value, which can occur with the split/multi VFD. */ - if(H5F_addr_gt(sblock->ext_addr, stored_eoa)) { + if(H5F_addr_gt(sblock->ext_addr, stored_eof)) { /* Set the 'eoa' for the object header memory type large enough * to give some room for a reasonably sized superblock extension. * (This is _rather_ a kludge -QAK) @@ -669,7 +669,7 @@ H5F_sblock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t UNUSED addr, H5P_genplist_t *dxpl; /* DXPL object */ uint8_t buf[H5F_MAX_SUPERBLOCK_SIZE + H5F_MAX_DRVINFOBLOCK_SIZE]; /* Superblock & driver info blockencoding buffer */ uint8_t *p; /* Ptr into encoding buffer */ - haddr_t rel_eoa; /* Relative EOA for file */ + haddr_t rel_eof; /* Relative EOF for file */ size_t superblock_size; /* Size of superblock, in bytes */ size_t driver_size; /* Size of driver info block (bytes)*/ @@ -709,8 +709,15 @@ H5F_sblock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t UNUSED addr, /* Encode the address of global free-space index */ H5F_addr_encode(f, &p, sblock->ext_addr); - rel_eoa = H5FD_get_eoa(f->shared->lf, H5FD_MEM_SUPER); - H5F_addr_encode(f, &p, (rel_eoa + sblock->base_addr)); + + /* Encode the end-of-file address. Note that at this point in time, + * the EOF value itself may not be reflective of the file's size, as + * we will eventually truncate the file to match the EOA value. As + * such, use the EOA value in its place, knowing that the current EOF + * value will ultimately match it. */ + if ((rel_eof = H5FD_get_eoa(f->shared->lf, H5FD_MEM_SUPER)) == HADDR_UNDEF) + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "driver get_eoa request failed") + H5F_addr_encode(f, &p, (rel_eof + sblock->base_addr)); /* Encode the driver informaton block address */ H5F_addr_encode(f, &p, sblock->driver_addr); @@ -769,8 +776,14 @@ H5F_sblock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t UNUSED addr, /* Encode the address of the superblock extension */ H5F_addr_encode(f, &p, sblock->ext_addr); - rel_eoa = H5FD_get_eoa(f->shared->lf, H5FD_MEM_SUPER); - H5F_addr_encode(f, &p, (rel_eoa + sblock->base_addr)); + /* At this point in time, the EOF value itself may + * not be reflective of the file's size, since we'll eventually + * truncate it to match the EOA value. As such, use the EOA value + * in its place, knowing that the current EOF value will + * ultimately match it. */ + if ((rel_eof = H5FD_get_eoa(f->shared->lf, H5FD_MEM_SUPER)) == HADDR_UNDEF) + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "driver get_eoa request failed") + H5F_addr_encode(f, &p, rel_eof + sblock->base_addr); /* Retrieve information for root group */ if(NULL == (root_oloc = H5G_oloc(f->shared->root_grp))) diff --git a/src/H5Ofill.c b/src/H5Ofill.c index 1e8ccb1..a0fc42e 100644 --- a/src/H5Ofill.c +++ b/src/H5Ofill.c @@ -890,7 +890,7 @@ H5O_fill_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_fill, FILE *s else fprintf(stream, "\n"); - FUNC_LEAVE_NOAPI(SUCCEED); + FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5O_fill_debug() */ @@ -993,7 +993,7 @@ done: if(bkg) H5MM_xfree(bkg); - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* end H5O_fill_convert() */ diff --git a/src/H5Smpio.c b/src/H5Smpio.c index 9a1b5a6..def7598 100644 --- a/src/H5Smpio.c +++ b/src/H5Smpio.c @@ -168,18 +168,23 @@ H5S_mpio_create_point_datatype (size_t elmt_size, hsize_t num_points, if(MPI_SUCCESS != (mpi_code = MPI_Type_contiguous((int)elmt_size, MPI_BYTE, &elmt_type))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_contiguous failed", mpi_code) elmt_type_created = TRUE; - + +#if MPI_VERSION >= 3 + /* Create an MPI datatype for the whole point selection */ + if(MPI_SUCCESS != (mpi_code = MPI_Type_create_hindexed_block((int)num_points, 1, disp, elmt_type, new_type))) + HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_indexed_block failed", mpi_code) +#else /* Allocate block sizes for MPI datatype call */ if(NULL == (blocks = (int *)H5MM_malloc(sizeof(int) * num_points))) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTALLOC, FAIL, "can't allocate array of blocks") - /* Would be nice to have Create_Hindexed_block to avoid this array of all ones */ for(u = 0; u < num_points; u++) blocks[u] = 1; /* Create an MPI datatype for the whole point selection */ if(MPI_SUCCESS != (mpi_code = MPI_Type_create_hindexed((int)num_points, blocks, disp, elmt_type, new_type))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_indexed_block failed", mpi_code) +#endif /* Commit MPI datatype for later use */ if(MPI_SUCCESS != (mpi_code = MPI_Type_commit(new_type))) diff --git a/src/H5public.h b/src/H5public.h index 1e768fe..b01ecc9 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -94,10 +94,10 @@ extern "C" { /* Version numbers */ #define H5_VERS_MAJOR 1 /* For major interface/format changes */ #define H5_VERS_MINOR 9 /* For minor interface/format changes */ -#define H5_VERS_RELEASE 207 /* For tweaks, bug-fixes, or development */ +#define H5_VERS_RELEASE 210 /* For tweaks, bug-fixes, or development */ #define H5_VERS_SUBRELEASE "swmr0" /* For pre-releases like snap0 */ /* Empty string for real releases. */ -#define H5_VERS_INFO "HDF5 library version: 1.9.207-swmr0" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.9.210-swmr0" /* Full version string */ #define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ H5_VERS_RELEASE) diff --git a/src/Makefile.in b/src/Makefile.in index 10d52cb..b944ca1 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -736,7 +736,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 197 +LT_VERS_REVISION = 200 LT_VERS_AGE = 0 # Our main target, the HDF5 library diff --git a/test/testmeta.c b/test/testmeta.c index a008cc7..e1d12e6 100644 --- a/test/testmeta.c +++ b/test/testmeta.c @@ -105,9 +105,11 @@ int main(void) for(j=0; j= 0), ""); /* Create a new file. If file exists its contents will be overwritten. */ - file_id = H5Fcreate(h5_rmprefix(filename), H5F_ACC_TRUNC, H5P_DEFAULT, + file_id = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); VRFY((file_id >= 0), "H5Fcreate"); diff --git a/testpar/t_pflush2.c b/testpar/t_pflush2.c index a570d4c..743a3d3 100644 --- a/testpar/t_pflush2.c +++ b/testpar/t_pflush2.c @@ -133,9 +133,7 @@ error: int main(int argc, char* argv[]) { - hid_t fapl1, fapl2; H5E_auto2_t func; - char name[1024]; const char *envval = NULL; @@ -147,13 +145,6 @@ main(int argc, char* argv[]) MPI_Comm_size(comm, &mpi_size); MPI_Comm_rank(comm, &mpi_rank); - fapl1 = H5Pcreate(H5P_FILE_ACCESS); - H5Pset_fapl_mpio(fapl1, comm, info); - - fapl2 = H5Pcreate(H5P_FILE_ACCESS); - H5Pset_fapl_mpio(fapl2, comm, info); - - if(mpi_rank == 0) TESTING("H5Fflush (part2 with flush)"); @@ -162,6 +153,14 @@ main(int argc, char* argv[]) if (envval == NULL) envval = "nomatch"; if (HDstrcmp(envval, "core") && HDstrcmp(envval, "split")) { + hid_t fapl1, fapl2; + + fapl1 = H5Pcreate(H5P_FILE_ACCESS); + H5Pset_fapl_mpio(fapl1, comm, info); + + fapl2 = H5Pcreate(H5P_FILE_ACCESS); + H5Pset_fapl_mpio(fapl2, comm, info); + /* Check the case where the file was flushed */ h5_fixname(FILENAME[0], fapl1, name, sizeof name); if(check_file(name, fapl1)) @@ -213,6 +212,3 @@ main(int argc, char* argv[]) return 1; } - - - diff --git a/testpar/t_shapesame.c b/testpar/t_shapesame.c index f96c669..d167687 100644 --- a/testpar/t_shapesame.c +++ b/testpar/t_shapesame.c @@ -5037,9 +5037,11 @@ int main(int argc, char **argv) { int mpi_size, mpi_rank; /* mpi variables */ +#ifndef H5_HAVE_WIN32_API /* Un-buffer the stdout and stderr */ - setbuf(stderr, NULL); - setbuf(stdout, NULL); + HDsetbuf(stderr, NULL); + HDsetbuf(stdout, NULL); +#endif MPI_Init(&argc, &argv); MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); diff --git a/testpar/testphdf5.c b/testpar/testphdf5.c index c55e2de..c3da73f 100644 --- a/testpar/testphdf5.c +++ b/testpar/testphdf5.c @@ -307,9 +307,11 @@ int main(int argc, char **argv) H5Ptest_param_t io_mode_confusion_params; H5Ptest_param_t rr_obj_flush_confusion_params; +#ifndef H5_HAVE_WIN32_API /* Un-buffer the stdout and stderr */ - setbuf(stderr, NULL); - setbuf(stdout, NULL); + HDsetbuf(stderr, NULL); + HDsetbuf(stdout, NULL); +#endif MPI_Init(&argc, &argv); MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); diff --git a/tools/h5dump/CMakeTestsXML.cmake b/tools/h5dump/CMakeTestsXML.cmake index 0d4e0f4..a939d78 100644 --- a/tools/h5dump/CMakeTestsXML.cmake +++ b/tools/h5dump/CMakeTestsXML.cmake @@ -414,9 +414,9 @@ # The lone colon here confuses some systems (Cray X1). Skip # it if configure detects that this is a problem. set (TESTTYPE "TEST") - if (NOT "H5_LONE_COLON") + if (NOT ${H5_LONE_COLON}) set (TESTTYPE "SKIP") - endif (NOT "H5_LONE_COLON") + endif (NOT ${H5_LONE_COLON}) ADD_XML_SKIP_H5_TEST (tempty-nons.h5 0 ${TESTTYPE} -X : tempty.h5) ADD_XML_H5_TEST (tempty-nons-2.h5 0 --xml-ns=: tempty.h5) diff --git a/tools/lib/CMakeLists.txt b/tools/lib/CMakeLists.txt index e65673a..3dba919 100644 --- a/tools/lib/CMakeLists.txt +++ b/tools/lib/CMakeLists.txt @@ -24,6 +24,7 @@ set (H5_TOOLS_LIB_SRCS ${HDF5_TOOLS_LIB_SOURCE_DIR}/h5tools_type.c ${HDF5_TOOLS_LIB_SOURCE_DIR}/h5tools_utils.c ${HDF5_TOOLS_LIB_SOURCE_DIR}/h5trav.c + ${HDF5_TOOLS_LIB_SOURCE_DIR}/io_timer.c ) set (H5_TOOLS_LIB_HDRS diff --git a/tools/lib/Makefile.am b/tools/lib/Makefile.am index 9050aac..e8fc6a1 100644 --- a/tools/lib/Makefile.am +++ b/tools/lib/Makefile.am @@ -28,7 +28,7 @@ noinst_LTLIBRARIES=libh5tools.la libh5tools_la_SOURCES=h5tools.c h5tools_dump.c h5tools_str.c h5tools_utils.c h5diff.c \ h5diff_array.c h5diff_attr.c h5diff_dset.c h5diff_util.c h5trav.c \ - h5tools_filters.c h5tools_ref.c h5tools_type.c + h5tools_filters.c h5tools_ref.c h5tools_type.c io_timer.c # Test program. Link using libhdf5 and libh5tools TEST_PROG= diff --git a/tools/lib/Makefile.in b/tools/lib/Makefile.in index 210b6b3..b2afb07 100644 --- a/tools/lib/Makefile.in +++ b/tools/lib/Makefile.in @@ -115,7 +115,7 @@ libh5tools_la_LIBADD = am_libh5tools_la_OBJECTS = h5tools.lo h5tools_dump.lo h5tools_str.lo \ h5tools_utils.lo h5diff.lo h5diff_array.lo h5diff_attr.lo \ h5diff_dset.lo h5diff_util.lo h5trav.lo h5tools_filters.lo \ - h5tools_ref.lo h5tools_type.lo + h5tools_ref.lo h5tools_type.lo io_timer.lo libh5tools_la_OBJECTS = $(am_libh5tools_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -666,7 +666,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog noinst_LTLIBRARIES = libh5tools.la libh5tools_la_SOURCES = h5tools.c h5tools_dump.c h5tools_str.c h5tools_utils.c h5diff.c \ h5diff_array.c h5diff_attr.c h5diff_dset.c h5diff_util.c h5trav.c \ - h5tools_filters.c h5tools_ref.c h5tools_type.c + h5tools_filters.c h5tools_ref.c h5tools_type.c io_timer.c # Test program. Link using libhdf5 and libh5tools @@ -773,6 +773,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/h5tools_type.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/h5tools_utils.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/h5trav.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/io_timer.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< diff --git a/tools/lib/io_timer.c b/tools/lib/io_timer.c new file mode 100644 index 0000000..78e7fe9 --- /dev/null +++ b/tools/lib/io_timer.c @@ -0,0 +1,232 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/* changes: + * rename pio_timer.c as io_timer.c; + * Removed pio_perf.h so that it is not dependant on it; + * Removed set_timer_type() and get_timer_type() since no one calls them; + * Merged sio_timer.c into io_timer.c; + */ + +/* + * Purpose: + * + * This is a module of useful timing functions for performance testing. + */ + +#include +#include + +#include "H5private.h" +#include "hdf5.h" + +#ifdef H5_HAVE_PARALLEL +#include +#endif + +#include "io_timer.h" + +/* + * The number to divide the tv_usec field with to get a nice decimal to add to + * the number of seconds. + */ +#define MICROSECOND 1000000.0 + +/* global variables */ +io_time_t *timer_g; /* timer: global for stub functions */ + +/* + * Function: sub_time + * Purpose: Struct two time values, and return the difference, in microseconds + * + * Note that the function assumes that a > b + * Programmer: Leon Arber, 1/27/06 + */ +static double sub_time(struct timeval* a, struct timeval* b) +{ + return (((double)a->tv_sec + + ((double)a->tv_usec) / MICROSECOND) - + ((double)b->tv_sec + + ((double)b->tv_usec) / MICROSECOND)); +} + + +/* + * Function: io_time_new + * Purpose: Build us a brand, spankin', new performance time object. + * The object is a black box to the user. They just tell us + * what type of timer they want (MPI_CLOCK for MPI_Wtime or + * SYS_CLOCK for system time). + * Return: Pointer to io_time object + * Programmer: Bill Wendling, 01. October 2001 + * Modifications: + */ +io_time_t * +io_time_new(clock_type type) +{ + io_time_t *pt = (io_time_t *)HDcalloc(1, sizeof(struct io_time_t)); + + /* set global timer variable */ + timer_g = pt; + + pt->type = type; + return pt; +} + +/* + * Function: io_time_destroy + * Purpose: Remove the memory allocated for the io_time object. Only + * need to call on a pointer allocated with the ``io_time_new'' + * function. + * Return: Nothing + * Programmer: Bill Wendling, 01. October 2001 + * Modifications: + */ +void +io_time_destroy(io_time_t *pt) +{ + HDfree(pt); + /* reset the global timer pointer too. */ + timer_g = NULL; +} + +#if 0 +/* no one is calling set_timer_type or get_timer_type ???*/ +/* + * Function: set_timer_type + * Purpose: Set the type of the timer to either MPI_CLOCK or SYS_CLOCK. + * This really only needs to be called if you didn't construct a + * timer with the pio_timer_new function (shame!). + * Return: Nothing + * Programmer: Bill Wendling, 04. October 2001 + * Modifications: + */ +void +set_timer_type(io_time_t *pt, clock_type type) +{ + pt->type = type; +} + +/* + * Function: get_timer_type + * Purpose: Get the type of the timer. + * Return: MPI_CLOCK or SYS_CLOCK. + * Programmer: Bill Wendling, 04. October 2001 + * Modifications: + */ +clock_type +get_timer_type(io_time_t *pt) +{ + return pt->type; +} +#endif + +/* + * Function: set_time + * 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) +{ + /* sanity check */ + assert(pt); + + 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; +#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])); + + + } else { + struct timeval sys_t; + + 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])); + + } + break; + default: + HDfprintf(stderr, "Unknown time clock type (%d)\n", pt->type); + return (NULL); + break; + } + +#if 0 + /* this does not belong here. Need fix in h5perf code when set_time() is called. -AKC- */ + debug_start_stop_time(pt, t, start_stop); +#endif + + return pt; +} + +/* + * Function: get_time + * 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: + */ +double +get_time(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 new file mode 100644 index 0000000..4ce0733 --- /dev/null +++ b/tools/lib/io_timer.h @@ -0,0 +1,83 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#ifndef IO_TIMER__ +#define IO_TIMER__ + +#include "hdf5.h" + +#if defined(H5_TIME_WITH_SYS_TIME) +# include +# include +#elif defined(H5_HAVE_SYS_TIME_H) +# include +#else +# include +#endif + +#ifdef H5_HAVE_WINSOCK2_H +# include +#endif /* H5_HAVE_WINSOCK2_H */ +/* The different types of timers we can have */ +typedef enum timer_type_ { + HDF5_FILE_OPENCLOSE, + HDF5_DATASET_CREATE, + HDF5_MPI_WRITE, + HDF5_MPI_READ, + HDF5_FILE_READ_OPEN, + HDF5_FILE_READ_CLOSE, + HDF5_FILE_WRITE_OPEN, + HDF5_FILE_WRITE_CLOSE, + HDF5_FINE_WRITE_FIXED_DIMS, + HDF5_FINE_READ_FIXED_DIMS, + HDF5_GROSS_WRITE_FIXED_DIMS, + HDF5_GROSS_READ_FIXED_DIMS, + HDF5_RAW_WRITE_FIXED_DIMS, + HDF5_RAW_READ_FIXED_DIMS, + NUM_TIMERS +} timer_type; + +typedef enum clock_type_ { + SYS_CLOCK = 0, /* Use system clock to measure time */ + MPI_CLOCK = 1 /* Use MPI clock to measure time */ +} clock_type; + +/* Miscellaneous identifiers */ +enum { + TSTART, /* Start a specified timer */ + TSTOP /* Stop a specified timer */ +}; + +/* The performance time structure */ +typedef struct io_time_t { + clock_type type; + double total_time[NUM_TIMERS]; + double mpi_timer[NUM_TIMERS]; + struct timeval sys_timer[NUM_TIMERS]; +} io_time_t; + +/* External function declarations */ +#ifdef __cplusplus +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); +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* IO_TIMER__ */ diff --git a/tools/perform/CMakeLists.txt b/tools/perform/CMakeLists.txt index 6887c60..0713661 100644 --- a/tools/perform/CMakeLists.txt +++ b/tools/perform/CMakeLists.txt @@ -17,7 +17,6 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib ) # -------------------------------------------------------------------- #-- Adding test for h5perf_serial set (h5perf_serial_SRCS - ${HDF5_PERFORM_SOURCE_DIR}/sio_timer.c ${HDF5_PERFORM_SOURCE_DIR}/sio_perf.c ${HDF5_PERFORM_SOURCE_DIR}/sio_engine.c ) @@ -30,7 +29,6 @@ set_target_properties (h5perf_serial PROPERTIES FOLDER perform) 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 ) @@ -74,15 +72,17 @@ TARGET_C_PROPERTIES (overhead " " " ") target_link_libraries (overhead ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (overhead PROPERTIES FOLDER perform) +if (BUILD_TESTING) #-- Adding test for perf_meta -set (perf_meta_SRCS - ${HDF5_PERFORM_SOURCE_DIR}/perf_meta.c -) -add_executable (perf_meta ${perf_meta_SRCS}) -TARGET_NAMING (perf_meta ${LIB_TYPE}) -TARGET_C_PROPERTIES (perf_meta " " " ") -target_link_libraries (perf_meta ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) -set_target_properties (perf_meta PROPERTIES FOLDER perform) + set (perf_meta_SRCS + ${HDF5_PERFORM_SOURCE_DIR}/perf_meta.c + ) + add_executable (perf_meta ${perf_meta_SRCS}) + TARGET_NAMING (perf_meta ${LIB_TYPE}) + TARGET_C_PROPERTIES (perf_meta " " " ") + target_link_libraries (perf_meta ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) + set_target_properties (perf_meta PROPERTIES FOLDER perform) +endif (BUILD_TESTING) #-- Adding test for zip_perf set (zip_perf_SRCS @@ -94,10 +94,9 @@ TARGET_C_PROPERTIES (zip_perf " " " ") target_link_libraries (zip_perf ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (zip_perf PROPERTIES FOLDER perform) -if (H5_HAVE_PARALLEL) +if (H5_HAVE_PARALLEL AND BUILD_TESTING) #-- Adding test for h5perf set (h5perf_SRCS - ${HDF5_PERFORM_SOURCE_DIR}/pio_timer.c ${HDF5_PERFORM_SOURCE_DIR}/pio_perf.c ${HDF5_PERFORM_SOURCE_DIR}/pio_engine.c ) @@ -110,7 +109,6 @@ if (H5_HAVE_PARALLEL) 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 ) @@ -123,18 +121,6 @@ if (H5_HAVE_PARALLEL) target_link_libraries (h5perf_alone ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) set_target_properties (h5perf_alone PROPERTIES FOLDER perform) endif (HDF5_BUILD_PERFORM_STANDALONE) - - if (HDF5_BUILD_PARALLEL_ALL) - #-- Adding test for benchpar - set (benchpar_SRCS - ${HDF5_PERFORM_SOURCE_DIR}/benchpar.c - ) - add_executable (benchpar ${benchpar_SRCS}) - TARGET_NAMING (benchpar ${LIB_TYPE}) - TARGET_C_PROPERTIES (benchpar " " " ") - target_link_libraries (benchpar ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) - set_target_properties (benchpar PROPERTIES FOLDER perform) - endif (HDF5_BUILD_PARALLEL_ALL) -endif (H5_HAVE_PARALLEL) +endif (H5_HAVE_PARALLEL AND BUILD_TESTING) include (CMakeTests.cmake) diff --git a/tools/perform/CMakeTests.cmake b/tools/perform/CMakeTests.cmake index 74055d5..6927124 100644 --- a/tools/perform/CMakeTests.cmake +++ b/tools/perform/CMakeTests.cmake @@ -55,8 +55,4 @@ if (H5_HAVE_PARALLEL) if (HDF5_BUILD_PERFORM_STANDALONE) add_test (NAME PERFORM_h5perf_alone COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) endif (HDF5_BUILD_PERFORM_STANDALONE) - - if (HDF5_BUILD_PARALLEL_ALL) - add_test (NAME PERFORM_benchpar COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) - endif (HDF5_BUILD_PARALLEL_ALL) endif (H5_HAVE_PARALLEL) diff --git a/tools/perform/Makefile.am b/tools/perform/Makefile.am index 59c598a..1af0e7f 100644 --- a/tools/perform/Makefile.am +++ b/tools/perform/Makefile.am @@ -59,8 +59,8 @@ TEST_PROG = iopipe chunk overhead zip_perf perf_meta h5perf_serial $(BUILD_ALL_P # "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 +h5perf_SOURCES=pio_perf.c pio_engine.c +h5perf_serial_SOURCES=sio_perf.c sio_engine.c # These are the files that `make clean' (and derivatives) will remove from # this directory. diff --git a/tools/perform/Makefile.in b/tools/perform/Makefile.in index 1244e27..24aa8be 100644 --- a/tools/perform/Makefile.in +++ b/tools/perform/Makefile.in @@ -130,15 +130,13 @@ AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = -am_h5perf_OBJECTS = pio_perf.$(OBJEXT) pio_engine.$(OBJEXT) \ - pio_timer.$(OBJEXT) +am_h5perf_OBJECTS = pio_perf.$(OBJEXT) pio_engine.$(OBJEXT) h5perf_OBJECTS = $(am_h5perf_OBJECTS) h5perf_DEPENDENCIES = $(LIBH5TOOLS) $(LIBH5TEST) $(LIBHDF5) h5perf_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(h5perf_LDFLAGS) $(LDFLAGS) -o $@ -am_h5perf_serial_OBJECTS = sio_perf.$(OBJEXT) sio_engine.$(OBJEXT) \ - sio_timer.$(OBJEXT) +am_h5perf_serial_OBJECTS = sio_perf.$(OBJEXT) sio_engine.$(OBJEXT) h5perf_serial_OBJECTS = $(am_h5perf_serial_OBJECTS) h5perf_serial_DEPENDENCIES = $(LIBH5TOOLS) $(LIBH5TEST) $(LIBHDF5) h5perf_serial_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ @@ -723,8 +721,8 @@ h5perf_serial_LDFLAGS = $(LT_STATIC_EXEC) $(AM_LDFLAGS) @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 +h5perf_SOURCES = pio_perf.c pio_engine.c +h5perf_serial_SOURCES = sio_perf.c sio_engine.c # These are the files that `make clean' (and derivatives) will remove from # this directory. @@ -898,10 +896,8 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/perf_meta.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pio_engine.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pio_perf.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pio_timer.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sio_engine.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sio_perf.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sio_timer.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zip_perf.Po@am__quote@ .c.o: diff --git a/tools/perform/benchpar.c b/tools/perform/benchpar.c deleted file mode 100644 index b75006a..0000000 --- a/tools/perform/benchpar.c +++ /dev/null @@ -1,488 +0,0 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * - * All rights reserved. * - * * - * This file is part of HDF5. The full HDF5 copyright notice, including * - * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -#ifdef H5_HAVE_UNISTD_H -#include -#endif -#include -#include -#include -#include -#include - -#include "hdf5.h" - -/* Local macros */ -#ifdef H5_HAVE_VISUAL_STUDIO -#define HDgetlogin() Wgetlogin() -#else /* H5_HAVE_VISUAL_STUDIO */ -#define HDgetlogin() getlogin() -#endif /* H5_HAVE_VISUAL_STUDIO */ - -/* - * HDF Boolean type. - */ -#ifndef FALSE -# define FALSE 0 -#endif -#ifndef TRUE -# define TRUE 1 -#endif - -/* defines for type of VFL driver to use */ -#define FACC_DEFAULT 0 -#define FACC_MPIO 1 - -/* Defines for computing performance information */ -#define ONE_KB 1024 -#define ONE_MB (ONE_KB * ONE_KB) -#define ONE_GB (ONE_MB * ONE_KB) - -/* report 0.0 in case t is zero too */ -#define MB_PER_SEC(bytes,t) ((fabs(t)<0.0000000001) ? 0.0 : ((((double)bytes) / ONE_MB) / (t))) - -/* Control default behavior (with no command line arguments) */ -#define DEFAULT_RANK 3 -#define DEFAULT_DIM 1024 -#define DEFAULT_PREFIX "/tmp" -#define DEFAULT_USERNAME "koziol" -#define DEFAULT_FILENAME "benchpar.h5" -#define DEFAULT_SLICE 0 -#define DEFAULT_C_TYPE int -#define DEFAULT_HDF5_DATATYPE H5T_NATIVE_INT /* Keep this in sync with the DEFAULT_C_TYPE */ -#define DEFAULT_DATASET_NAME "Dataset" -#define DEFAULT_VFL_DRIVER FACC_MPIO -#define DEFAULT_PAR_MODE H5FD_MPIO_COLLECTIVE -#define DEFAULT_CHUNK_STORAGE 0 -#define DEFAULT_ITER 3 - -/* MPI info */ -int mpi_rank, mpi_size; -int mpi_namelen; -char mpi_name[MPI_MAX_PROCESSOR_NAME]; - -/* Usage information */ -static void usage(void) -{ - printf("usage: benchpar [-d <# of dims>] [-s ] [-f ] [-h]\n"); - printf(" [-S ] [-I] [-c] [-i <# of iterations>\n"); - printf(" -c - Use chunked storage for dataset with 1-1 exact\n"); - printf(" mapping of chunks to hyperslabs\n"); - printf(" Default: off (i.e. contiguous storage)\n"); - printf(" -d <# of dims> - Number of dimensions of the dataset\n"); - printf(" Default: 3\n"); - printf(" -f - Set the name of the test file\n"); - printf(" Default: /tmp//benchpar.h5\n"); - printf(" -h - Prints usage information\n"); - printf(" -i <# of iters> - Set the number of test iterations to perform\n"); - printf(" Default: 3\n"); - printf(" -I - Use independent parallel I/O\n"); - printf(" Default: use collective parallel I/O\n"); - printf(" -s - Set the size of each of the dataset's dimensions\n"); - printf(" Default: 1024\n"); - printf(" -S - Set the dimension to slice the dataset along\n"); - printf(" Default: 0\n"); -} /* end usage() */ - -/* Create & initialize file creation property list with appropriate properties */ -static hid_t create_fcpl(void) -{ - hid_t fcpl; /* File creation property list */ - - fcpl=H5Pcreate(H5P_FILE_CREATE); - assert(fcpl>0); - - return(fcpl); -} /* end create_fcpl() */ - -/* Create & initialize file access property list with appropriate properties */ -static hid_t create_fapl(MPI_Comm comm, MPI_Info info, int acc_type ) -{ - hid_t fapl; /* File access property list */ - herr_t ret; /* Generic return value */ - - fapl = H5Pcreate (H5P_FILE_ACCESS); - assert(fapl>0); - - /* set parallel access with communicator, using MPI-I/O driver */ - if (acc_type == FACC_MPIO) { - ret = H5Pset_fapl_mpio(fapl, comm, info); - assert(ret>=0); - } /* end if */ - - return (fapl); -} /* end create_fapl() */ - -/* Create & initialize dataset creation property list with appropriate properties */ -static hid_t create_dcpl(unsigned use_chunks, int rank, hsize_t *dims) -{ - hid_t dcpl; /* Dataset creation property list */ - herr_t ret; /* Generic return value */ - - dcpl=H5Pcreate(H5P_DATASET_CREATE); - assert(dcpl>0); - - /* Check if the dataset should be chunked */ - if(use_chunks) { - ret = H5Pset_chunk(dcpl, rank, dims); - assert(ret>=0); - } /* end if */ - - return(dcpl); -} /* end create_dcpl() */ - -/* Create & initialize dataset transfer property list with appropriate properties */ -static hid_t create_dxpl(H5FD_mpio_xfer_t par_mode) -{ - hid_t dxpl; /* Dataset creation property list */ - herr_t ret; /* Generic return value */ - - dxpl=H5Pcreate(H5P_DATASET_XFER); - assert(dxpl>0); - - /* Set collective I/O on this transfer */ - ret=H5Pset_dxpl_mpio(dxpl, par_mode); - assert(ret>=0); - - return(dxpl); -} /* end create_dcpl() */ - -int main(int argc, char *argv[]) -{ - int curr_arg; /* Current command line argument being processed */ - int rank; /* Number of dimensions of the dataset */ - hsize_t dim_size; /* Dimension size of each dimension */ - hsize_t dims[H5S_MAX_RANK]; /* Pointer to array of dimensions */ - hsize_t start[H5S_MAX_RANK]; /* Pointer to array of starting locations for hyperslab selection */ - hsize_t count[H5S_MAX_RANK]; /* Pointer to array of counts for hyperslab selection */ - unsigned slice_dim; /* Dimension to slice up */ - char *file_name=NULL; /* Name of file to put data into */ - hid_t fcpl; /* HDF5 File creation property list ID */ - hid_t fapl; /* HDF5 File access property list ID */ - hid_t dcpl; /* HDF5 Dataset creation property list ID */ - hid_t dxpl; /* HDF5 Dataset transfer property list ID */ - hid_t fid; /* HDF5 file ID */ - hid_t dsid; /* HDF5 dataset ID */ - hid_t file_sid; /* HDF5 dataspace ID for dataset on disk */ - hid_t mem_sid; /* HDF5 dataspace ID for dataset in memory */ - DEFAULT_C_TYPE *buf; /* Buffer to write out */ - hsize_t buf_size; /* Size of buffer to write */ - int i; /* Local index variable */ - herr_t ret; /* Generic return value */ - double start_write_time, end_write_time, elap_write_time; /* Start, end and elapsed time to write raw data */ - double tmp_max_write_time; /* Temporary holders for maximum time for all nodes to perform raw data I/O */ - double max_write_time=-DBL_MAX, min_write_time=DBL_MAX; /* Minimum & maximum time for all nodes to perform raw data I/O */ - double start_file_time, end_file_time, elap_file_time; /* Start, end and elapsed time from file open to file close */ - double tmp_max_file_time; /* Temporary holders for maximum time for all nodes from file open to file close */ - double max_file_time=-DBL_MAX, min_file_time=DBL_MAX; /* Minimum & maximum time for all nodes from file open to file close */ - int vfl_type; /* Type of VFL driver to use */ - H5FD_mpio_xfer_t par_mode; /* Type of parallel I/O to perform */ - unsigned use_chunks; /* Whether to use chunks for dataset or not */ - unsigned num_iter; /* Number of iterations to perform */ - unsigned u; /* Local index variable */ - - /* Un-buffer the stdout and stderr */ - setbuf(stderr, NULL); - setbuf(stdout, NULL); - - /* MPI initialization */ - MPI_Init(&argc,&argv); - MPI_Comm_size(MPI_COMM_WORLD,&mpi_size); - MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank); - MPI_Get_processor_name(mpi_name,&mpi_namelen); - - /* Set some defaults */ - rank=DEFAULT_RANK; - dim_size=DEFAULT_DIM; - slice_dim=DEFAULT_SLICE; - vfl_type=DEFAULT_VFL_DRIVER; - par_mode=DEFAULT_PAR_MODE; - use_chunks=DEFAULT_CHUNK_STORAGE; - num_iter=DEFAULT_ITER; - - /* Parse command line arguments */ - if(argc>1) { - curr_arg=1; - while(curr_arg=rank) { - printf("rank=%d, error, slice dim larger than rank: slice_dim=%d, rank=%d\n",mpi_rank,slice_dim,rank); - goto done; - } /* end if */ - - /* Set rest of defaults */ - if(file_name==NULL) { - char *login; /* Pointer to login name */ - - /* Get the login name for this user */ - login=HDgetlogin(); - if(login==NULL) - login=DEFAULT_USERNAME; - - /* Allocate enough room for the prefix, the login name, two '/'s, the filename and the string terminator */ - file_name=malloc(strlen(DEFAULT_PREFIX)+1+strlen(login)+1+strlen(DEFAULT_FILENAME)+1); - strcpy(file_name,DEFAULT_PREFIX); - strcat(file_name,"/"); - strcat(file_name,login); - strcat(file_name,"/"); - strcat(file_name,DEFAULT_FILENAME); - } /* end if */ - - /* Allocate memory for this process's portion of dataset */ - buf_size=sizeof(DEFAULT_C_TYPE); - for(i=0; i0); - - /* Create file access property list */ - fapl=create_fapl(MPI_COMM_WORLD,MPI_INFO_NULL,vfl_type); - assert(fapl>0); - - /* Get file start time */ - start_file_time = MPI_Wtime(); - - /* Create file */ - fid=H5Fcreate(file_name,H5F_ACC_TRUNC,fcpl,fapl); - assert(fid>0); - - /* Close file creation property list */ - ret=H5Pclose(fcpl); - assert(ret>=0); - - /* Close file access property list */ - ret=H5Pclose(fapl); - assert(ret>=0); - - /* Create dataspace for dataset on disk */ - for(i=0; i0); - - /* Create dataspace for buffer in memory */ - for(i=0; i0); - - /* Create dataset creation property list */ - dcpl=create_dcpl(use_chunks,rank,dims); - assert(dcpl>0); - - /* Create dataset */ - dsid = H5Dcreate2(fid, DEFAULT_DATASET_NAME, DEFAULT_HDF5_DATATYPE, file_sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); - assert(dsid > 0); - - /* Close dataset creation property list */ - ret=H5Pclose(dcpl); - assert(ret>=0); - - /* Select hyperslab for file dataspace */ - for(i=0; i=0); - - /* Create dataset transfer property list */ - dxpl=create_dxpl(par_mode); - assert(dxpl>0); - - /* Get raw data start time */ - start_write_time = MPI_Wtime(); - - /* Write hyperslab to dataset */ - ret = H5Dwrite(dsid, DEFAULT_HDF5_DATATYPE, mem_sid, - file_sid, dxpl, buf); - assert(ret>=0); - - /* Get stop time for raw data timer */ - end_write_time = MPI_Wtime(); - - /* Close dataset transfer property list */ - ret=H5Pclose(dxpl); - assert(ret>=0); - - /* Close memory dataspace */ - ret=H5Sclose(mem_sid); - assert(ret>=0); - - /* Close file dataspace */ - ret=H5Sclose(file_sid); - assert(ret>=0); - - /* Close dataset */ - ret=H5Dclose(dsid); - assert(ret>=0); - - /* Close file */ - ret=H5Fclose(fid); - assert(ret>=0); - - /* Get stop time for file timer */ - end_file_time = MPI_Wtime(); - - /* Compute timing results */ - elap_write_time=end_write_time-start_write_time; - elap_file_time=end_file_time-start_file_time; - - /* Collect the minimum and maximum times by MPI reduces */ - MPI_Allreduce(&elap_write_time, &tmp_max_write_time, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); - MPI_Allreduce(&elap_file_time, &tmp_max_file_time, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); - - /* Track the fastest & slowest total runs */ - if(tmp_max_write_time>max_write_time) - max_write_time=tmp_max_write_time; - if(tmp_max_write_timemax_file_time) - max_file_time=tmp_max_file_time; - if(tmp_max_file_time= 4) { + const char *msg; + int myrank; + + MPI_Comm_rank(pio_comm_g, &myrank); + + switch (t) { + case HDF5_FILE_OPENCLOSE: + msg = "File Open/Close"; + break; + case HDF5_DATASET_CREATE: + msg = "Dataset Create"; + break; + case HDF5_MPI_WRITE: + msg = "MPI Write"; + break; + case HDF5_MPI_READ: + msg = "MPI Read"; + break; + case HDF5_FINE_WRITE_FIXED_DIMS: + msg = "Fine Write"; + break; + case HDF5_FINE_READ_FIXED_DIMS: + msg = "Fine Read"; + break; + case HDF5_GROSS_WRITE_FIXED_DIMS: + msg = "Gross Write"; + break; + case HDF5_GROSS_READ_FIXED_DIMS: + msg = "Gross Read"; + break; + case HDF5_RAW_WRITE_FIXED_DIMS: + msg = "Raw Write"; + break; + case HDF5_RAW_READ_FIXED_DIMS: + msg = "Raw Read"; + break; + default: + msg = "Unknown Timer"; + break; + } + + fprintf(output, " Proc %d: %s %s: %.2f\n", myrank, msg, + (start_stop == TSTART ? "Start" : "Stop"), + pt->total_time[t]); + } +#endif +} /* debug_start_stop_time */ + #else /* H5_HAVE_PARALLEL */ /* diff --git a/tools/perform/pio_perf.h b/tools/perform/pio_perf.h index 3295e2b..0fff7a3 100644 --- a/tools/perform/pio_perf.h +++ b/tools/perform/pio_perf.h @@ -24,7 +24,7 @@ #else #include "pio_standalone.h" #endif -#include "pio_timer.h" +#include "io_timer.h" /* setup the dataset no fill option if this is v1.5 or more */ #if H5_VERS_MAJOR > 1 || H5_VERS_MINOR > 4 @@ -59,7 +59,7 @@ typedef struct parameters_ { typedef struct results_ { herr_t ret_code; - pio_time *timers; + io_time_t *timers; } results; #ifndef SUCCESS @@ -71,7 +71,7 @@ typedef struct results_ { #endif /* !FAIL */ extern FILE *output; /* output file */ -extern pio_time *timer_g; /* timer: global for stub functions */ +extern io_time_t *timer_g; /* timer: global for stub functions */ extern int comm_world_rank_g; /* my rank in MPI_COMM_RANK */ extern int comm_world_nprocs_g;/* num. of processes of MPI_COMM_WORLD */ extern MPI_Comm pio_comm_g; /* Communicator to run the PIO */ diff --git a/tools/perform/pio_timer.c b/tools/perform/pio_timer.c deleted file mode 100644 index aba219e..0000000 --- a/tools/perform/pio_timer.c +++ /dev/null @@ -1,258 +0,0 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * - * All rights reserved. * - * * - * This file is part of HDF5. The full HDF5 copyright notice, including * - * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -/* - * Purpose: - * - * This is a module of useful timing functions for performance testing. - */ - -#include -#include - -#include "hdf5.h" - -#ifdef H5_HAVE_PARALLEL - -#include - -#include "pio_perf.h" - -/* - * The number to divide the tv_usec field with to get a nice decimal to add to - * the number of seconds. - */ -#define MICROSECOND 1000000.0 - -/* global variables */ -pio_time *timer_g; /* timer: global for stub functions */ - -/* - * Function: sub_time - * Purpose: Struct two time values, and return the difference, in microseconds - * - * Note that the function assumes that a > b - * Programmer: Leon Arber, 1/27/06 - */ -static double sub_time(struct timeval* a, struct timeval* b) -{ - return (((double)a->tv_sec + - ((double)a->tv_usec) / MICROSECOND) - - ((double)b->tv_sec + - ((double)b->tv_usec) / MICROSECOND)); -} - - -/* - * Function: pio_time_new - * Purpose: Build us a brand, spankin', new performance time object. - * The object is a black box to the user. They just tell us - * what type of timer they want (MPI_TIMER for MPI_Wtime or - * SYS_TIMER for system time). - * Return: Pointer to pio_time object - * Programmer: Bill Wendling, 01. October 2001 - * Modifications: - */ -pio_time * -pio_time_new(clock_type type) -{ - pio_time *pt = (pio_time *)calloc(1, sizeof(struct pio_time_)); - - /* set global timer variable */ - timer_g = pt; - - pt->type = type; - return pt; -} - -/* - * Function: pio_time_destroy - * Purpose: Remove the memory allocated for the pio_time object. Only - * need to call on a pointer allocated with the ``pio_time_new'' - * function. - * Return: Nothing - * Programmer: Bill Wendling, 01. October 2001 - * Modifications: - */ -void -pio_time_destroy(pio_time *pt) -{ - HDfree(pt); - /* reset the global timer pointer too. */ - timer_g = NULL; -} - -/* - * Function: set_timer_type - * Purpose: Set the type of the timer to either MPI_TIMER or SYS_TIMER. - * This really only needs to be called if you didn't construct a - * timer with the pio_timer_new function (shame!). - * Return: Nothing - * Programmer: Bill Wendling, 04. October 2001 - * Modifications: - */ -void -set_timer_type(pio_time *pt, clock_type type) -{ - pt->type = type; -} - -/* - * Function: get_timer_type - * Purpose: Get the type of the timer. - * Return: MPI_TIMER or SYS_TIMER. - * Programmer: Bill Wendling, 04. October 2001 - * Modifications: - */ -clock_type -get_timer_type(pio_time *pt) -{ - return pt->type; -} - -/* - * Function: set_time - * Purpose: Set the time in a ``pio_time'' object. - * Return: Pointer to the passed in ``pio_time'' object. - * Programmer: Bill Wendling, 01. October 2001 - * Modifications: - */ -pio_time * -set_time(pio_time *pt, timer_type t, int start_stop) -{ - if (pt) { - if (pt->type == MPI_TIMER) { - 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]; - } - } else { - 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])); - - - } else { - struct timeval sys_t; - - HDgettimeofday(&sys_t, NULL); - pt->total_time[t] += sub_time(&sys_t, &(pt->sys_timer[t])); - -/* ((double)sys_t.tv_sec + - ((double)sys_t.tv_usec) / MICROSECOND) - - ((double)pt->sys_timer[t].tv_sec + - ((double)pt->sys_timer[t].tv_usec) / MICROSECOND);*/ - - /* 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])); - - } - } - - if (pio_debug_level >= 4) { - const char *msg; - int myrank; - - MPI_Comm_rank(pio_comm_g, &myrank); - - switch (t) { - case HDF5_FILE_OPENCLOSE: - msg = "File Open/Close"; - break; - case HDF5_DATASET_CREATE: - msg = "Dataset Create"; - break; - case HDF5_MPI_WRITE: - msg = "MPI Write"; - break; - case HDF5_MPI_READ: - msg = "MPI Read"; - break; - case HDF5_FINE_WRITE_FIXED_DIMS: - msg = "Fine Write"; - break; - case HDF5_FINE_READ_FIXED_DIMS: - msg = "Fine Read"; - break; - case HDF5_GROSS_WRITE_FIXED_DIMS: - msg = "Gross Write"; - break; - case HDF5_GROSS_READ_FIXED_DIMS: - msg = "Gross Read"; - break; - case HDF5_RAW_WRITE_FIXED_DIMS: - msg = "Raw Write"; - break; - case HDF5_RAW_READ_FIXED_DIMS: - msg = "Raw Read"; - break; - default: - msg = "Unknown Timer"; - break; - } - - fprintf(output, " Proc %d: %s %s: %.2f\n", myrank, msg, - (start_stop == TSTART ? "Start" : "Stop"), - pt->total_time[t]); - } - } - - return pt; -} - -/* - * Function: get_time - * Purpose: Get the time from a ``pio_time'' object. - * Return: The number of seconds as a DOUBLE. - * Programmer: Bill Wendling, 01. October 2001 - * Modifications: - */ -double -get_time(pio_time *pt, timer_type t) -{ - return pt->total_time[t]; -} - -#endif /* H5_HAVE_PARALLEL */ -#ifdef STANDALONE -#include "pio_standalone.c" -#endif diff --git a/tools/perform/pio_timer.h b/tools/perform/pio_timer.h deleted file mode 100644 index a5ee6d7..0000000 --- a/tools/perform/pio_timer.h +++ /dev/null @@ -1,82 +0,0 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * - * All rights reserved. * - * * - * This file is part of HDF5. The full HDF5 copyright notice, including * - * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -#ifndef PIO_TIMER__ -#define PIO_TIMER__ - -#include "hdf5.h" - -#if defined(H5_TIME_WITH_SYS_TIME) -# include -# include -#elif defined(H5_HAVE_SYS_TIME_H) -# include -#else -# include -#endif - -/* The different types of timers we can have */ -typedef enum timer_type_ { - HDF5_FILE_OPENCLOSE, - HDF5_DATASET_CREATE, - HDF5_MPI_WRITE, - HDF5_MPI_READ, - HDF5_FILE_READ_OPEN, - HDF5_FILE_READ_CLOSE, - HDF5_FILE_WRITE_OPEN, - HDF5_FILE_WRITE_CLOSE, - HDF5_FINE_WRITE_FIXED_DIMS, - HDF5_FINE_READ_FIXED_DIMS, - HDF5_GROSS_WRITE_FIXED_DIMS, - HDF5_GROSS_READ_FIXED_DIMS, - HDF5_RAW_WRITE_FIXED_DIMS, - HDF5_RAW_READ_FIXED_DIMS, - NUM_TIMERS -} timer_type; - -typedef enum clock_type_ { - MPI_TIMER = 0, /* Use MPI timer to measure time */ - SYS_TIMER = 1 /* Use system clock to measure time */ -} clock_type; - -/* Miscellaneous identifiers */ -enum { - TSTART, /* Start a specified timer */ - TSTOP /* Stop a specified timer */ -}; - -/* The performance time structure */ -typedef struct pio_time_ { - clock_type type; - double total_time[NUM_TIMERS]; - double mpi_timer[NUM_TIMERS]; - struct timeval sys_timer[NUM_TIMERS]; -} pio_time; - -/* External function declarations */ -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ -extern pio_time *pio_time_new(clock_type t); -extern void pio_time_destroy(pio_time *pt); -extern void set_timer_type(pio_time *pt, clock_type type); -extern clock_type get_timer_type(pio_time *pt); -extern pio_time *set_time(pio_time *pt, timer_type t, int start_stop); -extern double get_time(pio_time *pt, timer_type t); -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* PIO_TIMER__ */ diff --git a/tools/perform/sio_engine.c b/tools/perform/sio_engine.c index 07e6b16c..3b28ea7 100644 --- a/tools/perform/sio_engine.c +++ b/tools/perform/sio_engine.c @@ -29,7 +29,6 @@ #include "hdf5.h" #include "sio_perf.h" -#include "sio_timer.h" /* Macro definitions */ @@ -143,11 +142,11 @@ do_sio(parameters param) switch (iot) { case POSIXIO: fd.posixfd = -1; - res.timers = sio_time_new(); + res.timers = io_time_new(SYS_CLOCK); break; case HDF5: fd.h5fd = -1; - res.timers = sio_time_new(); + res.timers = io_time_new(SYS_CLOCK); break; default: /* unknown request */ diff --git a/tools/perform/sio_perf.c b/tools/perform/sio_perf.c index 26cec6d..1828d6f 100644 --- a/tools/perform/sio_perf.c +++ b/tools/perform/sio_perf.c @@ -547,7 +547,7 @@ run_test(iotype iot, parameters parms, struct options *opts) read_raw_mm_table[i] = read_gross_mm; } - sio_time_destroy(res.timers); + io_time_destroy(res.timers); } /* @@ -1407,3 +1407,50 @@ usage(const char *prog) fflush(stdout); } +void debug_start_stop_time(io_time_t *pt, timer_type t, int start_stop) +{ + if (sio_debug_level >= 4) { + const char *msg; + + switch (t) { + case HDF5_FILE_OPENCLOSE: + msg = "File Open/Close"; + break; + case HDF5_DATASET_CREATE: + msg = "Dataset Create"; + break; + case HDF5_MPI_WRITE: + msg = "MPI Write"; + break; + case HDF5_MPI_READ: + msg = "MPI Read"; + break; + case HDF5_FINE_WRITE_FIXED_DIMS: + msg = "Fine Write"; + break; + case HDF5_FINE_READ_FIXED_DIMS: + msg = "Fine Read"; + break; + case HDF5_GROSS_WRITE_FIXED_DIMS: + msg = "Gross Write"; + break; + case HDF5_GROSS_READ_FIXED_DIMS: + msg = "Gross Read"; + break; + case HDF5_RAW_WRITE_FIXED_DIMS: + msg = "Raw Write"; + break; + case HDF5_RAW_READ_FIXED_DIMS: + msg = "Raw Read"; + break; + default: + msg = "Unknown Timer"; + break; + } + + fprintf(output, " %s %s: %.2f\n", msg, + (start_stop == TSTART ? "Start" : "Stop"), + pt->total_time[t]); + } +} /* debug_start_stop_time */ + diff --git a/tools/perform/sio_perf.h b/tools/perform/sio_perf.h index b40fed3..311d909 100644 --- a/tools/perform/sio_perf.h +++ b/tools/perform/sio_perf.h @@ -15,7 +15,7 @@ #ifndef SIO_PERF_H__ #define SIO_PERF_H__ -#include "sio_timer.h" +#include "io_timer.h" #ifndef STANDALONE #include "H5private.h" #include "h5test.h" @@ -71,7 +71,7 @@ typedef struct parameters_ { typedef struct results_ { herr_t ret_code; - sio_time *timers; + io_time_t *timers; } results; #ifndef SUCCESS @@ -83,7 +83,7 @@ typedef struct results_ { #endif /* !FAIL */ extern FILE *output; /* output file */ -extern sio_time *timer_g; /* timer: global for stub functions */ +extern io_time_t *timer_g; /* timer: global for stub functions */ extern int sio_debug_level; /* The debug level: * 0 - Off * 1 - Minimal diff --git a/tools/perform/sio_timer.c b/tools/perform/sio_timer.c deleted file mode 100644 index 4e42ee6..0000000 --- a/tools/perform/sio_timer.c +++ /dev/null @@ -1,197 +0,0 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Copyright by The HDF Group. * - * All rights reserved. * - * * - * This file is part of HDF5. The full HDF5 copyright notice, including * - * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -/* - * Purpose: - * - * This is a module of useful timing functions for performance testing. - */ - -#include -#include - -#include "sio_timer.h" - - -#include "sio_perf.h" - -/* - * The number to divide the tv_usec field with to get a nice decimal to add to - * the number of seconds. - */ -#define MICROSECOND 1000000.0 - -/* global variables */ -sio_time *timer_g; /* timer: global for stub functions */ - -/* - * Function: sub_time - * Purpose: Struct two time values, and return the difference, in microseconds - * - * Note that the function assumes that a > b - * Programmer: Leon Arber, 1/27/06 - */ -static double sub_time(struct timeval* a, struct timeval* b) -{ - return (((double)a->tv_sec + - ((double)a->tv_usec) / MICROSECOND) - - ((double)b->tv_sec + - ((double)b->tv_usec) / MICROSECOND)); -} - - -/* - * Function: sio_time_new - * Purpose: Build us a brand, spankin', new performance time object. - * The object is a black box to the user. - * Return: Pointer to sio_time object - * Programmer: Bill Wendling, 01. October 2001 - * Modifications: - */ -sio_time * -sio_time_new(void) -{ - sio_time *pt = (sio_time *)calloc(1, sizeof(struct sio_time_)); - - /* set global timer variable */ - timer_g = pt; - - return pt; -} - -/* - * Function: sio_time_destroy - * Purpose: Remove the memory allocated for the sio_time object. Only - * need to call on a pointer allocated with the ``sio_time_new'' - * function. - * Return: Nothing - * Programmer: Bill Wendling, 01. October 2001 - * Modifications: - */ -void -sio_time_destroy(sio_time *pt) -{ - HDfree(pt); - /* reset the global timer pointer too. */ - timer_g = NULL; -} - - - -/* - * Function: set_time - * Purpose: Set the time in a ``sio_time'' object. - * Return: Pointer to the passed in ``sio_time'' object. - * Programmer: Bill Wendling, 01. October 2001 - * Modifications: - */ -sio_time * -set_time(sio_time *pt, timer_type t, int start_stop) -{ - if (pt) { - 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])); - - - } else { - struct timeval sys_t; - - HDgettimeofday(&sys_t, NULL); - pt->total_time[t] += sub_time(&sys_t, &(pt->sys_timer[t])); - -/* ((double)sys_t.tv_sec + - ((double)sys_t.tv_usec) / MICROSECOND) - - ((double)pt->sys_timer[t].tv_sec + - ((double)pt->sys_timer[t].tv_usec) / MICROSECOND);*/ - - /* 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])); - - } - - if (sio_debug_level >= 4) { - const char *msg; - - switch (t) { - case HDF5_FILE_OPENCLOSE: - msg = "File Open/Close"; - break; - case HDF5_DATASET_CREATE: - msg = "Dataset Create"; - break; - case HDF5_MPI_WRITE: - msg = "MPI Write"; - break; - case HDF5_MPI_READ: - msg = "MPI Read"; - break; - case HDF5_FINE_WRITE_FIXED_DIMS: - msg = "Fine Write"; - break; - case HDF5_FINE_READ_FIXED_DIMS: - msg = "Fine Read"; - break; - case HDF5_GROSS_WRITE_FIXED_DIMS: - msg = "Gross Write"; - break; - case HDF5_GROSS_READ_FIXED_DIMS: - msg = "Gross Read"; - break; - case HDF5_RAW_WRITE_FIXED_DIMS: - msg = "Raw Write"; - break; - case HDF5_RAW_READ_FIXED_DIMS: - msg = "Raw Read"; - break; - default: - msg = "Unknown Timer"; - break; - } - - fprintf(output, " %s %s: %.2f\n", msg, - (start_stop == TSTART ? "Start" : "Stop"), - pt->total_time[t]); - } - } - - return pt; -} - -/* - * Function: get_time - * Purpose: Get the time from a ``sio_time'' object. - * Return: The number of seconds as a DOUBLE. - * Programmer: Bill Wendling, 01. October 2001 - * Modifications: - */ -double -get_time(sio_time *pt, timer_type t) -{ - return pt->total_time[t]; -} -#ifdef STANDALONE -#include "sio_standalone.c" -#endif - diff --git a/tools/perform/sio_timer.h b/tools/perform/sio_timer.h deleted file mode 100644 index 46702c3..0000000 --- a/tools/perform/sio_timer.h +++ /dev/null @@ -1,78 +0,0 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Copyright by The HDF Group. * - * All rights reserved. * - * * - * This file is part of HDF5. The full HDF5 copyright notice, including * - * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -#ifndef SIO_TIMER__ -#define SIO_TIMER__ - -#include "hdf5.h" - -#if defined(H5_TIME_WITH_SYS_TIME) -# include -# include -#elif defined(H5_HAVE_SYS_TIME_H) -# include -#else -# include -#endif - -#ifdef H5_HAVE_WINSOCK2_H -# include -#endif /* H5_HAVE_WINSOCK2_H */ - -/* The different types of timers we can have */ -typedef enum timer_type_ { - HDF5_FILE_OPENCLOSE, - HDF5_DATASET_CREATE, - HDF5_MPI_WRITE, - HDF5_MPI_READ, - HDF5_FILE_READ_OPEN, - HDF5_FILE_READ_CLOSE, - HDF5_FILE_WRITE_OPEN, - HDF5_FILE_WRITE_CLOSE, - HDF5_FINE_WRITE_FIXED_DIMS, - HDF5_FINE_READ_FIXED_DIMS, - HDF5_GROSS_WRITE_FIXED_DIMS, - HDF5_GROSS_READ_FIXED_DIMS, - HDF5_RAW_WRITE_FIXED_DIMS, - HDF5_RAW_READ_FIXED_DIMS, - NUM_TIMERS -} timer_type; - - -/* Miscellaneous identifiers */ -enum { - TSTART, /* Start a specified timer */ - TSTOP /* Stop a specified timer */ -}; - -/* The performance time structure */ -typedef struct sio_time_ { - double total_time[NUM_TIMERS]; - struct timeval sys_timer[NUM_TIMERS]; -} sio_time; - -/* External function declarations */ -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ -extern sio_time *sio_time_new(void); -extern void sio_time_destroy(sio_time *pt); -extern void set_timer_type(sio_time *pt); -extern sio_time *set_time(sio_time *pt, timer_type t, int start_stop); -extern double get_time(sio_time *pt, timer_type t); -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* SIO_TIMER__ */ diff --git a/vms/src/h5pubconf.h b/vms/src/h5pubconf.h index b4d36f1..54e0fbe 100644 --- a/vms/src/h5pubconf.h +++ b/vms/src/h5pubconf.h @@ -501,7 +501,7 @@ #define H5_PACKAGE_NAME "HDF5" /* Define to the full name and version of this package. */ -#define H5_PACKAGE_STRING "HDF5 1.9.207-swmr0" +#define H5_PACKAGE_STRING "HDF5 1.9.210-swmr0" /* Define to the one symbol short name of this package. */ #define H5_PACKAGE_TARNAME "hdf5" @@ -510,7 +510,7 @@ #define H5_PACKAGE_URL "" /* Define to the version of this package. */ -#define H5_PACKAGE_VERSION "1.9.207-swmr0" +#define H5_PACKAGE_VERSION "1.9.210-swmr0" /* Width for printf() for type `long long' or `__int64', use `ll' */ #define H5_PRINTF_LL_WIDTH "ll" @@ -673,7 +673,7 @@ /* #undef H5_USING_MEMCHECKER */ /* Version number of package */ -#define H5_VERSION "1.9.207-swmr0" +#define H5_VERSION "1.9.210-swmr0" /* Define if vsnprintf() returns the correct value for formatted strings that don't fit into size allowed */ -- cgit v0.12