summaryrefslogtreecommitdiffstats
path: root/src/H5Spoint.c
diff options
context:
space:
mode:
authorAlbert Cheng <acheng@hdfgroup.org>1999-05-25 21:29:31 (GMT)
committerAlbert Cheng <acheng@hdfgroup.org>1999-05-25 21:29:31 (GMT)
commitac830927fbda984086d7bd601282c5f3e5478176 (patch)
treed516c754a10ce7824f141e1bc82280977fab24f4 /src/H5Spoint.c
parent9282a3e3575d7e3af855bea6ddd4d1a0ba511671 (diff)
downloadhdf5-ac830927fbda984086d7bd601282c5f3e5478176.zip
hdf5-ac830927fbda984086d7bd601282c5f3e5478176.tar.gz
hdf5-ac830927fbda984086d7bd601282c5f3e5478176.tar.bz2
[svn-r1277] Added additional checks into the dataspace code to determine if the hyperslabs
being written out are contiguous in memory and on disk and write/read them as one I/O operation (if the datatypes don't require conversion). This should be a good performance boost for those situations. It's especially needed on the ASCI Red (TFlops) machine. - QAK (from Albert's account on modi4 :-)
Diffstat (limited to 'src/H5Spoint.c')
-rw-r--r--src/H5Spoint.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/H5Spoint.c b/src/H5Spoint.c
index dfdfa03..ac3d3e1 100644
--- a/src/H5Spoint.c
+++ b/src/H5Spoint.c
@@ -1069,3 +1069,42 @@ H5S_point_bounds(H5S_t *space, hsize_t *start, hsize_t *end)
FUNC_LEAVE (ret_value);
} /* H5Sget_point_bounds() */
+
+/*--------------------------------------------------------------------------
+ NAME
+ H5S_point_select_contiguous
+ PURPOSE
+ Check if a point selection is contiguous within the dataspace extent.
+ USAGE
+ htri_t H5S_point_select_contiguous(space)
+ H5S_t *space; IN: Dataspace pointer to check
+ RETURNS
+ TRUE/FALSE/FAIL
+ DESCRIPTION
+ Checks to see if the current selection in the dataspace is contiguous.
+ This is primarily used for reading the entire selection in one swoop.
+ This code currently doesn't properly check for contiguousness when there is
+ more than one point, as that would take a lot of extra coding that we
+ don't need now.
+ GLOBAL VARIABLES
+ COMMENTS, BUGS, ASSUMPTIONS
+ EXAMPLES
+ REVISION LOG
+--------------------------------------------------------------------------*/
+htri_t
+H5S_point_select_contiguous(const H5S_t *space)
+{
+ htri_t ret_value=FAIL; /* return value */
+
+ FUNC_ENTER (H5S_point_select_contiguous, FAIL);
+
+ assert(space);
+
+ /* One point is definitely contiguous */
+ if(space->select.num_elem==1)
+ ret_value=TRUE;
+ else /* More than one point might be contiguous, but it's complex to check and we don't need it right now */
+ ret_value=FALSE;
+
+ FUNC_LEAVE (ret_value);
+} /* H5S_select_contiguous() */