summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2000-12-11 20:06:02 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2000-12-11 20:06:02 (GMT)
commitbe2d93daff1f111e15c64bf56b53cd2e0b7c20fe (patch)
tree000c4e6e8b5e8ee1bd8d237ca03b4516194e1acf /src
parenta44b5b4725b3666eb69276b45712b22aef257fb9 (diff)
downloadhdf5-be2d93daff1f111e15c64bf56b53cd2e0b7c20fe.zip
hdf5-be2d93daff1f111e15c64bf56b53cd2e0b7c20fe.tar.gz
hdf5-be2d93daff1f111e15c64bf56b53cd2e0b7c20fe.tar.bz2
[svn-r3110] Purpose:
Bug Fix Description: Compound datatypes weren't reading background data properly when used with array or vlen fields. Solution: Changed to always read background information from file in those situations. Platforms tested: FreeBSD 4.2 (hawkwind)
Diffstat (limited to 'src')
-rw-r--r--src/H5D.c50
-rw-r--r--src/H5Tconv.c2
2 files changed, 29 insertions, 23 deletions
diff --git a/src/H5D.c b/src/H5D.c
index 719e064..e2d8783 100644
--- a/src/H5D.c
+++ b/src/H5D.c
@@ -2251,7 +2251,7 @@ H5D_write(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space,
}
#ifdef QAK
- printf("%s: check 3.0, request_nelmts=%d\n",FUNC,(int)request_nelmts);
+ printf("%s: check 3.0, request_nelmts=%d, tpath->cdata.need_bkg=%d\n",FUNC,(int)request_nelmts,(int)tpath->cdata.need_bkg);
#endif
/*
@@ -2336,32 +2336,38 @@ H5D_write(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space,
#endif
if (H5T_BKG_YES==need_bkg) {
+#ifdef QAK
+ printf("%s: check 6.1, need_bkg=%d\n",FUNC,(int)need_bkg);
+#endif
#ifdef H5S_DEBUG
- H5_timer_begin(&timer);
+ H5_timer_begin(&timer);
#endif
n = (sconv->f->gath)(dataset->ent.file, &(dataset->layout),
- &(dataset->create_parms->pline),
- &(dataset->create_parms->fill),
- &(dataset->create_parms->efl), dst_type_size,
- file_space, &bkg_iter, smine_nelmts,
- dxpl_id, bkg_buf/*out*/);
+ &(dataset->create_parms->pline),
+ &(dataset->create_parms->fill),
+ &(dataset->create_parms->efl), dst_type_size,
+ file_space, &bkg_iter, smine_nelmts,
+ dxpl_id, bkg_buf/*out*/);
#ifdef H5S_DEBUG
- H5_timer_end(&(sconv->stats[0].bkg_timer), &timer);
- sconv->stats[0].bkg_nbytes += n * dst_type_size;
- sconv->stats[0].bkg_ncalls++;
+ H5_timer_end(&(sconv->stats[0].bkg_timer), &timer);
+ sconv->stats[0].bkg_nbytes += n * dst_type_size;
+ sconv->stats[0].bkg_ncalls++;
#endif
- if (n!=smine_nelmts) {
+ if (n!=smine_nelmts) {
HGOTO_ERROR (H5E_IO, H5E_WRITEERROR, FAIL,
- "file gather failed");
+ "file gather failed");
}
} else if (need_bkg) {
- HDmemset(bkg_buf, 0, request_nelmts*dst_type_size);
- }
+#ifdef QAK
+ printf("%s: check 6.2, need_bkg=%d\n",FUNC,(int)need_bkg);
+#endif
+ HDmemset(bkg_buf, 0, request_nelmts*dst_type_size);
+ }
/*
* Perform data type conversion.
*/
- if (H5T_convert(tpath, src_id, dst_id, smine_nelmts, 0, 0, tconv_buf,
+ if (H5T_convert(tpath, src_id, dst_id, smine_nelmts, 0, 0, tconv_buf,
bkg_buf, dxpl_id)<0) {
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL,
"data type conversion failed");
@@ -2374,9 +2380,9 @@ H5D_write(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space,
* Scatter the data out to the file.
*/
#ifdef H5S_DEBUG
- H5_timer_begin(&timer);
+ H5_timer_begin(&timer);
#endif
- status = (sconv->f->scat)(dataset->ent.file, &(dataset->layout),
+ status = (sconv->f->scat)(dataset->ent.file, &(dataset->layout),
&(dataset->create_parms->pline),
&(dataset->create_parms->fill),
&(dataset->create_parms->efl), dst_type_size,
@@ -2386,11 +2392,11 @@ H5D_write(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space,
printf("%s: check 6.35\n",FUNC);
#endif
#ifdef H5S_DEBUG
- H5_timer_end(&(sconv->stats[0].scat_timer), &timer);
- sconv->stats[0].scat_nbytes += smine_nelmts * dst_type_size;
- sconv->stats[0].scat_ncalls++;
+ H5_timer_end(&(sconv->stats[0].scat_timer), &timer);
+ sconv->stats[0].scat_nbytes += smine_nelmts * dst_type_size;
+ sconv->stats[0].scat_ncalls++;
#endif
- if (status<0) {
+ if (status<0) {
HGOTO_ERROR (H5E_DATASET, H5E_WRITEERROR, FAIL, "scatter failed");
}
}
@@ -2403,7 +2409,7 @@ H5D_write(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space,
* writing to a dataset doesn't necessarily change the object header.
*/
if (H5O_touch(&(dataset->ent), FALSE)<0) {
- HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL,
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL,
"unable to update modification time");
}
diff --git a/src/H5Tconv.c b/src/H5Tconv.c
index 90fe6e8..7ffbc40 100644
--- a/src/H5Tconv.c
+++ b/src/H5Tconv.c
@@ -805,7 +805,7 @@ H5T_conv_need_bkg (H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata)
assert(cdata);
if (H5T_detect_class(src,H5T_COMPOUND)==TRUE || H5T_detect_class(dst,H5T_COMPOUND)==TRUE)
- cdata->need_bkg = H5T_BKG_TEMP;
+ cdata->need_bkg = H5T_BKG_YES;
FUNC_LEAVE (SUCCEED);
}