summaryrefslogtreecommitdiffstats
path: root/src/H5Dseq.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2001-12-03 21:00:46 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2001-12-03 21:00:46 (GMT)
commit6e1ab59a750da75acec98ee519de16729cb0795e (patch)
treead1a45dd6e09cfb7cd87072cd1625250a0c6246d /src/H5Dseq.c
parent0c4dec2ba1c93260c06f9f5a2aa4c519748b2f47 (diff)
downloadhdf5-6e1ab59a750da75acec98ee519de16729cb0795e.zip
hdf5-6e1ab59a750da75acec98ee519de16729cb0795e.tar.gz
hdf5-6e1ab59a750da75acec98ee519de16729cb0795e.tar.bz2
[svn-r4664] Purpose:
Code cleanup Description: Check in some small speedups for chunked storage I/O. Platforms tested: Solaris 2.6 (baldric)
Diffstat (limited to 'src/H5Dseq.c')
-rw-r--r--src/H5Dseq.c69
1 files changed, 34 insertions, 35 deletions
diff --git a/src/H5Dseq.c b/src/H5Dseq.c
index 49b9203..0fec03d 100644
--- a/src/H5Dseq.c
+++ b/src/H5Dseq.c
@@ -271,6 +271,23 @@ H5F_seq_readv(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
break;
case H5D_CHUNKED:
+ /*
+ * 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");
+ }
+ /* Compute the file offset coordinates and hyperslab size */
+ if((ndims=H5S_get_simple_extent_dims(file_space,dset_dims,NULL))<0)
+ HRETURN_ERROR(H5E_IO, H5E_UNSUPPORTED, FAIL, "unable to retrieve dataspace dimensions");
+
+ /* Build the array of cumulative hyperslab sizes */
+ for(acc=1, i=(ndims-1); i>=0; i--) {
+ down_size[i]=acc;
+ acc*=dset_dims[i];
+ } /* end for */
+
/* Brute-force, stupid way to implement the vectors, but too complex to do other ways... */
for(v=0; v<nseq; v++) {
file_offset=file_offset_arr[v];
@@ -278,18 +295,6 @@ H5F_seq_readv(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
buf=real_buf;
{
- /*
- * 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");
- }
- /* Compute the file offset coordinates and hyperslab size */
- if((ndims=H5S_get_simple_extent_dims(file_space,dset_dims,NULL))<0)
- HRETURN_ERROR(H5E_IO, H5E_UNSUPPORTED, FAIL, "unable to retrieve dataspace dimensions");
-
-
/* Set location in dataset from the file_offset */
addr=file_offset;
@@ -297,12 +302,6 @@ H5F_seq_readv(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
seq_len/=elmt_size;
addr/=elmt_size;
- /* Build the array of cumulative hyperslab sizes */
- for(acc=1, i=(ndims-1); i>=0; i--) {
- down_size[i]=acc;
- acc*=dset_dims[i];
- } /* end for */
-
/* Compute the hyperslab offset from the address given */
for(i=ndims-1; i>=0; i--) {
coords[i]=addr%dset_dims[i];
@@ -660,6 +659,23 @@ H5F_seq_writev(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
break;
case H5D_CHUNKED:
+ /*
+ * 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");
+ }
+ /* Compute the file offset coordinates and hyperslab size */
+ if((ndims=H5S_get_simple_extent_dims(file_space,dset_dims,NULL))<0)
+ HRETURN_ERROR(H5E_IO, H5E_UNSUPPORTED, FAIL, "unable to retrieve dataspace dimensions");
+
+ /* Build the array of cumulative hyperslab sizes */
+ for(acc=1, i=(ndims-1); i>=0; i--) {
+ down_size[i]=acc;
+ acc*=dset_dims[i];
+ } /* end for */
+
/* Brute-force, stupid way to implement the vectors, but too complex to do other ways... */
for(v=0; v<nseq; v++) {
file_offset=file_offset_arr[v];
@@ -667,17 +683,6 @@ H5F_seq_writev(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
buf=real_buf;
{
- /*
- * 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");
- }
- /* Compute the file offset coordinates and hyperslab size */
- if((ndims=H5S_get_simple_extent_dims(file_space,dset_dims,NULL))<0)
- HRETURN_ERROR(H5E_IO, H5E_UNSUPPORTED, FAIL, "unable to retrieve dataspace dimensions");
-
/* Set location in dataset from the file_offset */
addr=file_offset;
@@ -685,12 +690,6 @@ H5F_seq_writev(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
seq_len/=elmt_size;
addr/=elmt_size;
- /* Build the array of cumulative hyperslab sizes */
- for(acc=1, i=(ndims-1); i>=0; i--) {
- down_size[i]=acc;
- acc*=dset_dims[i];
- } /* end for */
-
/* Compute the hyperslab offset from the address given */
for(i=ndims-1; i>=0; i--) {
coords[i]=addr%dset_dims[i];