summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorRobb Matzke <matzke@llnl.gov>1998-03-17 01:29:54 (GMT)
committerRobb Matzke <matzke@llnl.gov>1998-03-17 01:29:54 (GMT)
commit31a709a6b24f4cf80f9cd99a3e55f56e81cf3066 (patch)
treec38f19508a87b990f911f8fe2d526b0cb1f2a2b3 /test
parent48e075110624e0039b1918a7187316366a20462b (diff)
downloadhdf5-31a709a6b24f4cf80f9cd99a3e55f56e81cf3066.zip
hdf5-31a709a6b24f4cf80f9cd99a3e55f56e81cf3066.tar.gz
hdf5-31a709a6b24f4cf80f9cd99a3e55f56e81cf3066.tar.bz2
[svn-r322] Changes since 19980313
---------------------- ./configure.in ./configure ./test/iopipe.c Added check for system(3) ./config/freebsd2.2.1 ./config/linux Added -DH5D_DEBUG to the debug flags. ./src/H5D.c ./src/H5Dprivate.h ./src/H5P.c ./src/H5Ppublic.h ./src/H5Sprivate.h ./src/H5Ssimp.c ./html/Datasets.html Finally implemented strip mining in the I/O pipeline, placing a user-defined upper bound on the amount of temporary memory used by the pipeline. The default is 1MB type conversion and background buffers allocated/freed on demand. However, the size can be changed and/or application-allocated buffers supplied with H5Pset_buffers() called on the data transfer property list passed to H5Dread() and H5Dwrite(). Minor optimizations to H5Dread() and H5Dwrite(). More coming later... ./test/dsets.c Added calls to H5Pset_buffer() to test application-defined temporary buffers in the I/O pipeline. ./test/Makefile.in Removed `iopipe' from the list of confidence tests. Saying `make timings' in the test directory runs timing tests. I did this because (1) they don't really test anything new, and (2) they can take a long time to run.
Diffstat (limited to 'test')
-rw-r--r--test/Makefile.in17
-rw-r--r--test/dsets.c22
-rw-r--r--test/iopipe.c23
3 files changed, 49 insertions, 13 deletions
diff --git a/test/Makefile.in b/test/Makefile.in
index 3bf75a4..f4d9009 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -11,13 +11,14 @@ CPPFLAGS=-I. -I../src @CPPFLAGS@
# These are our main targets. They should be listed in the order to be
# executed, generally most specific tests to least specific tests.
-PROGS=testhdf5 hyperslab istore dtypes dsets cmpd_dset extend external \
+PROGS=testhdf5 hyperslab istore dtypes dsets cmpd_dset extend external \
iopipe
-TESTS=$(PROGS)
+TESTS=testhdf5 hyperslab istore dtypes dsets cmpd_dset extend external
+TIMINGS=iopipe
# Temporary files
MOSTLYCLEAN=cmpd_dset.h5 dataset.h5 extend.h5 istore.h5 tfile1.h5 tfile2.h5 \
- tfile3.h5 th5s1.h5 theap.h5 tohdr.h5 tstab1.h5 tstab2.h5 \
+ tfile3.h5 th5s1.h5 theap.h5 tohdr.h5 tstab1.h5 tstab2.h5 \
extern_1.h5 extern_2.h5 extern_3.h5 extern_1.raw extern_1b.raw \
extern_2.raw extern_2b.raw extern_3.raw extern_3b.raw \
extern_4.raw extern_4b.raw iopipe.raw iopipe.h5
@@ -64,6 +65,16 @@ IOPIPE_OBJ=$(IOPIPE_SRC:.c=.o)
# Private header files (not to be installed)...
PRIVATE_HDR=testhdf5.h
+# Additional targets
+.PHONY: timings _timings
+timings _timings: $(TIMINGS)
+ @for timing in $(TIMINGS) dummy; do \
+ if test $$timing != dummy; then \
+ echo "Running $$timing $(TEST_FLAGS)"; \
+ $(RUNTEST) ./$$timing $(TEST_FLAGS) || exit 1; \
+ fi; \
+ done;
+
# How to build the programs...
testhdf5: $(TESTHDF5_OBJ) ../src/libhdf5.a
$(CC) $(CFLAGS) -o $@ $(TESTHDF5_OBJ) ../src/libhdf5.a $(LIBS)
diff --git a/test/dsets.c b/test/dsets.c
index c92824c..eaca4a8 100644
--- a/test/dsets.c
+++ b/test/dsets.c
@@ -184,11 +184,12 @@ test_create(hid_t file)
static herr_t
test_simple_io(hid_t file)
{
- hid_t dataset, space;
- herr_t status;
- int points[100][200], check[100][200];
- int i, j, n;
- size_t dims[2];
+ hid_t dataset, space, xfer;
+ herr_t status;
+ int points[100][200], check[100][200];
+ int i, j, n;
+ size_t dims[2];
+ void *tconv_buf = NULL;
printf("%-70s", "Testing simple I/O");
@@ -205,6 +206,13 @@ test_simple_io(hid_t file)
space = H5Screate_simple(2, dims, NULL);
assert(space>=0);
+ /* Create a small conversion buffer to test strip mining */
+ tconv_buf = malloc (1000);
+ xfer = H5Pcreate (H5P_DATASET_XFER);
+ assert (xfer>=0);
+ status = H5Pset_buffer (xfer, 1000, tconv_buf, NULL);
+ assert (status>=0);
+
/* Create the dataset */
dataset = H5Dcreate(file, DSET_SIMPLE_IO_NAME, H5T_NATIVE_INT, space,
H5P_DEFAULT);
@@ -212,12 +220,12 @@ test_simple_io(hid_t file)
/* Write the data to the dataset */
status = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
- H5P_DEFAULT, points);
+ xfer, points);
if (status<0) goto error;
/* Read the dataset back */
status = H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
- H5P_DEFAULT, check);
+ xfer, check);
if (status<0) goto error;
/* Check that the values read are the same as the values written */
diff --git a/test/iopipe.c b/test/iopipe.c
index 813150e..f185aad 100644
--- a/test/iopipe.c
+++ b/test/iopipe.c
@@ -19,12 +19,22 @@
#define RAW_FILE_NAME "iopipe.raw"
#define HDF5_FILE_NAME "iopipe.h5"
+#define HEADING "%-16s"
+#define PROGRESS '='
+
+#if 1
+/* Normal testing */
#define REQUEST_SIZE_X 4579
#define REQUEST_SIZE_Y 4579
#define NREAD_REQUESTS 45
#define NWRITE_REQUESTS 45
-#define HEADING "%-16s"
-#define PROGRESS '='
+#else
+/* Speedy testing */
+#define REQUEST_SIZE_X 1000
+#define REQUEST_SIZE_Y 1000
+#define NREAD_REQUESTS 45
+#define NWRITE_REQUESTS 45
+#endif
/*-------------------------------------------------------------------------
@@ -83,10 +93,17 @@ print_stats (const char *prefix,
static void
synchronize (void)
{
+#ifdef HAVE_SYSTEM
system ("sync");
system ("df >/dev/null");
#if 0
- system ("/sbin/swapout 130");
+ /*
+ * This works well on Linux to get rid of all cached disk buffers. The
+ * number should be approximately the amount of RAM in MB. Do not
+ * include swap space in that amount or the command will fail.
+ */
+ system ("/sbin/swapout 128");
+#endif
#endif
}