summaryrefslogtreecommitdiffstats
path: root/src/H5Dio.c
diff options
context:
space:
mode:
authorLeon Arber <larber@ncsa.uiuc.edu>2004-05-06 22:44:38 (GMT)
committerLeon Arber <larber@ncsa.uiuc.edu>2004-05-06 22:44:38 (GMT)
commit1867c05efb2527e435776808720572e31ab95bb7 (patch)
treebd196861d102803a7c170872ff7ed0920942e95c /src/H5Dio.c
parent28eb73c97268c016728bce5e3e8d95ceb1f66b39 (diff)
downloadhdf5-1867c05efb2527e435776808720572e31ab95bb7.zip
hdf5-1867c05efb2527e435776808720572e31ab95bb7.tar.gz
hdf5-1867c05efb2527e435776808720572e31ab95bb7.tar.bz2
[svn-r8488] Purpose:
Bug fix. Description: Fixed handling of trivial data transform expressions (like 5/3 + 3) and some data coversion fixes. Also added more tests to dtransform.c Solution: Added some more checks in the H5Z_xform_reduce_tree function to see if perhaps the transform expression is complicated and is a non-trivial reduction. Added tests for data conversion to dtransform as well as tests for a trivial data transform expression. Platforms tested: h5committest'ed, except used arabica instead of sol and didn't do on copper b/c no logon there. Problem noted with mtime test...doesn't appear to be related to anything having to do with data transforms.
Diffstat (limited to 'src/H5Dio.c')
-rw-r--r--src/H5Dio.c53
1 files changed, 36 insertions, 17 deletions
diff --git a/src/H5Dio.c b/src/H5Dio.c
index 8fc2982..4bcc9aa 100644
--- a/src/H5Dio.c
+++ b/src/H5Dio.c
@@ -1207,18 +1207,22 @@ H5D_contig_read(hsize_t nelmts, H5D_t *dataset, const H5T_t *mem_type,
HGOTO_ERROR (H5E_IO, H5E_READERROR, FAIL, "mem gather failed")
} /* end if */
- /*
+ /*
* Perform data type conversion.
*/
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")
+
-
- /* Added by LA to do data transforms */
+ /* Do the data transform after the conversion (since we're using type mem_type) */
if(!H5Z_xform_noop(dxpl_cache->data_xform_prop))
- H5Z_xform_eval(dxpl_cache->data_xform_prop, tconv_buf, smine_nelmts, mem_type);
+ {
+ if( H5Z_xform_eval(dxpl_cache->data_xform_prop, tconv_buf, smine_nelmts, mem_type) < 0)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Error performing data transform")
+ }
/* end of LA additions */
+
/*
* Scatter the data into memory.
*/
@@ -1445,12 +1449,23 @@ H5D_contig_write(hsize_t nelmts, H5D_t *dataset, const H5T_t *mem_type, const H5
HGOTO_ERROR (H5E_IO, H5E_WRITEERROR, FAIL, "file gather failed")
} /* end if */
- /*
+
+
+ /*
* Perform data type conversion.
*/
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")
+ /* Do the data transform after the type conversion (since we're using dataset->type). */
+ if(!H5Z_xform_noop(dxpl_cache->data_xform_prop))
+ {
+ if( H5Z_xform_eval(dxpl_cache->data_xform_prop, tconv_buf, smine_nelmts, dataset->type) < 0)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Error performing data transform")
+ }
+ /* End of LA modifications */
+
+
/*
* Scatter the data out to the file.
*/
@@ -1458,15 +1473,11 @@ H5D_contig_write(hsize_t nelmts, H5D_t *dataset, const H5T_t *mem_type, const H5
H5_timer_begin(&timer);
#endif
- /* LA additions for data transforms */
- if(!H5Z_xform_noop(dxpl_cache->data_xform_prop))
- H5Z_xform_eval(dxpl_cache->data_xform_prop, tconv_buf, smine_nelmts, dataset->type);
- /* End of LA modifications */
-
- status = H5S_select_fscat(dataset->ent.file, &(dataset->layout),
+ status = H5S_select_fscat(dataset->ent.file, &(dataset->layout),
&dataset->dcpl_cache, (H5D_storage_t *)&(dataset->efl), file_space, &file_iter,
smine_nelmts, dxpl_cache, dxpl_id, tconv_buf);
+
#ifdef H5S_DEBUG
H5_timer_end(&(sconv->stats[0].scat_timer), &timer);
sconv->stats[0].scat_nbytes += smine_nelmts * dst_type_size;
@@ -1734,9 +1745,12 @@ UNUSED
tconv_buf, bkg_buf, dxpl_id)<0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "data type conversion failed")
- /* LA additions for data transforms */
+ /* Do the data transform after the conversion (since we're using type mem_type) */
if(!H5Z_xform_noop(dxpl_cache->data_xform_prop))
- H5Z_xform_eval(dxpl_cache->data_xform_prop, tconv_buf, smine_nelmts, mem_type);
+ {
+ if( H5Z_xform_eval(dxpl_cache->data_xform_prop, tconv_buf, smine_nelmts, mem_type) < 0)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Error performing data transform")
+ }
/*
* Scatter the data into memory.
@@ -2070,17 +2084,22 @@ nelmts, H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space,
if (n!=smine_nelmts)
HGOTO_ERROR (H5E_IO, H5E_WRITEERROR, FAIL, "file gather failed")
} /* end if */
-
- /*
+
+
+
+ /*
* Perform data type conversion.
*/
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")
- /* LA additions for data transforms */
+ /* Do the data transform after the type conversion (since we're using dataset->type) */
if(!H5Z_xform_noop(dxpl_cache->data_xform_prop))
- H5Z_xform_eval(dxpl_cache->data_xform_prop, tconv_buf, smine_nelmts, dataset->type);
+ {
+ if( H5Z_xform_eval(dxpl_cache->data_xform_prop, tconv_buf, smine_nelmts, dataset->type) < 0)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Error performing data transform")
+ }
/*
* Scatter the data out to the file.