summaryrefslogtreecommitdiffstats
path: root/src/H5S.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2002-08-27 13:41:32 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2002-08-27 13:41:32 (GMT)
commit32b58cef083388eec4b81c956eef717f59f24a87 (patch)
tree356224f63e62b8e4810f75308376323a9474a621 /src/H5S.c
parentd85657351a9252a34bd766a31c067949353ff8d0 (diff)
downloadhdf5-32b58cef083388eec4b81c956eef717f59f24a87.zip
hdf5-32b58cef083388eec4b81c956eef717f59f24a87.tar.gz
hdf5-32b58cef083388eec4b81c956eef717f59f24a87.tar.bz2
[svn-r5894] Purpose:
Bug fix/Code cleanup/New Feature Description: Correct problems with writing fill-values to external storage and allocate the data storage at the correct times. Also, mostly straighten out the strange code which allocates and fills raw data storage for datasets. Things are still a bit odd in that the fill-values for chunked datasets are written when the space is allocated, instead of in a separate routine, but there are two reasons for this: it's inefficient (especially in parallel) to iterate through all the chunks twice, and (more importantly) the space needed to store compressed chunks isn't known until we've got a buffer of compressed fill-values ready to write to the chunk. Additionally, add in the H5D_SPACE_ALLOC_INCR and H5D_SPACE_ALLOC_DEFAULT setting for the "space time", which incorporate the previous behavior of the space allocation for chunked datasets. The default settings for the different types of dataset storage are now as follows: Contiguous - Late Chunked - Incremental Compact - Early This checkin also incorporates a change to the behavior of external data storage in two ways - fill-values are _never_ written to external storage (under the assumption that writing fill-values is triggered by allocating space in an HDF5 file, and since space is not allocated in the file, the fill-values should not be written) and external data files are now created if they don't exist when data is written to them. The fill-value will probably need to be revisited at some time in the future, this just seemed like the safer course currently. I think I cleaned up some compiler errors also, before getting bogged down in the fixes for the space allocation and fill-values. Platforms tested: FreeBSD 4.6 (sleipnir) w/serial & parallel. Will be testing on IRIX64 6.5 (modi4) in serial & parallel shortly.
Diffstat (limited to 'src/H5S.c')
-rw-r--r--src/H5S.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/H5S.c b/src/H5S.c
index 34eb4ea..6424ada 100644
--- a/src/H5S.c
+++ b/src/H5S.c
@@ -1899,11 +1899,11 @@ done:
*
*-------------------------------------------------------------------------
*/
-herr_t
+int
H5S_set_extent( H5S_t *space, const hsize_t *size )
{
unsigned u;
- herr_t ret_value=SUCCEED;
+ herr_t ret_value=0;
FUNC_ENTER_NOAPI( H5S_set_extent, FAIL );
@@ -1911,19 +1911,21 @@ H5S_set_extent( H5S_t *space, const hsize_t *size )
assert( space && H5S_SIMPLE==space->extent.type );
assert( size);
- /* Check for changing dimensions of a scalar dataspace */
- if(space->extent.u.simple.rank==0)
-
/* Verify that the dimensions being changed are allowed to change */
- for ( u = 0; u < space->extent.u.simple.rank; u++ )
+ for ( u = 0; u < space->extent.u.simple.rank; u++ ) {
if ( space->extent.u.simple.max &&
H5S_UNLIMITED != space->extent.u.simple.max[u] &&
- space->extent.u.simple.max[u]<size[u] )
+ space->extent.u.simple.max[u]!=size[u] )
HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL,"dimension cannot be modified");
+ ret_value++;
+ } /* end for */
- /* Update dimensions with new values */
- for ( u = 0; u < space->extent.u.simple.rank; u++ )
- space->extent.u.simple.size[u] = size[u];
+ /* Update */
+ if (ret_value) {
+ /* Update dimensions with new values */
+ for ( u = 0; u < space->extent.u.simple.rank; u++ )
+ space->extent.u.simple.size[u] = size[u];
+ } /* end if */
done:
FUNC_LEAVE( ret_value );