summaryrefslogtreecommitdiffstats
path: root/src/H5MFaggr.c
diff options
context:
space:
mode:
authorNeil Fortner <nfortne2@hdfgroup.org>2016-08-11 20:56:13 (GMT)
committerNeil Fortner <nfortne2@hdfgroup.org>2016-08-11 20:56:13 (GMT)
commit6dec81e7ac7edacf524a8f4dbb125d4fe40f3dc0 (patch)
tree63c89d90dfee9e6e7dabef15b007e98a024a7d14 /src/H5MFaggr.c
parent1d9e5ff1ca96bd10b66507ba281cb4617090e65e (diff)
downloadhdf5-6dec81e7ac7edacf524a8f4dbb125d4fe40f3dc0.zip
hdf5-6dec81e7ac7edacf524a8f4dbb125d4fe40f3dc0.tar.gz
hdf5-6dec81e7ac7edacf524a8f4dbb125d4fe40f3dc0.tar.bz2
[svn-r30278] Merge revision 30270 to the 1.8 branch
Fix an issue that could occur when allocating a chunked dataset in parallel, with an alignment threshold set to be larger than the chunk size but smaller than the size of the small data aggregator. Tested: h5committest, jelly, ummon (trunk); h5committest, jelly, ummon (1.8)
Diffstat (limited to 'src/H5MFaggr.c')
-rw-r--r--src/H5MFaggr.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/src/H5MFaggr.c b/src/H5MFaggr.c
index 21d460e..663e266 100644
--- a/src/H5MFaggr.c
+++ b/src/H5MFaggr.c
@@ -295,10 +295,26 @@ HDfprintf(stderr, "%s: Allocating block\n", FUNC);
if(H5MF_xfree(f, alloc_type, dxpl_id, aggr->addr, aggr->size) < 0)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, HADDR_UNDEF, "can't free aggregation block")
- /* Point the aggregator at the newly allocated block */
- aggr->addr = new_space;
- aggr->size = aggr->alloc_size;
- aggr->tot_size = aggr->alloc_size;
+ /* If the block is not to be aligned, fold the eoa fragment
+ * into the newly allocated aggregator, as it could have
+ * been allocated in an aligned manner if the aggregator
+ * block is larger than the threshold */
+ if(eoa_frag_size && !alignment) {
+ HDassert(eoa_frag_addr + eoa_frag_size == new_space);
+ aggr->addr = eoa_frag_addr;
+ aggr->size = aggr->alloc_size + eoa_frag_size;
+ aggr->tot_size = aggr->size;
+
+ /* Reset EOA fragment */
+ eoa_frag_addr = HADDR_UNDEF;
+ eoa_frag_size = 0;
+ } /* end if */
+ else {
+ /* Point the aggregator at the newly allocated block */
+ aggr->addr = new_space;
+ aggr->size = aggr->alloc_size;
+ aggr->tot_size = aggr->alloc_size;
+ }
} /* end else */
/* Allocate space out of the metadata block */