diff options
Diffstat (limited to 'hl/tools/h5watch')
-rw-r--r-- | hl/tools/h5watch/Makefile.am | 54 | ||||
-rw-r--r-- | hl/tools/h5watch/Makefile.in | 970 | ||||
-rw-r--r-- | hl/tools/h5watch/WATCH.h5 | bin | 0 -> 26032 bytes | |||
-rw-r--r-- | hl/tools/h5watch/extend_dset.c | 380 | ||||
-rw-r--r-- | hl/tools/h5watch/h5watch.c | 917 | ||||
-rw-r--r-- | hl/tools/h5watch/h5watchgentest.c | 328 | ||||
-rw-r--r-- | hl/tools/h5watch/testh5watch.sh.in | 372 |
7 files changed, 3021 insertions, 0 deletions
diff --git a/hl/tools/h5watch/Makefile.am b/hl/tools/h5watch/Makefile.am new file mode 100644 index 0000000..0bf7c1b --- /dev/null +++ b/hl/tools/h5watch/Makefile.am @@ -0,0 +1,54 @@ +# +# 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. +## +## Makefile.am +## Run automake to generate a Makefile.in from this file. +# +# HDF5 Library Makefile(.in) +# + +include $(top_srcdir)/config/commence.am + +# Include src and tools/lib directories +INCLUDES=-I$(top_srcdir)/src -I$(top_srcdir)/tools/lib -I$(top_srcdir)/hl/src + +# These are our main targets, the tools +#TEST_PROG=h5watchgentest +TEST_SCRIPT=testh5watch.sh +#check_PROGRAMS=h5watchgentest +check_SCRIPTS=$(TEST_SCRIPT) +SCRIPT_DEPEND=h5watch$(EXEEXT) + +bin_PROGRAMS=h5watch +noinst_PROGRAMS=h5watchgentest extend_dset + +# Add h5watch specific linker flags here +h5watch_LDFLAGS = $(LT_STATIC_EXEC) $(AM_LDFLAGS) + +h5watch_SOURCES=h5watch.c + +#gen_onetwo_test_SOURCES=gen_onetwo_test.c +h5watchgentest_SOURCES=h5watchgentest.c +extend_dset_SOURCES=extend_dset.c +#extend_one_SOURCES=extend_one.c +#extend_two_SOURCES=extend_two.c + +# Programs all depend on the hdf5 library, the tools library, and the HL +# library. +LDADD=$(LIBH5_HL) $(LIBH5TOOLS) $(LIBHDF5) + +CHECK_CLEANFILES+=*.h5 +DISTCLEANFILES=testh5watch.sh + +include $(top_srcdir)/config/conclude.am diff --git a/hl/tools/h5watch/Makefile.in b/hl/tools/h5watch/Makefile.in new file mode 100644 index 0000000..8c9411a --- /dev/null +++ b/hl/tools/h5watch/Makefile.in @@ -0,0 +1,970 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# +# 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. +# +# HDF5 Library Makefile(.in) +# + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(srcdir)/testh5watch.sh.in $(top_srcdir)/config/commence.am \ + $(top_srcdir)/config/conclude.am +bin_PROGRAMS = h5watch$(EXEEXT) +noinst_PROGRAMS = h5watchgentest$(EXEEXT) extend_dset$(EXEEXT) +TESTS = $(check_SCRIPTS) +subdir = hl/tools/h5watch +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/src/H5config.h +CONFIG_CLEAN_FILES = testh5watch.sh +CONFIG_CLEAN_VPATH_FILES = +am__installdirs = "$(DESTDIR)$(bindir)" +PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) +am_extend_dset_OBJECTS = extend_dset.$(OBJEXT) +extend_dset_OBJECTS = $(am_extend_dset_OBJECTS) +extend_dset_LDADD = $(LDADD) +extend_dset_DEPENDENCIES = $(LIBH5_HL) $(LIBH5TOOLS) $(LIBHDF5) +am_h5watch_OBJECTS = h5watch.$(OBJEXT) +h5watch_OBJECTS = $(am_h5watch_OBJECTS) +h5watch_LDADD = $(LDADD) +h5watch_DEPENDENCIES = $(LIBH5_HL) $(LIBH5TOOLS) $(LIBHDF5) +h5watch_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(h5watch_LDFLAGS) \ + $(LDFLAGS) -o $@ +am_h5watchgentest_OBJECTS = h5watchgentest.$(OBJEXT) +h5watchgentest_OBJECTS = $(am_h5watchgentest_OBJECTS) +h5watchgentest_LDADD = $(LDADD) +h5watchgentest_DEPENDENCIES = $(LIBH5_HL) $(LIBH5TOOLS) $(LIBHDF5) +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src +depcomp = $(SHELL) $(top_srcdir)/bin/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(extend_dset_SOURCES) $(h5watch_SOURCES) \ + $(h5watchgentest_SOURCES) +DIST_SOURCES = $(extend_dset_SOURCES) $(h5watch_SOURCES) \ + $(h5watchgentest_SOURCES) +ETAGS = etags +CTAGS = ctags +am__tty_colors = \ +red=; grn=; lgn=; blu=; std= +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = /home1/packages/automake/automake-1.9.6/bin/aclocal-1.9 -I /afs/ncsa/projects/hdf/packages/libtool_1.5.14/Linux_2.4/share/aclocal +ADD_PARALLEL_FILES = @ADD_PARALLEL_FILES@ +AMTAR = @AMTAR@ + +# H5_CFLAGS holds flags that should be used when building hdf5, +# but which should not be exported to h5cc for building other programs. +# AM_CFLAGS is an automake construct which should be used by Makefiles +# instead of CFLAGS, as CFLAGS is reserved solely for the user to define. +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ +AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ +AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ +AM_FCFLAGS = @AM_FCFLAGS@ @H5_FCFLAGS@ +AM_LDFLAGS = @AM_LDFLAGS@ +AM_MAKEFLAGS = @AM_MAKEFLAGS@ +AR = @AR@ + +# Set the paths for AFS installs of autotools for Linux machines +# Ideally, these tools should never be needed during the build. +AUTOCONF = /home1/packages/autoconf/autoconf-2.60/bin/autoconf +AUTOHEADER = /home1/packages/autoconf/autoconf-2.60/bin/autoheader +AUTOMAKE = /home1/packages/automake/automake-1.9.6/bin/automake-1.9 +AWK = @AWK@ +BYTESEX = @BYTESEX@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CC_VERSION = @CC_VERSION@ +CFLAGS = @CFLAGS@ +CLEARFILEBUF = @CLEARFILEBUF@ +CODESTACK = @CODESTACK@ +CONFIG_DATE = @CONFIG_DATE@ +CONFIG_MODE = @CONFIG_MODE@ +CONFIG_USER = @CONFIG_USER@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CXX_VERSION = @CXX_VERSION@ +CYGPATH_W = @CYGPATH_W@ +DEBUG_PKG = @DEBUG_PKG@ +DEFAULT_API_VERSION = @DEFAULT_API_VERSION@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DEPRECATED_SYMBOLS = @DEPRECATED_SYMBOLS@ +DIRECT_VFD = @DIRECT_VFD@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +DYNAMIC_DIRS = @DYNAMIC_DIRS@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +EXTERNAL_FILTERS = @EXTERNAL_FILTERS@ + +# Make sure that these variables are exported to the Makefiles +F9XMODEXT = @F9XMODEXT@ +F9XMODFLAG = @F9XMODFLAG@ +F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ +FC = @FC@ +FCFLAGS = @FCFLAGS@ +FCFLAGS_f90 = @FCFLAGS_f90@ +FCLIBS = @FCLIBS@ +FC_VERSION = @FC_VERSION@ +FGREP = @FGREP@ +FILTERS = @FILTERS@ +FSEARCH_DIRS = @FSEARCH_DIRS@ +GPFS = @GPFS@ +GREP = @GREP@ +H5_CFLAGS = @H5_CFLAGS@ +H5_CPPFLAGS = @H5_CPPFLAGS@ +H5_CXXFLAGS = @H5_CXXFLAGS@ +H5_FCFLAGS = @H5_FCFLAGS@ +H5_LONE_COLON = @H5_LONE_COLON@ +H5_VERSION = @H5_VERSION@ +HADDR_T = @HADDR_T@ +HAVE_DMALLOC = @HAVE_DMALLOC@ +HDF5_HL = @HDF5_HL@ +HDF5_INTERFACES = @HDF5_INTERFACES@ +HDF_CXX = @HDF_CXX@ +HDF_FORTRAN = @HDF_FORTRAN@ +HID_T = @HID_T@ +HL = @HL@ +HL_FOR = @HL_FOR@ +HSIZE_T = @HSIZE_T@ +HSSIZE_T = @HSSIZE_T@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTRUMENT = @INSTRUMENT@ +INSTRUMENT_LIBRARY = @INSTRUMENT_LIBRARY@ +LARGEFILE = @LARGEFILE@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LL_PATH = @LL_PATH@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_STATIC_EXEC = @LT_STATIC_EXEC@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +MPE = @MPE@ +MPI_GET_SIZE = @MPI_GET_SIZE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJECT_NAMELEN_DEFAULT_F = @OBJECT_NAMELEN_DEFAULT_F@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PARALLEL = @PARALLEL@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PTHREAD = @PTHREAD@ +RANLIB = @RANLIB@ +ROOT = @ROOT@ +RUNPARALLEL = @RUNPARALLEL@ +RUNSERIAL = @RUNSERIAL@ +R_INTEGER = @R_INTEGER@ +R_LARGE = @R_LARGE@ +SEARCH = @SEARCH@ +SED = @SED@ +SETX = @SETX@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SIZE_T = @SIZE_T@ +STATIC_EXEC = @STATIC_EXEC@ +STATIC_SHARED = @STATIC_SHARED@ +STRICT_FORMAT_CHECKS = @STRICT_FORMAT_CHECKS@ +STRIP = @STRIP@ +TESTPARALLEL = @TESTPARALLEL@ +THREADSAFE = @THREADSAFE@ +TIME = @TIME@ +TR = @TR@ +TRACE_API = @TRACE_API@ +UNAME_INFO = @UNAME_INFO@ +USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@ +USE_FILTER_FLETCHER32 = @USE_FILTER_FLETCHER32@ +USE_FILTER_NBIT = @USE_FILTER_NBIT@ +USE_FILTER_SCALEOFFSET = @USE_FILTER_SCALEOFFSET@ +USE_FILTER_SHUFFLE = @USE_FILTER_SHUFFLE@ +USE_FILTER_SZIP = @USE_FILTER_SZIP@ +USINGMEMCHECKER = @USINGMEMCHECKER@ +VERSION = @VERSION@ +WORDS_BIGENDIAN = @WORDS_BIGENDIAN@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +ac_ct_FC = @ac_ct_FC@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ + +# Install directories that automake doesn't know about +docdir = $(exec_prefix)/doc +dvidir = @dvidir@ +enable_shared = @enable_shared@ +enable_static = @enable_static@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ + +# Shell commands used in Makefiles +RM = rm -f +CP = cp + +# Some machines need a command to run executables; this is that command +# so that our tests will run. +# We use RUNEXEC instead of RUNSERIAL directly because it may be that +# some tests need to be run with a different command. Older versions +# of the makefiles used the command +# $(LIBTOOL) --mode=execute +# in some directories, for instance. +RUNEXEC = $(RUNSERIAL) + +# Libraries to link to while building +LIBHDF5 = $(top_builddir)/src/libhdf5.la +LIBH5TEST = $(top_builddir)/test/libh5test.la +LIBH5F = $(top_builddir)/fortran/src/libhdf5_fortran.la +LIBH5FTEST = $(top_builddir)/fortran/test/libh5test_fortran.la +LIBH5CPP = $(top_builddir)/c++/src/libhdf5_cpp.la +LIBH5TOOLS = $(top_builddir)/tools/lib/libh5tools.la +LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la +LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la +LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la + +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. + +# Scripts used to build examples +# If only shared libraries have been installed, have h5cc build examples with +# shared libraries instead of static libraries +H5CC = ${DESTDIR}$(bindir)/h5cc +H5CC_PP = ${DESTDIR}$(bindir)/h5pcc +H5FC = ${DESTDIR}$(bindir)/h5fc +H5FC_PP = ${DESTDIR}$(bindir)/h5pfc +H5CPP = ${DESTDIR}$(bindir)/h5c++ +ACLOCAL_AMFLAGS = "-I m4" + +# The trace script; this is used on source files from the C library to +# insert tracing macros. +TRACE = perl $(top_srcdir)/bin/trace + +# .chkexe files are used to mark tests that have run successfully. +# .chklog files are output from those tests. +# *.clog are from the MPE option. +CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.h5 + +# Include src and tools/lib directories +INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/tools/lib -I$(top_srcdir)/hl/src + +# These are our main targets, the tools +#TEST_PROG=h5watchgentest +TEST_SCRIPT = testh5watch.sh +#check_PROGRAMS=h5watchgentest +check_SCRIPTS = $(TEST_SCRIPT) +SCRIPT_DEPEND = h5watch$(EXEEXT) + +# Add h5watch specific linker flags here +h5watch_LDFLAGS = $(LT_STATIC_EXEC) $(AM_LDFLAGS) +h5watch_SOURCES = h5watch.c + +#gen_onetwo_test_SOURCES=gen_onetwo_test.c +h5watchgentest_SOURCES = h5watchgentest.c +extend_dset_SOURCES = extend_dset.c +#extend_one_SOURCES=extend_one.c +#extend_two_SOURCES=extend_two.c + +# Programs all depend on the hdf5 library, the tools library, and the HL +# library. +LDADD = $(LIBH5_HL) $(LIBH5TOOLS) $(LIBHDF5) +DISTCLEANFILES = testh5watch.sh + +# Automake needs to be taught how to build lib, progs, and tests targets. +# These will be filled in automatically for the most part (e.g., +# lib_LIBRARIES are built for lib target), but EXTRA_LIB, EXTRA_PROG, and +# EXTRA_TEST variables are supplied to allow the user to force targets to +# be built at certain times. +LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ + $(noinst_LTLIBRARIES) $(check_LIBRARIES) $(check_LTLIBRARIES) $(EXTRA_LIB) + +PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ + $(EXTRA_PROG) + +TEST_PROG_CHKEXE = $(TEST_PROG:=.chkexe_) +TEST_PROG_PARA_CHKEXE = $(TEST_PROG_PARA:=.chkexe_) +TEST_SCRIPT_CHKSH = $(TEST_SCRIPT:=.chkexe_) +TEST_SCRIPT_PARA_CHKSH = $(TEST_SCRIPT_PARA:=.chkexe_) +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/config/commence.am $(top_srcdir)/config/conclude.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign hl/tools/h5watch/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign hl/tools/h5watch/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +testh5watch.sh: $(top_builddir)/config.status $(srcdir)/testh5watch.sh.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p || test -f $$p1; \ + then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(bindir)" && rm -f $$files + +clean-binPROGRAMS: + @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list + +clean-noinstPROGRAMS: + @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list +extend_dset$(EXEEXT): $(extend_dset_OBJECTS) $(extend_dset_DEPENDENCIES) + @rm -f extend_dset$(EXEEXT) + $(LINK) $(extend_dset_OBJECTS) $(extend_dset_LDADD) $(LIBS) +h5watch$(EXEEXT): $(h5watch_OBJECTS) $(h5watch_DEPENDENCIES) + @rm -f h5watch$(EXEEXT) + $(h5watch_LINK) $(h5watch_OBJECTS) $(h5watch_LDADD) $(LIBS) +h5watchgentest$(EXEEXT): $(h5watchgentest_OBJECTS) $(h5watchgentest_DEPENDENCIES) + @rm -f h5watchgentest$(EXEEXT) + $(LINK) $(h5watchgentest_OBJECTS) $(h5watchgentest_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/extend_dset.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/h5watch.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/h5watchgentest.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) $(check_SCRIPTS) + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: check-am +all-am: Makefile $(PROGRAMS) all-local +installdirs: + for dir in "$(DESTDIR)$(bindir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-binPROGRAMS clean-generic clean-libtool \ + clean-noinstPROGRAMS mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-binPROGRAMS + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool mostlyclean-local + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-binPROGRAMS + +.MAKE: check-am install-am install-strip + +.PHONY: CTAGS GTAGS all all-am all-local check check-TESTS check-am \ + clean clean-binPROGRAMS clean-generic clean-libtool \ + clean-noinstPROGRAMS ctags distclean distclean-compile \ + distclean-generic distclean-libtool distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-binPROGRAMS install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + mostlyclean-local pdf pdf-am ps ps-am tags uninstall \ + uninstall-am uninstall-binPROGRAMS + + +# List all build rules defined by HDF5 Makefiles as "PHONY" targets here. +# This tells the Makefiles that these targets are not files to be built but +# commands that should be executed even if a file with the same name already +# exists. +.PHONY: build-check-clean build-check-p build-check-s build-lib build-progs \ + build-tests check-clean check-install check-p check-s check-vfd \ + install-doc lib progs tests uninstall-doc _exec_check-s _test help + +help: + @$(top_srcdir)/bin/makehelp + +# lib/progs/tests targets recurse into subdirectories. build-* targets +# build files in this directory. +build-lib: $(LIB) +build-progs: $(LIB) $(PROGS) +build-tests: $(LIB) $(PROGS) $(TESTS) + +# General rule for recursive building targets. +# BUILT_SOURCES contain targets that need to be built before anything else +# in the directory (e.g., for Fortran type detection) +lib progs tests check-s check-p :: $(BUILT_SOURCES) + @$(MAKE) $(AM_MAKEFLAGS) build-$@ || exit 1; + @for d in X $(SUBDIRS); do \ + if test $$d != X && test $$d != .; then \ + (set -x; cd $$d && $(MAKE) $(AM_MAKEFLAGS) $@) || exit 1; \ + fi; \ + done + +# General rule for recursive cleaning targets. Like the rule above, +# but doesn't require building BUILT_SOURCES. +check-clean :: + @$(MAKE) $(AM_MAKEFLAGS) build-$@ || exit 1; + @for d in X $(SUBDIRS); do \ + if test $$d != X && test $$d != .; then \ + (set -x; cd $$d && $(MAKE) $(AM_MAKEFLAGS) $@) || exit 1; \ + fi; \ + done + +# Tell Automake to build tests when the user types `make all' (this is +# not its default behavior). Also build EXTRA_LIB and EXTRA_PROG since +# Automake won't build them automatically, either. +all-local: $(EXTRA_LIB) $(EXTRA_PROG) $(TESTS) + +# make install-doc doesn't do anything outside of doc directory, but +# Makefiles should recognize it. +# UPDATE: docs no longer reside in this build tree, so this target +# is depreciated. +install-doc uninstall-doc: + @echo "Nothing to be done." + +# clean up files generated by tests so they can be re-run. +build-check-clean: + $(RM) -rf $(CHECK_CLEANFILES) + +# run check-clean whenever mostlyclean is run +mostlyclean-local: build-check-clean + +# check-install is just a synonym for installcheck +check-install: installcheck + +# Run each test in order, passing $(TEST_FLAGS) to the program. +# Since tests are done in a shell loop, "make -i" does apply inside it. +# Set HDF5_Make_Ignore to a non-blank string to ignore errors inside the loop. +# The timestamps give a rough idea how much time the tests use. +# +# Note that targets in TESTS (defined above) will be built when the user +# types 'make tests' or 'make check', but only programs in TEST_PROG, +# TEST_PROG_PARA, or TEST_SCRIPT will actually be executed. +check-TESTS: test + +test _test: + @$(MAKE) build-check-s + @$(MAKE) build-check-p + +# Actual execution of check-s. +build-check-s: $(LIB) $(PROGS) $(TESTS) + @if test -n "$(TEST_PROG)$(TEST_SCRIPT)"; then \ + echo "===Serial tests in `echo ${PWD} | sed -e s:.*/::` begin `date`==="; \ + fi + @$(MAKE) $(AM_MAKEFLAGS) _exec_check-s + @if test -n "$(TEST_PROG)$(TEST_SCRIPT)"; then \ + echo "===Serial tests in `echo ${PWD} | sed -e s:.*/::` ended `date`===";\ + fi + +_exec_check-s: $(TEST_PROG_CHKEXE) $(TEST_SCRIPT_CHKSH) + +# The dummy.chkexe here prevents the target from being +# empty if there are no tests in the current directory. +# $${log} is the log file. +# $${tname} is the name of test. +$(TEST_PROG_CHKEXE) $(TEST_PROG_PARA_CHKEXE) dummy.chkexe_: + @if test "X$@" != "X.chkexe_" && test "X$@" != "Xdummy.chkexe_"; then \ + tname=$(@:.chkexe_=)$(EXEEXT);\ + log=$(@:.chkexe_=.chklog); \ + echo "============================"; \ + if $(top_srcdir)/bin/newer $(@:.chkexe_=.chkexe) $${tname}; then \ + echo "No need to test $${tname} again."; \ + else \ + echo "============================" > $${log}; \ + if test "X$(FORTRAN_API)" = "Xyes"; then \ + echo "Fortran API: Testing $(HDF5_DRIVER) $${tname} $(TEST_FLAGS)"; \ + echo "Fortran API: $(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" >> $${log}; \ + elif test "X$(CXX_API)" = "Xyes"; then \ + echo "C++ API: Testing $(HDF5_DRIVER) $${tname} $(TEST_FLAGS)"; \ + echo "C++ API: $(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" >> $${log};\ + else \ + echo "Testing $(HDF5_DRIVER) $${tname} $(TEST_FLAGS)"; \ + echo "$(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" >> $${log}; \ + fi; \ + echo "============================" >> $${log}; \ + srcdir="$(srcdir)" \ + $(TIME) $(RUNEXEC) ./$${tname} $(TEST_FLAGS) >> $${log} 2>&1 \ + && touch $(@:.chkexe_=.chkexe) || \ + (test $$HDF5_Make_Ignore && echo "*** Error ignored") || \ + (cat $${log} && false) || exit 1; \ + echo "" >> $${log}; \ + echo "Finished testing $${tname} $(TEST_FLAGS)" >> $${log}; \ + echo "============================" >> $${log}; \ + echo "Finished testing $${tname} $(TEST_FLAGS)"; \ + cat $${log}; \ + fi; \ + fi + +# The dummysh.chkexe here prevents the target from being +# empty if there are no tests in the current directory. +# $${log} is the log file. +# $${tname} is the name of test. +$(TEST_SCRIPT_CHKSH) $(TEST_SCRIPT_PARA_CHKSH) dummysh.chkexe_: + @if test "X$@" != "X.chkexe_" && test "X$@" != "Xdummysh.chkexe_"; then \ + cmd=$(@:.chkexe_=);\ + tname=`basename $$cmd`;\ + chkname=`basename $(@:.chkexe_=.chkexe)`;\ + log=`basename $(@:.chkexe_=.chklog)`; \ + echo "============================"; \ + if $(top_srcdir)/bin/newer $${chkname} $$cmd $(SCRIPT_DEPEND); then \ + echo "No need to test $${tname} again."; \ + else \ + echo "============================" > $${log}; \ + if test "X$(FORTRAN_API)" = "Xyes"; then \ + echo "Fortran API: Testing $${tname} $(TEST_FLAGS)"; \ + echo "Fortran API: $${tname} $(TEST_FLAGS) Test Log" >> $${log}; \ + elif test "X$(CXX_API)" = "Xyes"; then \ + echo "C++ API: Testing $${tname} $(TEST_FLAGS)"; \ + echo "C++ API: $${tname} $(TEST_FLAGS) Test Log" >> $${log}; \ + else \ + echo "Testing $${tname} $(TEST_FLAGS)"; \ + echo "$${tname} $(TEST_FLAGS) Test Log" >> $${log}; \ + fi; \ + echo "============================" >> $${log}; \ + RUNSERIAL="$(RUNSERIAL)" RUNPARALLEL="$(RUNPARALLEL)" \ + srcdir="$(srcdir)" \ + $(TIME) $(SHELL) $$cmd $(TEST_FLAGS) >> $${log} 2>&1 \ + && touch $${chkname} || \ + (test $$HDF5_Make_Ignore && echo "*** Error ignored") || \ + (cat $${log} && false) || exit 1; \ + echo "" >> $${log}; \ + echo "Finished testing $${tname} $(TEST_FLAGS)" >> $${log}; \ + echo "============================" >> $${log}; \ + echo "Finished testing $${tname} $(TEST_FLAGS)"; \ + cat $${log}; \ + fi; \ + echo "============================"; \ + fi + +# Actual execution of check-p. +build-check-p: $(LIB) $(PROGS) $(TESTS) + @if test -n "$(TEST_PROG_PARA)$(TEST_SCRIPT_PARA)"; then \ + echo "===Parallel tests in `echo ${PWD} | sed -e s:.*/::` begin `date`==="; \ + fi + @if test -n "$(TEST_PROG_PARA)"; then \ + echo "**** Hint ****"; \ + echo "Parallel test files reside in the current directory" \ + "by default."; \ + echo "Set HDF5_PARAPREFIX to use another directory. E.g.,"; \ + echo " HDF5_PARAPREFIX=/PFS/user/me"; \ + echo " export HDF5_PARAPREFIX"; \ + echo " make check"; \ + echo "**** end of Hint ****"; \ + fi + @for test in $(TEST_PROG_PARA) dummy; do \ + if test $$test != dummy; then \ + $(MAKE) $(AM_MAKEFLAGS) $$test.chkexe_ \ + RUNEXEC="$(RUNPARALLEL)" || exit 1; \ + fi; \ + done + @for test in $(TEST_SCRIPT_PARA) dummy; do \ + if test $$test != dummy; then \ + $(MAKE) $(AM_MAKEFLAGS) $$test.chkexe_ || exit 1; \ + fi; \ + done + @if test -n "$(TEST_PROG_PARA)$(TEST_SCRIPT_PARA)"; then \ + echo "===Parallel tests in `echo ${PWD} | sed -e s:.*/::` ended `date`===";\ + fi + +# Run test with different Virtual File Driver +check-vfd: $(LIB) $(PROGS) $(TESTS) + @for vfd in $(VFD_LIST) dummy; do \ + if test $$vfd != dummy; then \ + echo "============================"; \ + echo "Testing Virtual File Driver $$vfd"; \ + echo "============================"; \ + $(MAKE) $(AM_MAKEFLAGS) check-clean || exit 1; \ + HDF5_DRIVER=$$vfd $(MAKE) $(AM_MAKEFLAGS) check || exit 1; \ + fi; \ + done + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/hl/tools/h5watch/WATCH.h5 b/hl/tools/h5watch/WATCH.h5 Binary files differnew file mode 100644 index 0000000..add819d --- /dev/null +++ b/hl/tools/h5watch/WATCH.h5 diff --git a/hl/tools/h5watch/extend_dset.c b/hl/tools/h5watch/extend_dset.c new file mode 100644 index 0000000..61cc09f --- /dev/null +++ b/hl/tools/h5watch/extend_dset.c @@ -0,0 +1,380 @@ +#include "H5HLprivate2.h" +#include <stdio.h> +#include <string.h> +#include <assert.h> +#include <stdlib.h> +#include <unistd.h> + +/* + * Extending datasets in WATCH.h5 generated by h5watchgentest.c + */ +#define DSET_ONE "DSET_ONE" +#define DSET_TWO "DSET_TWO" +#define DSET_CMPD "DSET_CMPD" +#define DSET_CMPD_ESC "DSET_CMPD_ESC" +#define DSET_CMPD_TWO "DSET_CMPD_TWO" + +#define DSET_ALLOC_LATE "DSET_ALLOC_LATE" +#define DSET_ALLOC_EARLY "DSET_ALLOC_EARLY" + +/* Size of data buffer */ +#define TEST_BUF_SIZE 100 + +/* + * Test variations (incremental) for one-dimensional dataset: + * Varies from 10->13->12->12->1->3 + */ +#define ONE_NTESTS 5 +int one_tests[ONE_NTESTS] = {3, -1, 0, -11, 2}; + +/* + * Test variations (incremental) for two-dimensional dataset: + * Varies from {4,10}->{6,12}->{8,1}->{10,1}-> + * {3,3}->{2,2}->{1,2}-> + * {1,4}->{1,3}->{1,3} + */ +#define TWO_NTESTS 9 +int two_tests[TWO_NTESTS][2] = { {2, 2}, {2, -11}, {2, 0}, + {-7, 2}, {-1, -1}, {-1, 0}, + {0, 2}, {0, -1}, {0, 0} + }; + +static int extend_dset_two(const char *file, char *dname); +static int extend_dset_one(const char *file, char *dname); + +/* Data structures for datasets with compound data type */ +typedef struct sub22_t { + unsigned int a; + unsigned int b; + unsigned int c; +} sub22_t; + +typedef struct sub2_t { + unsigned int a; + sub22_t b; + unsigned int c; +} sub2_t; + +typedef struct sub4_t { + unsigned int a; + unsigned int b; +} sub4_t; + +typedef struct set_t { + unsigned int field1; + sub2_t field2; + double field3; + sub4_t field4; +} set_t; + +/* + *********************************************************************** + * + * Extending a two-dimensional dataset: + * dims[0] dims[1] + * ------- ------- + * case #1: increase increase + * case #2: increase decrease + * case #3: increase same + * case #4: decrease increase + * case #5: decrease decrease (no action) + * case #6: decrease same (no action) + * case #7: same increase + * case #8: same decrease (no action) + * case #9: same same (no action) + * + * two_tests[TWO_NTESTS][2] = { {2,2}, {2,-11}, {2,0}, + * {-7,2}, {-1,-1}, {-1,0}, + * {0,2}, {0,-1}, {0,0} } + * varies from {4,10}->{6,12}->{8,1}->{10,1}-> + * {3,3}->{2,2}->{1,2}-> + * {1,4}->{1,3}->{1,3} + *********************************************************************** + */ +static int +extend_dset_two(const char *file, char *dname) +{ + hid_t fid; /* file id */ + hid_t did; /* dataset id */ + hid_t sid; /* dataspace id */ + hid_t dtid; /* dataset's datatype id */ + int ndims; /* # of dimension sizes */ + unsigned i, j; /* local index variable */ + hsize_t ext_dims[2]; /* new dimension sizes after extension */ + hsize_t cur_dims[2]; /* current dimension sizes */ + size_t dtype_size; /* size of the dataset's datatype */ + unsigned num_elmts; /* number of elements in the dataset */ + int ibuf[TEST_BUF_SIZE]; /* buffer for storing retrieved elements (integer) */ + set_t cbuf[TEST_BUF_SIZE]; /* buffer for storing retrieved elemnets (compound) */ + + /* Open the file and dataset */ + if((fid = H5Fopen(file, H5F_ACC_RDWR, H5P_DEFAULT)) < 0) + goto done; + + if((did = H5Dopen2(fid, dname, H5P_DEFAULT)) < 0) + goto done; + + if((sid = H5Dget_space(did)) < 0) + goto done; + + if((ndims = H5Sget_simple_extent_ndims(sid)) < 0) + goto done; + + /* Get the size of the dataset's datatype */ + if((dtype_size = H5LDget_dset_type_size(did, NULL)) == 0) + goto done; + + /* Get the dataset's data type */ + if((dtid = H5Tget_native_type(H5Dget_type(did), H5T_DIR_DEFAULT)) < 0) + goto done; + + /* Loop through different variations of extending the dataset */ + for(i = 0; i < TWO_NTESTS; i++) { + + /* sleep to emulate about 2 seconds of application operation */ + sleep(2); + + /* Get current dimension sizes */ + if(H5LDget_dset_dims(did, cur_dims) < 0) + goto done; + + /* Set up the new extended dimension sizes */ + ext_dims[0] = cur_dims[0] + two_tests[i][0]; + ext_dims[1] = cur_dims[1] + two_tests[i][1]; + + /* Extend the dataset */ + if(H5Dset_extent(did, ext_dims) < 0) + goto done; + + num_elmts = 1; + for(j = 0; j < (unsigned)ndims; j++) + num_elmts *= ext_dims[j]; + + /* Compound type */ + if(!HDstrcmp(dname, DSET_CMPD_TWO)) { + + HDmemset(cbuf, 0, sizeof(cbuf)); + for(j = 0; j < num_elmts; j++) { + cbuf[j].field1 = i + 1; + cbuf[j].field2.a = i + 1; + cbuf[j].field2.c = i + 1; + cbuf[j].field2.b.a = i + 1; + cbuf[j].field2.b.b = i + 1; + cbuf[j].field2.b.c = i + 1; + cbuf[j].field3 = i + 1; + cbuf[j].field4.a = i + 1; + cbuf[j].field4.b = i + 1; + } + + /* Write to the dataset */ + if(H5Dwrite(did, dtid, H5S_ALL, H5S_ALL, H5P_DEFAULT, cbuf) < 0) + goto done; + } else { /* Integer type */ + HDmemset(ibuf, 0, sizeof(ibuf)); + for(j = 0; j < num_elmts; j++) + ibuf[j] = i + 1; + + /* Write to the dataset */ + if(H5Dwrite(did, dtid, H5S_ALL, H5S_ALL, H5P_DEFAULT, ibuf) < 0) + goto done; + } + + if(H5Dflush(did) < 0) + goto done; + + } /* end for TWO_NTESTS */ + + /* Closing */ + if(H5Tclose(dtid) < 0) goto done; + if(H5Dclose(did) < 0) goto done; + if(H5Fclose(fid) < 0) goto done; + + return(SUCCEED); + +done: + H5E_BEGIN_TRY + H5Tclose(dtid); + H5Dclose(did); + H5Fclose(fid); + H5E_END_TRY + + return(FAIL); + +} /* extend_dset_two() */ + +/* + *********************************************************************** + * + * Extending a one-dimensional dataset + * Test cases: + * #1: increase + * #2: decrease + * #3: same + * #4: decrease + * #5: increase + * + * one_tests[ONE_NTESTS] = {3, -1, 0, -11, 2} + * varies from 10->13->12->12->1->3 + * + *********************************************************************** + */ +static int +extend_dset_one(const char *file, char *dname) +{ + hid_t fid; /* file id */ + hid_t did; /* dataset id */ + hid_t dtid; /* dataset's datatype id */ + hid_t sid; /* dataspace id */ + hid_t mid; /* memory space id */ + unsigned i, j; /* local index variable */ + int ibuf[TEST_BUF_SIZE]; /* buffer for storing retrieved elements (integer) */ + set_t cbuf[TEST_BUF_SIZE]; /* buffer for storing retrieved elemnets (compound) */ + hsize_t cur_dims[1]; /* current dimension sizes */ + hsize_t ext_dims[1]; /* new dimension sizes after extension */ + hsize_t offset[1]; /* starting offsets of appended data */ + hsize_t count[1]; /* dimension sizes of appended data */ + size_t dtype_size; /* size of the dataset's datatype */ + + /* Open the file and dataset */ + if((fid = H5Fopen(file, H5F_ACC_RDWR, H5P_DEFAULT)) < 0) + goto done; + + if((did = H5Dopen2(fid, dname, H5P_DEFAULT)) < 0) + goto done; + + /* Get size of the dataset's datatype */ + if((dtype_size = H5LDget_dset_type_size(did, NULL)) == 0) + goto done; + + /* Get dataset's datatype */ + if((dtid = H5Tget_native_type(H5Dget_type(did), H5T_DIR_DEFAULT)) < 0) + goto done; + + /* Loop through different variations of extending the dataset */ + for(i = 0; i < ONE_NTESTS; i++) { + + /* sleep to emulate about 2 seconds of application operation */ + sleep(2); + + /* Get current dimension sizes */ + if(H5LDget_dset_dims(did, cur_dims) < 0) + goto done; + + /* Set up the new extended dimension sizes */ + ext_dims[0] = cur_dims[0] + one_tests[i]; + + /* Extend the dataset */ + if(H5Dset_extent(did, ext_dims) < 0) + goto done; + + /* Write to the new appended region of the dataset */ + if(one_tests[i] > 0) { + + /* Select the extended region */ + offset[0] = cur_dims[0]; + count[0] = one_tests[i]; + if((sid = H5Dget_space(did)) < 0) + goto done; + if(H5Sselect_hyperslab(sid, H5S_SELECT_SET, offset, NULL, count, NULL) < 0) + goto done; + + /* Set up memory space and get dataset's datatype */ + if((mid = H5Screate_simple(1, count, NULL)) < 0) + goto done; + + /* Initialize data for the extended region of the dataset */ + /* Compound type */ + if(!HDstrcmp(dname, DSET_CMPD) || !HDstrcmp(dname, DSET_CMPD_ESC)) { + HDmemset(cbuf, 0, sizeof(cbuf)); + for(j = 0; j < (unsigned)one_tests[i]; j++) { + cbuf[j].field1 = j + 1; + cbuf[j].field2.a = j + 2; + cbuf[j].field2.b.a = j + 2; + cbuf[j].field2.b.b = j + 2; + cbuf[j].field2.b.c = j + 2; + cbuf[j].field2.c = j + 2; + + cbuf[j].field3 = j + 3; + + cbuf[j].field4.a = j + 4; + cbuf[j].field4.b = j + 4; + } /* end for */ + + /* Write to the extended region of the dataset */ + if(H5Dwrite(did, dtid, mid, sid, H5P_DEFAULT, cbuf) < 0) + goto done; + } else { /* Integer type */ + for(j = 0; j < (unsigned)one_tests[i]; j++) + ibuf[j] = j; + + /* Write to the extended region of the dataset */ + if(H5Dwrite(did, dtid, mid, sid, H5P_DEFAULT, ibuf) < 0) + goto done; + } + + /* Closing */ + if(H5Sclose(sid) < 0) goto done; + if(H5Sclose(mid) < 0) goto done; + } /* end if */ + + if(H5Dflush(did) < 0) + goto done; + + } /* end for ONE_NTESTS */ + + /* Closing */ + if(H5Tclose(dtid) < 0) goto done; + if(H5Dclose(did) < 0) goto done; + if(H5Fclose(fid) < 0) goto done; + + return(SUCCEED); + +done: + H5E_BEGIN_TRY + H5Sclose(sid); + H5Sclose(mid); + H5Tclose(dtid); + H5Dclose(did); + H5Fclose(fid); + H5E_END_TRY + + return(FAIL); +} /* extend_dset_one() */ + +/* Usage: extend_dset xx.h5 dname */ +int +main(int argc, const char *argv[]) +{ + char *dname = NULL; + char *fname = NULL; + + if(argc != 3) { + fprintf(stderr, "Should have file name and dataset name to be extended...\n"); + goto done; + } + + /* Get the dataset name to be extended */ + fname = strdup(argv[1]); + dname = strdup(argv[2]); + + if(!HDstrcmp(dname, DSET_CMPD) || !HDstrcmp(dname, DSET_CMPD_ESC)) { + if(extend_dset_one(fname, dname) < 0) goto done; + } else if(!HDstrcmp(dname, DSET_ONE) || + !HDstrcmp(dname, DSET_ALLOC_LATE) || + !HDstrcmp(dname, DSET_ALLOC_EARLY)) { + if(extend_dset_one(fname, dname) < 0) + goto done; + } else if(!HDstrcmp(dname, DSET_TWO) || !HDstrcmp(dname, DSET_CMPD_TWO)) { + if(extend_dset_two(fname, dname) < 0) + goto done; + } else { + fprintf(stdout, "Dataset cannot be extended...\n"); + goto done; + } + exit(EXIT_SUCCESS); + +done: + if(dname) HDfree(dname); + if(fname) HDfree(fname); + exit(EXIT_FAILURE); +} /* main() */ diff --git a/hl/tools/h5watch/h5watch.c b/hl/tools/h5watch/h5watch.c new file mode 100644 index 0000000..c9dfcf6 --- /dev/null +++ b/hl/tools/h5watch/h5watch.c @@ -0,0 +1,917 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +#include <stdio.h> +#include <stdlib.h> +#include <assert.h> +#include <string.h> +#include <unistd.h> +#include <float.h> + +#include "h5tools.h" +#include "h5tools_utils.h" +#include "h5tools_ref.h" +#include "h5trav.h" +#include "H5LDprivate.h" + +/* + * Note: This tool used private routine + */ +#define PROGRAMNAME "h5watch" /* Name of tool */ +#define FIELD_SEP "," /* nested field separator */ +#define DEFAULT_RETRY 10 /* number of times to try opening the file */ + +/* + * Note:(see comments in hl/src/H5LDprivate.h) + * This tool uses private routines H5LD_construct_vector()and H5LD_clean_vector() + * This tool uses H5LD_memb_t data structure declared in H5LDprivate.h + */ + +const char *progname = "h5watch"; /* tool name */ +static char *g_list_of_fields = NULL; /* command line input for "list_of_fields" */ +static char *g_dup_fields = NULL; /* copy of "list_of_fields" */ +static H5LD_memb_t **g_listv = NULL; /* vector info for "list_of_fields" */ + +static hbool_t g_monitor_size_only = FALSE; /* monitor changes in dataset dimension sizes */ +static unsigned g_polling_interval = 1; /* polling interval to check appended data */ +static hbool_t g_label = FALSE; /* label compound values */ +static int g_display_width = 80; /* output width in characters */ +static hbool_t g_simple_output = FALSE; /* make output more machine-readable */ +static unsigned g_retry = DEFAULT_RETRY; /* # of times to try opening the file if somehow file is unstable */ +static hbool_t g_display_hex = FALSE; /* display data in hexadecimal format : LATER */ + +static herr_t doprint(hid_t did, hsize_t *start, hsize_t *block, int rank); +static herr_t slicendump(hid_t did, hsize_t *prev_dims, hsize_t *cur_dims, + hsize_t *start, hsize_t *block, int rank, int subrank); +static herr_t monitor_dataset(hid_t fid, char *dsetname); +static herr_t process_cmpd_fields(hid_t fid, char *dsetname); +static herr_t check_dataset(hid_t fid, char *dsetname); +static void leave(int ret); +static void usage(const char *prog); +static void parse_command_line(int argc, const char *argv[]); + + +/* + * Command-line options: The user can only specify long-named parameters. + * The long-named ones can be partially spelled. When + * adding more, make sure that they don't clash with each other. + */ +static struct long_options l_opts[] = { + { "help", no_arg, 'h' }, + { "hel", no_arg, 'h' }, + { "dim", no_arg, 'd' }, + { "di", no_arg, 'd' }, + { "label", no_arg, 'l' }, + { "labe", no_arg, 'l' }, + { "lab", no_arg, 'l' }, + { "la", no_arg, 'l' }, + { "simple", no_arg, 'S' }, + { "simpl", no_arg, 'S' }, + { "simp", no_arg, 'S' }, + { "sim", no_arg, 'S' }, + { "si", no_arg, 'S' }, + { "hexdump", no_arg, 'x' }, + { "hexdum", no_arg, 'x' }, + { "hexdu", no_arg, 'x' }, + { "hexd", no_arg, 'x' }, + { "hex", no_arg, 'x' }, + { "width", require_arg, 'w' }, + { "widt", require_arg, 'w' }, + { "wid", require_arg, 'w' }, + { "wi", require_arg, 'w' }, + { "polling", require_arg, 'p' }, + { "pollin", require_arg, 'p' }, + { "polli", require_arg, 'p' }, + { "poll", require_arg, 'p' }, + { "pol", require_arg, 'p' }, + { "po", require_arg, 'p' }, + { "fields", require_arg, 'f' }, + { "field", require_arg, 'f' }, + { "fiel", require_arg, 'f' }, + { "fie", require_arg, 'f' }, + { "fi", require_arg, 'f' }, + { "version", no_arg, 'V' }, + { "versio", no_arg, 'V' }, + { "versi", no_arg, 'V' }, + { "vers", no_arg, 'V' }, + { "ver", no_arg, 'V' }, + { "ve", no_arg, 'V' }, + { NULL, 0, '\0' } +}; + + +/*------------------------------------------------------------------------- + * Function: doprint() + * + * Purpose: Prepare to print the dataset's appended data. + * Call the tools library routine h5tools_dump_dset() to do the printing. + * (This routine is mostly copied from dump_dataset_values() in tools/h5ls/h5ls.c + * and modified accordingly). + * + * Return: 0 on success; negative on failure + * + * Programmer: Vailin Choi; August 2010 + * + *------------------------------------------------------------------------- + */ +static herr_t +doprint(hid_t did, hsize_t *start, hsize_t *block, int rank) +{ + h5tool_format_t info; /* Format info for the tools library */ + static char fmt_double[16], fmt_float[16]; /* Format info */ + struct subset_t subset; /* Subsetting info */ + hsize_t ss_start[H5S_MAX_RANK]; /* Info for hyperslab */ + hsize_t ss_stride[H5S_MAX_RANK]; /* Info for hyperslab */ + hsize_t ss_block[H5S_MAX_RANK]; /* Info for hyperslab */ + hsize_t ss_count[H5S_MAX_RANK]; /* Info for hyperslab */ + int i; /* Local index variable */ + herr_t ret_value = SUCCEED; /* Return value */ + + /* Subsetting information for the tools library printing routines */ + subset.start.data = ss_start; + subset.stride.data = ss_stride; + subset.block.data = ss_block; + subset.count.data = ss_count; + + /* Initialize subsetting information */ + for(i = 0; i < rank; i++) { + subset.stride.data[i] = 1; + subset.count.data[i] = 1; + subset.start.data[i] = start[i]; + subset.block.data[i] = block[i]; + } + + /* Set to all default values and then override */ + HDmemset(&info, 0, sizeof info); + + if(g_simple_output) { + info.idx_fmt = ""; + info.line_ncols = 65535; /*something big*/ + info.line_per_line = 1; + info.line_multi_new = 0; + info.line_pre = " "; + info.line_cont = " "; + + info.arr_pre = ""; + info.arr_suf = ""; + info.arr_sep = " "; + + info.cmpd_pre = ""; + info.cmpd_suf = ""; + info.cmpd_sep = " "; + + /* The "fields" selected by the user */ + info.cmpd_listv = (const struct H5LD_memb_t **)g_listv; + + if(g_label) info.cmpd_name = "%s="; + + info.elmt_suf1 = " "; + info.str_locale = ESCAPE_HTML; + + } else { + info.idx_fmt = "(%s)"; + if(!g_display_width) { + info.line_ncols = 65535; + info.line_per_line = 1; + } + else + info.line_ncols = g_display_width; + + info.line_multi_new = 1; + + /* The "fields" selected by the user */ + info.cmpd_listv = (const struct H5LD_memb_t **)g_listv; + if(g_label) info.cmpd_name = "%s="; + info.line_pre = " %s "; + info.line_cont = " %s "; + info.str_repeat = 8; + } + + /* Floating point types should display full precision */ + sprintf(fmt_float, "%%1.%dg", FLT_DIG); + info.fmt_float = fmt_float; + sprintf(fmt_double, "%%1.%dg", DBL_DIG); + info.fmt_double = fmt_double; + + info.dset_format = "DSET-%s "; + info.dset_hidefileno = 0; + + info.obj_format = "-%lu:"H5_PRINTF_HADDR_FMT; + info.obj_hidefileno = 0; + + info.dset_blockformat_pre = "%sBlk%lu: "; + info.dset_ptformat_pre = "%sPt%lu: "; + + info.line_indent = ""; + + if(g_display_hex) { + /* Print all data in hexadecimal format if the `-x' or `--hexdump' + * command line switch was given. */ + info.raw = TRUE; + } + + /* Print the values. */ + if((ret_value = h5tools_dump_dset(stdout, &info, did, -1, &subset, -1)) < 0) + error_msg("unable to print data\n"); + + return(ret_value); + +} /* doprint() */ + +/*------------------------------------------------------------------------- + * Function: slicendump + * + * Purpose: To dump the slice for each dimension + * For example: prev_dims[2] = {5, 4}; cur_dims[2] = {7, 8} + * This routine will dump data as follows: + * {0, 3} to {0, 7} (1x4 elements) + * {1, 3} to {0, 7} (1x4 elements) + * {2, 3} to {0, 7} (1x4 elements) + * {3, 3} to {0, 7} (1x4 elements) + * {4, 3} to {0, 7} (1x4 elements) + * {5, 0} to {6, 7} (2x8 elements) + * + * Return: Non-negative on success + * Negative on failure + * + * Programmer: Vailin Choi; August 2010 + * + *------------------------------------------------------------------------- + */ +static herr_t +slicendump(hid_t did, hsize_t *prev_dims, hsize_t *cur_dims, hsize_t *start, hsize_t *block, int rank, int subrank) +{ + int i; /* Local index variable */ + int ind; /* Index for the current rank */ + herr_t ret_value = SUCCEED; /* Return value */ + + ind = rank - subrank; + + if((subrank - 1) > 0) { + /* continue onto the next dimension */ + for (i = 0; i < (hssize_t)MIN(prev_dims[ind], cur_dims[ind]); i++){ + start[ind] = (hsize_t)i; + if((ret_value = slicendump(did, prev_dims, cur_dims, start, block, rank, subrank-1)) < 0) + goto done; + } + } + + /* this dimension remains the same or shrinking */ + if(cur_dims[ind] <= prev_dims[ind]) + goto done; + + /* select first the slice for the faster changing dimension */ + /* select later the whole slice for the slower changing dimension */ + start[ind] = prev_dims[ind]; + block[ind] = cur_dims[ind] - prev_dims[ind]; + + for(i = ind + 1; i < rank; i++){ + start[i] = 0; + block[i] = cur_dims[i]; + } + + /* Print the appended data */ + ret_value = doprint(did, start, block, rank); + +done: + return(ret_value); +} /* slicendump() */ + + +/*------------------------------------------------------------------------- + * Function: monitor_dataset + * + * Purpose: To poll a dataset periodically for changes in dimension sizes. + * For dataset with unchanged and/or decreased dimension sizes: + * it just prints the dimension size changes + * For dataset with increase in at least one of its dimension sizes: + * it will print the new appended data to the dataset + * + * Return: Non-negative on success: dataset can be monitored + * Negative on failure: dataset cannot be monitored + * + * Programmer: Vailin Choi; August 2010 + * + *------------------------------------------------------------------------- + */ +static herr_t +monitor_dataset(hid_t fid, char *dsetname) +{ + char drivername[50];/* Driver's name for opening the file */ + hid_t did; /* dataset id */ + hid_t sid; /* dataspace id */ + int ndims; /* # of dimensions in the dataspace */ + int i, u; /* local index variable */ + hsize_t prev_dims[H5S_MAX_RANK]; /* current dataspace dimensions */ + hsize_t cur_dims[H5S_MAX_RANK]; /* previous dataspace dimensions */ + herr_t ret_value = SUCCEED; /* return value */ + + HDfprintf(stdout, "Monitoring dataset %s...\n", dsetname); + + /* Open the dataset for minitoring */ + if((did = H5Dopen2(fid, dsetname, H5P_DEFAULT)) < 0) { + error_msg("error in opening dataset \"%s\"\n", dsetname); + ret_value = FAIL; + goto done; + } + if((sid = H5Dget_space(did)) < 0) { + error_msg("error in getting dataspace id for dataset \"%s\"\n", dsetname); + ret_value = FAIL; + goto done; + } + + /* Get the dataset's dimension sizes */ + if((ndims = H5Sget_simple_extent_dims(sid, prev_dims, NULL)) < 0) { + error_msg("unable to get dimensions sizes for \"%s\"\n", dsetname); + ret_value = FAIL; + goto done; + } + + while(1) { + + /* Refreshes the dataset */ + if(H5Drefresh(did) < 0) { + ret_value = FAIL; + goto done; + } + + /* Get the dataset's current dimension sizes */ + if(H5LDget_dset_dims(did, cur_dims) < 0) { + error_msg("unable to get dimension sizes for \"%s\"\n", dsetname); + ret_value = FAIL; + goto done; + } + + /* Check the dimension sizes */ + for(i = 0; i < ndims; i++) + if(cur_dims[i] != prev_dims[i]) + break; + + /* at least one dimension has changed */ + if(i != ndims) { + /* Printing changes in dimension sizes */ + for(u = 0; u < ndims; u++) { + HDfprintf(stdout, "dimension %u: %Hu->%Hu", u, prev_dims[u], cur_dims[u]); + if(cur_dims[u] > prev_dims[u]) + HDfprintf(stdout, " (increases)\n"); + else if(cur_dims[u] < prev_dims[u]) + HDfprintf(stdout, " (decreases)\n"); + else + HDfprintf(stdout, " (unchanged)\n"); + } + + /* Printing elements appended to the dataset if there is */ + if(!g_monitor_size_only) { + + /* See if at least one dimension size has increased */ + for(u = 0; u < ndims; u++) { + int j; + hsize_t start[H5S_MAX_RANK]; + hsize_t block[H5S_MAX_RANK]; + + /* Print the new appended data to the dataset */ + if(cur_dims[u] > prev_dims[u]) { + HDfprintf(stdout, " Data:\n"); + + for(j = 0; j < ndims; j++) { + start[j] = 0; + block[j] = 1; + } + + if((ret_value = slicendump(did, prev_dims, cur_dims, start, block, ndims, ndims)) < 0) + goto done; + break; + } + } /* end for */ + } + HDfflush(stdout); + } + + /* Save the current dimension sizes */ + HDmemcpy(prev_dims, cur_dims, ndims * sizeof(hsize_t)); + + /* Sleep before next monitor */ + HDsleep(g_polling_interval); + } /* end while */ + +done: + /* Closing */ + H5E_BEGIN_TRY + H5Dclose(did); + H5E_END_TRY + + return(ret_value); +} /* monitor_dataset() */ + +/*------------------------------------------------------------------------- + * Function: process_cmpd_fields + * + * Purpose: To check whether the fields selected in "g_list_of_fields" + * are valid fields associated with the dataset. + * + * Return: 0 on success; negative on failure + * + * Programmer: Vailin Choi; August 2010 + * + *------------------------------------------------------------------------- + */ +static herr_t +process_cmpd_fields(hid_t fid, char *dsetname) +{ + hid_t did; /* dataset id */ + hid_t dtid, tid; /* dataset's data type id */ + size_t len; /* number of comma-separated fields in "g_list_of_fields" */ + herr_t ret_value = SUCCEED; /* Return value */ + + HDassert(g_list_of_fields && *g_list_of_fields); + + /* Open the dataset */ + if((did = H5Dopen2(fid, dsetname, H5P_DEFAULT)) < 0) { + error_msg("error in opening dataset \"%s\"\n", dsetname); + ret_value = FAIL; + goto done; + } + + /* Get the dataset's datatype */ + if(((dtid = H5Dget_type(did)) < 0) || (tid = H5Tget_native_type(dtid, H5T_DIR_DEFAULT)) < 0) { + error_msg("error in getting dataset's datatype\n"); + ret_value = FAIL; + goto done; + } + + /* Check to make sure that the dataset's datatype is compound type */ + if(H5Tget_class(dtid) != H5T_COMPOUND) { + error_msg("dataset should be compound type for <list_of_fields>\n"); + ret_value = FAIL; + goto done; + } + + /* Make a copy of "g_list_of_fields" */ + if((g_dup_fields = HDstrdup(g_list_of_fields)) == NULL) { + error_msg("error in duplicating g_list_of_fields\n"); + ret_value = FAIL; + goto done; + } + + /* Estimate the number of comma-separated fields in "g_list of_fields" */ + len = HDstrlen(g_list_of_fields)/2 + 2; + + /* Allocate memory for a list vector of H5LD_memb_t structures to store "g_list_of_fields" info */ + if((g_listv = (H5LD_memb_t **)HDcalloc(len, sizeof(H5LD_memb_t *))) == NULL) { + error_msg("error in allocating memory for H5LD_memb_t\n"); + ret_value = FAIL; + goto done; + } + + /* Process and store info for "g_listv" */ + if(H5LD_construct_vector(g_dup_fields, g_listv, tid) < 0) { + error_msg("error in processing <list_of_fields>\n"); + ret_value = FAIL; + goto done; + } + + /* Will free memory for g_listv and g_dup_fields when exiting from h5watch */ +done: + /* Closing */ + H5E_BEGIN_TRY + H5Tclose(dtid); + H5Tclose(tid); + H5Dclose(did); + H5E_END_TRY + return(ret_value); +} /* process_cmpd_fields() */ + + +/*------------------------------------------------------------------------- + * Function: check_dataset + * + * Purpose: To check whether a dataset can be monitored: + A chunked dataset with unlimited or max. dimension setting + * + * Return: Non-negative on success: dataset can be monitored + * Negative on failure: dataset cannot be monitored + * + * Programmer: Vailin Choi; August 2010 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +static herr_t +check_dataset(hid_t fid, char *dsetname) +{ + hid_t did; /* Dataset id */ + hid_t dcp; /* Dataset creation property */ + hid_t sid; /* Dataset's dataspace id */ + int ndims; /* # of dimensions in the dataspace */ + unsigned u; /* Local index variable */ + hsize_t cur_dims[H5S_MAX_RANK]; /* size of dataspace dimensions */ + hsize_t max_dims[H5S_MAX_RANK]; /* maximum size of dataspace dimensions */ + hbool_t unlim_max_dims = FALSE; /* whether dataset has unlimited or max. dimension setting */ + void *edata; + H5E_auto2_t func; + herr_t ret_value = SUCCEED; /* Return value */ + + /* Disable error reporting */ + H5Eget_auto2(H5E_DEFAULT, &func, &edata); + H5Eset_auto2(H5E_DEFAULT, NULL, NULL); + + /* Open the dataset */ + if((did = H5Dopen2(fid, dsetname, H5P_DEFAULT)) < 0) { + error_msg("unable to open dataset \"%s\"\n", dsetname); + ret_value = FAIL; + goto done; + } + + /* Get dataset's creation property list */ + if((dcp = H5Dget_create_plist(did)) < 0) { + error_msg("unable to get dataset's creation property list\"%s\"\n", dsetname); + ret_value = FAIL; + goto done; + } + + /* Query dataset's layout; the layout should be chunked */ + if(H5Pget_layout(dcp) != H5D_CHUNKED) { + error_msg("\"%s\" should be a chunked dataset\n", dsetname); + ret_value = FAIL; + goto done; + } + + HDmemset(cur_dims, 0, sizeof cur_dims); + HDmemset(max_dims, 0, sizeof max_dims); + + /* Get dataset's dataspace */ + if((sid = H5Dget_space(did)) < 0) { + error_msg("can't get dataset's dataspace\"%s\"\n", dsetname); + ret_value = FAIL; + goto done; + } + + /* Get dimension size of dataset's dataspace */ + if((ndims = H5Sget_simple_extent_dims(sid, cur_dims, max_dims)) < 0) { + error_msg("can't get dataspace dimensions for dataset \"%s\"\n", dsetname); + ret_value = FAIL; + goto done; + } + + /* Check whether dataset has unlimited dimension or max. dimension setting */ + for(u = 0; u < (unsigned)ndims; u++) + if(max_dims[u] == H5S_UNLIMITED || cur_dims[u] != max_dims[u]) { + unlim_max_dims = TRUE; + break; + } + + if(!unlim_max_dims) { + error_msg("\"%s\" should have unlimited or max. dimension setting\n", dsetname); + ret_value = FAIL; + } + +done: + /* Closing */ + H5E_BEGIN_TRY + H5Sclose(sid); + H5Pclose(dcp); + H5Dclose(did); + H5E_END_TRY + + H5Eset_auto2(H5E_DEFAULT, func, edata); + + return(ret_value); +} /* check_dataset() */ + + +/*------------------------------------------------------------------------- + * Function: leave + * + * Purpose: Close the H5 Tools library and exit + * + * Return: Does not return + * + * Programmer: Vailin Choi; August 2010 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +static void +leave(int ret) +{ + h5tools_close(); + + exit(ret); +} + + +/*------------------------------------------------------------------------- + * Function: usage + * + * Purpose: Print the usage message about h5watch (only long options) + * + * Return: void + * + * Programmer: Vailin Choi; August 2010 + * + * Modifications: + *------------------------------------------------------------------------- + */ +static void +usage(const char *prog) +{ + HDfflush(stdout); + HDfprintf(stdout, "Usage: %s [OPTIONS] [OBJECT]\n", prog); + HDfprintf(stdout, "\n"); + HDfprintf(stdout, " OPTIONS\n"); + HDfprintf(stdout, " --help Print a usage message and exit.\n"); + HDfprintf(stdout, " --version Print version number and exit.\n"); + HDfprintf(stdout, " --label Label members of compound typed dataset.\n"); + HDfprintf(stdout, " --simple Use a machine-readable output format.\n"); + HDfprintf(stdout, " --dim Monitor changes in size of dataset dimensions only.\n"); + HDfprintf(stdout, " --width=N Set the number of columns to N for output.\n"); + HDfprintf(stdout, " A value of 0 sets the number of columns to the\n"); + HDfprintf(stdout, " maximum (65535). The default width is 80 columns.\n"); + HDfprintf(stdout, " --polling=N Set the polling interval to N (in seconds) when the\n"); + HDfprintf(stdout, " dataset will be checked for appended data. The default\n"); + HDfprintf(stdout, " polling interval is 1.\n"); + HDfprintf(stdout, " --fields=<list_of_fields>\n"); + HDfprintf(stdout, " Display data for the fields specified in <list_of_fields>\n"); + HDfprintf(stdout, " for a compound data type. <list_of_fields> can be\n"); + HDfprintf(stdout, " specified as follows:\n"); + HDfprintf(stdout, " 1) A comma-separated list of field names in a\n"); + HDfprintf(stdout, " compound data type. \",\" is the separator\n"); + HDfprintf(stdout, " for field names while \".\" is the separator\n"); + HDfprintf(stdout, " for a nested field.\n"); + HDfprintf(stdout, " 2) A single field name in a compound data type.\n"); + HDfprintf(stdout, " Can use this option multiple times.\n"); + HDfprintf(stdout, " Note that backslash is the escape character to avoid\n"); + HDfprintf(stdout, " characters in field names that conflict with the tool's\n"); + HDfprintf(stdout, " separators.\n"); + HDfprintf(stdout, "\n"); + HDfprintf(stdout, " OBJECT is specified as [<filename>/<path_to_dataset>/<dsetname>]\n"); + HDfprintf(stdout, " <filename> Name of the HDF5 file. It may be preceded by path\n"); + HDfprintf(stdout, " separated by slashes to the specified HDF5 file.\n"); + HDfprintf(stdout, " <path_to_dataset> Path separated by slashes to the specified dataset\n"); + HDfprintf(stdout, " <dsetname> Name of the dataset\n"); + HDfprintf(stdout, "\n"); + +} /* usage() */ + + +/*------------------------------------------------------------------------- + * Function: parse_command_line + * + * Purpose: Parse the command line for h5watch (take only long options) + * + * Return: Success: Set the corresponding command flags and return void + * Failure: Exits program with EXIT_FAILURE value. + * + * Programmer: Vailin Choi; August 2010 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +static void +parse_command_line(int argc, const char *argv[]) +{ + int opt; /* Command line option */ + int tmp; + + /* no arguments */ + if (argc == 1) { + usage(h5tools_getprogname()); + leave(EXIT_FAILURE); + } + + /* parse command line options */ + while ((opt = get_option(argc, argv, NULL, l_opts)) != EOF) { + switch ((char)opt) { + case '?': + case 'h': /* --help */ + usage(h5tools_getprogname()); + leave(EXIT_SUCCESS); + + case 'V': /* --version */ + print_version(progname); + leave(EXIT_SUCCESS); + break; + + case 'w': /* --width=N */ + g_display_width = HDstrtol(opt_arg, NULL, 0); + if(g_display_width < 0) { + usage(h5tools_getprogname()); + leave(EXIT_FAILURE); + } + break; + + case 'd': /* --dim */ + g_monitor_size_only = TRUE; + break; + + case 'S': /* --simple */ + g_simple_output = TRUE; + break; + + case 'l': /* --label */ + g_label = TRUE; + break; + + case 'p': /* --polling=N */ + /* g_polling_interval = HDstrtod(opt_arg, NULL); */ + if((tmp = (int)HDstrtol(opt_arg, NULL, 10)) <= 0) { + usage(h5tools_getprogname()); + leave(EXIT_FAILURE); + } + g_polling_interval = (unsigned)tmp; + break; + + case 'f': /* --fields=<list_of_fields> */ + if(g_list_of_fields == NULL) { + if((g_list_of_fields = HDstrdup(opt_arg)) == NULL) { + error_msg("memory allocation failed (file %s:line %d)\n", + __FILE__, __LINE__); + leave(EXIT_FAILURE); + } + } else { + char *str; + + if((str = HDstrdup(opt_arg)) == NULL) { + error_msg("memory allocation failed (file %s:line %d)\n", + __FILE__, __LINE__); + leave(EXIT_FAILURE); + } + if((g_list_of_fields = (char *)HDrealloc(g_list_of_fields, HDstrlen(g_list_of_fields) + HDstrlen(str) + 2)) == NULL) { + error_msg("memory allocation failed (file %s:line %d)\n", + __FILE__, __LINE__); + leave(EXIT_FAILURE); + + } + HDstrcat(g_list_of_fields, FIELD_SEP); + HDstrcat(g_list_of_fields, str); + } + + break; + + default: + usage(h5tools_getprogname()); + leave(EXIT_FAILURE); + } + } + + + /* check for object to be processed */ + if (argc <= opt_ind) { + error_msg("missing dataset name\n"); + usage(h5tools_getprogname()); + leave(EXIT_FAILURE); + } +} /* parse_command_line() */ + +/*------------------------------------------------------------------------- + * Function: main + * + * Purpose: h5watch + * + * Return: Success: 0 + * Failure: 1 + * + * Programmer: Vailin Choi; August 2010 + * + *------------------------------------------------------------------------- + */ +int +main(int argc, const char *argv[]) +{ + char drivername[50]; + char *fname = NULL; + char *dname = NULL; + void *edata; + H5E_auto2_t func; + char *x; + hid_t fid = -1; + + /* Set up tool name and exit status */ + h5tools_setprogname(PROGRAMNAME); + h5tools_setstatus(EXIT_SUCCESS); + + /* Disable error reporting */ + H5Eget_auto2(H5E_DEFAULT, &func, &edata); + H5Eset_auto2(H5E_DEFAULT, NULL, NULL); + + /* Initialize h5tools lib */ + h5tools_init(); + + /* parse command line options */ + parse_command_line(argc, argv); + + if(argc <= opt_ind) { + error_msg("missing dataset name\n"); + usage(h5tools_getprogname()); + leave(EXIT_FAILURE); + } + + /* Mostly copied from tools/h5ls coding & modified accordingly */ + /* + * [OBJECT] is specified as + * [<filename>/<path_to_dataset>/<dsetname>] + * + * Example: ../dir1/foo/bar/dset + * \_________/\______/ + * file obj + * + * The dichotomy is determined by calling H5Fopen() repeatedly until it + * succeeds. The first call uses the entire name and each subsequent call + * chops off the last component. If we reach the beginning of the name + * then there must have been something wrong with the file (perhaps it + * doesn't exist). + */ + if((fname = HDstrdup(argv[opt_ind])) == NULL) { + error_msg("memory allocation failed (file %s:line %d)\n", + __FILE__, __LINE__); + h5tools_setstatus(EXIT_FAILURE); + } + + do { + while(fname && *fname) { + fid = h5tools_fopen(fname, H5F_ACC_SWMR_READ, H5P_DEFAULT, NULL, drivername, sizeof drivername); + + if(fid >= 0) { + HDfprintf(stdout, "Opened \"%s\" with %s driver.\n", fname, drivername); + break; /*success*/ + } /* end if */ + + /* Shorten the file name; lengthen the object name */ + x = dname; + dname = HDstrrchr(fname, '/'); + if(x) + *x = '/'; + if(!dname) + break; + *dname = '\0'; + } /* end while */ + /* Try opening the file again if somehow unstable */ + } while(g_retry-- > 0 && fid == FAIL && !HDsleep(g_polling_interval)); + + if(fid < 0) { + error_msg("unable to open file \"%s\"\n", fname); + HDfree(fname); + leave(EXIT_FAILURE); + } + + if(!dname) { + error_msg("no dataset specified\n"); + h5tools_setstatus(EXIT_FAILURE); + } else { + *dname = '/'; + x = dname; + if((dname = HDstrdup(dname)) == NULL) { + error_msg("memory allocation failed (file %s:line %d)\n", + __FILE__, __LINE__); + h5tools_setstatus(EXIT_FAILURE); + } else { + *x = '\0'; + /* Validate dataset */ + if(check_dataset(fid, dname) < 0) + h5tools_setstatus(EXIT_FAILURE); + /* Validate input "fields" */ + else if(g_list_of_fields && *g_list_of_fields) + if(process_cmpd_fields(fid, dname) < 0) + h5tools_setstatus(EXIT_FAILURE); + } + } + + /* If everything is fine, start monitoring the datset */ + if(h5tools_getstatus() != EXIT_FAILURE) + if(monitor_dataset(fid, dname) < 0) + h5tools_setstatus(EXIT_FAILURE); + + /* Free spaces */ + if(fname) HDfree(fname); + if(dname) HDfree(dname); + if(g_list_of_fields) HDfree(g_list_of_fields); + if(g_listv) { + H5LD_clean_vector(g_listv); + HDfree(g_listv); + } + if(g_dup_fields) HDfree(g_dup_fields); + + /* Close the file */ + if(H5Fclose(fid) < 0) { + error_msg("unable to close file\n"); + h5tools_setstatus(EXIT_FAILURE); + } + + H5Eset_auto2(H5E_DEFAULT, func, edata); + /* exit */ + leave(h5tools_getstatus()); +} /* main() */ diff --git a/hl/tools/h5watch/h5watchgentest.c b/hl/tools/h5watch/h5watchgentest.c new file mode 100644 index 0000000..36c90e6 --- /dev/null +++ b/hl/tools/h5watch/h5watchgentest.c @@ -0,0 +1,328 @@ +#include "hdf5.h" +#include "H5HLprivate2.h" +#include <time.h> +#include <sys/time.h> +#include <sys/resource.h> +#include <stdlib.h> + +/* + * WATCH.h5: file with various types of datasets for testing-- + * + * The following datasets are chunked, H5D_ALLOC_TIME_INCR, max. dimensional setting: + * DSET_ONE: one-dimensional dataset + * DSET_TWO: two-dimensional dataset + * DSET_CMPD: one-dimensional dataset with compound type + * DSET_CMPD_ESC: one-dimensional dataset with compound type and member names with + * escape/separator characters + * DSET_CMPD_TWO: two-dimensional dataset with compound type + * + * The following datasets are one-dimensional, chunked, max. dimension setting: + * DSET_ALLOC_EARLY: dataset with H5D_ALLOC_TIME_EARLY + * DSET_ALLOC_LATE: dataset H5D_ALLOC_TIME_LATE + * + * The following datasets are one-dimensional: + * DSET_NONE: fixed dimension setting, contiguous, H5D_ALLOC_TIME_LATE + * DSET_NOMAX: fixed dimension setting, chunked, H5D_ALLOC_TIME_INCR + */ +#define ONE_DIMS0 10 +#define MAX_ONE_DIMS0 100 + +#define DSET_ONE "DSET_ONE" +#define DSET_NONE "DSET_NONE" +#define DSET_NOMAX "DSET_NOMAX" +#define DSET_ALLOC_LATE "DSET_ALLOC_LATE" +#define DSET_ALLOC_EARLY "DSET_ALLOC_EARLY" +#define DSET_CMPD "DSET_CMPD" +#define DSET_CMPD_ESC "DSET_CMPD_ESC" + +#define TWO_DIMS0 4 +#define TWO_DIMS1 10 +#define MAX_TWO_DIMS0 60 +#define MAX_TWO_DIMS1 100 + +#define DSET_TWO "DSET_TWO" +#define DSET_CMPD_TWO "DSET_CMPD_TWO" + +#define CHUNK_SIZE 2 + +#define FILE "WATCH.h5" + +/* Data structures for datasets with compound types */ +typedef struct sub22_t { + unsigned int a; + unsigned int b; + unsigned int c; +} sub22_t; + +typedef struct sub2_t { + unsigned int a; + sub22_t b; + unsigned int c; +} sub2_t; + +typedef struct sub4_t { + unsigned int a; + unsigned int b; +} sub4_t; + +typedef struct set_t { + unsigned int field1; + sub2_t field2; + double field3; + sub4_t field4; +} set_t; + +/* + ************************************************************************************** + * + * Create a dataset with the given input parameters + * Write to the dataset with the given "data" + * + ************************************************************************************** + */ +static int +generate_dset(hid_t fid, const char *dname, int ndims, hsize_t *dims, hsize_t *maxdims, hid_t dtid, void *data) +{ + hid_t dcpl; /* Dataset creation property */ + hid_t did; /* Dataset id */ + hid_t sid; /* Dataspace id */ + int i; /* Local index variable */ + hsize_t chunk_dims[H5S_MAX_RANK]; /* Dimension sizes for chunks */ + + /* Create the dataspace */ + if((sid = H5Screate_simple(ndims, dims, maxdims)) < 0) + goto done; + + /* Set up dataset's creation properties */ + if(!HDstrcmp(dname, DSET_NONE)) + dcpl = H5P_DEFAULT; + else { + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) + goto done; + for(i = 0; i < ndims; i++) + chunk_dims[i] = CHUNK_SIZE; + if(H5Pset_chunk(dcpl, ndims, chunk_dims) < 0) + goto done; + } + + if(!HDstrcmp(dname, DSET_ALLOC_LATE)) { + if(H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_LATE) < 0) + goto done; + } else if(!HDstrcmp(dname, DSET_ALLOC_EARLY)) { + if(H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_EARLY) < 0) + goto done; + } + + /* Create the dataset */ + if((did = H5Dcreate2(fid, dname, dtid, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) + goto done; + + /* Write to the dataset */ + if(H5Dwrite(did, dtid, H5S_ALL, H5S_ALL, H5P_DEFAULT, data) < 0) + goto done; + + /* Closing */ + if(H5Pclose(dcpl) < 0) goto done; + if(H5Sclose(sid) < 0) goto done; + if(H5Dclose(did) < 0) goto done; + + return(SUCCEED); + +done: + H5E_BEGIN_TRY + H5Sclose(sid); + H5Pclose(dcpl); + H5Dclose(did); + H5E_END_TRY + + return(FAIL); +} /* generate_dset() */ + +int +main(void) +{ + hid_t fid; /* File id */ + hsize_t cur_dims[1]; /* Dimension sizes */ + hsize_t max_dims[1]; /* Maximum dimension sizes */ + hsize_t cur2_dims[2]; /* Current dimension sizes */ + hsize_t max2_dims[2]; /* Maximum dimension sizes */ + hid_t set_tid, esc_set_tid; /* Compound type id */ + hid_t sub22_tid; /* Compound type id */ + hid_t sub2_tid, esc_sub2_tid; /* Compound type id */ + hid_t sub4_tid, esc_sub4_tid; /* Compound type id */ + int one_data[ONE_DIMS0]; /* Buffer for data */ + int two_data[TWO_DIMS0*TWO_DIMS1]; /* Buffer for data */ + set_t one_cbuf[ONE_DIMS0]; /* Buffer for data with compound type */ + set_t two_cbuf[TWO_DIMS0*TWO_DIMS1]; /* Buffer for data with compound type */ + int i; /* Local index variable */ + + /* Create a file */ + if((fid = H5Fcreate(FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) + goto done; + + /* Initialization for one-dimensional dataset */ + cur_dims[0] = ONE_DIMS0; + max_dims[0] = MAX_ONE_DIMS0; + for(i = 0; i < ONE_DIMS0; i++) + one_data[i] = i; + + /* Generate DSET_ONE, DSET_NONE, DSET_NOMAX, DSET_ALLOC_LATE, DSET_EARLY */ + if(generate_dset(fid, DSET_ONE, 1, cur_dims, max_dims, H5T_NATIVE_INT, one_data) < 0) + goto done; + if(generate_dset(fid, DSET_NONE, 1, cur_dims, NULL, H5T_NATIVE_INT, one_data) < 0) + goto done; + if(generate_dset(fid, DSET_NOMAX, 1, cur_dims, NULL, H5T_NATIVE_INT, one_data) < 0) + goto done; + if(generate_dset(fid, DSET_ALLOC_LATE, 1, cur_dims, max_dims, H5T_NATIVE_INT, one_data) < 0) + goto done; + if(generate_dset(fid, DSET_ALLOC_EARLY, 1, cur_dims, max_dims, H5T_NATIVE_INT, one_data) < 0) + goto done; + + /* Initialization for two-dimensional dataset */ + cur2_dims[0] = TWO_DIMS0; + cur2_dims[1] = TWO_DIMS1; + max2_dims[0] = MAX_TWO_DIMS0; + max2_dims[1] = MAX_TWO_DIMS1; + + for(i = 0; i < (TWO_DIMS0 * TWO_DIMS1); i++) + two_data[i] = i; + + /* Generate DSET_TWO */ + if(generate_dset(fid, DSET_TWO, 2, cur2_dims, max2_dims, H5T_NATIVE_INT, two_data) < 0) + goto done; + + /* Initialization for one-dimensional compound typed dataset */ + cur_dims[0] = ONE_DIMS0; + max_dims[0] = MAX_ONE_DIMS0; + + for (i = 0; i < ONE_DIMS0; i++) { + one_cbuf[i].field1 = 1; + one_cbuf[i].field2.a = 2; + one_cbuf[i].field2.c = 4; + one_cbuf[i].field2.b.a = 20; + one_cbuf[i].field2.b.b = 40; + one_cbuf[i].field2.b.c = 80; + one_cbuf[i].field3 = 3.0; + one_cbuf[i].field4.a = 4; + one_cbuf[i].field4.b = 8; + } + + /* Create the compound type */ + if((sub22_tid = H5Tcreate(H5T_COMPOUND, sizeof(sub22_t))) < 0) + goto done; + if(H5Tinsert(sub22_tid, "a", HOFFSET(sub22_t, a), H5T_NATIVE_INT) < 0) + goto done; + if(H5Tinsert(sub22_tid, "b", HOFFSET(sub22_t, b), H5T_NATIVE_INT) < 0) + goto done; + if(H5Tinsert(sub22_tid, "c", HOFFSET(sub22_t, c), H5T_NATIVE_INT) < 0) + goto done; + + if((sub2_tid = H5Tcreate(H5T_COMPOUND, sizeof(sub2_t))) < 0) + goto done; + if(H5Tinsert(sub2_tid, "a", HOFFSET(sub2_t, a), H5T_NATIVE_INT) < 0) + goto done; + if(H5Tinsert(sub2_tid, "b", HOFFSET(sub2_t, b), sub22_tid) < 0) + goto done; + if(H5Tinsert(sub2_tid, "c", HOFFSET(sub2_t, c), H5T_NATIVE_INT) < 0) + goto done; + + if((sub4_tid = H5Tcreate(H5T_COMPOUND, sizeof(sub4_t))) < 0) + goto done; + if(H5Tinsert(sub4_tid, "a", HOFFSET(sub4_t, a), H5T_NATIVE_INT) < 0) + goto done; + if(H5Tinsert(sub4_tid, "b", HOFFSET(sub4_t, b), H5T_NATIVE_INT) < 0) + goto done; + + if((set_tid = H5Tcreate(H5T_COMPOUND, sizeof(set_t))) < 0) + goto done; + if(H5Tinsert(set_tid, "field1", HOFFSET(set_t, field1), H5T_NATIVE_INT) < 0) + goto done; + if(H5Tinsert(set_tid, "field2", HOFFSET(set_t, field2), sub2_tid) < 0) + goto done; + if(H5Tinsert(set_tid, "field3", HOFFSET(set_t, field3), H5T_NATIVE_DOUBLE) < 0) + goto done; + if(H5Tinsert(set_tid, "field4", HOFFSET(set_t, field4), sub4_tid) < 0) + goto done; + + /* Create the compound type with escape/separator characters */ + if((esc_sub2_tid = H5Tcreate(H5T_COMPOUND, sizeof(sub2_t))) < 0) + goto done; + if(H5Tinsert(esc_sub2_tid, ".a", HOFFSET(sub2_t, a), H5T_NATIVE_INT) < 0) + goto done; + if(H5Tinsert(esc_sub2_tid, ",b", HOFFSET(sub2_t, b), sub22_tid) < 0) + goto done; + if(H5Tinsert(esc_sub2_tid, "\\K", HOFFSET(sub2_t, c), H5T_NATIVE_INT) < 0) + goto done; + + if((esc_sub4_tid = H5Tcreate(H5T_COMPOUND, sizeof(sub4_t))) < 0) + goto done; + if(H5Tinsert(esc_sub4_tid, "a.", HOFFSET(sub4_t, a), H5T_NATIVE_INT) < 0) + goto done; + if(H5Tinsert(esc_sub4_tid, "b,", HOFFSET(sub4_t, b), H5T_NATIVE_INT) < 0) + goto done; + + if((esc_set_tid = H5Tcreate(H5T_COMPOUND, sizeof(set_t))) < 0) + goto done; + if(H5Tinsert(esc_set_tid, "field,1", HOFFSET(set_t, field1), H5T_NATIVE_INT) < 0) + goto done; + if(H5Tinsert(esc_set_tid, "field2.", HOFFSET(set_t, field2), esc_sub2_tid) < 0) + goto done; + if(H5Tinsert(esc_set_tid, "field\\3", HOFFSET(set_t, field3), H5T_NATIVE_DOUBLE) < 0) + goto done; + if(H5Tinsert(esc_set_tid, "field4,", HOFFSET(set_t, field4), esc_sub4_tid) < 0) + goto done; + + /* Generate DSET_CMPD, DSET_CMPD_ESC */ + if(generate_dset(fid, DSET_CMPD, 1, cur_dims, max_dims, set_tid, one_cbuf) < 0) + goto done; + if(generate_dset(fid, DSET_CMPD_ESC, 1, cur_dims, max_dims, esc_set_tid, one_cbuf) < 0) + goto done; + + /* Initialization for two-dimensional compound typed dataset */ + cur2_dims[0] = TWO_DIMS0; + cur2_dims[1] = TWO_DIMS1; + max2_dims[0] = MAX_TWO_DIMS0; + max2_dims[0] = MAX_TWO_DIMS1; + + for (i = 0; i < (TWO_DIMS0 * TWO_DIMS1); i++) { + two_cbuf[i].field1 = 1; + two_cbuf[i].field2.a = 2; + two_cbuf[i].field2.c = 4; + two_cbuf[i].field2.b.a = 20; + two_cbuf[i].field2.b.b = 40; + two_cbuf[i].field2.b.c = 80; + two_cbuf[i].field3 = 3.0; + two_cbuf[i].field4.a = 4; + two_cbuf[i].field4.b = 8; + } + + /* Generate DSET_CMPD_TWO */ + if(generate_dset(fid, DSET_CMPD_TWO, 2, cur2_dims, max2_dims, set_tid, two_cbuf) < 0) + goto done; + + /* Closing */ + if(H5Tclose(sub22_tid) < 0) goto done; + if(H5Tclose(sub2_tid) < 0) goto done; + if(H5Tclose(sub4_tid) < 0) goto done; + if(H5Tclose(set_tid) < 0) goto done; + if(H5Tclose(esc_sub2_tid) < 0) goto done; + if(H5Tclose(esc_sub4_tid) < 0) goto done; + if(H5Tclose(esc_set_tid) < 0) goto done; + if(H5Fclose(fid) < 0) goto done; + + exit(EXIT_SUCCESS); + +done: + H5E_BEGIN_TRY + H5Tclose(sub22_tid); + H5Tclose(sub2_tid); + H5Tclose(sub4_tid); + H5Tclose(set_tid); + H5Tclose(esc_sub2_tid); + H5Tclose(esc_sub4_tid); + H5Tclose(esc_set_tid); + H5Fclose(fid); + H5E_END_TRY + + exit(EXIT_FAILURE); +} /* main() */ diff --git a/hl/tools/h5watch/testh5watch.sh.in b/hl/tools/h5watch/testh5watch.sh.in new file mode 100644 index 0000000..8451151 --- /dev/null +++ b/hl/tools/h5watch/testh5watch.sh.in @@ -0,0 +1,372 @@ +#! /bin/sh +# +# 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. +# +# Tests for the h5watch tool +# +H5WATCH=h5watch # The tool name +H5WATCH_BIN=`pwd`/$H5WATCH # The path of H5WATCH +EXTEND_DSET=extend_dset # Helper to extend the dataset when watching +EXTEND_BIN=`pwd`/$EXTEND_DSET # The path of EXTEND_DSET +# +EXIT_SUCCESS=0 +EXIT_FAILURE=1 +# +GEN_TEST=h5watchgentest # Generate HDF5 file with various datasets +GEN_TEST_BIN=`pwd`/$GEN_TEST # Path of the binary GEN_TEST +# + +CP='cp' +CMP='cmp -s' +DIFF='diff -c' +KILL='kill' +SLEEP='sleep' +NLINES=20 # Max. lines of output to display if test fails +# +# Mac OS: just to make sure echo "backslash backslash" behaves properly +if test `uname -s` = 'Darwin'; then + ECHO='/bin/echo' +else + ECHO='echo' +fi + +# Global variables +nerrors=0 +verbose=yes + +# The build (current) directory might be different than the source directory. +if test -z "$srcdir"; then + srcdir=. +fi +test -d ../testfiles || mkdir ../testfiles + +# Print a line-line message left justified in a field of 70 characters +# beginning with the word "Testing". +TESTING() { + SPACES=" " + $ECHO "Testing $* $SPACES" |cut -c1-70 |tr -d '\012' +} + +# +# Overall algorithm: +# +# Run a test and print PASSED or FAILED +# If a test did not return with the expected return code, +# increment the `nerrors' global variable and (if $verbose is set) display up to $NLINES +# lines of the actual output from the test. +# If the test did return the expected code, +# compare the actual output with the expected output; +# If the outputs are the same, print PASSED, +# Otherwise print FAILED and the difference between the two outputs. +# The output files are not removed if $HDF5_NOCLEANUP has a non-zero value. +# +# +# TOOLTEST(): +# +# Arguments: +# +# $1 -- expected output +# $2 -- expected return code +# $3 and on -- arguments for h5watch +TOOLTEST() { + expect="$srcdir/../testfiles/$1" + actual="../testfiles/`basename $1 .ddl`.out" + actual_err="../testfiles/`basename $1 .ddl`.err" + shift + retvalexpect=$1 + shift + # Run test. + # Stderr is included in stdout so that the diff can detect + # any unexpected output from that stream too. + TESTING $H5WATCH $@ + ( + $ECHO "#############################" + $ECHO " output for '$H5WATCH $@'" + $ECHO "#############################" + $RUNSERIAL $H5WATCH_BIN "$@" + ) > $actual 2>$actual_err + exitcode=$? + cat $actual_err >> $actual + if [ $exitcode -ne $retvalexpect ]; then + $ECHO "*FAILED*" + nerrors="`expr $nerrors + 1`" + if [ yes = "$verbose" ]; then + $ECHO "test returned with exit code $exitcode" + $ECHO "test output: (up to $NLINES lines)" + head -$NLINES $actual + $ECHO "***end of test output***" + $ECHO "" + fi + elif $CMP $expect $actual; then + $ECHO " PASSED" + else + $ECHO "*FAILED*" + $ECHO " Expected result differs from actual result" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + fi + + # Clean up output file + if test -z "$HDF5_NOCLEANUP"; then + rm -f $actual $actual_err + fi +} + +# +# TEST_WATCH(): TEST_WATCH $1 $2 $3 $4 $5 ... +# +# Arguments: +# $1 -- number of objects to watch and to extend +# $2 -- the specified file to watch and to extend +# (filename varies with $1 suffix) +# $3 -- the specified dataset to watch and to extend +# $4 -- the options to h5watch (can be NULL) +# $5 -- expected output from watching the object +# ($3, $4, $5) can be repeated for $1 times +# +# This is done to reduce the sleeping time for testing +# +TEST_WATCH() { + plist="" # plist: the list of h5watch process IDs + dlist="" # dlist: the list of dataset names to watch/extend + outlist="" # outlist: the list of expected output files with suffix ".ddl" stripped + xlist="" # xlist: the list of exit codes from extending the dataset + NUM=$1 # number of objects to watch/extend + shift + NFNAME="`basename $1 .h5`" #the file to watch and to extend stripped of suffix ".h5" + shift + ctr=1 #counter for tracking the # of objects to test + while [ $ctr -le $NUM ] ; #loop till end of all objects to test + do + actual="../testfiles/`basename $3 .ddl`.out" #the actual output + outlist="$outlist`basename $3 .ddl` " #store to the list of output names + dlist="$dlist$1 " #store to the list of datasets + # + $CP "$NFNAME.h5" "$NFNAME$ctr.h5" #copy the file to a temporary file + # + if test -z "$2"; then #compile options & object to h5watch + OBJ="$NFNAME$ctr.h5/$1" #no options, just object + else + OBJ="$2 $NFNAME$ctr.h5/$1" #option and object + fi + # + # Run h5watch and put in background, output to a file + # + TESTING $H5WATCH $OBJ + $ECHO "" + $ECHO "#############################" > $actual + $ECHO " output for '$H5WATCH $OBJ'" >>$actual + $ECHO "#############################" >>$actual + $RUNSERIAL $H5WATCH_BIN $2 "$NFNAME$ctr.h5/$1" >> $actual & + WATCH_PID=$! #get h5watch process ID + plist="$plist$! " #store to the list of process IDs + shift; shift; shift + ctr=`expr $ctr + 1` + done; + # + # Extend the list of datasets corresponding to the list of files + n=1; + for d in $dlist; do + $EXTEND_BIN "$NFNAME$n.h5" $d + xlist="$xlist$? " #store to the list of exit codes from extending the dataset + n=`expr $n + 1` + done; + # + # Sleep to make sure output is flushed out before stopping h5watch + $ECHO "Sleeping for 4 seconds..." + $SLEEP 4 + # + # Kill the list of h5watch processes + $ECHO "Killing h5watch processes..." + for p in $plist; do #kill the list of h5watch processes + $KILL $p + done + # + # Check the list of return codes from extending the dataset + # Compare the list of actual output from h5watch with the corresponding expected output + n=1 + for x in $xlist; do + outname=`$ECHO $outlist|cut -d' ' -f$n` + actual="../testfiles/$outname.out" + expect="$srcdir/../testfiles/$outname.ddl" + if [ $x -ne 0 ]; then + $ECHO "*FAILED*" + nerrors="`expr $nerrors + 1`" + if [ yes = "$verbose" ]; then + $ECHO "test returned with exit code $exitcode" + $ECHO "test output: (up to $NLINES lines)" + + head -$NLINES $actual + $ECHO "***end of test output***" + $ECHO "" + fi + elif $CMP $expect $actual; then + $ECHO " PASSED" + else + $ECHO "*FAILED*" + $ECHO " Expected result differs from actual result" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + fi + # + # Cleaning + rm -f "$NFNAME$n.h5" + if test -z "$HDF5_NOCLEANUP"; then + rm -f $actual + fi + n="`expr $n + 1`" + done; +} + +############################################################################## +############################################################################## +### T H E T E S T S ### +############################################################################## +############################################################################## +# +# +################################################################################################# +# # +# WATCH.h5: file with various types of datasets for testing-- # +# The following datasets are chunked, H5D_ALLOC_TIME_INCR, max. dimensional setting: # +# DSET_ONE: one-dimensional dataset # +# DSET_TWO: two-dimensional dataset # +# DSET_CMPD: one-dimensional dataset with compound type # +# DSET_CMPD_ESC: one-dimensional dataset with compound type & escape/separator characters # +# DSET_CMPD_TWO: two-dimensional dataset with compound type # +# # +# The following datasets are one-dimensional, chunked, max. dimension setting: # +# DSET_ALLOC_EARLY: dataset with H5D_ALLOC_TIME_EARLY # +# DSET_ALLOC_LATE: dataset H5D_ALLOC_TIME_LATE # +# # +# The following datasets are one-dimensional: # +# DSET_NONE: fixed dimension setting, contiguous, H5D_ALLOC_TIME_LATE # +# DSET_NOMAX: fixed dimension setting, chunked, H5D_ALLOC_TIME_INCR # +# # +################################################################################################# +# +# +################################################################################################# +# # +# Tests on expected failures: # +# Invalid file name # +# Unable to find dataset, invalid dataset # +# DSET_NONE and DSET_NOMAX # +# Invalid input to options --width and --polling # +# Invalid field names for -f option # +# # +################################################################################################# +# +# Generate file with various types of datasets +$GEN_TEST_BIN +# Test on --help options +TOOLTEST w-help1.ddl 0 --help +# +# Tests on expected failures +TOOLTEST w-err-dset1.ddl 1 WATCH.h5 +TOOLTEST w-err-dset2.ddl 1 WATCH.h5/group/DSET_CMPD +TOOLTEST w-err-dset-none.ddl 1 WATCH.h5/DSET_NONE +TOOLTEST w-err-dset-nomax.ddl 1 WATCH.h5/DSET_NOMAX +TOOLTEST w-err-file.ddl 1 ../WATCH.h5/DSET_CMPD +TOOLTEST w-err-width.ddl 1 --width=-8 WATCH.h5/DSET_ONE +TOOLTEST w-err-poll.ddl 1 --polling=-8 WATCH.h5/DSET_ONE +TOOLTEST w-err-poll0.ddl 1 --polling=0 WATCH.h5/DSET_ONE +# +# Tests on invalid field names via --fields option for a compound typed dataset: DSET_CMPD +TOOLTEST w-err-cmpd1.ddl 1 --fields=fieldx WATCH.h5/DSET_CMPD +TOOLTEST w-err-cmpd2.ddl 1 --fields=field1,field2. WATCH.h5/DSET_CMPD +TOOLTEST w-err-cmpd3.ddl 1 --fields=field1,field2, WATCH.h5/DSET_CMPD +TOOLTEST w-err-cmpd4.ddl 1 --fields=field1,field2.b.k WATCH.h5/DSET_CMPD +TOOLTEST w-err-cmpd5.ddl 1 --fields=field1 --fields=field2.b.k WATCH.h5/DSET_CMPD +# +# +################################################################################################# +# # +# Tests on extending datasets-- # +# DSET_ONE, DSET_CMPD, DSET_CMPD_ESC # +# DSET_ALLOC_EARLY, DSET_ALLOC_LATE # +# DSET_TWO, DSET_CMPD_TWO # +# # +################################################################################################# +# +# Generate file with various types of datasets +$GEN_TEST_BIN +# +# Watching and extending: WATCH1.h5/DSET_ONE, WATCH2.h5/DSET_ALLOC_EARLY, WATCH3.h5/DSET_ALLOC_LATE WATCH4.h5/DSET_CMPD +# : WATCH5.h5/DSET_TWO, WATCH6.h5/DSET_CMPD_TWO, WATCH7.h5/DDSET_CMPD_ESC +TEST_WATCH 7 WATCH.h5 DSET_ONE '' w-ext-one.ddl DSET_ALLOC_EARLY '' w-ext-early.ddl DSET_ALLOC_LATE '' w-ext-late.ddl DSET_CMPD '' w-ext-cmpd.ddl DSET_TWO '' w-ext-two.ddl DSET_CMPD_TWO '' w-ext-cmpd-two.ddl DSET_CMPD_ESC '' w-ext-cmpd-esc.ddl +# +############################ +# Tests on --fields option # +############################ +# +# Watching and extending: +# WATCH1.h5/DSET_CMPD with --fields=field1,field2 +# WATCH2.h5/DSET_CMP_TWO with --fields=field1,field2 +# WATCH3.h5/DSET_CMPD_ESC with --fields=field\,1,field2\. +# WATCH4.h5/DSET_CMPD with --fields=field1 --fields=field2 +# WATCH5.h5/DSET_CMPD_ESC with --fields=field\,1 --fields=field2\. +# WATCH6.h5/DSET_CMPD_TWO with --fields=field1 --fields=field2 +# +TEST_WATCH 6 WATCH.h5 DSET_CMPD --fields=field1,field2 w-ext-cmpd-f1.ddl DSET_CMPD_TWO --fields=field1,field2 w-ext-cmpd-two-f1.ddl DSET_CMPD_ESC '--fields=field\,1,field2\.' w-ext-cmpd-esc-f1.ddl DSET_CMPD '--fields=field1 --fields=field2' w-ext-cmpd-ff1.ddl DSET_CMPD_ESC '--fields=field\,1 --fields=field2\.' w-ext-cmpd-esc-ff1.ddl DSET_CMPD_TWO '--fields=field1 --fields=field2' w-ext-cmpd-two-ff1.ddl +# +# +# +# Watching and extending: +# WATCH1.h5/DSET_CMPD with --fields=field2.b,field4 +# WATCH2.h5/DSET_CMPD_ESC with --fields=field2\..\,b,field4\ +# WATCH3.h5/DSET_CMPD_TWO with --fields=field2.b,field4 +# WATCH4.h5/DSET_CMPD with --fields=field2.b --fields=field4 +# WATCH5.h5/DSET_CMPD_ESC with --fields=field2\..\,b --fields=field4\, +# WATCH6.h5/DSET_CMPD_TWO with --fields=field2.b --fields=field4 +TEST_WATCH 6 WATCH.h5 DSET_CMPD --fields=field2.b,field4 w-ext-cmpd-f2.ddl DSET_CMPD_ESC '--fields=field2\..\,b,field4\,' w-ext-cmpd-esc-f2.ddl DSET_CMPD_TWO --fields=field2.b,field4 w-ext-cmpd-two-f2.ddl DSET_CMPD '--fields=field2.b --fields=field4' w-ext-cmpd-ff2.ddl DSET_CMPD_ESC '--fields=field2\..\,b --fields=field4\,' w-ext-cmpd-esc-ff2.ddl DSET_CMPD_TWO '--fields=field2.b --fields=field4' w-ext-cmpd-two-ff2.ddl +# +# +# +# Watching and extending: +# WATCH1.h5/DSET_CMPD with --fields=field2.b.a,field2.c +# WATCH2.h5/DSET_CMPD_ESC with --fields=field2\..\,b.a,field2\..\\K +# WATCH3.h5/DSET_CMPD_TWO with --fields=field2.b.a,field2.c +# WATCH4.h5/DSET_CMPD with --fields=field2.b.a --fields=field2.c +# WATCH5.h5/DSET_CMPD_ESC with --fields=field2\..\,b.a --fields=field2\..\\K +# WATCH6.h5/DSET_CMPD_TWO with --fields=field2.b.a --fields=field2.c +TEST_WATCH 6 WATCH.h5 DSET_CMPD --fields=field2.b.a,field2.c w-ext-cmpd-f3.ddl DSET_CMPD_ESC '--fields=field2\..\,b.a,field2\..\\K' w-ext-cmpd-esc-f3.ddl DSET_CMPD_TWO --fields=field2.b.a,field2.c w-ext-cmpd-two-f3.ddl DSET_CMPD '--fields=field2.b.a --fields=field2.c' w-ext-cmpd-ff3.ddl DSET_CMPD_ESC '--fields=field2\..\,b.a --fields=field2\..\\K' w-ext-cmpd-esc-ff3.ddl DSET_CMPD_TWO '--fields=field2.b.a --fields=field2.c' w-ext-cmpd-two-ff3.ddl +# +# +# +######################################################### +# # +# Tests on options: # +# --dim # +# --width, --label, --simple, --help # +# # +######################################################### +# +# Watching and extending: +# WATCH1.h5/DSET_ONE with -d option +# WATCH2.h5/DSET_TWO with --dim option +# WATCH3.h5/DSET_TWO with --width=60 option +# WATCH4.h5/DSET_CMPD with --label option +# WATCH5.h5/DSET_ONE with --simple option +TEST_WATCH 5 WATCH.h5 DSET_ONE --dim w-ext-one-d.ddl DSET_TWO --dim w-ext-two-d.ddl DSET_TWO --width=30 w-ext-two-width.ddl DSET_CMPD --label w-ext-cmpd-label.ddl DSET_ONE --simple w-ext-one-simple.ddl +# +# +# +if test $nerrors -eq 0 ; then + $ECHO "All h5watch tests passed." + exit $EXIT_SUCCESS +else + $ECHO "h5watch tests failed with $nerrors errors." + exit $EXIT_FAILURE +fi |