diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2012-04-06 02:57:06 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2012-04-06 02:57:06 (GMT) |
commit | d5a62239587f7cc5de301fa5c6b0919807689818 (patch) | |
tree | 40a36d60dd8ac2d10a45886869cc53d3fdc9181e /src/H5Dcontig.c | |
parent | ebf3d99b955c705217227fb7f8ae4405e941399a (diff) | |
download | hdf5-d5a62239587f7cc5de301fa5c6b0919807689818.zip hdf5-d5a62239587f7cc5de301fa5c6b0919807689818.tar.gz hdf5-d5a62239587f7cc5de301fa5c6b0919807689818.tar.bz2 |
[svn-r22254] Description:
Bring r22085:22251 from trunk to revise_chunks branch.
Also tackle some testing issues in test/objcopy.c test and clean up
some warnings.
Tested on:
FreeBSD/32 8.2 (loyalty) w/gcc4.6, w/C++ & FORTRAN, in debug mode
FreeBSD/64 8.2 (freedom) w/gcc4.6, w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (koala) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, w/threadsafe, in production mode
Linux/PPC 2.6 (ostrich) w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-ia64 2.6 (ember) w/Intel compilers, w/paralle, C++ & FORTRAN,
in production mode
Mac OS X/32 10.7.3 (amazon) in debug mode
Mac OS X/32 10.7.3 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
Mac OS X/32 10.7.3 (amazon) w/parallel, in debug mode
Diffstat (limited to 'src/H5Dcontig.c')
-rw-r--r-- | src/H5Dcontig.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/H5Dcontig.c b/src/H5Dcontig.c index 674582d..c1ff68c 100644 --- a/src/H5Dcontig.c +++ b/src/H5Dcontig.c @@ -420,6 +420,7 @@ H5D_contig_construct(H5F_t *f, H5D_t *dset) hsize_t nelmts; /* Number of elements in dataspace */ size_t dt_size; /* Size of datatype */ hsize_t tmp_size; /* Temporary holder for raw data size */ + size_t tmp_sieve_buf_size; /* Temporary holder for sieve buffer size */ hsize_t dim[H5O_LAYOUT_NDIMS]; /* Current size of data in elements */ hsize_t max_dim[H5O_LAYOUT_NDIMS]; /* Maximum size of data in elements */ int ndims; /* Rank of dataspace */ @@ -464,8 +465,15 @@ H5D_contig_construct(H5F_t *f, H5D_t *dset) /* Assign the dataset's contiguous storage size */ dset->shared->layout.storage.u.contig.size = tmp_size; - /* Get the sieve buffer size for this dataset */ - dset->shared->cache.contig.sieve_buf_size = H5F_SIEVE_BUF_SIZE(f); + /* Get the sieve buffer size for the file */ + tmp_sieve_buf_size = H5F_SIEVE_BUF_SIZE(f); + + /* Adjust the sieve buffer size to the smaller one between the dataset size and the buffer size + * from the file access property. (SLU - 2012/3/30) */ + if(tmp_size < tmp_sieve_buf_size) + dset->shared->cache.contig.sieve_buf_size = tmp_size; + else + dset->shared->cache.contig.sieve_buf_size = tmp_sieve_buf_size; done: FUNC_LEAVE_NOAPI(ret_value) @@ -965,6 +973,7 @@ H5D_contig_writevv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len, /* Allocate room for the data sieve buffer */ if(NULL == (dset_contig->sieve_buf = H5FL_BLK_MALLOC(sieve_buf, dset_contig->sieve_buf_size))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "memory allocation failed") + #ifdef H5_CLEAR_MEMORY if(dset_contig->sieve_size > len) HDmemset(dset_contig->sieve_buf + len, 0, (dset_contig->sieve_size - len)); |