summaryrefslogtreecommitdiffstats
path: root/src/H5Farray.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2002-04-02 20:51:41 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2002-04-02 20:51:41 (GMT)
commitd2232a345f36988f4a60034d63ddca25c476fc08 (patch)
tree2ba460735cb162b5ee94ae98f0d46873488fa454 /src/H5Farray.c
parentc1e44699f0460cd5a675a71dc85296740f07063a (diff)
downloadhdf5-d2232a345f36988f4a60034d63ddca25c476fc08.zip
hdf5-d2232a345f36988f4a60034d63ddca25c476fc08.tar.gz
hdf5-d2232a345f36988f4a60034d63ddca25c476fc08.tar.bz2
[svn-r5130] Purpose:
Bug Fix & Feature Description: The selection offset was being ignored for optimized hyperslab selection I/O operations. Additionally, I've found that the restrictions on optimized selection I/O operations were too strict and found a way to allow more hyperslabs to use the optimized I/O routines. Solution: Incorporate the selection offset into the selection location when performing optimized I/O operations. Allow optimized I/O on any single hyperslab selection and also allow hyperslab operations on chunked datasets. Platforms tested: FreeBSD 4.5 (sleipnir)
Diffstat (limited to 'src/H5Farray.c')
-rw-r--r--src/H5Farray.c53
1 files changed, 17 insertions, 36 deletions
diff --git a/src/H5Farray.c b/src/H5Farray.c
index 6b4155c..58d8558 100644
--- a/src/H5Farray.c
+++ b/src/H5Farray.c
@@ -352,29 +352,20 @@ H5F_arr_read(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
case H5D_CHUNKED:
/*
- * This method is unable to access external raw data files or to copy
- * into a proper hyperslab.
+ * This method is unable to access external raw data files
*/
- if (efl && efl->nused>0) {
- HRETURN_ERROR(H5E_IO, H5E_UNSUPPORTED, FAIL,
- "chunking and external files are mutually exclusive");
- }
- for (u=0; u<layout->ndims; u++) {
- if (0!=mem_offset[u] || hslab_size[u]!=mem_size[u]) {
- HRETURN_ERROR(H5E_IO, H5E_UNSUPPORTED, FAIL,
- "unable to copy into a proper hyperslab");
- }
- }
- if (H5F_istore_read(f, dxpl_id, layout, pline, fill, file_offset,
- hslab_size, buf)<0) {
+ if (efl && efl->nused>0)
+ HRETURN_ERROR(H5E_IO, H5E_UNSUPPORTED, FAIL, "chunking and external files are mutually exclusive");
+
+ /* Go get the data from the chunks */
+ if (H5F_istore_read(f, dxpl_id, layout, pline, fill, mem_size,
+ mem_offset, file_offset, hslab_size, buf)<0)
HRETURN_ERROR(H5E_IO, H5E_READERROR, FAIL, "chunked read failed");
- }
break;
default:
assert("not implemented yet" && 0);
- HRETURN_ERROR(H5E_IO, H5E_UNSUPPORTED, FAIL,
- "unsupported storage layout");
+ HRETURN_ERROR(H5E_IO, H5E_UNSUPPORTED, FAIL, "unsupported storage layout");
}
FUNC_LEAVE(SUCCEED);
@@ -628,30 +619,20 @@ H5F_arr_write(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
case H5D_CHUNKED:
/*
- * This method is unable to access external raw data files or to copy
- * from a proper hyperslab.
+ * This method is unable to access external raw data files
*/
- if (efl && efl->nused>0) {
- HRETURN_ERROR(H5E_IO, H5E_UNSUPPORTED, FAIL,
- "chunking and external files are mutually exclusive");
- }
- for (u=0; u<layout->ndims; u++) {
- if (0!=mem_offset[u] || hslab_size[u]!=mem_size[u]) {
- HRETURN_ERROR(H5E_IO, H5E_UNSUPPORTED, FAIL,
- "unable to copy from a proper hyperslab");
- }
- }
- if (H5F_istore_write(f, dxpl_id, layout, pline, fill, file_offset,
- hslab_size, buf)<0) {
- HRETURN_ERROR(H5E_IO, H5E_WRITEERROR, FAIL,
- "chunked write failed");
- }
+ if (efl && efl->nused>0)
+ HRETURN_ERROR(H5E_IO, H5E_UNSUPPORTED, FAIL, "chunking and external files are mutually exclusive");
+
+ /* Write the read to the chunks */
+ if (H5F_istore_write(f, dxpl_id, layout, pline, fill, mem_size,
+ mem_offset, file_offset, hslab_size, buf)<0)
+ HRETURN_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "chunked write failed");
break;
default:
assert("not implemented yet" && 0);
- HRETURN_ERROR(H5E_IO, H5E_UNSUPPORTED, FAIL,
- "unsupported storage layout");
+ HRETURN_ERROR(H5E_IO, H5E_UNSUPPORTED, FAIL, "unsupported storage layout");
}
FUNC_LEAVE (SUCCEED);