summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlbert Cheng <acheng@hdfgroup.org>2005-08-30 04:47:57 (GMT)
committerAlbert Cheng <acheng@hdfgroup.org>2005-08-30 04:47:57 (GMT)
commitec65db7972421b5d4a5b2f23db09ba210d3dd606 (patch)
tree733cdafd7e19c2ab444ed02257dce597c6aca912 /src
parente9d0931e45b578fa263661b6646cf29913d71a81 (diff)
downloadhdf5-ec65db7972421b5d4a5b2f23db09ba210d3dd606.zip
hdf5-ec65db7972421b5d4a5b2f23db09ba210d3dd606.tar.gz
hdf5-ec65db7972421b5d4a5b2f23db09ba210d3dd606.tar.bz2
[svn-r11314] Purpose:
Bug #281 Description: A dataset created in serial mode with H5D_ALLOC_TIME_INCR allocation setting was not extendible, either explicitly by H5Dextend or implicitly by writing to unallocated chunks. This was because parallel mode expects the allocation mode be H5D_ALLOC_TIME_INCR only. Solution: Modified library to allocate more space when needed or directed if the file is opened by parallel mode, independent of what the dataset allocation mode is. Platforms tested: Heping pp.
Diffstat (limited to 'src')
-rw-r--r--src/H5D.c41
1 files changed, 26 insertions, 15 deletions
diff --git a/src/H5D.c b/src/H5D.c
index 64c0847..c1e680f 100644
--- a/src/H5D.c
+++ b/src/H5D.c
@@ -2989,14 +2989,17 @@ done:
*
* Modifications:
*
- * Raymond Lu
- * Tuesday, October 2, 2001
- * Changed the way to retrieve property for generic property
- * list.
+ * Raymond Lu, October 2, 2001
+ * Changed the way to retrieve property for generic property list.
+ *
+ * Nat Furrer/James Laird, June 17, 2004
+ * Added check for filter encode capability.
+ *
+ * Christian Chilan, June 27, 2005
+ * In addition to the case where allocation property is
+ * H5D_ALLOC_TIME_EARLY, storage will be allocated when the
+ * dataset is open by parallel mode.
*
- * Nat Furrer and James Laird
- * June 17, 2004
- * Added check for filter encode capability
*-------------------------------------------------------------------------
*/
static herr_t
@@ -3062,7 +3065,7 @@ H5D_extend (H5D_t *dataset, const hsize_t *size, hid_t dxpl_id)
HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to update cached chunk indices")
/* Allocate space for the new parts of the dataset, if appropriate */
- if(dataset->shared->alloc_time==H5D_ALLOC_TIME_EARLY)
+ if(dataset->shared->alloc_time==H5D_ALLOC_TIME_EARLY || IS_H5FD_MPI(dataset->ent.file))
if (H5D_alloc_storage(dataset->ent.file, dxpl_id, dataset, H5D_ALLOC_EXTEND, TRUE, FALSE)<0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize dataset with fill value")
} /* end if */
@@ -3168,11 +3171,15 @@ H5D_get_file (const H5D_t *dset)
* Friday, January 16, 1998
*
* Modifications:
- * Quincey Koziol
- * Thursday, August 22, 2002
+ * Quincey Koziol, August 22, 2002
* Moved here from H5F_arr_create and moved more logic into
* this function from places where it was being called.
*
+ * Christian Chilan, June 27, 2005
+ * In addition to the case where allocation property is
+ * H5D_ALLOC_TIME_EARLY, storage will be allocated when the
+ * dataset is open by parallel mode.
+ *
*-------------------------------------------------------------------------
*/
herr_t
@@ -3226,13 +3233,17 @@ H5D_alloc_storage (H5F_t *f, hid_t dxpl_id, H5D_t *dset/*in,out*/, H5D_time_allo
init_space=1;
} /* end if */
- /* If space allocation is set to 'early' and we are extending
- * the dataset, indicate that space should be allocated, so the
+ /* If (space allocation is set to 'early' or file is opened
+ * by parallel mode) and we are extending the dataset,
+ * indicate that space should be allocated, so the
* B-tree gets expanded. -QAK
*/
- if(dset->shared->alloc_time==H5D_ALLOC_TIME_EARLY && time_alloc==H5D_ALLOC_EXTEND)
- init_space=1;
-
+ if((dset->shared->alloc_time==H5D_ALLOC_TIME_EARLY ||
+ IS_H5FD_MPI(dset->ent.file)) &&
+ time_alloc==H5D_ALLOC_EXTEND)
+ {
+ init_space=1;
+ }
break;
case H5D_COMPACT: