diff options
author | Raymond Lu <songyulu@hdfgroup.org> | 2003-05-13 16:49:38 (GMT) |
---|---|---|
committer | Raymond Lu <songyulu@hdfgroup.org> | 2003-05-13 16:49:38 (GMT) |
commit | 27c63279734a2e508f15f1d51162ac31c865be47 (patch) | |
tree | 904cf6f1446543a49189e0d772f6e7bb9d2f5862 /src | |
parent | 8751379484a7ea6747e32ab795d820ed93884f2e (diff) | |
download | hdf5-27c63279734a2e508f15f1d51162ac31c865be47.zip hdf5-27c63279734a2e508f15f1d51162ac31c865be47.tar.gz hdf5-27c63279734a2e508f15f1d51162ac31c865be47.tar.bz2 |
[svn-r6857] Purpose: bug fix
Description: when a datatype element size is bigger than I/O datatype
conversion buffer(1MB), library reports failure.
Solution: adjust conversion buffer to be at least equal to one element size
Platforms tested: h5committest
Diffstat (limited to 'src')
-rw-r--r-- | src/H5Dio.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/H5Dio.c b/src/H5Dio.c index 2053139..e447c4f 100644 --- a/src/H5Dio.c +++ b/src/H5Dio.c @@ -994,7 +994,14 @@ H5D_contig_read(hsize_t nelmts, H5D_t *dataset, const H5T_t *mem_type, const H5S src_type_size = H5T_get_size(dataset->type); dst_type_size = H5T_get_size(mem_type); target_size = H5P_peek_size_t(dx_plist,H5D_XFER_MAX_TEMP_BUF_NAME); + if(target_size==H5D_XFER_MAX_TEMP_BUF_DEF && + target_size<MAX(src_type_size, dst_type_size)) + target_size = MAX(src_type_size, dst_type_size); request_nelmts = target_size / MAX(src_type_size, dst_type_size); + + /* Sanity check elements in temporary buffer */ + if (request_nelmts<=0) + HGOTO_ERROR (H5E_DATASET, H5E_CANTINIT, FAIL, "temporary buffer max size is too small"); /* Figure out the strip mine size. */ if (H5S_select_iter_init(&file_iter, file_space, src_type_size)<0) @@ -1230,6 +1237,9 @@ H5D_contig_write(hsize_t nelmts, H5D_t *dataset, const H5T_t *mem_type, const H5 src_type_size = H5T_get_size(mem_type); dst_type_size = H5T_get_size(dataset->type); target_size = H5P_peek_size_t(dx_plist,H5D_XFER_MAX_TEMP_BUF_NAME); + if(target_size==H5D_XFER_MAX_TEMP_BUF_DEF && + target_size<MAX(src_type_size, dst_type_size)) + target_size = MAX(src_type_size, dst_type_size); request_nelmts = target_size / MAX (src_type_size, dst_type_size); /* Sanity check elements in temporary buffer */ @@ -1491,8 +1501,11 @@ H5D_chunk_read(hsize_t nelmts, H5D_t *dataset, const H5T_t *mem_type, const H5S_ src_type_size = H5T_get_size(dataset->type); dst_type_size = H5T_get_size(mem_type); target_size = H5P_peek_size_t(dx_plist,H5D_XFER_MAX_TEMP_BUF_NAME); - request_nelmts = target_size / MAX(src_type_size, dst_type_size); - + if(target_size==H5D_XFER_MAX_TEMP_BUF_DEF && + target_size<MAX(src_type_size, dst_type_size)) + target_size = MAX(src_type_size, dst_type_size); + request_nelmts = target_size / MAX (src_type_size, dst_type_size); + /* Sanity check elements in temporary buffer */ if (request_nelmts<=0) HGOTO_ERROR (H5E_DATASET, H5E_CANTINIT, FAIL, "temporary buffer max size is too small"); @@ -1787,6 +1800,9 @@ H5D_chunk_write(hsize_t nelmts, H5D_t *dataset, const H5T_t *mem_type, const H5S src_type_size = H5T_get_size(mem_type); dst_type_size = H5T_get_size(dataset->type); target_size = H5P_peek_size_t(dx_plist,H5D_XFER_MAX_TEMP_BUF_NAME); + if(target_size==H5D_XFER_MAX_TEMP_BUF_DEF && + target_size<MAX(src_type_size, dst_type_size)) + target_size = MAX(src_type_size, dst_type_size); request_nelmts = target_size / MAX (src_type_size, dst_type_size); /* Sanity check elements in temporary buffer */ |