summaryrefslogtreecommitdiffstats
path: root/src/H5S.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2007-12-06 19:24:30 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2007-12-06 19:24:30 (GMT)
commit74c005fdb21644607cd93b3c2dd9098d9cc7e7c5 (patch)
treee1c2dc64d2fbf66c17e9c67a8cd41b1a81e83ffe /src/H5S.c
parent110a7d4869b546f5b73ba726f749870e7cd04674 (diff)
downloadhdf5-74c005fdb21644607cd93b3c2dd9098d9cc7e7c5.zip
hdf5-74c005fdb21644607cd93b3c2dd9098d9cc7e7c5.tar.gz
hdf5-74c005fdb21644607cd93b3c2dd9098d9cc7e7c5.tar.bz2
[svn-r14326] Description:
- Keep skip list for tracking chunks with dataset (instead of creating/ destroying it for each I/O operation) and just delete the skip list nodes. - Avoid computations for normalizing selection offset when offset not set. - Avoid updating object modification time twice during dataset creation. - Avoid updating dataset layout message (and object modification time) until dataset is closed. Tested on: FreeBSD/32 6.2 (duty) in debug mode FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN, in production mode Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN, in production mode Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN, w/szip filter, in production mode Mac OS X/32 10.4.10 (amazon) in debug mode Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Diffstat (limited to 'src/H5S.c')
-rw-r--r--src/H5S.c40
1 files changed, 13 insertions, 27 deletions
diff --git a/src/H5S.c b/src/H5S.c
index 8a498aa..8a58cba 100644
--- a/src/H5S.c
+++ b/src/H5S.c
@@ -1055,27 +1055,20 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5S_write(H5O_loc_t *loc, const H5S_t *ds, hbool_t update_time, hid_t dxpl_id)
+H5S_write(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned update_flags, H5S_t *ds)
{
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(H5S_write, FAIL)
- HDassert(loc);
+ HDassert(f);
+ HDassert(oh);
HDassert(ds);
+ HDassert(H5S_GET_EXTENT_TYPE(ds) >= 0);
- switch(H5S_GET_EXTENT_TYPE(ds)) {
- case H5S_NULL:
- case H5S_SCALAR:
- case H5S_SIMPLE:
- if(H5O_msg_write(loc, H5O_SDSPACE_ID, 0, update_time, &(ds->extent), dxpl_id) < 0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "can't update simple dataspace message")
- break;
-
- default:
- HDassert("unknown dataspace class" && 0);
- break;
- } /* end switch */
+ /* Write the current dataspace extent to the dataspace message */
+ if(H5O_msg_write_oh(f, dxpl_id, oh, H5O_SDSPACE_ID, 0, update_flags, &(ds->extent)) < 0)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "can't update simple dataspace message")
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -1103,7 +1096,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5S_append(H5F_t *f, hid_t dxpl_id, struct H5O_t *oh, const H5S_t *ds)
+H5S_append(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5S_t *ds)
{
herr_t ret_value = SUCCEED; /* Return value */
@@ -1112,19 +1105,11 @@ H5S_append(H5F_t *f, hid_t dxpl_id, struct H5O_t *oh, const H5S_t *ds)
HDassert(f);
HDassert(oh);
HDassert(ds);
+ HDassert(H5S_GET_EXTENT_TYPE(ds) >= 0);
- switch (H5S_GET_EXTENT_TYPE(ds)) {
- case H5S_NULL:
- case H5S_SCALAR:
- case H5S_SIMPLE:
- if(H5O_msg_append(f, dxpl_id, oh, H5O_SDSPACE_ID, 0, 0, &(ds->extent)) < 0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "can't update simple data space message")
- break;
-
- default:
- assert("unknown data space class" && 0);
- break;
- }
+ /* Add the dataspace message to the object header */
+ if(H5O_msg_append_oh(f, dxpl_id, oh, H5O_SDSPACE_ID, 0, 0, &(ds->extent)) < 0)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "can't add simple dataspace message")
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -1388,6 +1373,7 @@ H5S_set_extent_simple(H5S_t *space, unsigned rank, const hsize_t *dims,
/* Set offset to zeros */
for(u = 0; u < space->extent.rank; u++)
space->select.offset[u] = 0;
+ space->select.offset_changed = FALSE;
/* If the selection is 'all', update the number of elements selected */
if(H5S_GET_SELECT_TYPE(space) == H5S_SEL_ALL)