diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2007-12-06 19:24:30 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2007-12-06 19:24:30 (GMT) |
commit | 74c005fdb21644607cd93b3c2dd9098d9cc7e7c5 (patch) | |
tree | e1c2dc64d2fbf66c17e9c67a8cd41b1a81e83ffe /src/H5Shyper.c | |
parent | 110a7d4869b546f5b73ba726f749870e7cd04674 (diff) | |
download | hdf5-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/H5Shyper.c')
-rw-r--r-- | src/H5Shyper.c | 47 |
1 files changed, 23 insertions, 24 deletions
diff --git a/src/H5Shyper.c b/src/H5Shyper.c index 9ca1fdc..8c56056 100644 --- a/src/H5Shyper.c +++ b/src/H5Shyper.c @@ -4238,35 +4238,37 @@ done: EXAMPLES REVISION LOG --------------------------------------------------------------------------*/ -herr_t +htri_t H5S_hyper_normalize_offset(H5S_t *space, hssize_t *old_offset) { unsigned u; /* Local index variable */ - herr_t ret_value=SUCCEED; /* Return value */ + herr_t ret_value = FALSE; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_normalize_offset); + FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_normalize_offset) - assert(space); + HDassert(space); - /* Check for 'all' selection, instead of a hyperslab selection */ - /* (Technically, this check shouldn't be in the "hyperslab" routines...) */ - if(H5S_GET_SELECT_TYPE(space)==H5S_SEL_HYPERSLABS) { + /* Check for hyperslab selection & offset changed */ + if(H5S_GET_SELECT_TYPE(space) == H5S_SEL_HYPERSLABS && space->select.offset_changed) { /* Copy & invert the selection offset */ - for(u=0; u<space->extent.rank; u++) { + for(u = 0; u<space->extent.rank; u++) { old_offset[u] = space->select.offset[u]; space->select.offset[u] = -space->select.offset[u]; } /* end for */ /* Call the existing 'adjust' routine */ - if(H5S_hyper_adjust_s(space, space->select.offset)<0) - HGOTO_ERROR(H5E_DATASPACE, H5E_BADSELECT, FAIL, "can't perform hyperslab normalization"); + if(H5S_hyper_adjust_s(space, space->select.offset) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_BADSELECT, FAIL, "can't perform hyperslab normalization") /* Zero out the selection offset */ HDmemset(space->select.offset, 0, sizeof(hssize_t) * space->extent.rank); + + /* Indicate that the offset was normalized */ + ret_value = TRUE; } /* end if */ done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* H5S_hyper_normalize_offset() */ @@ -4294,25 +4296,22 @@ done: herr_t H5S_hyper_denormalize_offset(H5S_t *space, const hssize_t *old_offset) { - herr_t ret_value=SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_denormalize_offset); + FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_denormalize_offset) - assert(space); + HDassert(space); + HDassert(H5S_GET_SELECT_TYPE(space) == H5S_SEL_HYPERSLABS); - /* Check for 'all' selection, instead of a hyperslab selection */ - /* (Technically, this check shouldn't be in the "hyperslab" routines...) */ - if(H5S_GET_SELECT_TYPE(space)==H5S_SEL_HYPERSLABS) { - /* Call the existing 'adjust' routine */ - if(H5S_hyper_adjust_s(space, old_offset)<0) - HGOTO_ERROR(H5E_DATASPACE, H5E_BADSELECT, FAIL, "can't perform hyperslab normalization"); + /* Call the existing 'adjust' routine */ + if(H5S_hyper_adjust_s(space, old_offset) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_BADSELECT, FAIL, "can't perform hyperslab normalization") - /* Copy the selection offset over */ - HDmemcpy(space->select.offset, old_offset, sizeof(hssize_t) * space->extent.rank); - } /* end if */ + /* Copy the selection offset over */ + HDmemcpy(space->select.offset, old_offset, sizeof(hssize_t) * space->extent.rank); done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* H5S_hyper_denormalize_offset() */ |