summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaymond Lu <songyulu@hdfgroup.org>2012-08-09 19:59:43 (GMT)
committerRaymond Lu <songyulu@hdfgroup.org>2012-08-09 19:59:43 (GMT)
commit3b3ae10c5b7a54a64c92b321d53cfe3b00c6584d (patch)
tree00ef6ec200109ee176834d33ffdc16f2b8f39cf2
parentfaba610060cb168d97a7b9c01d95688542e2cf28 (diff)
downloadhdf5-3b3ae10c5b7a54a64c92b321d53cfe3b00c6584d.zip
hdf5-3b3ae10c5b7a54a64c92b321d53cfe3b00c6584d.tar.gz
hdf5-3b3ae10c5b7a54a64c92b321d53cfe3b00c6584d.tar.bz2
[svn-r22653] Dectris project: I revised the code per Quincey's suggestion.
Tested on koala.
-rw-r--r--perform/Makefile.am5
-rw-r--r--perform/Makefile.in20
-rw-r--r--perform/dectris_perf.c (renamed from test/dectris_perf.c)145
-rw-r--r--src/H5Dio.c10
-rw-r--r--test/Makefile.am4
-rw-r--r--test/Makefile.in47
-rw-r--r--test/dectris_tst.c10
7 files changed, 177 insertions, 64 deletions
diff --git a/perform/Makefile.am b/perform/Makefile.am
index 4b44b43..c4720f8 100644
--- a/perform/Makefile.am
+++ b/perform/Makefile.am
@@ -51,12 +51,12 @@ if BUILD_PARALLEL_CONDITIONAL
TEST_PROG_PARA=h5perf perf
endif
# Serial test programs.
-TEST_PROG = iopipe chunk overhead zip_perf perf_meta h5perf_serial $(BUILD_ALL_PROGS)
+TEST_PROG = dectris_perf iopipe chunk overhead zip_perf perf_meta h5perf_serial $(BUILD_ALL_PROGS)
# check_PROGRAMS will be built but not installed. Do not any executable
# that is in bin_PROGRAMS already. Otherwise, it will be removed twice in
# "make clean" and some systems, e.g., AIX, do not like it.
-check_PROGRAMS= iopipe chunk overhead zip_perf perf_meta $(BUILD_ALL_PROGS) perf
+check_PROGRAMS= dectris_perf iopipe chunk overhead zip_perf perf_meta $(BUILD_ALL_PROGS) perf
h5perf_SOURCES=pio_perf.c pio_engine.c pio_timer.c
h5perf_serial_SOURCES=sio_perf.c sio_engine.c sio_timer.c
@@ -71,6 +71,7 @@ LDADD=$(LIBHDF5)
h5perf_LDADD=$(LIBH5TOOLS) $(LIBH5TEST) $(LIBHDF5)
h5perf_serial_LDADD=$(LIBH5TOOLS) $(LIBH5TEST) $(LIBHDF5)
perf_LDADD=$(LIBH5TEST) $(LIBHDF5)
+dectris_perf_LDADD=$(LIBH5TEST) $(LIBHDF5)
iopipe_LDADD=$(LIBH5TEST) $(LIBHDF5)
zip_perf_LDADD=$(LIBH5TOOLS) $(LIBH5TEST) $(LIBHDF5)
perf_meta_LDADD=$(LIBH5TEST) $(LIBHDF5)
diff --git a/perform/Makefile.in b/perform/Makefile.in
index 39739a4..a702438 100644
--- a/perform/Makefile.in
+++ b/perform/Makefile.in
@@ -59,9 +59,9 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
@BUILD_PARALLEL_CONDITIONAL_TRUE@bin_PROGRAMS = \
@BUILD_PARALLEL_CONDITIONAL_TRUE@ h5perf_serial$(EXEEXT) \
@BUILD_PARALLEL_CONDITIONAL_TRUE@ h5perf$(EXEEXT)
-check_PROGRAMS = iopipe$(EXEEXT) chunk$(EXEEXT) overhead$(EXEEXT) \
- zip_perf$(EXEEXT) perf_meta$(EXEEXT) $(am__EXEEXT_2) \
- perf$(EXEEXT)
+check_PROGRAMS = dectris_perf$(EXEEXT) iopipe$(EXEEXT) chunk$(EXEEXT) \
+ overhead$(EXEEXT) zip_perf$(EXEEXT) perf_meta$(EXEEXT) \
+ $(am__EXEEXT_2) perf$(EXEEXT)
TESTS = $(check_PROGRAMS)
subdir = perform
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
@@ -88,6 +88,9 @@ chunk_SOURCES = chunk.c
chunk_OBJECTS = chunk.$(OBJEXT)
chunk_LDADD = $(LDADD)
chunk_DEPENDENCIES = $(LIBHDF5)
+dectris_perf_SOURCES = dectris_perf.c
+dectris_perf_OBJECTS = dectris_perf.$(OBJEXT)
+dectris_perf_DEPENDENCIES = $(LIBH5TEST) $(LIBHDF5)
am_h5perf_OBJECTS = pio_perf.$(OBJEXT) pio_engine.$(OBJEXT) \
pio_timer.$(OBJEXT)
h5perf_OBJECTS = $(am_h5perf_OBJECTS)
@@ -148,10 +151,10 @@ am__v_CCLD_0 = @echo " CCLD " $@;
AM_V_GEN = $(am__v_GEN_$(V))
am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
am__v_GEN_0 = @echo " GEN " $@;
-SOURCES = benchpar.c chunk.c $(h5perf_SOURCES) \
+SOURCES = benchpar.c chunk.c dectris_perf.c $(h5perf_SOURCES) \
$(h5perf_serial_SOURCES) iopipe.c mpi-perf.c overhead.c perf.c \
perf_meta.c zip_perf.c
-DIST_SOURCES = benchpar.c chunk.c $(h5perf_SOURCES) \
+DIST_SOURCES = benchpar.c chunk.c dectris_perf.c $(h5perf_SOURCES) \
$(h5perf_serial_SOURCES) iopipe.c mpi-perf.c overhead.c perf.c \
perf_meta.c zip_perf.c
ETAGS = etags
@@ -457,7 +460,7 @@ h5perf_serial_LDFLAGS = $(LT_STATIC_EXEC) $(AM_LDFLAGS)
# Parallel test programs.
@BUILD_PARALLEL_CONDITIONAL_TRUE@TEST_PROG_PARA = h5perf perf
# Serial test programs.
-TEST_PROG = iopipe chunk overhead zip_perf perf_meta h5perf_serial $(BUILD_ALL_PROGS)
+TEST_PROG = dectris_perf iopipe chunk overhead zip_perf perf_meta h5perf_serial $(BUILD_ALL_PROGS)
h5perf_SOURCES = pio_perf.c pio_engine.c pio_timer.c
h5perf_serial_SOURCES = sio_perf.c sio_engine.c sio_timer.c
@@ -471,6 +474,7 @@ LDADD = $(LIBHDF5)
h5perf_LDADD = $(LIBH5TOOLS) $(LIBH5TEST) $(LIBHDF5)
h5perf_serial_LDADD = $(LIBH5TOOLS) $(LIBH5TEST) $(LIBHDF5)
perf_LDADD = $(LIBH5TEST) $(LIBHDF5)
+dectris_perf_LDADD = $(LIBH5TEST) $(LIBHDF5)
iopipe_LDADD = $(LIBH5TEST) $(LIBHDF5)
zip_perf_LDADD = $(LIBH5TOOLS) $(LIBH5TEST) $(LIBHDF5)
perf_meta_LDADD = $(LIBH5TEST) $(LIBHDF5)
@@ -582,6 +586,9 @@ benchpar$(EXEEXT): $(benchpar_OBJECTS) $(benchpar_DEPENDENCIES)
chunk$(EXEEXT): $(chunk_OBJECTS) $(chunk_DEPENDENCIES)
@rm -f chunk$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(chunk_OBJECTS) $(chunk_LDADD) $(LIBS)
+dectris_perf$(EXEEXT): $(dectris_perf_OBJECTS) $(dectris_perf_DEPENDENCIES)
+ @rm -f dectris_perf$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(dectris_perf_OBJECTS) $(dectris_perf_LDADD) $(LIBS)
h5perf$(EXEEXT): $(h5perf_OBJECTS) $(h5perf_DEPENDENCIES)
@rm -f h5perf$(EXEEXT)
$(AM_V_CCLD)$(h5perf_LINK) $(h5perf_OBJECTS) $(h5perf_LDADD) $(LIBS)
@@ -615,6 +622,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/benchpar.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chunk.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dectris_perf.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iopipe.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mpi-perf.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/overhead.Po@am__quote@
diff --git a/test/dectris_perf.c b/perform/dectris_perf.c
index e743a19..cf0580c 100644
--- a/test/dectris_perf.c
+++ b/perform/dectris_perf.c
@@ -18,14 +18,17 @@
*
*/
-#include "h5test.h"
+#include "hdf5.h"
+#include "H5private.h"
#include <zlib.h>
#include <math.h>
+#include <stdio.h>
#include <stdlib.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
+#include <unistd.h>
const char *FILENAME[] = {
"dectris_perf",
@@ -33,16 +36,28 @@ const char *FILENAME[] = {
NULL
};
-#define DIRECT_DSET "direct_dset"
-#define COMPRESSED_DSET "compressed_dset"
-#define NO_COMPRESS_DSET "no_compress_dset"
+/*
+ * Print the current location on the standard output stream.
+ */
+#define FUNC __func__
+#define AT() printf (" at %s:%d in %s()...\n", \
+ __FILE__, __LINE__, FUNC);
+#define H5_FAILED() {puts("*FAILED*");fflush(stdout);}
+#define TEST_ERROR {H5_FAILED(); AT(); goto error;}
+#define TESTING(WHAT) {printf("Testing %-62s",WHAT); fflush(stdout);}
+#define PASSED() {puts(" PASSED");fflush(stdout);}
+
+#define DIRECT_UNCOMPRESSED_DSET "direct_uncompressed_dset"
+#define DIRECT_COMPRESSED_DSET "direct_compressed_dset"
+#define REG_COMPRESSED_DSET "reg_compressed_dset"
+#define REG_NO_COMPRESS_DSET "reg_no_compress_dset"
#define RANK 3
#define NX 100
-#define NY 100
-#define NZ 25
+#define NY 1000
+#define NZ 250
#define CHUNK_NX 1
-#define CHUNK_NY 100
-#define CHUNK_NZ 25
+#define CHUNK_NY 1000
+#define CHUNK_NZ 250
#define DEFLATE_SIZE_ADJUST(s) (ceil(((double)(s))*1.001)+12)
char filename[1024];
@@ -92,6 +107,9 @@ int create_file(hid_t fapl_id)
int ret;
int i, j, n;
+ int flag;
+ int unix_file;
+
unsigned int *p;
size_t buf_size = CHUNK_NY*CHUNK_NZ*sizeof(unsigned int);
@@ -127,7 +145,14 @@ int create_file(hid_t fapl_id)
* Create a new dataset within the file using cparms
* creation properties.
*/
- if((dataset = H5Dcreate2(file, NO_COMPRESS_DSET, H5T_NATIVE_INT, dataspace, H5P_DEFAULT,
+ if((dataset = H5Dcreate2(file, DIRECT_UNCOMPRESSED_DSET, H5T_NATIVE_INT, dataspace, H5P_DEFAULT,
+ cparms, H5P_DEFAULT)) < 0)
+ TEST_ERROR;
+
+ if(H5Dclose(dataset) < 0)
+ TEST_ERROR;
+
+ if((dataset = H5Dcreate2(file, REG_NO_COMPRESS_DSET, H5T_NATIVE_INT, dataspace, H5P_DEFAULT,
cparms, H5P_DEFAULT)) < 0)
TEST_ERROR;
@@ -138,7 +163,7 @@ int create_file(hid_t fapl_id)
if(H5Pset_deflate( cparms, aggression) < 0)
TEST_ERROR;
- if((dataset = H5Dcreate2(file, DIRECT_DSET, H5T_NATIVE_INT, dataspace, H5P_DEFAULT,
+ if((dataset = H5Dcreate2(file, DIRECT_COMPRESSED_DSET, H5T_NATIVE_INT, dataspace, H5P_DEFAULT,
cparms, H5P_DEFAULT)) < 0)
TEST_ERROR;
@@ -146,7 +171,7 @@ int create_file(hid_t fapl_id)
TEST_ERROR;
- if((dataset = H5Dcreate2(file, COMPRESSED_DSET, H5T_NATIVE_INT, dataspace, H5P_DEFAULT,
+ if((dataset = H5Dcreate2(file, REG_COMPRESSED_DSET, H5T_NATIVE_INT, dataspace, H5P_DEFAULT,
cparms, H5P_DEFAULT)) < 0)
TEST_ERROR;
@@ -162,6 +187,19 @@ int create_file(hid_t fapl_id)
if(H5Pclose(cparms) < 0)
TEST_ERROR;
+ /* create a unix file*/
+ flag = O_CREAT|O_TRUNC|O_WRONLY;
+
+ if ((unix_file=open(FILENAME[1],flag,S_IRWXU))== -1)
+ TEST_ERROR;
+
+ if (close(unix_file) < 0)
+ {
+ printf(" unable to close the file\n");
+ TEST_ERROR;
+ }
+
+
/* Initialize data for chunks */
for(i = 0; i < NX; i++) {
p = direct_buf[i] = (unsigned int*)malloc(CHUNK_NY*CHUNK_NZ*sizeof(unsigned int));
@@ -209,11 +247,77 @@ error:
}
/*--------------------------------------------------
- * Benchmark the performance of the new function
+ * Benchmark the performance of the new function
+ * with precompressed data.
+ *--------------------------------------------------
+ */
+int
+test_direct_write_uncompressed_data(hid_t fapl_id)
+{
+ hid_t file; /* handles */
+ hid_t dataspace, dataset;
+ hid_t dxpl;
+ herr_t status;
+ int i;
+
+ unsigned filter_mask = 0;
+ hsize_t offset[RANK+1] = {0, 0, 0, 0};
+
+ struct timeval timeval_start;
+
+ TESTING("H5PSIdirect_write for uncompressed data");
+
+ if((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0)
+ TEST_ERROR;
+
+ /* Start the timer */
+ gettimeofday(&timeval_start,NULL);
+
+ /* Reopen the file and dataset */
+ if((file = H5Fopen(filename, H5F_ACC_RDWR|H5F_ACC_SYNC, fapl_id)) < 0)
+ TEST_ERROR;
+
+ if((dataset = H5Dopen(file, DIRECT_UNCOMPRESSED_DSET, H5P_DEFAULT)) < 0)
+ TEST_ERROR;
+
+
+ /* Write the compressed chunk data repeatedly to cover all the chunks in the
+ * dataset, using the direct writing function. */
+ for(i=0; i<NX; i++) {
+ status = H5PSIdirect_write(dataset, dxpl, filter_mask, offset, CHUNK_NY*CHUNK_NZ*sizeof(unsigned int), direct_buf[i]);
+ (offset[0])++;
+ }
+
+ /*
+ * Close/release resources.
+ */
+ H5Dclose(dataset);
+ H5Pclose(dxpl);
+ H5Fclose(file);
+
+ /* Report the performance */
+ reportTime(timeval_start, (double)(NX*NY*NZ*sizeof(unsigned int)/MB));
+
+ PASSED();
+ return 0;
+
+error:
+ H5E_BEGIN_TRY {
+ H5Dclose(dataset);
+ H5Pclose(dxpl);
+ H5Fclose(file);
+ } H5E_END_TRY;
+ return 1;
+}
+
+
+/*--------------------------------------------------
+ * Benchmark the performance of the new function
+ * with precompressed data.
*--------------------------------------------------
*/
int
-test_direct_write(hid_t fapl_id)
+test_direct_write_compressed_data(hid_t fapl_id)
{
hid_t file; /* handles */
hid_t dataspace, dataset;
@@ -226,7 +330,7 @@ test_direct_write(hid_t fapl_id)
struct timeval timeval_start;
- TESTING("H5PSIdirect_write for DECTRIS project");
+ TESTING("H5PSIdirect_write for pre-compressed data");
if((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0)
TEST_ERROR;
@@ -238,7 +342,7 @@ test_direct_write(hid_t fapl_id)
if((file = H5Fopen(filename, H5F_ACC_RDWR|H5F_ACC_SYNC, fapl_id)) < 0)
TEST_ERROR;
- if((dataset = H5Dopen(file, DIRECT_DSET, H5P_DEFAULT)) < 0)
+ if((dataset = H5Dopen(file, DIRECT_COMPRESSED_DSET, H5P_DEFAULT)) < 0)
TEST_ERROR;
@@ -309,7 +413,7 @@ test_compressed_write(hid_t fapl_id)
if((file = H5Fopen(filename, H5F_ACC_RDWR|H5F_ACC_SYNC, fapl_id)) < 0)
TEST_ERROR;
- if((dataset = H5Dopen(file, COMPRESSED_DSET, H5P_DEFAULT)) < 0)
+ if((dataset = H5Dopen(file, REG_COMPRESSED_DSET, H5P_DEFAULT)) < 0)
TEST_ERROR;
if((dataspace = H5Dget_space(dataset)) < 0)
@@ -397,7 +501,7 @@ test_no_compress_write(hid_t fapl_id)
if((file = H5Fopen(filename, H5F_ACC_RDWR|H5F_ACC_SYNC, fapl_id)) < 0)
TEST_ERROR;
- if((dataset = H5Dopen(file, NO_COMPRESS_DSET, H5P_DEFAULT)) < 0)
+ if((dataset = H5Dopen(file, REG_NO_COMPRESS_DSET, H5P_DEFAULT)) < 0)
TEST_ERROR;
if((dataspace = H5Dget_space(dataset)) < 0)
@@ -463,12 +567,12 @@ test_unix_write(void)
TESTING("Write compressed data to a Unix file");
/* create file*/
- flag = O_CREAT|O_TRUNC|O_WRONLY|O_SYNC;
+ flag = O_WRONLY|O_SYNC;
/* Start the timer */
gettimeofday(&timeval_start,NULL);
- if ((file=open(FILENAME[1],flag,S_IRWXU))== -1)
+ if ((file=open(FILENAME[1],flag))== -1)
TEST_ERROR;
/* Write the compressed chunk data repeatedly to cover all the chunks in the
@@ -520,7 +624,8 @@ main (void)
h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
create_file(fapl);
- test_direct_write(fapl);
+ test_direct_write_uncompressed_data(fapl);
+ test_direct_write_compressed_data(fapl);
test_no_compress_write(fapl);
test_compressed_write(fapl);
test_unix_write();
diff --git a/src/H5Dio.c b/src/H5Dio.c
index 9576177..b55a263 100644
--- a/src/H5Dio.c
+++ b/src/H5Dio.c
@@ -290,7 +290,7 @@ H5PSIdirect_write(hid_t dset_id, hid_t dxpl_id, unsigned filters, hsize_t *offse
{
H5D_t *dset = NULL;
int ndims;
- hsize_t *dims;
+ hsize_t *dims = NULL;
int i;
herr_t ret_value = SUCCEED; /* Return value */
@@ -316,7 +316,8 @@ H5PSIdirect_write(hid_t dset_id, hid_t dxpl_id, unsigned filters, hsize_t *offse
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no output buffer")
ndims = (int)H5S_GET_EXTENT_NDIMS(dset->shared->space);
- dims = (hsize_t *)HDmalloc(ndims*sizeof(hsize_t));
+ if(NULL == (dims = (hsize_t *)H5MM_malloc(ndims*sizeof(hsize_t))))
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for dimensions")
if(H5S_get_simple_extent_dims(dset->shared->space, dims, NULL) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't retrieve dataspace extent dims")
@@ -331,13 +332,14 @@ H5PSIdirect_write(hid_t dset_id, hid_t dxpl_id, unsigned filters, hsize_t *offse
if(offset[i] % dset->shared->layout.u.chunk.dim[i])
HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "offset doesn't fall on chunks's boundary")
- HDfree(dims);
-
/* write raw data */
if(H5D__chunk_direct_write(dset, dxpl_id, filters, offset, data_size, buf) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "can't write data")
done:
+ if(dims)
+ H5MM_free(dims);
+
FUNC_LEAVE_API(ret_value)
} /* end H5PSIdirect_write() */
diff --git a/test/Makefile.am b/test/Makefile.am
index 006e24b..0197e99 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -40,7 +40,7 @@ TEST_PROG= testhdf5 lheap ohdr stab gheap cache cache_api cache_tagging \
pool accum hyperslab istore bittests dt_arith \
dtypes dsets cmpd_dset filter_fail extend external efc objcopy links unlink \
big mtime fillval mount flush1 flush2 app_ref enum \
- set_extent ttsafe dectris_tst dectris_perf \
+ set_extent ttsafe dectris_tst \
getname vfd ntypes dangle dtransform reserved cross_read \
freespace mf farray earray btree2 fheap file_image
@@ -128,7 +128,7 @@ CHECK_CLEANFILES+=accum.h5 cmpd_dset.h5 compact_dataset.h5 dataset.h5 dset_offse
earray.h5 efc[0-5].h5 log_vfd_out.log \
new_multi_file_v16-r.h5 new_multi_file_v16-s.h5 \
split_get_file_image_test-m.h5 split_get_file_image_test-r.h5 \
- file_image_core_test.h5.copy dectris.h5 dectris_perf.h5
+ file_image_core_test.h5.copy dectris.h5
# Sources for testhdf5 executable
testhdf5_SOURCES=testhdf5.c tarray.c tattr.c tchecksum.c tconfig.c tfile.c \
diff --git a/test/Makefile.in b/test/Makefile.in
index 21706d7..ddc481e 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -89,8 +89,8 @@ am__EXEEXT_1 = testhdf5$(EXEEXT) lheap$(EXEEXT) ohdr$(EXEEXT) \
unlink$(EXEEXT) big$(EXEEXT) mtime$(EXEEXT) fillval$(EXEEXT) \
mount$(EXEEXT) flush1$(EXEEXT) flush2$(EXEEXT) \
app_ref$(EXEEXT) enum$(EXEEXT) set_extent$(EXEEXT) \
- ttsafe$(EXEEXT) dectris_tst$(EXEEXT) dectris_perf$(EXEEXT) \
- getname$(EXEEXT) vfd$(EXEEXT) ntypes$(EXEEXT) dangle$(EXEEXT) \
+ ttsafe$(EXEEXT) dectris_tst$(EXEEXT) getname$(EXEEXT) \
+ vfd$(EXEEXT) ntypes$(EXEEXT) dangle$(EXEEXT) \
dtransform$(EXEEXT) reserved$(EXEEXT) cross_read$(EXEEXT) \
freespace$(EXEEXT) mf$(EXEEXT) farray$(EXEEXT) earray$(EXEEXT) \
btree2$(EXEEXT) fheap$(EXEEXT) file_image$(EXEEXT)
@@ -148,10 +148,6 @@ dangle_SOURCES = dangle.c
dangle_OBJECTS = dangle.$(OBJEXT)
dangle_LDADD = $(LDADD)
dangle_DEPENDENCIES = libh5test.la $(LIBHDF5)
-dectris_perf_SOURCES = dectris_perf.c
-dectris_perf_OBJECTS = dectris_perf.$(OBJEXT)
-dectris_perf_LDADD = $(LDADD)
-dectris_perf_DEPENDENCIES = libh5test.la $(LIBHDF5)
dectris_tst_SOURCES = dectris_tst.c
dectris_tst_OBJECTS = dectris_tst.$(OBJEXT)
dectris_tst_LDADD = $(LDADD)
@@ -434,24 +430,23 @@ am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
am__v_GEN_0 = @echo " GEN " $@;
SOURCES = $(libh5test_la_SOURCES) accum.c app_ref.c big.c bittests.c \
btree2.c cache.c cache_api.c cache_tagging.c cmpd_dset.c \
- cross_read.c dangle.c dectris_perf.c dectris_tst.c dsets.c \
- dt_arith.c dtransform.c dtypes.c earray.c efc.c enum.c \
- err_compat.c error_test.c extend.c external.c farray.c fheap.c \
- file_image.c fillval.c filter_fail.c flush1.c flush2.c \
- freespace.c gen_bad_ohdr.c gen_bogus.c gen_cross.c \
- gen_deflate.c gen_file_image.c gen_filespace.c gen_filters.c \
- gen_new_array.c gen_new_fill.c gen_new_group.c gen_new_mtime.c \
- gen_new_super.c gen_noencoder.c gen_nullspace.c \
- gen_sizes_lheap.c gen_specmetaread.c gen_udlinks.c getname.c \
- gheap.c hyperslab.c istore.c lheap.c links.c links_env.c mf.c \
- mount.c mtime.c ntypes.c objcopy.c ohdr.c pool.c reserved.c \
- set_extent.c space_overflow.c stab.c tcheck_version.c \
- $(testhdf5_SOURCES) testmeta.c $(ttsafe_SOURCES) unlink.c \
- vfd.c
+ cross_read.c dangle.c dectris_tst.c dsets.c dt_arith.c \
+ dtransform.c dtypes.c earray.c efc.c enum.c err_compat.c \
+ error_test.c extend.c external.c farray.c fheap.c file_image.c \
+ fillval.c filter_fail.c flush1.c flush2.c freespace.c \
+ gen_bad_ohdr.c gen_bogus.c gen_cross.c gen_deflate.c \
+ gen_file_image.c gen_filespace.c gen_filters.c gen_new_array.c \
+ gen_new_fill.c gen_new_group.c gen_new_mtime.c gen_new_super.c \
+ gen_noencoder.c gen_nullspace.c gen_sizes_lheap.c \
+ gen_specmetaread.c gen_udlinks.c getname.c gheap.c hyperslab.c \
+ istore.c lheap.c links.c links_env.c mf.c mount.c mtime.c \
+ ntypes.c objcopy.c ohdr.c pool.c reserved.c set_extent.c \
+ space_overflow.c stab.c tcheck_version.c $(testhdf5_SOURCES) \
+ testmeta.c $(ttsafe_SOURCES) unlink.c vfd.c
DIST_SOURCES = $(libh5test_la_SOURCES) accum.c app_ref.c big.c \
bittests.c btree2.c cache.c cache_api.c cache_tagging.c \
- cmpd_dset.c cross_read.c dangle.c dectris_perf.c dectris_tst.c \
- dsets.c dt_arith.c dtransform.c dtypes.c earray.c efc.c enum.c \
+ cmpd_dset.c cross_read.c dangle.c dectris_tst.c dsets.c \
+ dt_arith.c dtransform.c dtypes.c earray.c efc.c enum.c \
err_compat.c error_test.c extend.c external.c farray.c fheap.c \
file_image.c fillval.c filter_fail.c flush1.c flush2.c \
freespace.c gen_bad_ohdr.c gen_bogus.c gen_cross.c \
@@ -781,7 +776,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog accum.h5 cmpd_dset.h5 \
earray.h5 efc[0-5].h5 log_vfd_out.log new_multi_file_v16-r.h5 \
new_multi_file_v16-s.h5 split_get_file_image_test-m.h5 \
split_get_file_image_test-r.h5 file_image_core_test.h5.copy \
- dectris.h5 dectris_perf.h5
+ dectris.h5
INCLUDES = -I$(top_srcdir)/src -I$(top_builddir)/src
# Test script for error_test and err_compat
@@ -800,7 +795,7 @@ TEST_PROG = testhdf5 lheap ohdr stab gheap cache cache_api cache_tagging \
pool accum hyperslab istore bittests dt_arith \
dtypes dsets cmpd_dset filter_fail extend external efc objcopy links unlink \
big mtime fillval mount flush1 flush2 app_ref enum \
- set_extent ttsafe dectris_tst dectris_perf \
+ set_extent ttsafe dectris_tst \
getname vfd ntypes dangle dtransform reserved cross_read \
freespace mf farray earray btree2 fheap file_image
@@ -963,9 +958,6 @@ cross_read$(EXEEXT): $(cross_read_OBJECTS) $(cross_read_DEPENDENCIES)
dangle$(EXEEXT): $(dangle_OBJECTS) $(dangle_DEPENDENCIES)
@rm -f dangle$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(dangle_OBJECTS) $(dangle_LDADD) $(LIBS)
-dectris_perf$(EXEEXT): $(dectris_perf_OBJECTS) $(dectris_perf_DEPENDENCIES)
- @rm -f dectris_perf$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(dectris_perf_OBJECTS) $(dectris_perf_LDADD) $(LIBS)
dectris_tst$(EXEEXT): $(dectris_tst_OBJECTS) $(dectris_tst_DEPENDENCIES)
@rm -f dectris_tst$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(dectris_tst_OBJECTS) $(dectris_tst_LDADD) $(LIBS)
@@ -1168,7 +1160,6 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmpd_dset.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cross_read.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dangle.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dectris_perf.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dectris_tst.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dsets.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dt_arith.Po@am__quote@
diff --git a/test/dectris_tst.c b/test/dectris_tst.c
index a6bbaab..56d58ab 100644
--- a/test/dectris_tst.c
+++ b/test/dectris_tst.c
@@ -167,7 +167,8 @@ main (void)
offset[1] = 0;
}
- free(outbuf);
+ if(outbuf)
+ free(outbuf);
if(H5Dclose(dataset) < 0)
TEST_ERROR;
@@ -244,7 +245,8 @@ main (void)
offset[1] = 0;
}
- free(outbuf);
+ if(outbuf)
+ free(outbuf);
if(H5Dclose(dataset) < 0)
TEST_ERROR;
@@ -300,5 +302,9 @@ error:
H5Pclose(dxpl);
H5Fclose(file);
} H5E_END_TRY;
+
+ if(outbuf)
+ free(outbuf);
+
return 1;
}