summaryrefslogtreecommitdiffstats
path: root/src/H5Distore.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/H5Distore.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/H5Distore.c')
-rw-r--r--src/H5Distore.c36
1 files changed, 16 insertions, 20 deletions
diff --git a/src/H5Distore.c b/src/H5Distore.c
index 1a9a3d6..c12a98e 100644
--- a/src/H5Distore.c
+++ b/src/H5Distore.c
@@ -1695,15 +1695,17 @@ H5F_istore_unlock(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
* Robb Matzke, 1999-08-02
* The data transfer property list is passed as an object ID
* since that's how the virtual file layer wants it.
+ *
+ * Quincey Koziol, 2002-04-02
+ * Enable hyperslab I/O into memory buffer
*-------------------------------------------------------------------------
*/
herr_t
H5F_istore_read(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
const H5O_pline_t *pline, const H5O_fill_t *fill,
+ const hsize_t size_m[], const hssize_t offset_m[],
const hssize_t offset_f[], const hsize_t size[], void *buf)
{
- hssize_t offset_m[H5O_LAYOUT_NDIMS];
- hsize_t size_m[H5O_LAYOUT_NDIMS];
hsize_t idx_cur[H5O_LAYOUT_NDIMS];
hsize_t idx_min[H5O_LAYOUT_NDIMS];
hsize_t idx_max[H5O_LAYOUT_NDIMS];
@@ -1726,19 +1728,15 @@ H5F_istore_read(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
assert(layout && H5D_CHUNKED==layout->type);
assert(layout->ndims>0 && layout->ndims<=H5O_LAYOUT_NDIMS);
assert(H5F_addr_defined(layout->addr));
+ assert(size_m);
+ assert(offset_m);
assert(offset_f);
assert(size);
assert(buf);
- /*
- * For now, a hyperslab of the file must be read into an array in
- * memory.We do not yet support reading into a hyperslab of memory.
- */
- for (u=0, chunk_size=1; u<layout->ndims; u++) {
- offset_m[u] = 0;
- size_m[u] = size[u];
+ /* Compute chunk size */
+ for (u=0, chunk_size=1; u<layout->ndims; u++)
chunk_size *= layout->dim[u];
- } /* end for */
#ifndef NDEBUG
for (u=0; u<layout->ndims; u++) {
@@ -1874,16 +1872,18 @@ H5F_istore_read(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
* Robb Matzke, 1999-08-02
* The data transfer property list is passed as an object ID
* since that's how the virtual file layer wants it.
+ *
+ * Quincey Koziol, 2002-04-02
+ * Enable hyperslab I/O into memory buffer
*-------------------------------------------------------------------------
*/
herr_t
H5F_istore_write(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
const H5O_pline_t *pline, const H5O_fill_t *fill,
+ const hsize_t size_m[], const hssize_t offset_m[],
const hssize_t offset_f[], const hsize_t size[],
const void *buf)
{
- hssize_t offset_m[H5O_LAYOUT_NDIMS];
- hsize_t size_m[H5O_LAYOUT_NDIMS];
int i, carry;
unsigned u;
hsize_t idx_cur[H5O_LAYOUT_NDIMS];
@@ -1905,19 +1905,15 @@ H5F_istore_write(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
assert(layout && H5D_CHUNKED==layout->type);
assert(layout->ndims>0 && layout->ndims<=H5O_LAYOUT_NDIMS);
assert(H5F_addr_defined(layout->addr));
+ assert(size_m);
+ assert(offset_m);
assert(offset_f);
assert(size);
assert(buf);
- /*
- * For now the source must not be a hyperslab. It must be an entire
- * memory buffer.
- */
- for (u=0, chunk_size=1; u<layout->ndims; u++) {
- offset_m[u] = 0;
- size_m[u] = size[u];
+ /* Compute chunk size */
+ for (u=0, chunk_size=1; u<layout->ndims; u++)
chunk_size *= layout->dim[u];
- } /* end for */
#ifndef NDEBUG
for (u=0; u<layout->ndims; u++) {