summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMohamad Chaarawi <chaarawi@hdfgroup.org>2012-06-08 13:49:24 (GMT)
committerMohamad Chaarawi <chaarawi@hdfgroup.org>2012-06-08 13:49:24 (GMT)
commit217c553b95358bfb0c41bf54df4f7596055cc9af (patch)
tree0d0480c6a94572f27b7ac151501eb7c973f37255 /src
parent6d5505282c353aeeae1c5bd4420607cd7489c996 (diff)
parent0820bef83e258c42294583e140e59f0637a77694 (diff)
downloadhdf5-217c553b95358bfb0c41bf54df4f7596055cc9af.zip
hdf5-217c553b95358bfb0c41bf54df4f7596055cc9af.tar.gz
hdf5-217c553b95358bfb0c41bf54df4f7596055cc9af.tar.bz2
[svn-r22446] merge fron trunk pre-code review
Diffstat (limited to 'src')
-rw-r--r--src/H5F.c1
-rw-r--r--src/H5FDlog.c19
-rw-r--r--src/H5FDmulti.c3
-rw-r--r--src/H5FDpublic.h2
-rw-r--r--src/H5Faccum.c27
-rw-r--r--src/H5MF.c20
-rw-r--r--src/H5MFaggr.c115
-rw-r--r--src/H5config.h.in4
8 files changed, 134 insertions, 57 deletions
diff --git a/src/H5F.c b/src/H5F.c
index ab69011..724477c 100644
--- a/src/H5F.c
+++ b/src/H5F.c
@@ -610,7 +610,6 @@ H5F_get_objects(const H5F_t *f, unsigned types, size_t max_index, hid_t *obj_id_
{
size_t obj_id_count=0; /* Number of open IDs */
H5F_olist_t olist; /* Structure to hold search results */
- htri_t type_exists; /* Whether objects of a type are open */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
diff --git a/src/H5FDlog.c b/src/H5FDlog.c
index 0b5c677..b2c6398 100644
--- a/src/H5FDlog.c
+++ b/src/H5FDlog.c
@@ -1022,12 +1022,29 @@ H5FD_log_get_eoa(const H5FD_t *_file, H5FD_mem_t UNUSED type)
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_log_set_eoa(H5FD_t *_file, H5FD_mem_t UNUSED type, haddr_t addr)
+H5FD_log_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr)
{
H5FD_log_t *file = (H5FD_log_t *)_file;
FUNC_ENTER_NOAPI_NOINIT_NOERR
+ if(file->fa.flags != 0) {
+ if(H5F_addr_gt(addr, file->eoa) && H5F_addr_gt(addr, 0)) {
+ hsize_t size = addr - file->eoa;
+
+ /* Retain the flavor of the space allocated by the extension */
+ if(file->fa.flags & H5FD_LOG_FLAVOR) {
+ HDassert(addr < file->iosize);
+ H5_CHECK_OVERFLOW(size, hsize_t, size_t);
+ HDmemset(&file->flavor[file->eoa], (int)type, (size_t)size);
+ } /* end if */
+
+ /* Log the extension like an allocation */
+ if(file->fa.flags & H5FD_LOG_ALLOC)
+ HDfprintf(file->logfp, "%10a-%10a (%10Hu bytes) (%s) Allocated\n", file->eoa, addr, size, flavors[type]);
+ } /* end if */
+ } /* end if */
+
file->eoa = addr;
FUNC_LEAVE_NOAPI(SUCCEED)
diff --git a/src/H5FDmulti.c b/src/H5FDmulti.c
index 5751596..b1d312f 100644
--- a/src/H5FDmulti.c
+++ b/src/H5FDmulti.c
@@ -309,7 +309,8 @@ H5Pset_fapl_split(hid_t fapl, const char *meta_ext, hid_t meta_plist_id,
/* Initialize */
ALL_MEMBERS(mt) {
- memb_map[mt] = (H5FD_MEM_DRAW==mt?mt:H5FD_MEM_SUPER);
+ /* Treat global heap as raw data, not metadata */
+ memb_map[mt] = ((mt == H5FD_MEM_DRAW || mt == H5FD_MEM_GHEAP) ? H5FD_MEM_DRAW : H5FD_MEM_SUPER);
memb_fapl[mt] = -1;
memb_name[mt] = NULL;
memb_addr[mt] = HADDR_UNDEF;
diff --git a/src/H5FDpublic.h b/src/H5FDpublic.h
index ab19c68..5f70f71 100644
--- a/src/H5FDpublic.h
+++ b/src/H5FDpublic.h
@@ -133,7 +133,7 @@ typedef enum H5F_mem_t H5FD_mem_t;
H5FD_MEM_SUPER, /*super*/ \
H5FD_MEM_SUPER, /*btree*/ \
H5FD_MEM_DRAW, /*draw*/ \
- H5FD_MEM_SUPER, /*gheap*/ \
+ H5FD_MEM_DRAW, /*gheap*/ \
H5FD_MEM_SUPER, /*lheap*/ \
H5FD_MEM_SUPER /*ohdr*/ \
}
diff --git a/src/H5Faccum.c b/src/H5Faccum.c
index 3c72c5d..0e549fa 100644
--- a/src/H5Faccum.c
+++ b/src/H5Faccum.c
@@ -115,6 +115,7 @@ herr_t
H5F_accum_read(const H5F_t *f, hid_t dxpl_id, H5FD_mem_t type, haddr_t addr,
size_t size, void *buf/*out*/)
{
+ H5FD_mem_t map_type; /* Mapped memory type */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -123,8 +124,11 @@ H5F_accum_read(const H5F_t *f, hid_t dxpl_id, H5FD_mem_t type, haddr_t addr,
HDassert(f->shared);
HDassert(buf);
+ /* Treat global heap as raw data */
+ map_type = (type == H5FD_MEM_GHEAP) ? H5FD_MEM_DRAW : type;
+
/* Check if this information is in the metadata accumulator */
- if((f->shared->feature_flags & H5FD_FEAT_ACCUMULATE_METADATA) && type != H5FD_MEM_DRAW) {
+ if((f->shared->feature_flags & H5FD_FEAT_ACCUMULATE_METADATA) && map_type != H5FD_MEM_DRAW) {
if(size < H5F_ACCUM_MAX_SIZE) {
/* Sanity check */
HDassert(!f->shared->accum.buf || (f->shared->accum.alloc_size >= f->shared->accum.size));
@@ -173,7 +177,7 @@ H5F_accum_read(const H5F_t *f, hid_t dxpl_id, H5FD_mem_t type, haddr_t addr,
f->shared->accum.dirty_off += amount_before;
/* Dispatch to driver */
- if(H5FD_read(f->shared->lf, dxpl_id, type, addr, amount_before, f->shared->accum.buf) < 0)
+ if(H5FD_read(f->shared->lf, dxpl_id, map_type, addr, amount_before, f->shared->accum.buf) < 0)
HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "driver read request failed")
} /* end if */
else
@@ -187,7 +191,7 @@ H5F_accum_read(const H5F_t *f, hid_t dxpl_id, H5FD_mem_t type, haddr_t addr,
H5_ASSIGN_OVERFLOW(amount_after, ((addr + size) - (f->shared->accum.loc + f->shared->accum.size)), hsize_t, size_t);
/* Dispatch to driver */
- if(H5FD_read(f->shared->lf, dxpl_id, type, (f->shared->accum.loc + f->shared->accum.size), amount_after, (f->shared->accum.buf + f->shared->accum.size + amount_before)) < 0)
+ if(H5FD_read(f->shared->lf, dxpl_id, map_type, (f->shared->accum.loc + f->shared->accum.size), amount_after, (f->shared->accum.buf + f->shared->accum.size + amount_before)) < 0)
HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "driver read request failed")
} /* end if */
@@ -201,13 +205,13 @@ H5F_accum_read(const H5F_t *f, hid_t dxpl_id, H5FD_mem_t type, haddr_t addr,
/* Current read doesn't overlap with metadata accumulator, read it from file */
else {
/* Dispatch to driver */
- if(H5FD_read(f->shared->lf, dxpl_id, type, addr, size, buf) < 0)
+ if(H5FD_read(f->shared->lf, dxpl_id, map_type, addr, size, buf) < 0)
HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "driver read request failed")
} /* end else */
} /* end if */
else {
/* Read the data */
- if(H5FD_read(f->shared->lf, dxpl_id, type, addr, size, buf) < 0)
+ if(H5FD_read(f->shared->lf, dxpl_id, map_type, addr, size, buf) < 0)
HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "driver read request failed")
/* Check for overlap w/dirty accumulator */
@@ -250,7 +254,7 @@ H5F_accum_read(const H5F_t *f, hid_t dxpl_id, H5FD_mem_t type, haddr_t addr,
} /* end if */
else {
/* Read the data */
- if(H5FD_read(f->shared->lf, dxpl_id, type, addr, size, buf) < 0)
+ if(H5FD_read(f->shared->lf, dxpl_id, map_type, addr, size, buf) < 0)
HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "driver read request failed")
} /* end else */
@@ -415,6 +419,7 @@ herr_t
H5F_accum_write(const H5F_t *f, hid_t dxpl_id, H5FD_mem_t type, haddr_t addr,
size_t size, const void *buf)
{
+ H5FD_mem_t map_type; /* Mapped memory type */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -424,8 +429,11 @@ H5F_accum_write(const H5F_t *f, hid_t dxpl_id, H5FD_mem_t type, haddr_t addr,
HDassert(f->intent & H5F_ACC_RDWR);
HDassert(buf);
+ /* Treat global heap as raw data */
+ map_type = (type == H5FD_MEM_GHEAP) ? H5FD_MEM_DRAW : type;
+
/* Check for accumulating metadata */
- if((f->shared->feature_flags & H5FD_FEAT_ACCUMULATE_METADATA) && type != H5FD_MEM_DRAW) {
+ if((f->shared->feature_flags & H5FD_FEAT_ACCUMULATE_METADATA) && map_type != H5FD_MEM_DRAW) {
if(size < H5F_ACCUM_MAX_SIZE) {
/* Sanity check */
HDassert(!f->shared->accum.buf || (f->shared->accum.alloc_size >= f->shared->accum.size));
@@ -719,7 +727,7 @@ HDmemset(f->shared->accum.buf + size, 0, (f->shared->accum.alloc_size - size));
} /* end if */
else {
/* Write the data */
- if(H5FD_write(f->shared->lf, dxpl_id, type, addr, size, buf) < 0)
+ if(H5FD_write(f->shared->lf, dxpl_id, map_type, addr, size, buf) < 0)
HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "file write failed")
/* Check for overlap w/accumulator */
@@ -804,7 +812,7 @@ HDmemset(f->shared->accum.buf + size, 0, (f->shared->accum.alloc_size - size));
} /* end if */
else {
/* Write the data */
- if(H5FD_write(f->shared->lf, dxpl_id, type, addr, size, buf) < 0)
+ if(H5FD_write(f->shared->lf, dxpl_id, map_type, addr, size, buf) < 0)
HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "file write failed")
} /* end else */
@@ -846,6 +854,7 @@ H5F_accum_free(H5F_t *f, hid_t dxpl_id, H5FD_mem_t UNUSED type, haddr_t addr,
/* Sanity check */
/* (The metadata accumulator should not intersect w/raw data */
HDassert(H5FD_MEM_DRAW != type);
+ HDassert(H5FD_MEM_GHEAP != type); /* (global heap data is being treated as raw data currently) */
/* Check for overlapping the beginning of the accumulator */
if(H5F_addr_le(addr, f->shared->accum.loc)) {
diff --git a/src/H5MF.c b/src/H5MF.c
index f9ca256..5b4505f 100644
--- a/src/H5MF.c
+++ b/src/H5MF.c
@@ -160,7 +160,8 @@ H5MF_init_merge_flags(H5F_t *f)
all_metadata_same = TRUE;
for(type = H5FD_MEM_SUPER; type < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, type))
/* Skip checking raw data free list mapping */
- if(type != H5FD_MEM_DRAW) {
+ /* (global heap is treated as raw data) */
+ if(type != H5FD_MEM_DRAW && type != H5FD_MEM_GHEAP) {
/* Check for any different type mappings */
if(f->shared->fs_type_map[type] != f->shared->fs_type_map[H5FD_MEM_SUPER]) {
all_metadata_same = FALSE;
@@ -183,9 +184,12 @@ H5MF_init_merge_flags(H5F_t *f)
HDmemset(f->shared->fs_aggr_merge, 0, sizeof(f->shared->fs_aggr_merge));
/* Check if merging raw data should be allowed */
+ /* (treat global heaps as raw data) */
if(H5FD_MEM_DRAW == f->shared->fs_type_map[H5FD_MEM_DRAW] ||
- H5FD_MEM_DEFAULT == f->shared->fs_type_map[H5FD_MEM_DRAW])
+ H5FD_MEM_DEFAULT == f->shared->fs_type_map[H5FD_MEM_DRAW]) {
f->shared->fs_aggr_merge[H5FD_MEM_DRAW] = H5F_FS_MERGE_RAWDATA;
+ f->shared->fs_aggr_merge[H5FD_MEM_GHEAP] = H5F_FS_MERGE_RAWDATA;
+ } /* end if */
break;
case H5MF_AGGR_MERGE_DICHOTOMY:
@@ -193,7 +197,9 @@ H5MF_init_merge_flags(H5F_t *f)
HDmemset(f->shared->fs_aggr_merge, H5F_FS_MERGE_METADATA, sizeof(f->shared->fs_aggr_merge));
/* Allow merging raw data allocations together */
+ /* (treat global heaps as raw data) */
f->shared->fs_aggr_merge[H5FD_MEM_DRAW] = H5F_FS_MERGE_RAWDATA;
+ f->shared->fs_aggr_merge[H5FD_MEM_GHEAP] = H5F_FS_MERGE_RAWDATA;
break;
case H5MF_AGGR_MERGE_TOGETHER:
@@ -744,6 +750,7 @@ H5MF_try_extend(H5F_t *f, hid_t dxpl_id, H5FD_mem_t alloc_type, haddr_t addr,
hsize_t size, hsize_t extra_requested)
{
haddr_t end; /* End of block to extend */
+ H5FD_mem_t map_type; /* Mapped type */
htri_t ret_value; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -755,18 +762,21 @@ HDfprintf(stderr, "%s: Entering: alloc_type = %u, addr = %a, size = %Hu, extra_r
HDassert(f);
HDassert(H5F_INTENT(f) & H5F_ACC_RDWR);
+ /* Set mapped type, treating global heap as raw data */
+ map_type = (alloc_type == H5FD_MEM_GHEAP) ? H5FD_MEM_DRAW : alloc_type;
+
/* Compute end of block to extend */
end = addr + size;
/* Check if the block is exactly at the end of the file */
- if((ret_value = H5FD_try_extend(f->shared->lf, alloc_type, f, end, extra_requested)) < 0)
+ if((ret_value = H5FD_try_extend(f->shared->lf, map_type, f, end, extra_requested)) < 0)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTEXTEND, FAIL, "error extending file")
else if(ret_value == FALSE) {
H5F_blk_aggr_t *aggr; /* Aggregator to use */
/* Check for test block able to extend aggregation block */
- aggr = (alloc_type == H5FD_MEM_DRAW) ? &(f->shared->sdata_aggr) : &(f->shared->meta_aggr);
- if((ret_value = H5MF_aggr_try_extend(f, aggr, alloc_type, end, extra_requested)) < 0)
+ aggr = (map_type == H5FD_MEM_DRAW) ? &(f->shared->sdata_aggr) : &(f->shared->meta_aggr);
+ if((ret_value = H5MF_aggr_try_extend(f, aggr, map_type, end, extra_requested)) < 0)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTEXTEND, FAIL, "error extending aggregation block")
else if(ret_value == FALSE) {
H5FD_mem_t fs_type; /* Free space type (mapped from allocation type) */
diff --git a/src/H5MFaggr.c b/src/H5MFaggr.c
index 05a9241..6f68fd7 100644
--- a/src/H5MFaggr.c
+++ b/src/H5MFaggr.c
@@ -46,6 +46,7 @@
/******************/
/* Local Typedefs */
/******************/
+#define EXTEND_THRESHOLD .10
/********************/
@@ -108,14 +109,14 @@ HDfprintf(stderr, "%s: alloc_type = %u, size = %Hu\n", FUNC, (unsigned)alloc_typ
HDassert(size > 0);
/* Couldn't find anything from the free space manager, go allocate some */
- if(alloc_type != H5FD_MEM_DRAW) {
+ if(alloc_type != H5FD_MEM_DRAW && alloc_type != H5FD_MEM_GHEAP) {
/* Handle metadata differently from "raw" data */
if(HADDR_UNDEF == (ret_value = H5MF_aggr_alloc(f, dxpl_id, &(f->shared->meta_aggr), &(f->shared->sdata_aggr), alloc_type, size)))
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, HADDR_UNDEF, "can't allocate metadata")
} /* end if */
else {
- /* Allocate "raw" data */
- if(HADDR_UNDEF == (ret_value = H5MF_aggr_alloc(f, dxpl_id, &(f->shared->sdata_aggr), &(f->shared->meta_aggr), alloc_type, size)))
+ /* Allocate "raw" data: H5FD_MEM_DRAW and H5FD_MEM_GHEAP */
+ if(HADDR_UNDEF == (ret_value = H5MF_aggr_alloc(f, dxpl_id, &(f->shared->sdata_aggr), &(f->shared->meta_aggr), H5FD_MEM_DRAW, size)))
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, HADDR_UNDEF, "can't allocate raw data")
} /* end else */
@@ -242,7 +243,7 @@ HDfprintf(stderr, "%s: aggr = {%a, %Hu, %Hu}\n", FUNC, aggr->addr, aggr->tot_siz
} /* end if */
/* Allocate space from the VFD (i.e. at the end of the file) */
- if(HADDR_UNDEF == (ret_value = H5FD_alloc(f->shared->lf, dxpl_id, type, f, size, &eoa_frag_addr, &eoa_frag_size)))
+ if(HADDR_UNDEF == (ret_value = H5FD_alloc(f->shared->lf, dxpl_id, alloc_type, f, size, &eoa_frag_addr, &eoa_frag_size)))
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, HADDR_UNDEF, "can't allocate aggregation block")
} /* end else */
} /* end if */
@@ -307,12 +308,12 @@ HDfprintf(stderr, "%s: Allocating block\n", FUNC);
/* Freeing any possible fragment due to file allocation */
if(eoa_frag_size)
- if(H5MF_xfree(f, type, dxpl_id, eoa_frag_addr, eoa_frag_size) < 0)
+ if(H5MF_xfree(f, alloc_type, dxpl_id, eoa_frag_addr, eoa_frag_size) < 0)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, HADDR_UNDEF, "can't free eoa fragment")
/* Freeing any possible fragment due to alignment in the block after extension */
if(extended && aggr_frag_size)
- if(H5MF_xfree(f, type, dxpl_id, aggr_frag_addr, aggr_frag_size) < 0)
+ if(H5MF_xfree(f, alloc_type, dxpl_id, aggr_frag_addr, aggr_frag_size) < 0)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, HADDR_UNDEF, "can't free aggregation fragment")
} /* end if */
else {
@@ -323,7 +324,7 @@ HDfprintf(stderr, "%s: Allocating block\n", FUNC);
/* free any possible fragment */
if(aggr_frag_size)
- if(H5MF_xfree(f, type, dxpl_id, aggr_frag_addr, aggr_frag_size) < 0)
+ if(H5MF_xfree(f, alloc_type, dxpl_id, aggr_frag_addr, aggr_frag_size) < 0)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, HADDR_UNDEF, "can't free aggregation fragment")
} /* end else */
} /* end if */
@@ -364,6 +365,16 @@ HDfprintf(stderr, "%s: ret_value = %a\n", FUNC, ret_value);
* Purpose: Check if a block is inside an aggregator block and extend it
* if possible.
*
+ * Note:
+ * When the block to be extended adjoins the aggregator--
+ * 1) When the aggregator is at end of file:
+ * A) If the request is below the threshold, extend the block into the aggregator
+ * B) If the request is above the threshold,
+ * a) extend the aggregator by aggr->alloc_size or the extended amount
+ * b) extend the block into the aggregator
+ * 2) When the aggregator is not at end of file:
+ * Extended the block into the aggregator if it has enough space to satisfy the request
+ *
* Return: Success: TRUE(1) - Block was extended
* FALSE(0) - Block could not be extended
* Failure: FAIL
@@ -388,26 +399,56 @@ H5MF_aggr_try_extend(H5F_t *f, H5F_blk_aggr_t *aggr, H5FD_mem_t type,
/* Check if this aggregator is active */
if(f->shared->feature_flags & aggr->feature_flag) {
- /* If the block being tested adjoins the beginning of the aggregator
+ /*
+ * If the block being tested adjoins the beginning of the aggregator
* block, check if the aggregator can accomodate the extension.
*/
if(H5F_addr_eq(blk_end, aggr->addr)) {
- /* If the aggregator block is at the end of the file, extend the
- * file and "bubble" the aggregator up
- */
- if((ret_value = H5FD_try_extend(f->shared->lf, type, f, (aggr->addr + aggr->size), extra_requested)) < 0)
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTEXTEND, FAIL, "error extending file")
- else if(ret_value == TRUE) {
- /* Shift the aggregator block by the extra requested */
- aggr->addr += extra_requested;
-
- /* Add extra requested to the aggregator block's total amount allocated */
- aggr->tot_size += extra_requested;
- } /* end if */
- else {
- /* Check if the aggregator block has enough internal space to satisfy
- * extending the block.
- */
+ haddr_t eoa; /* EOA for the file */
+
+ /* Get the EOA for the file */
+ if(HADDR_UNDEF == (eoa = H5F_get_eoa(f, type)))
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "Unable to get eoa")
+
+ /* If the aggregator is at the end of file: */
+ if(H5F_addr_eq(eoa, aggr->addr + aggr->size)) {
+ /* If extra_requested is below percentage threshold, extend block into the aggregator. */
+ if(extra_requested <= (EXTEND_THRESHOLD * aggr->size)) {
+ aggr->size -= extra_requested;
+ aggr->addr += extra_requested;
+
+ /* Indicate success */
+ HGOTO_DONE(TRUE);
+ }
+ /*
+ * If extra_requested is above percentage threshold:
+ * 1) "bubble" up the aggregator by aggr->alloc_size or extra_requested
+ * 2) extend the block into the aggregator
+ */
+ else {
+ hsize_t extra = (extra_requested < aggr->alloc_size) ? aggr->alloc_size : extra_requested;
+
+ if((ret_value = H5FD_try_extend(f->shared->lf, type, f, (aggr->addr + aggr->size), extra)) < 0)
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTEXTEND, FAIL, "error extending file")
+ else if(ret_value == TRUE) {
+ /* Shift the aggregator block by the extra requested */
+ /* (allocates the space for the extra_requested) */
+ aggr->addr += extra_requested;
+
+ /* Add extra to the aggregator's total allocated amount */
+ aggr->tot_size += extra;
+
+ /* Account for any space added to the aggregator */
+ /* (either 0 (if extra_requested > aggr->alloc_size) or
+ * (aggr->alloc_size - extra_requested) -QAK
+ */
+ aggr->size += extra;
+ aggr->size -= extra_requested;
+ } /* end if */
+ } /* end if */
+ } /* end if */
+ else { /* The aggreator is not at end of file */
+ /* Check if aggregator has enough internal space to satisfy the extension. */
if(aggr->size >= extra_requested) {
/* Extend block into aggregator */
aggr->size -= extra_requested;
@@ -416,8 +457,8 @@ H5MF_aggr_try_extend(H5F_t *f, H5F_blk_aggr_t *aggr, H5FD_mem_t type,
/* Indicate success */
HGOTO_DONE(TRUE);
} /* end if */
- } /* end else */
- } /* end if */
+ } /* end else */
+ } /* end if */
} /* end if */
done:
@@ -462,7 +503,7 @@ H5MF_aggr_can_absorb(const H5F_t *f, const H5F_blk_aggr_t *aggr,
|| H5F_addr_eq((aggr->addr + aggr->size), sect->sect_info.addr)) {
#ifdef H5MF_AGGR_DEBUG
HDfprintf(stderr, "%s: section {%a, %Hu} adjoins aggr = {%a, %Hu}\n", "H5MF_aggr_can_absorb", sect->sect_info.addr, sect->sect_info.size, aggr->addr, aggr->size);
-#endif /* H5MF_AGGR_DBEUG */
+#endif /* H5MF_AGGR_DEBUG */
/* Check if aggregator would get too large and should be absorbed into section */
if((aggr->size + sect->sect_info.size) >= aggr->alloc_size)
*shrink = H5MF_SHRINK_SECT_ABSORB_AGGR;
@@ -510,9 +551,9 @@ H5MF_aggr_absorb(const H5F_t UNUSED *f, H5F_blk_aggr_t *aggr, H5MF_free_section_
if((aggr->size + sect->sect_info.size) >= aggr->alloc_size && allow_sect_absorb) {
/* Check if the section adjoins the beginning or end of the aggregator */
if(H5F_addr_eq((sect->sect_info.addr + sect->sect_info.size), aggr->addr)) {
-#ifdef H5MF_AGGR_DBEUG
+#ifdef H5MF_AGGR_DEBUG
HDfprintf(stderr, "%s: aggr {%a, %Hu} adjoins front of section = {%a, %Hu}\n", "H5MF_aggr_absorb", aggr->addr, aggr->size, sect->sect_info.addr, sect->sect_info.size);
-#endif /* H5MF_AGGR_DBEUG */
+#endif /* H5MF_AGGR_DEBUG */
/* Absorb aggregator onto end of section */
sect->sect_info.size += aggr->size;
} /* end if */
@@ -520,9 +561,9 @@ HDfprintf(stderr, "%s: aggr {%a, %Hu} adjoins front of section = {%a, %Hu}\n", "
/* Sanity check */
HDassert(H5F_addr_eq((aggr->addr + aggr->size), sect->sect_info.addr));
-#ifdef H5MF_AGGR_DBEUG
+#ifdef H5MF_AGGR_DEBUG
HDfprintf(stderr, "%s: aggr {%a, %Hu} adjoins end of section = {%a, %Hu}\n", "H5MF_aggr_absorb", aggr->addr, aggr->size, sect->sect_info.addr, sect->sect_info.size);
-#endif /* H5MF_AGGR_DBEUG */
+#endif /* H5MF_AGGR_DEBUG */
/* Absorb aggregator onto beginning of section */
sect->sect_info.addr -= aggr->size;
sect->sect_info.size += aggr->size;
@@ -536,9 +577,9 @@ HDfprintf(stderr, "%s: aggr {%a, %Hu} adjoins end of section = {%a, %Hu}\n", "H5
else {
/* Check if the section adjoins the beginning or end of the aggregator */
if(H5F_addr_eq((sect->sect_info.addr + sect->sect_info.size), aggr->addr)) {
-#ifdef H5MF_AGGR_DBEUG
+#ifdef H5MF_AGGR_DEBUG
HDfprintf(stderr, "%s: section {%a, %Hu} adjoins front of aggr = {%a, %Hu}\n", "H5MF_aggr_absorb", sect->sect_info.addr, sect->sect_info.size, aggr->addr, aggr->size);
-#endif /* H5MF_AGGR_DBEUG */
+#endif /* H5MF_AGGR_DEBUG */
/* Absorb section onto front of aggregator */
aggr->addr -= sect->sect_info.size;
aggr->size += sect->sect_info.size;
@@ -552,9 +593,9 @@ HDfprintf(stderr, "%s: section {%a, %Hu} adjoins front of aggr = {%a, %Hu}\n", "
/* Sanity check */
HDassert(H5F_addr_eq((aggr->addr + aggr->size), sect->sect_info.addr));
-#ifdef H5MF_AGGR_DBEUG
+#ifdef H5MF_AGGR_DEBUG
HDfprintf(stderr, "%s: section {%a, %Hu} adjoins end of aggr = {%a, %Hu}\n", "H5MF_aggr_absorb", sect->sect_info.addr, sect->sect_info.size, aggr->addr, aggr->size);
-#endif /* H5MF_AGGR_DBEUG */
+#endif /* H5MF_AGGR_DEBUG */
/* Absorb section onto end of aggregator */
aggr->size += sect->sect_info.size;
} /* end if */
@@ -637,9 +678,9 @@ H5MF_aggr_reset(H5F_t *f, hid_t dxpl_id, H5F_blk_aggr_t *aggr)
/* Retain aggregator info */
tmp_addr = aggr->addr;
tmp_size = aggr->size;
-#ifdef H5MF_AGGR_DBEUG
+#ifdef H5MF_AGGR_DEBUG
HDfprintf(stderr, "%s: tmp_addr = %a, tmp_size = %Hu\n", FUNC, tmp_addr, tmp_size);
-#endif /* H5MF_AGGR_DBEUG */
+#endif /* H5MF_AGGR_DEBUG */
/* Reset aggregator block information */
aggr->tot_size = 0;
diff --git a/src/H5config.h.in b/src/H5config.h.in
index 27d317c..b35d68e 100644
--- a/src/H5config.h.in
+++ b/src/H5config.h.in
@@ -408,8 +408,8 @@
/* Define if your system has window style path name. */
#undef HAVE_WINDOW_PATH
-/* Define to 1 if you have the <winsock.h> header file. */
-#undef HAVE_WINSOCK_H
+/* Define to 1 if you have the <winsock2.h> header file. */
+#undef HAVE_WINSOCK2_H
/* Define to 1 if you have the <zlib.h> header file. */
#undef HAVE_ZLIB_H