summaryrefslogtreecommitdiffstats
path: root/src/H5D.c
diff options
context:
space:
mode:
authorRobb Matzke <matzke@llnl.gov>1998-01-26 20:56:18 (GMT)
committerRobb Matzke <matzke@llnl.gov>1998-01-26 20:56:18 (GMT)
commit5c6a3af39679b2bbbdaebf8f1c19edbeed7af248 (patch)
tree8c495a15af0ae785dfcb22420e197d583deef7ba /src/H5D.c
parent6cd8818b735d3c22f3a1f7cd30d52360139ed72c (diff)
downloadhdf5-5c6a3af39679b2bbbdaebf8f1c19edbeed7af248.zip
hdf5-5c6a3af39679b2bbbdaebf8f1c19edbeed7af248.tar.gz
hdf5-5c6a3af39679b2bbbdaebf8f1c19edbeed7af248.tar.bz2
[svn-r170] Changes since 19980123
---------------------- ./src/H5D.c ./src/H5T.c ./src/H5Tconv.c ./src/H5Tpkg.h ./src/H5Tprivate.h ./src/H5Tpublic.h ./test/cmpd_dset.c Added support to turn background buffer on/off to help speed up conversions. Currently, every type of conversion turns it off except compound-->compound conversions which always turn it on. In the future the compound-->compound conversions might be more frugal.
Diffstat (limited to 'src/H5D.c')
-rw-r--r--src/H5D.c32
1 files changed, 19 insertions, 13 deletions
diff --git a/src/H5D.c b/src/H5D.c
index dac599c..48723cd 100644
--- a/src/H5D.c
+++ b/src/H5D.c
@@ -837,7 +837,7 @@ H5D_read(H5D_t *dataset, const H5T_t *mem_type, const H5P_t *mem_space,
hid_t src_id = -1, dst_id = -1;/*temporary type atoms */
const H5P_conv_t *sconv_func = NULL; /*space conversion funcs*/
H5P_number_t numbering; /*element numbering info*/
- void *cdata = NULL; /*type conversion data */
+ H5T_cdata_t *cdata = NULL; /*type conversion data */
herr_t ret_value = FAIL;
FUNC_ENTER(H5D_read, FAIL);
@@ -895,7 +895,7 @@ H5D_read(H5D_t *dataset, const H5T_t *mem_type, const H5P_t *mem_space,
size_t src_size = nelmts * H5T_get_size(dataset->type);
size_t dst_size = nelmts * H5T_get_size(mem_type);
tconv_buf = H5MM_xmalloc(MAX(src_size, dst_size));
- bkg_buf = H5MM_xmalloc (dst_size);
+ if (cdata->need_bkg) bkg_buf = H5MM_xmalloc (dst_size);
}
#endif
@@ -911,15 +911,18 @@ H5D_read(H5D_t *dataset, const H5T_t *mem_type, const H5P_t *mem_space,
tconv_buf/*out*/)!=nelmts) {
HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "file gather failed");
}
- if ((sconv_func->mgath)(buf, H5T_get_size (mem_type), mem_space,
- &numbering, 0, nelmts, bkg_buf/*out*/)!=nelmts) {
- HGOTO_ERROR (H5E_IO, H5E_READERROR, FAIL, "mem gather failed");
+ if (H5T_BKG_YES==cdata->need_bkg) {
+ if ((sconv_func->mgath)(buf, H5T_get_size (mem_type), mem_space,
+ &numbering, 0, nelmts,
+ bkg_buf/*out*/)!=nelmts) {
+ HGOTO_ERROR (H5E_IO, H5E_READERROR, FAIL, "mem gather failed");
+ }
}
/*
* Perform data type conversion.
*/
- if ((tconv_func) (src_id, dst_id, &cdata, nelmts, tconv_buf, bkg_buf)<0) {
+ if ((tconv_func) (src_id, dst_id, cdata, nelmts, tconv_buf, bkg_buf)<0) {
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL,
"data type conversion failed");
}
@@ -970,7 +973,7 @@ H5D_write(H5D_t *dataset, const H5T_t *mem_type, const H5P_t *mem_space,
hid_t src_id = -1, dst_id = -1;/*temporary type atoms */
const H5P_conv_t *sconv_func = NULL; /*space conversion funcs*/
H5P_number_t numbering; /*element numbering info*/
- void *cdata = NULL; /*type conversion data */
+ H5T_cdata_t *cdata = NULL; /*type conversion data */
herr_t ret_value = FAIL;
FUNC_ENTER(H5D_write, FAIL);
@@ -1028,7 +1031,7 @@ H5D_write(H5D_t *dataset, const H5T_t *mem_type, const H5P_t *mem_space,
size_t src_size = nelmts * H5T_get_size(mem_type);
size_t dst_size = nelmts * H5T_get_size(dataset->type);
tconv_buf = H5MM_xmalloc(MAX(src_size, dst_size));
- bkg_buf = H5MM_xmalloc (dst_size);
+ if (cdata->need_bkg) bkg_buf = H5MM_xmalloc (dst_size);
}
#endif
@@ -1043,16 +1046,19 @@ H5D_write(H5D_t *dataset, const H5T_t *mem_type, const H5P_t *mem_space,
&numbering, 0, nelmts, tconv_buf/*out*/)!=nelmts) {
HGOTO_ERROR (H5E_IO, H5E_WRITEERROR, FAIL, "mem gather failed");
}
- if ((sconv_func->fgath)(dataset->ent.file, &(dataset->layout),
- H5T_get_size (dataset->type), file_space,
- &numbering, 0, nelmts, bkg_buf/*out*/)!=nelmts) {
- HGOTO_ERROR (H5E_IO, H5E_WRITEERROR, FAIL, "file gather failed");
+ if (H5T_BKG_YES==cdata->need_bkg) {
+ if ((sconv_func->fgath)(dataset->ent.file, &(dataset->layout),
+ H5T_get_size (dataset->type), file_space,
+ &numbering, 0, nelmts,
+ bkg_buf/*out*/)!=nelmts) {
+ HGOTO_ERROR (H5E_IO, H5E_WRITEERROR, FAIL, "file gather failed");
+ }
}
/*
* Perform data type conversion.
*/
- if ((tconv_func) (src_id, dst_id, &cdata, nelmts, tconv_buf, bkg_buf)<0) {
+ if ((tconv_func) (src_id, dst_id, cdata, nelmts, tconv_buf, bkg_buf)<0) {
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL,
"data type conversion failed");
}