diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2007-10-11 16:24:11 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2007-10-11 16:24:11 (GMT) |
commit | d9e5ca72f39934531b534524d07cf784c3d0e613 (patch) | |
tree | 1913b13a317132523091035f1175b2291c8b9db7 /testpar/t_chunk_alloc.c | |
parent | 053807fa81579e6bd9ac6a701ddcaac39e4d0b87 (diff) | |
download | hdf5-d9e5ca72f39934531b534524d07cf784c3d0e613.zip hdf5-d9e5ca72f39934531b534524d07cf784c3d0e613.tar.gz hdf5-d9e5ca72f39934531b534524d07cf784c3d0e613.tar.bz2 |
[svn-r14199] Description:
Add H5Dcreate to API versioned routines, replacing internal usage with
H5Dcreate2
Fix thread-safe error stack initialization for API versioned error
stack printing routines.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
Diffstat (limited to 'testpar/t_chunk_alloc.c')
-rw-r--r-- | testpar/t_chunk_alloc.c | 44 |
1 files changed, 16 insertions, 28 deletions
diff --git a/testpar/t_chunk_alloc.c b/testpar/t_chunk_alloc.c index e496a58..5d02822 100644 --- a/testpar/t_chunk_alloc.c +++ b/testpar/t_chunk_alloc.c @@ -126,46 +126,34 @@ create_chunked_dataset(const char *filename, int nchunks, write_type write_patte VRFY((file_id >= 0), "H5Fcreate"); /* Modify dataset creation properties, i.e. enable chunking */ - cparms = H5Pcreate (H5P_DATASET_CREATE); + cparms = H5Pcreate(H5P_DATASET_CREATE); VRFY((cparms >= 0), ""); hrc = H5Pset_alloc_time(cparms, H5D_ALLOC_TIME_EARLY); VRFY((hrc >= 0), ""); - hrc = H5Pset_chunk ( cparms, 1, chunk_dims); + hrc = H5Pset_chunk(cparms, 1, chunk_dims); VRFY((hrc >= 0), ""); /* Create a new dataset within the file using cparms creation properties. */ - dataset = H5Dcreate (file_id, DATASETNAME, H5T_NATIVE_UCHAR, dataspace, cparms); + dataset = H5Dcreate2(file_id, DATASETNAME, H5T_NATIVE_UCHAR, dataspace, H5P_DEFAULT, cparms, H5P_DEFAULT); VRFY((dataset >= 0), ""); - switch (write_pattern) { - - /* writes only the second to last chunk */ - case sec_last: - - memset(buffer, 100, CHUNKSIZE); - - count[0] = 1; - stride[0] = 1; - block[0] = chunk_dims[0]; - offset[0] = (nchunks-2)*chunk_dims[0]; - - hrc = H5Sselect_hyperslab(dataspace, H5S_SELECT_SET, offset, stride, count, block); - VRFY((hrc >= 0), ""); + if(write_pattern == sec_last) { + HDmemset(buffer, 100, CHUNKSIZE); - /* Write sec_last chunk */ - hrc = H5Dwrite(dataset, H5T_NATIVE_UCHAR, memspace, dataspace, H5P_DEFAULT, buffer); - VRFY((hrc >= 0), "H5Dwrite"); + count[0] = 1; + stride[0] = 1; + block[0] = chunk_dims[0]; + offset[0] = (nchunks-2)*chunk_dims[0]; - break; - - - /* doesn't write anything */ - case none: + hrc = H5Sselect_hyperslab(dataspace, H5S_SELECT_SET, offset, stride, count, block); + VRFY((hrc >= 0), ""); - break; - } + /* Write sec_last chunk */ + hrc = H5Dwrite(dataset, H5T_NATIVE_UCHAR, memspace, dataspace, H5P_DEFAULT, buffer); + VRFY((hrc >= 0), "H5Dwrite"); + } /* end if */ /* Close resources */ hrc = H5Dclose (dataset); @@ -187,7 +175,7 @@ create_chunked_dataset(const char *filename, int nchunks, write_type write_patte /* verify file size */ filesize = get_filesize(filename); - est_filesize = nchunks*CHUNKSIZE*sizeof(unsigned char); + est_filesize = nchunks * CHUNKSIZE * sizeof(unsigned char); VRFY((filesize >= est_filesize), "file size check"); } |