summaryrefslogtreecommitdiffstats
path: root/src/H5D.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2001-07-10 21:19:18 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2001-07-10 21:19:18 (GMT)
commit990fadfbe55353383639f0151990ec375fbe18cb (patch)
treea07f3b3215057bad7d46cbb9e26a4699b1fc8040 /src/H5D.c
parent0c1c23245d103927c5d59c67b84526974e6217af (diff)
downloadhdf5-990fadfbe55353383639f0151990ec375fbe18cb.zip
hdf5-990fadfbe55353383639f0151990ec375fbe18cb.tar.gz
hdf5-990fadfbe55353383639f0151990ec375fbe18cb.tar.bz2
[svn-r4181] Purpose:
Bug Fix, Code Cleanup, Code Optimization, etc. Description: Fold in the hyperslab speedups, clean up compile warnings and change a few things from using 'unsigned' or 'hsize_t' to use 'size_t' instead. Platforms tested: FreeBSD 4.3 (hawkwind), Solaris 2.7 (arabica), Irix64 6.5 (modi4)
Diffstat (limited to 'src/H5D.c')
-rw-r--r--src/H5D.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/src/H5D.c b/src/H5D.c
index f20d4f2..c613915 100644
--- a/src/H5D.c
+++ b/src/H5D.c
@@ -86,11 +86,12 @@ H5D_xfer_t H5D_xfer_dflt = {
0, /*Don't cache the hyperslab blocks */
#endif /* H5_HAVE_PARALLEL */
0, /*No limit on hyperslab block size to cache */
+ 1024, /*Number of I/O vectors for hyperslabs */
NULL, /*Use malloc() for VL data allocations */
NULL, /*No information needed for malloc() calls */
NULL, /*Use free() for VL data frees */
NULL, /*No information needed for free() calls */
- H5FD_VFD_DEFAULT, /*See H5Pget_driver() */
+ H5FD_VFD_DEFAULT, /*See H5Pget_driver() */
NULL, /*No file driver-specific information yet */
#ifdef COALESCE_READS
0, /*coalesce single reads into a read */
@@ -1587,7 +1588,7 @@ H5D_read(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space,
herr_t status; /*function return status*/
size_t src_type_size; /*size of source type */
size_t dst_type_size; /*size of destination type*/
- hsize_t target_size; /*desired buffer size */
+ size_t target_size; /*desired buffer size */
hsize_t request_nelmts; /*requested strip mine */
H5T_bkg_t need_bkg; /*type of background buf*/
H5S_t *free_this_space=NULL; /*data space to free */
@@ -1774,15 +1775,15 @@ printf("%s: check 1.2, \n",FUNC);
/*
* This is the general case. Figure out the strip mine size.
*/
- if ((sconv->f->init)(&(dataset->layout), file_space, &file_iter)<0) {
+ if ((sconv->f->init)(file_space, &file_iter)<0) {
HGOTO_ERROR (H5E_DATASET, H5E_CANTINIT, FAIL,
"unable to initialize file selection information");
}
- if ((sconv->m->init)(&(dataset->layout), mem_space, &mem_iter)<0) {
+ if ((sconv->m->init)(mem_space, &mem_iter)<0) {
HGOTO_ERROR (H5E_DATASET, H5E_CANTINIT, FAIL,
"unable to initialize memory selection information");
}
- if ((sconv->m->init)(&(dataset->layout), mem_space, &bkg_iter)<0) {
+ if ((sconv->m->init)(mem_space, &bkg_iter)<0) {
HGOTO_ERROR (H5E_DATASET, H5E_CANTINIT, FAIL,
"unable to initialize background selection information");
}
@@ -1829,7 +1830,8 @@ printf("%s: check 2.0, src_type_size=%d, dst_type_size=%d, target_size=%d\n",FUN
printf("%s: check 3.2, allocating conversion buffer\n",FUNC);
#endif
/* Allocate temporary buffer */
- if((bkg_buf=H5FL_BLK_ALLOC(bkgr_conv,request_nelmts*dst_type_size,0))==NULL)
+ H5_CHECK_OVERFLOW((request_nelmts*dst_type_size),hsize_t,size_t);
+ if((bkg_buf=H5FL_BLK_ALLOC(bkgr_conv,(size_t)(request_nelmts*dst_type_size),0))==NULL)
HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL,
"memory allocation failed for background conversion");
}
@@ -2035,7 +2037,7 @@ H5D_write(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space,
herr_t status; /*function return status*/
size_t src_type_size; /*size of source type */
size_t dst_type_size; /*size of destination type*/
- hsize_t target_size; /*desired buffer size */
+ size_t target_size; /*desired buffer size */
hsize_t request_nelmts; /*requested strip mine */
H5T_bkg_t need_bkg; /*type of background buf*/
H5S_t *free_this_space=NULL; /*data space to free */
@@ -2251,15 +2253,15 @@ H5D_write(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space,
/*
* This is the general case. Figure out the strip mine size.
*/
- if ((sconv->f->init)(&(dataset->layout), file_space, &file_iter)<0) {
+ if ((sconv->f->init)(file_space, &file_iter)<0) {
HGOTO_ERROR (H5E_DATASET, H5E_CANTINIT, FAIL,
"unable to initialize file selection information");
}
- if ((sconv->m->init)(&(dataset->layout), mem_space, &mem_iter)<0) {
+ if ((sconv->m->init)(mem_space, &mem_iter)<0) {
HGOTO_ERROR (H5E_DATASET, H5E_CANTINIT, FAIL,
"unable to initialize memory selection information");
}
- if ((sconv->f->init)(&(dataset->layout), file_space, &bkg_iter)<0) {
+ if ((sconv->f->init)(file_space, &bkg_iter)<0) {
HGOTO_ERROR (H5E_DATASET, H5E_CANTINIT, FAIL,
"unable to initialize memory selection information");
}
@@ -2300,7 +2302,8 @@ printf("%s: check 2.0, src_type_size=%d, dst_type_size=%d, target_size=%d\n",FUN
}
if (need_bkg && NULL==(bkg_buf=xfer_parms->bkg_buf)) {
/* Allocate temporary buffer */
- if((bkg_buf=H5FL_BLK_ALLOC(bkgr_conv,request_nelmts*dst_type_size,0))==NULL)
+ H5_CHECK_OVERFLOW((request_nelmts*dst_type_size),hsize_t,size_t);
+ if((bkg_buf=H5FL_BLK_ALLOC(bkgr_conv,(size_t)(request_nelmts*dst_type_size),0))==NULL)
HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL,
"memory allocation failed for background conversion");
}
@@ -2650,7 +2653,8 @@ static herr_t
H5D_init_storage(H5D_t *dset, const H5S_t *space)
{
hssize_t npoints, ptsperbuf;
- hsize_t size, bufsize=8*1024;
+ size_t bufsize=8*1024;
+ size_t size;
haddr_t addr;
herr_t ret_value = FAIL;
void *buf = NULL;