From 6e1ab59a750da75acec98ee519de16729cb0795e Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Mon, 3 Dec 2001 16:00:46 -0500 Subject: [svn-r4664] Purpose: Code cleanup Description: Check in some small speedups for chunked storage I/O. Platforms tested: Solaris 2.6 (baldric) --- src/H5Dseq.c | 69 ++++++++++++++++++++++++++++++------------------------------ src/H5Fseq.c | 69 ++++++++++++++++++++++++++++++------------------------------ 2 files changed, 68 insertions(+), 70 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; vnused>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; vnused>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]; diff --git a/src/H5Fseq.c b/src/H5Fseq.c index 49b9203..0fec03d 100644 --- a/src/H5Fseq.c +++ b/src/H5Fseq.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; vnused>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; vnused>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]; -- cgit v0.12