summaryrefslogtreecommitdiffstats
path: root/src/H5HFiblock.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2009-12-17 22:21:08 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2009-12-17 22:21:08 (GMT)
commit1bc07c6aaeadd03d73216af25db0cb46db2391e0 (patch)
tree79cfb25eaad5e610b1c10f9a21b27ec9c07685b0 /src/H5HFiblock.c
parentdf2fef9759940bf5d80e8aa5a8dcd1251d58d490 (diff)
parent77038a81755bd6c853323ba261c9c671800d7be7 (diff)
downloadhdf5-1bc07c6aaeadd03d73216af25db0cb46db2391e0.zip
hdf5-1bc07c6aaeadd03d73216af25db0cb46db2391e0.tar.gz
hdf5-1bc07c6aaeadd03d73216af25db0cb46db2391e0.tar.bz2
[svn-r18031] Description:
Bring r18030 from merge_metadata_journaling branch to trunk: Bring "brush clearing" changes (whitespace & style issues, mostly) from metadata_journaling branch to the "merging" branch, to converge the trunk and the metadata_journaling branch. Also, some other minor cleanups along the way. Tested on: FreeBSD/32 6.3 (duty) in debug mode FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x, w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x, w/C++ & FORTRAN, in production mode Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN, w/szip filter, in production mode Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN, in production mode Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode Mac OS X/32 10.6.2 (amazon) in debug mode Mac OS X/32 10.6.2 (amazon) w/C++ & FORTRAN, w/threadsafe, in production mode
Diffstat (limited to 'src/H5HFiblock.c')
-rw-r--r--src/H5HFiblock.c112
1 files changed, 1 insertions, 111 deletions
diff --git a/src/H5HFiblock.c b/src/H5HFiblock.c
index 8969aae..c6e22cc 100644
--- a/src/H5HFiblock.c
+++ b/src/H5HFiblock.c
@@ -239,10 +239,6 @@ H5HF_iblock_incr(H5HF_indirect_t *iblock)
/* Increment reference count on shared indirect block */
iblock->rc++;
-#ifdef QAK
-HDfprintf(stderr, "%s: iblock->addr = %a, iblock->rc = %Zu\n", FUNC, iblock->addr, iblock->rc);
-HDfprintf(stderr, "%s: iblock->block_off = %Hu\n", FUNC, iblock->block_off);
-#endif /* QAK */
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -274,23 +270,13 @@ H5HF_iblock_decr(H5HF_indirect_t *iblock)
/* Decrement reference count on shared indirect block */
iblock->rc--;
-#ifdef QAK
-HDfprintf(stderr, "%s: iblock->addr = %a, iblock->rc = %Zu\n", FUNC, iblock->addr, iblock->rc);
-HDfprintf(stderr, "%s: iblock->block_off = %Hu\n", FUNC, iblock->block_off);
-#endif /* QAK */
/* Mark block as evictable again when no child blocks depend on it */
if(iblock->rc == 0) {
-#ifdef QAK
-HDfprintf(stderr, "%s: indirect block ref. count at zero, iblock->addr = %a\n", FUNC, iblock->addr);
-#endif /* QAK */
if(H5HF_iblock_unpin(iblock) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPIN, FAIL, "unable to unpin fractal heap indirect block")
if(iblock->nchildren == 0) {
-#ifdef QAK
-HDfprintf(stderr, "%s: Removing indirect block from cache, iblock->addr = %a\n", FUNC, iblock->addr);
-#endif /* QAK */
/* Check for deleting root indirect block (and no root direct block) */
if(iblock->block_off == 0 && iblock->hdr->man_dtable.curr_root_rows > 0) {
/* Reset root pointer information */
@@ -341,9 +327,6 @@ H5HF_iblock_dirty(H5HF_indirect_t *iblock)
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT(H5HF_iblock_dirty)
-#ifdef QAK
-HDfprintf(stderr, "%s: Marking indirect block as dirty\n", FUNC);
-#endif /* QAK */
/* Sanity check */
HDassert(iblock);
@@ -384,10 +367,6 @@ H5HF_man_iblock_root_create(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t min_dblock_si
FUNC_ENTER_NOAPI_NOINIT(H5HF_man_iblock_root_create)
-#ifdef QAK
-HDfprintf(stderr, "%s: Creating root indirect block\n", FUNC);
-#endif /* QAK */
-
/* Check for allocating entire root indirect block initially */
if(hdr->man_dtable.cparam.start_root_rows == 0)
nrows = hdr->man_dtable.max_root_rows;
@@ -404,16 +383,10 @@ HDfprintf(stderr, "%s: Creating root indirect block\n", FUNC);
if(nrows < rows_needed)
nrows = rows_needed;
} /* end else */
-#ifdef QAK
-HDfprintf(stderr, "%s: nrows = %u\n", FUNC, nrows);
-#endif /* QAK */
/* Allocate root indirect block */
if(H5HF_man_iblock_create(hdr, dxpl_id, NULL, 0, nrows, hdr->man_dtable.max_root_rows, &iblock_addr) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, FAIL, "can't allocate fractal heap indirect block")
-#ifdef QAK
-HDfprintf(stderr, "%s: iblock_addr = %a\n", FUNC, iblock_addr);
-#endif /* QAK */
/* Move current direct block (used as root) into new indirect block */
@@ -423,9 +396,6 @@ HDfprintf(stderr, "%s: iblock_addr = %a\n", FUNC, iblock_addr);
/* Check if there's already a direct block as root) */
have_direct_block = H5F_addr_defined(hdr->man_dtable.table_addr);
-#ifdef QAK
-HDfprintf(stderr, "%s: have_direct_block = %u\n", FUNC, (unsigned)have_direct_block);
-#endif /* QAK */
if(have_direct_block) {
H5HF_direct_t *dblock; /* Pointer to direct block to query */
@@ -527,14 +497,10 @@ H5HF_man_iblock_root_double(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t min_dblock_si
unsigned new_nrows; /* New # of rows */
hbool_t skip_direct_rows = FALSE; /* Whether we are skipping direct rows */
size_t u; /* Local index variable */
- herr_t ret_value = SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT(H5HF_man_iblock_root_double)
-#ifdef QAK
-HDfprintf(stderr, "%s: Extending root indirect block, min_dblock_size = %Zu\n", FUNC, min_dblock_size);
-#endif /* QAK */
-
/* Get "new block" iterator information */
if(H5HF_man_iter_curr(&hdr->next_block, &next_row, NULL, &next_entry, &iblock) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "unable to retrieve current block iterator location")
@@ -542,19 +508,10 @@ HDfprintf(stderr, "%s: Extending root indirect block, min_dblock_size = %Zu\n",
/* Make certain the iterator is at the root indirect block */
HDassert(iblock->parent == NULL);
-#ifdef QAK
-HDfprintf(stderr, "%s: iblock->block_off = %Hu\n", FUNC, iblock->block_off);
-#endif /* QAK */
HDassert(iblock->block_off == 0);
/* Keep this for later */
old_nrows = iblock->nrows;
-#ifdef QAK
-HDfprintf(stderr, "%s: old_nrows = %u\n", FUNC, old_nrows);
-HDfprintf(stderr, "%s: next_entry = %u\n", FUNC, next_entry);
-HDfprintf(stderr, "%s: next_row = %u\n", FUNC, next_row);
-HDfprintf(stderr, "%s: next_size = %Hu\n", FUNC, next_size);
-#endif /* QAK */
/* Check for skipping over direct block rows */
if(iblock->nrows < hdr->man_dtable.max_direct_rows && min_dblock_size > next_size) {
@@ -573,11 +530,6 @@ HDfprintf(stderr, "%s: next_size = %Hu\n", FUNC, next_size);
/* Compute new # of rows in indirect block */
new_nrows = MAX(min_nrows, MIN(2 * iblock->nrows, iblock->max_rows));
-#ifdef QAK
-HDfprintf(stderr, "%s: min_nrows = %u, new_nrows = %u\n", FUNC, min_nrows, new_nrows);
-HDfprintf(stderr, "%s: iblock->nrows = %u, iblock->max_rows = %u\n", FUNC, iblock->nrows, iblock->max_rows);
-HDfprintf(stderr, "%s: new_next_entry = %u\n", FUNC, new_next_entry);
-#endif /* QAK */
/* Check if the indirect block is NOT currently allocated in temp. file space */
/* (temp. file space does not need to be freed) */
@@ -609,9 +561,6 @@ HDfprintf(stderr, "%s: new_next_entry = %u\n", FUNC, new_next_entry);
if(HADDR_UNDEF == (new_addr = H5MF_alloc(hdr->f, H5FD_MEM_FHEAP_IBLOCK, dxpl_id, (hsize_t)iblock->size)))
HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, FAIL, "file allocation failed for fractal heap indirect block")
} /* end else */
-#ifdef QAK
-HDfprintf(stderr, "%s: Check 1.0 - iblock->addr = %a, new_addr = %a\n", FUNC, iblock->addr, new_addr);
-#endif /* QAK */
/* Move object in cache, if it actually was relocated */
if(H5F_addr_ne(iblock->addr, new_addr)) {
@@ -691,11 +640,6 @@ HDfprintf(stderr, "%s: Check 1.0 - iblock->addr = %a, new_addr = %a\n", FUNC, ib
hdr->man_dtable.table_addr = new_addr;
/* Extend heap to cover new root indirect block */
-#ifdef QAK
-HDfprintf(stderr, "%s: hdr->man_dtable.row_block_off[new_nrows - 1] = %Hu\n", FUNC, hdr->man_dtable.row_block_off[new_nrows - 1]);
-HDfprintf(stderr, "%s: hdr->man_dtable.row_block_off[new_nrows] = %Hu\n", FUNC, hdr->man_dtable.row_block_off[new_nrows]);
-HDfprintf(stderr, "%s: acc_dblock_free = %Hu\n", FUNC, acc_dblock_free);
-#endif /* QAK */
if(H5HF_hdr_adjust_heap(hdr, 2 * hdr->man_dtable.row_block_off[new_nrows - 1], (hssize_t)acc_dblock_free) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTEXTEND, FAIL, "can't increase space to cover root direct block")
@@ -736,19 +680,11 @@ H5HF_man_iblock_root_halve(H5HF_indirect_t *iblock, hid_t dxpl_id)
HDassert(iblock->parent == NULL);
HDassert(hdr);
-#ifdef QAK
-HDfprintf(stderr, "%s: Reducing root indirect block\n", FUNC);
-#endif /* QAK */
-
/* Compute maximum row used by child of indirect block */
max_child_row = iblock->max_child / hdr->man_dtable.cparam.width;
/* Compute new # of rows in root indirect block */
new_nrows = 1 << (1 + H5V_log2_gen((uint64_t)max_child_row));
-#ifdef QAK
-HDfprintf(stderr, "%s: new_nrows = %u\n", FUNC, new_nrows);
-HDfprintf(stderr, "%s: iblock->nrows = %u\n", FUNC, iblock->nrows);
-#endif /* QAK */
/* Check if the indirect block is NOT currently allocated in temp. file space */
/* (temp. file space does not need to be freed) */
@@ -786,9 +722,6 @@ HDfprintf(stderr, "%s: iblock->nrows = %u\n", FUNC, iblock->nrows);
if(HADDR_UNDEF == (new_addr = H5MF_alloc(hdr->f, H5FD_MEM_FHEAP_IBLOCK, dxpl_id, (hsize_t)iblock->size)))
HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, FAIL, "file allocation failed for fractal heap indirect block")
} /* end else */
-#ifdef QAK
-HDfprintf(stderr, "%s: new_addr = %a\n", FUNC, new_addr);
-#endif /* QAK */
/* Move object in cache, if it actually was relocated */
if(H5F_addr_ne(iblock->addr, new_addr)) {
@@ -834,11 +767,6 @@ HDfprintf(stderr, "%s: new_addr = %a\n", FUNC, new_addr);
hdr->man_dtable.table_addr = new_addr;
/* Shrink heap to only cover new root indirect block */
-#ifdef QAK
-HDfprintf(stderr, "%s: hdr->man_dtable.row_block_off[new_nrows - 1] = %Hu\n", FUNC, hdr->man_dtable.row_block_off[new_nrows - 1]);
-HDfprintf(stderr, "%s: hdr->man_dtable.row_block_off[new_nrows] = %Hu\n", FUNC, hdr->man_dtable.row_block_off[new_nrows]);
-HDfprintf(stderr, "%s: acc_dblock_free = %Hu\n", FUNC, acc_dblock_free);
-#endif /* QAK */
if(H5HF_hdr_adjust_heap(hdr, 2 * hdr->man_dtable.row_block_off[new_nrows - 1], -(hssize_t)acc_dblock_free) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTSHRINK, FAIL, "can't reduce space to cover root direct block")
@@ -879,10 +807,6 @@ H5HF_man_iblock_root_revert(H5HF_indirect_t *root_iblock, hid_t dxpl_id)
*/
HDassert(root_iblock);
-#ifdef QAK
-HDfprintf(stderr, "%s: Reverting root indirect block\n", FUNC);
-#endif /* QAK */
-
/* Set up local convenience variables */
hdr = root_iblock->hdr;
dblock_addr = root_iblock->ents[0].addr;
@@ -972,13 +896,6 @@ H5HF_man_iblock_alloc_row(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t **
if(NULL == (iblock = H5HF_sect_row_get_iblock(old_sec_node)))
HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't retrieve indirect block for row section")
-#ifdef QAK
-HDfprintf(stderr, "%s: iblock->addr = %a\n", FUNC, iblock->addr);
-HDfprintf(stderr, "%s: iblock->block_off = %Hu\n", FUNC, iblock->block_off);
-HDfprintf(stderr, "%s: iblock->parent = %p\n", FUNC, iblock->parent);
-HDfprintf(stderr, "%s: iblock->rc = %Zu\n", FUNC, iblock->rc);
-#endif /* QAK */
-
/* Hold indirect block in memory, until direct block can point to it */
if(H5HF_iblock_incr(iblock) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, FAIL, "can't increment reference count on shared indirect block")
@@ -989,9 +906,6 @@ HDfprintf(stderr, "%s: iblock->rc = %Zu\n", FUNC, iblock->rc);
HGOTO_ERROR(H5E_HEAP, H5E_CANTSHRINK, FAIL, "can't reduce row section node")
/* Create direct block & single section */
-#ifdef QAK
-HDfprintf(stderr, "%s: Allocating direct block, dblock_entry = %u\n", FUNC, dblock_entry);
-#endif /* QAK */
if(H5HF_man_dblock_create(dxpl_id, hdr, iblock, dblock_entry, NULL, sec_node) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, FAIL, "can't allocate fractal heap direct block")
@@ -1049,9 +963,6 @@ H5HF_man_iblock_create(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_indirect_t *par_iblo
if(H5HF_hdr_incr(hdr) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, FAIL, "can't increment reference count on shared heap header")
-#ifdef QAK
-HDfprintf(stderr, "%s: nrows = %u, max_rows = %u\n", FUNC, nrows, max_rows);
-#endif /* QAK */
/* Set info for direct block */
iblock->rc = 0;
iblock->nrows = nrows;
@@ -1074,9 +985,6 @@ HDfprintf(stderr, "%s: nrows = %u, max_rows = %u\n", FUNC, nrows, max_rows);
/* Compute the number of direct rows for this indirect block */
dir_rows = MIN(iblock->nrows, hdr->man_dtable.max_direct_rows);
-#ifdef QAK
-HDfprintf(stderr, "%s: dir_rows = %u\n", FUNC, dir_rows);
-#endif /* QAK */
/* Allocate & initialize indirect block filtered entry array */
if(NULL == (iblock->filt_ents = H5FL_SEQ_CALLOC(H5HF_indirect_filt_ent_t, (size_t)(dir_rows * hdr->man_dtable.cparam.width))))
@@ -1168,9 +1076,6 @@ H5HF_man_iblock_protect(H5HF_hdr_t *hdr, hid_t dxpl_id, haddr_t iblock_addr,
H5HF_indirect_t *ret_value; /* Return value */
FUNC_ENTER_NOAPI_NOINIT(H5HF_man_iblock_protect)
-#ifdef QAK
-HDfprintf(stderr, "%s: iblock_addr = %a, iblock_nrows = %u\n", FUNC, iblock_addr, iblock_nrows);
-#endif /* QAK */
/*
* Check arguments.
@@ -1296,10 +1201,6 @@ H5HF_man_iblock_attach(H5HF_indirect_t *iblock, unsigned entry, haddr_t child_ad
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT(H5HF_man_iblock_attach)
-#ifdef QAK
-HDfprintf(stderr, "%s: iblock = %p, entry = %u, child_addr = %a\n", FUNC, iblock, entry, child_addr);
-HDfprintf(stderr, "%s: iblock->block_off = %Hu, iblock->nchildren = %u\n", FUNC, iblock->block_off, iblock->nchildren);
-#endif /* QAK */
/*
* Check arguments.
@@ -1365,10 +1266,6 @@ H5HF_man_iblock_detach(H5HF_indirect_t *iblock, hid_t dxpl_id, unsigned entry)
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT(H5HF_man_iblock_detach)
-#ifdef QAK
-HDfprintf(stderr, "%s: iblock = %p, entry = %u\n", FUNC, iblock, entry);
-HDfprintf(stderr, "%s: iblock->block_off = %Hu, iblock->nchildren = %u\n", FUNC, iblock->block_off, iblock->nchildren);
-#endif /* QAK */
/*
* Check arguments.
@@ -1449,10 +1346,6 @@ HDfprintf(stderr, "%s: iblock->block_off = %Hu, iblock->nchildren = %u\n", FUNC,
HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't decrement reference count on shared indirect block")
done:
-#ifdef QAK
-HDfprintf(stderr, "%s: Leaving, ret_value = %d\n", FUNC, ret_value);
-HDfprintf(stderr, "%s: iblock->block_off = %Hu, iblock->nchildren = %u\n", FUNC, iblock->block_off, iblock->nchildren);
-#endif /* QAK */
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5HF_man_iblock_detach() */
@@ -1517,9 +1410,6 @@ H5HF_man_iblock_delete(H5HF_hdr_t *hdr, hid_t dxpl_id, haddr_t iblock_addr,
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT(H5HF_man_iblock_delete)
-#ifdef QAK
-HDfprintf(stderr, "%s: iblock_addr = %a, iblock_nrows = %u\n", FUNC, iblock_addr, iblock_nrows);
-#endif /* QAK */
/*
* Check arguments.