summaryrefslogtreecommitdiffstats
path: root/src/H5S.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2009-07-02 22:34:20 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2009-07-02 22:34:20 (GMT)
commitc243e1e13456365b0b555a9c82d5cc17f1436727 (patch)
treeacf5130fd8bede482315c050b1ec0e3faf096ee4 /src/H5S.c
parent47e4e67e3cd11f99ac417613eed9f47e65f55468 (diff)
downloadhdf5-c243e1e13456365b0b555a9c82d5cc17f1436727.zip
hdf5-c243e1e13456365b0b555a9c82d5cc17f1436727.tar.gz
hdf5-c243e1e13456365b0b555a9c82d5cc17f1436727.tar.bz2
[svn-r17148] Description:
Refactor how chunked dataset information is computed, moving it earlier and avoiding more recomputation. Tested on: FreeBSD/32 6.3 (duty) in debug mode FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode Linux/32 2.6 (jam) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x, w/C++ & FORTRAN, in production mode Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN, w/szip filter, in production mode Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN, in production mode Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode Mac OS X/32 10.5.7 (amazon) in debug mode Mac OS X/32 10.5.7 (amazon) w/C++ & FORTRAN, w/threadsafe, in production mode
Diffstat (limited to 'src/H5S.c')
-rw-r--r--src/H5S.c63
1 files changed, 48 insertions, 15 deletions
diff --git a/src/H5S.c b/src/H5S.c
index 9de4e95..c723127 100644
--- a/src/H5S.c
+++ b/src/H5S.c
@@ -841,49 +841,46 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5S_get_simple_extent_dims
+ * Function: H5S_extent_get_dims
*
* Purpose: Returns the size in each dimension of a dataspace. This
* function may not be meaningful for all types of dataspaces.
*
* Return: Success: Number of dimensions. Zero implies scalar.
- *
* Failure: Negative
*
- * Programmer: Robb Matzke
- * Thursday, December 11, 1997
- *
- * Modifications:
+ * Programmer: Quincey Koziol
+ * Tuesday, June 30, 2009
*
*-------------------------------------------------------------------------
*/
int
-H5S_get_simple_extent_dims(const H5S_t *ds, hsize_t dims[], hsize_t max_dims[])
+H5S_extent_get_dims(const H5S_extent_t *ext, hsize_t dims[], hsize_t max_dims[])
{
int i; /* Local index variable */
int ret_value; /* Return value */
- FUNC_ENTER_NOAPI(H5S_get_simple_extent_dims, FAIL)
+ FUNC_ENTER_NOAPI(H5S_extent_get_dims, FAIL)
/* check args */
- HDassert(ds);
+ HDassert(ext);
- switch(H5S_GET_EXTENT_TYPE(ds)) {
+ switch(ext->type) {
case H5S_NULL:
case H5S_SCALAR:
ret_value = 0;
break;
case H5S_SIMPLE:
- ret_value = (int)ds->extent.rank;
+ ret_value = (int)ext->rank;
for(i = 0; i < ret_value; i++) {
if(dims)
- dims[i] = ds->extent.size[i];
+ dims[i] = ext->size[i];
if(max_dims) {
- if(ds->extent.max)
- max_dims[i] = ds->extent.max[i];
+ if(ext->max)
+ max_dims[i] = ext->max[i];
else
- max_dims[i] = ds->extent.size[i];
+ max_dims[i] = ext->size[i];
} /* end if */
} /* end for */
break;
@@ -895,6 +892,42 @@ H5S_get_simple_extent_dims(const H5S_t *ds, hsize_t dims[], hsize_t max_dims[])
done:
FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5S_extent_get_dims() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5S_get_simple_extent_dims
+ *
+ * Purpose: Returns the size in each dimension of a dataspace. This
+ * function may not be meaningful for all types of dataspaces.
+ *
+ * Return: Success: Number of dimensions. Zero implies scalar.
+ *
+ * Failure: Negative
+ *
+ * Programmer: Robb Matzke
+ * Thursday, December 11, 1997
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+int
+H5S_get_simple_extent_dims(const H5S_t *ds, hsize_t dims[], hsize_t max_dims[])
+{
+ int ret_value; /* Return value */
+
+ FUNC_ENTER_NOAPI(H5S_get_simple_extent_dims, FAIL)
+
+ /* check args */
+ HDassert(ds);
+
+ /* Get dims for extent */
+ if((ret_value = H5S_extent_get_dims(&ds->extent, dims, max_dims)) < 0)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't retrieve dataspace extent dims")
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5S_get_simple_extent_dims() */