diff options
author | Vailin Choi <vchoi@hdfgroup.org> | 2015-07-04 00:42:34 (GMT) |
---|---|---|
committer | Vailin Choi <vchoi@hdfgroup.org> | 2015-07-04 00:42:34 (GMT) |
commit | f3b42904a5069df96df36989876351bb8302b251 (patch) | |
tree | 2a0273776eadb4882fba3e8496bec67055b5850c /hl | |
parent | 0fc7dc5b751a7748226193fa1c603a935af811ac (diff) | |
download | hdf5-f3b42904a5069df96df36989876351bb8302b251.zip hdf5-f3b42904a5069df96df36989876351bb8302b251.tar.gz hdf5-f3b42904a5069df96df36989876351bb8302b251.tar.bz2 |
[svn-r27335] Bring revisions #24679, #24736 from revise_chksum_retry branch to revise_chunks.
Tested on jam, koala, ostrich, platypus.
Diffstat (limited to 'hl')
-rw-r--r-- | hl/test/Makefile.am | 8 | ||||
-rw-r--r-- | hl/test/Makefile.in | 41 | ||||
-rw-r--r-- | hl/test/ld_mx.c | 353 | ||||
-rw-r--r-- | hl/test/test_ld.sh.in | 102 | ||||
-rw-r--r-- | hl/test/testfiles/test_ld_out1 | 31 | ||||
-rw-r--r-- | hl/test/testfiles/test_ld_out2 | 72 | ||||
-rw-r--r-- | hl/tools/h5watch/h5watch.c | 7 |
7 files changed, 16 insertions, 598 deletions
diff --git a/hl/test/Makefile.am b/hl/test/Makefile.am index 7e6a8e9..324c4f9 100644 --- a/hl/test/Makefile.am +++ b/hl/test/Makefile.am @@ -23,11 +23,6 @@ include $(top_srcdir)/config/commence.am # Add include directories to C preprocessor flags AM_CPPFLAGS+=-I. -I$(srcdir) -I$(top_builddir)/src -I$(top_srcdir)/src -I$(top_builddir)/test -I$(top_srcdir)/test -I$(top_srcdir)/hl/src -# Test script -TEST_SCRIPT = test_ld.sh -check_SCRIPTS = $(TEST_SCRIPT) -SCRIPT_DEPEND = ld_mx$(EXEEXT) - # The tests depend on the hdf5, hdf5 test, and hdf5_hl libraries LDADD=$(LIBH5_HL) $(LIBH5TEST) $(LIBHDF5) @@ -35,7 +30,7 @@ LDADD=$(LIBH5_HL) $(LIBH5TEST) $(LIBHDF5) # order to be executed, generally most specific tests to least specific tests. TEST_PROG=test_lite test_image test_file_image test_table test_ds test_packet test_dset_opt \ test_ld test_dset_append -check_PROGRAMS=$(TEST_PROG) ld_mx +check_PROGRAMS=$(TEST_PROG) # These programs generate test files for the tests. They don't need to be # compiled every time we want to test the library. However, putting @@ -53,6 +48,5 @@ CHECK_CLEANFILES+=combine_tables[1-2].h5 test_ds[1-9].h5 test_ds10.h5 \ test_image[1-3].h5 file_img[1-2].h5 test_lite[1-4].h5 test_table.h5 \ test_packet_table.h5 test_packet_compress.h5 test_detach.h5 \ test_dectris.h5 -DISTCLEANFILES=test_ld.sh include $(top_srcdir)/config/conclude.am diff --git a/hl/test/Makefile.in b/hl/test/Makefile.in index 23aab728..982ff3f 100644 --- a/hl/test/Makefile.in +++ b/hl/test/Makefile.in @@ -99,12 +99,11 @@ host_triplet = @host@ DIST_COMMON = $(top_srcdir)/config/commence.am \ $(top_srcdir)/config/conclude.am $(srcdir)/Makefile.in \ $(srcdir)/Makefile.am $(top_srcdir)/bin/mkinstalldirs \ - $(srcdir)/H5srcdir_str.h.in $(srcdir)/test_ld.sh.in \ - $(top_srcdir)/bin/depcomp $(top_srcdir)/bin/test-driver \ - COPYING -check_PROGRAMS = $(am__EXEEXT_1) ld_mx$(EXEEXT) + $(srcdir)/H5srcdir_str.h.in $(top_srcdir)/bin/depcomp \ + $(top_srcdir)/bin/test-driver COPYING +check_PROGRAMS = $(am__EXEEXT_1) @BUILD_ALL_CONDITIONAL_TRUE@noinst_PROGRAMS = $(am__EXEEXT_2) -TESTS = $(am__EXEEXT_1) $(TEST_SCRIPT) +TESTS = $(am__EXEEXT_1) subdir = hl/test ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/aclocal_cxx.m4 \ @@ -113,7 +112,7 @@ 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 = H5srcdir_str.h test_ld.sh +CONFIG_CLEAN_FILES = H5srcdir_str.h CONFIG_CLEAN_VPATH_FILES = am__EXEEXT_1 = test_lite$(EXEEXT) test_image$(EXEEXT) \ test_file_image$(EXEEXT) test_table$(EXEEXT) test_ds$(EXEEXT) \ @@ -133,10 +132,6 @@ gen_test_ld_SOURCES = gen_test_ld.c gen_test_ld_OBJECTS = gen_test_ld.$(OBJEXT) gen_test_ld_LDADD = $(LDADD) gen_test_ld_DEPENDENCIES = $(LIBH5_HL) $(LIBH5TEST) $(LIBHDF5) -ld_mx_SOURCES = ld_mx.c -ld_mx_OBJECTS = ld_mx.$(OBJEXT) -ld_mx_LDADD = $(LDADD) -ld_mx_DEPENDENCIES = $(LIBH5_HL) $(LIBH5TEST) $(LIBHDF5) test_ds_SOURCES = test_ds.c test_ds_OBJECTS = test_ds.$(OBJEXT) test_ds_LDADD = $(LDADD) @@ -207,10 +202,10 @@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = -SOURCES = gen_test_ds.c gen_test_ld.c ld_mx.c test_ds.c \ - test_dset_append.c test_dset_opt.c test_file_image.c \ - test_image.c test_ld.c test_lite.c test_packet.c test_table.c -DIST_SOURCES = gen_test_ds.c gen_test_ld.c ld_mx.c test_ds.c \ +SOURCES = gen_test_ds.c gen_test_ld.c test_ds.c test_dset_append.c \ + test_dset_opt.c test_file_image.c test_image.c test_ld.c \ + test_lite.c test_packet.c test_table.c +DIST_SOURCES = gen_test_ds.c gen_test_ld.c test_ds.c \ test_dset_append.c test_dset_opt.c test_file_image.c \ test_image.c test_ld.c test_lite.c test_packet.c test_table.c am__can_run_installinfo = \ @@ -717,11 +712,6 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 \ test_table.h5 test_packet_table.h5 test_packet_compress.h5 \ test_detach.h5 test_dectris.h5 -# Test script -TEST_SCRIPT = test_ld.sh -check_SCRIPTS = $(TEST_SCRIPT) -SCRIPT_DEPEND = ld_mx$(EXEEXT) - # The tests depend on the hdf5, hdf5 test, and hdf5_hl libraries LDADD = $(LIBH5_HL) $(LIBH5TEST) $(LIBHDF5) @@ -737,7 +727,6 @@ TEST_PROG = test_lite test_image test_file_image test_table test_ds test_packet # can be built by hand. They can also be built by specifying # --enable-build-all at configure time. BUILD_ALL_PROGS = gen_test_ds gen_test_ld -DISTCLEANFILES = test_ld.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., @@ -795,8 +784,6 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(am__aclocal_m4_deps): H5srcdir_str.h: $(top_builddir)/config.status $(srcdir)/H5srcdir_str.h.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ -test_ld.sh: $(top_builddir)/config.status $(srcdir)/test_ld.sh.in - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ clean-checkPROGRAMS: @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ @@ -824,10 +811,6 @@ gen_test_ld$(EXEEXT): $(gen_test_ld_OBJECTS) $(gen_test_ld_DEPENDENCIES) $(EXTRA @rm -f gen_test_ld$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gen_test_ld_OBJECTS) $(gen_test_ld_LDADD) $(LIBS) -ld_mx$(EXEEXT): $(ld_mx_OBJECTS) $(ld_mx_DEPENDENCIES) $(EXTRA_ld_mx_DEPENDENCIES) - @rm -f ld_mx$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(ld_mx_OBJECTS) $(ld_mx_LDADD) $(LIBS) - test_ds$(EXEEXT): $(test_ds_OBJECTS) $(test_ds_DEPENDENCIES) $(EXTRA_test_ds_DEPENDENCIES) @rm -f test_ds$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_ds_OBJECTS) $(test_ds_LDADD) $(LIBS) @@ -872,7 +855,6 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gen_test_ds.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gen_test_ld.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ld_mx.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_ds.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_dset_append.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_dset_opt.Po@am__quote@ @@ -1081,7 +1063,7 @@ $(TEST_SUITE_LOG): $(TEST_LOGS) echo "$$col$$br$$std"; \ fi; \ $$success || exit 1 -recheck: all $(check_PROGRAMS) $(check_SCRIPTS) +recheck: all $(check_PROGRAMS) @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ bases=`for i in $$bases; do echo $$i; done \ @@ -1201,7 +1183,7 @@ distdir: $(DISTFILES) fi; \ done check-am: all-am - $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(check_SCRIPTS) + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile $(PROGRAMS) all-local @@ -1235,7 +1217,6 @@ 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" diff --git a/hl/test/ld_mx.c b/hl/test/ld_mx.c deleted file mode 100644 index 9d45823..0000000 --- a/hl/test/ld_mx.c +++ /dev/null @@ -1,353 +0,0 @@ -#include "h5hltest.h" -#include <stdio.h> -#include <string.h> -#include <assert.h> -#include <stdlib.h> -#include <unistd.h> -#include <errno.h> - -/* Size of data buffer */ -#define TEST_BUF_SIZE 100 - -/* Note: These two defines should be the same as the defines in test_ld.sh.in */ -/* The message sent by extend_dset that the file is done with file open releasing the file lock */ -#define WRITER_MESSAGE "LD_WRITER_MESSAGE" -/* The message sent by monitor_dset that it is done setting up */ -#define READER_MESSAGE "LD_READER_MESSAGE" - -/* - * 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} - }; - -/* - * Extend the specified dataset in the file with "monitor_dset" monitoring - * the dataset on the other end: - * 1) Extend the dataset according to the variations: ONE_NTESTS, TWO_NTESTS - * 2) Write to the dataset (currently, only for integer dataset) - * 3) Flush the dataset - * - * Due to the implementation of file locking, coordination is needed in file - * opening for the writer/reader tests to proceed as expected: - * --it will send the WRITER_MESSAGE when the file open is done: - * to notify monitor_dset() to start monitoring the dataset - * --it will wait for the READER_MESSAGE from monitor_dset() before extending - * the dataset - */ -static int -extend_dset(const char *file, char *dname) -{ - hid_t fid; /* file id */ - hid_t fapl; /* file access property list */ - hid_t did; /* dataset id */ - hid_t dtype; /* dataset's datatype */ - hid_t sid; /* dataspace id */ - int i, j, k; /* local index variable */ - int ndims; /* number of dimensions */ - int buf[TEST_BUF_SIZE]; /* buffer for data */ - hsize_t cur_dims[2]; /* current dimension sizes */ - hsize_t ext_dims[2]; /* new dimension sizes after extension */ - - /* Create a file access property list */ - if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) - goto done; - - /* Set to use latest library format */ - if((H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST)) < 0) - goto done; - - /* Open the file with SWMR write */ - if((fid = H5Fopen(file, H5F_ACC_RDWR|H5F_ACC_SWMR_WRITE, fapl)) < 0) - goto done; - - /* Send message that "extend_dset" (this routine) is done with H5Fopen--the file lock is released */ - h5_send_message(WRITER_MESSAGE); - - /* Open the dataset */ - if((did = H5Dopen2(fid, dname, H5P_DEFAULT)) < 0) - goto done; - - /* Get the dataset's data space */ - if((sid = H5Dget_space(did)) < 0) - goto done; - - /* Get the # of dimensions for the dataset */ - if((ndims = H5Sget_simple_extent_ndims(sid)) < 0) - goto done; - - /* Initialize data written to the dataset */ - HDmemset(buf, 0, sizeof(buf)); - for(k = 0; k < TEST_BUF_SIZE; k++) - buf[k] = k; - - /* Wait for message from "monitor_dset" before starting to extend the dataset */ - if(h5_wait_message(READER_MESSAGE) < 0) - goto done; - - /* Loop through different variations of extending the dataset */ - for(i = 0; i < (ndims == 1 ? ONE_NTESTS: TWO_NTESTS); i++) { - HDsleep(2); - - /* Get the dataset's current dimension sizes */ - if(H5LDget_dset_dims(did, cur_dims) < 0) - goto done; - - /* Set up the new extended dimension sizes */ - for(j = 0; j < ndims; j++) - ext_dims[j] = cur_dims[j] + (ndims == 1 ? (hsize_t)one_tests[i] : (hsize_t)two_tests[i][j]); - - /* Extend the dataset */ - if(H5Dset_extent(did, ext_dims) < 0) - goto done; - - /* Get the dataset's data type */ - if((dtype = H5Tget_native_type(H5Dget_type(did), H5T_DIR_DEFAULT)) < 0) - goto done; - - /* Write to the whole dataset after extension */ - if(H5Dwrite(did, dtype, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) - goto done; - - /* Flush the data */ - if(H5Dflush(did) < 0) - goto done; - - } /* end for ONE_NTESTS or TWO_NTESTS */ - - /* Closing */ - if(H5Tclose(dtype) < 0) goto done; - if(H5Sclose(sid) < 0) goto done; - if(H5Dclose(did) < 0) goto done; - if(H5Pclose(fapl) < 0) goto done; - if(H5Fclose(fid) < 0) goto done; - - return(0); - -done: - H5E_BEGIN_TRY - H5Tclose(dtype); - H5Sclose(sid); - H5Dclose(did); - H5Pclose(fapl); - H5Fclose(fid); - H5E_END_TRY - - return(-1); -} /* extend_dset() */ - - -/* - * Monitor the specified dataset in the file while "extend_dset" is extending - * and writing to the dataset on the other end: - * - * 1) Retrieve the dataset's current dimension sizes - * 2) If there are changes in dimension sizes: - * print the dimension sizes - * retrieve the appended data and print them - * - * Due to the implementation of file locking, coordination is needed in file - * opening for the writer/reader tests to proceed as expected: - * --it will wait for the WRITER_MESSAGE from extend_dset() before opening - * the test file - * --it will send the READER_MESSAGE when the setup is done: - * to notify extend_dset() to start extending the dataset - */ -static int -monitor_dset(const char *fname, char *dname) -{ - hid_t fid; /* file id */ - hid_t fapl; /* file access property list */ - 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 cur_dims[H5S_MAX_RANK]; /* current dimension sizes */ - hsize_t prev_dims[H5S_MAX_RANK]; /* previous dimension sizes */ - int buf[TEST_BUF_SIZE]; /* Buffer for data */ - herr_t ret_value = 0; /* return value */ - - /* Wait for message from "extend_dset" before opening the file */ - if(h5_wait_message(WRITER_MESSAGE) < 0) - goto done; - - /* Create a file access property list */ - if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) - goto done; - - /* Set to use latest library format */ - if((H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST)) < 0) - goto done; - - /* Open the file with SWMR access */ - if((fid = H5Fopen(fname, H5F_ACC_SWMR_READ, fapl)) < 0) { - ret_value = -1; - goto done; - } - - HDfprintf(stdout, "Monitoring dataset %s...\n", dname); - - /* Open the dataset for minitoring */ - if((did = H5Dopen2(fid, dname, H5P_DEFAULT)) < 0) { - HDfprintf(stdout, "error in opening dataset \"%s\"\n", dname); - ret_value = -1; - goto done; - } - - /* Get the dataset's data space */ - if((sid = H5Dget_space(did)) < 0) { - HDfprintf(stdout, "error in getting dataspace id for dataset \"%s\"\n", dname); - ret_value = -1; - goto done; - } - - /* Get the dataset's dimension sizes */ - if((ndims = H5Sget_simple_extent_dims(sid, prev_dims, NULL)) < 0) { - HDfprintf(stdout, "unable to get dimensions sizes for \"%s\"\n", dname); - ret_value = -1; - goto done; - } - - /* Send message that "monitor_dset" (this routine) is done with setting up */ - h5_send_message(READER_MESSAGE); - - /* Monitor the dataset for changes */ - while(1) { - - /* Refresh the dataset */ - if(H5Drefresh(did) < 0) { - ret_value = -1; - goto done; - } - - /* Get the dataset's current dimension sizes */ - if(H5LDget_dset_dims(did, cur_dims) < 0) { - HDfprintf(stdout, "unable to get dimension sizes for \"%s\"\n", dname); - ret_value = -1; - goto done; - } - - /* Check for changes in dimension sizes */ - for(u = 0; u < ndims; u++) { - if(cur_dims[u] != prev_dims[u]) { - break; - } - } - - /* Printing only when there are changes */ - if(u < ndims) { - /* Print the current dimension sizes */ - HDfprintf(stdout, "\n"); - for(i = 0; i < ndims; i++) - HDfprintf(stdout, "%d ", (int)cur_dims[i]); - HDfprintf(stdout, "\n"); - - /* Get data appended to the dataset and print the data */ - HDmemset(buf, 0, sizeof(buf)); - if(H5LDget_dset_elmts(did, prev_dims, cur_dims, NULL, buf) >= 0) { - - for(i = 0; i < TEST_BUF_SIZE; i++) { - if(i % 10) - HDfprintf(stdout, "%d ", buf[i]); - else - HDfprintf(stdout, "\n%d ", buf[i]); - } - HDfprintf(stdout, "\n"); - } - - /* Flush the output to stdout */ - HDfflush(stdout); - /* Update the dimension sizes */ - HDmemcpy(prev_dims, cur_dims, ndims * sizeof(hsize_t)); - } - HDsleep(1); - } /* end for */ - -done: - /* Closing */ - H5E_BEGIN_TRY - H5Sclose(sid); - H5Dclose(did); - H5Pclose(fapl); - H5E_END_TRY - - return(ret_value); -} /* monitor_dset() */ - -/* Usage: - * ld_mx -m fname dname -- to monitor the file's dataset - * or - * ld_mx -x fname dname -- to extend the file's dataset - */ -/* This file is a combination of ld_monitor.c and ld_extend.c which are svn deleted */ -int -main(int argc, char *argv[]) -{ - char *dname = NULL; /* dataset name */ - char *fname = NULL; /* file name */ - int opt = 0; - unsigned int monitor = 0, extend = 0; - - if(argc != 4) { - fprintf(stderr, "Usage: ld_mx -m fname dname for monitoring the dataset 'dname' in the file 'fname'\n"); - fprintf(stderr, "Usage: ld_mx -x fname dname for extending the dataset 'dname' in the file 'fname'\n"); - goto done; - } - /* Parse command line options */ - while((opt = getopt(argc, argv, "mx")) != -1) { - switch(opt) { - case 'm': /* monitor dataset */ - monitor = 1; - break; - - case 'x': /* extend dataset */ - extend = 1; - break; - default: - printf("Invalid option encountered\n"); - break; - } - } - - if((extend && monitor) || (!extend && !monitor)) { - fprintf(stderr, "Usage: ldmx -m/-x fname dname\n"); - goto done; - } - - if(optind != 2) { - fprintf(stderr, "Usage: ldmx -m/-x fname dname\n"); - goto done; - } - - fname = HDstrdup(argv[optind++]); - dname = HDstrdup(argv[optind++]); - - - if(extend) { - if(extend_dset(fname, dname) < 0) - goto done; - } else if(monitor) { - if(monitor_dset(fname, dname) < 0) - goto done; - } - - exit(EXIT_SUCCESS); - -done: - if(dname) HDfree(dname); - if(fname) HDfree(fname); - exit(EXIT_FAILURE); -} /* main() */ diff --git a/hl/test/test_ld.sh.in b/hl/test/test_ld.sh.in deleted file mode 100644 index b263f2a..0000000 --- a/hl/test/test_ld.sh.in +++ /dev/null @@ -1,102 +0,0 @@ -#! /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. -# -# -# Concurrent tests for H5LD* routines -# -# Determine backward compatibility options eneabled -DEPRECATED_SYMBOLS="@DEPRECATED_SYMBOLS@" - -CMP='cmp -s' -DIFF='diff -c' -LD_MONITOR='ld_mx -m' -LD_MONITOR_BIN=`pwd`/$LD_MONITOR -LD_EXTEND='ld_mx -x' -LD_EXTEND_BIN=`pwd`/$LD_EXTEND -# These two message files should be the same as the two defines in ./ld_mx.c -READER_MESSAGE='LD_READER_MESSAGE' -WRITER_MESSAGE='LD_WRITER_MESSAGE' -# -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' -} - -# $1 -- the hdf5 file to be monitored and extended -# $2 -- the dataset name to be monitored and extended -# $3 -- the expected output from monitoring the dataset -TESTLD() { - expect="$srcdir/testfiles/$3" # the expected output - actual="./testfiles/$3.OUT" # the actual output - FNAME="`basename $1 .h5`_$2.h5" # the HDF5 file - cp $srcdir/$1 ./$FNAME # copy the file to a temporary file -# - rm -f $WRITER_MESSAGE # remove the message file just to be sure - rm -f $READER_MESSAGE # remove the message file just to be sure -# - $LD_EXTEND_BIN $FNAME $2 & # extend the dataset - EXTEND_PID=$! # get the id of the "extend" process - $LD_MONITOR_BIN $FNAME $2 > $actual 2>&1 & # monitor the dataset in the file - MONITOR_PID=$! # get the id of the "monitor" process - wait $EXTEND_PID # wait for the completion of the "extend" process -# - sleep 1 # sleep to ensure that the monitoring completes - kill $MONITOR_PID # kill the "monitor" process -# - if $CMP $expect $actual; then # compare the output with the expected output - 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 - if test -z "$HDF5_NOCLEANUP"; then # clean up output file, temporary HDF5 file - rm -f $actual $FNAME - fi -} - -############################################################################## -############################################################################## -### T H E T E S T S ### -############################################################################## -############################################################################## - -# Monitor DSET_ONE while extending the dataset -TESTLD test_ld.h5 DSET_ONE test_ld_out1 -# -# -# Monitor DSET_TWO while extending the dataset -TESTLD test_ld.h5 DSET_TWO test_ld_out2 -# -# -if test $nerrors -eq 0 ; then - echo "All high level H5LD concurrent tests passed." -fi - -exit $nerrors diff --git a/hl/test/testfiles/test_ld_out1 b/hl/test/testfiles/test_ld_out1 deleted file mode 100644 index dda3552..0000000 --- a/hl/test/testfiles/test_ld_out1 +++ /dev/null @@ -1,31 +0,0 @@ -Monitoring dataset DSET_ONE... - -13 - -10 11 12 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 - -12 - -1 - -3 - -1 2 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 diff --git a/hl/test/testfiles/test_ld_out2 b/hl/test/testfiles/test_ld_out2 deleted file mode 100644 index 7a98c19..0000000 --- a/hl/test/testfiles/test_ld_out2 +++ /dev/null @@ -1,72 +0,0 @@ -Monitoring dataset DSET_TWO... - -6 12 - -10 11 22 23 34 35 46 47 48 49 -50 51 52 53 54 55 56 57 58 59 -60 61 62 63 64 65 66 67 68 69 -70 71 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 - -8 1 - -6 7 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 - -10 1 - -8 9 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 - -3 3 - -1 2 4 5 7 8 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 - -2 2 - -1 2 - -1 4 - -2 3 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 - -1 3 diff --git a/hl/tools/h5watch/h5watch.c b/hl/tools/h5watch/h5watch.c index c5f6f8d..7bb86a2 100644 --- a/hl/tools/h5watch/h5watch.c +++ b/hl/tools/h5watch/h5watch.c @@ -28,7 +28,7 @@ */ #define PROGRAMNAME "h5watch" /* Name of tool */ #define FIELD_SEP "," /* nested field separator */ -#define DEFAULT_RETRY 10 /* number of times to try opening the file */ +#define DEFAULT_RETRY 50 /* number of times to try opening the file */ /* @@ -66,6 +66,7 @@ static void parse_command_line(int argc, const char *argv[]); * The long-named ones can be partially spelled. When * adding more, make sure that they don't clash with each other. */ +static const char *s_opts ="?"; static struct long_options l_opts[] = { { "help", no_arg, 'h' }, { "hel", no_arg, 'h' }, @@ -697,7 +698,7 @@ parse_command_line(int argc, const char *argv[]) } /* parse command line options */ - while ((opt = get_option(argc, argv, NULL, l_opts)) != EOF) { + while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) { switch ((char)opt) { case '?': case 'h': /* --help */ @@ -905,7 +906,7 @@ main(int argc, const char *argv[]) *dname = '\0'; } /* end while */ /* Try opening the file again if somehow unstable */ - } while(g_retry-- > 0 && fid == FAIL && !HDsleep(g_polling_interval)); + } while(g_retry-- > 0 && fid == FAIL); if(fid < 0) { error_msg("unable to open file \"%s\"\n", fname); |