summaryrefslogtreecommitdiffstats
path: root/src/H5SM.c
diff options
context:
space:
mode:
authorVailin Choi <vchoi@hdfgroup.org>2007-07-13 21:12:25 (GMT)
committerVailin Choi <vchoi@hdfgroup.org>2007-07-13 21:12:25 (GMT)
commitd44b27ddcc66a8ed55f5069eabbf4c287ce1d99a (patch)
treeab22bfaa95add178894e6c649dc4b8aea0d196f4 /src/H5SM.c
parent31a2af29ca7aa91fcd47eb018a02ff2e425c5b55 (diff)
downloadhdf5-d44b27ddcc66a8ed55f5069eabbf4c287ce1d99a.zip
hdf5-d44b27ddcc66a8ed55f5069eabbf4c287ce1d99a.tar.gz
hdf5-d44b27ddcc66a8ed55f5069eabbf4c287ce1d99a.tar.bz2
[svn-r13978] purpose:
New feature. Description: Added routines to report on the amount of storage for: 1) 1.6 btree and heap storage info for groups 2) 1.8 btree, fractal heap storage info for groups, attributes and SOHM table 3) btree storage for chunked datasets 4) 1.8 superblock extension size. Platform tested: h5committested.
Diffstat (limited to 'src/H5SM.c')
-rwxr-xr-xsrc/H5SM.c65
1 files changed, 65 insertions, 0 deletions
diff --git a/src/H5SM.c b/src/H5SM.c
index 88b4b10..1ca4652 100755
--- a/src/H5SM.c
+++ b/src/H5SM.c
@@ -2474,3 +2474,68 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5SM_list_debug() */
+/*-------------------------------------------------------------------------
+ * Function: H5SM_ih_info
+ *
+ * Purpose: Loop through the master SOHM table (if there is one) to:
+ * 1. collect storage used for header
+ * 1. collect storage used for B-tree and List
+ * (include btree storage used by huge objects in fractal heap)
+ * 2. collect fractal heap storage
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Vailin Choi
+ * June 19, 2007
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5SM_ih_info(H5F_t *f, H5F_info_t *finfo, hid_t dxpl_id)
+{
+ H5SM_master_table_t *table=NULL; /* SOHM master table */
+ herr_t ret_value=SUCCEED; /* Return value */
+ unsigned x;
+ hsize_t huge_bt_size=0;
+
+
+ FUNC_ENTER_NOAPI(H5SM_ih_info, FAIL)
+
+ /* Sanity check */
+ HDassert(f);
+ HDassert(H5F_addr_defined(f->shared->sohm_addr));
+ HDassert(finfo);
+
+ /* Look up the master SOHM table */
+ if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, f->shared->sohm_addr, NULL, NULL, H5AC_READ)))
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, FAIL, "unable to load SOHM master table")
+
+ finfo->sohm.hdr_size = (hsize_t) H5SM_TABLE_SIZE(f) +
+ (hsize_t)(table->num_indexes * H5SM_INDEX_HEADER_SIZE(f));
+
+ for(x = 0; x < table->num_indexes; x++) {
+ if (table->indexes[x].index_type==H5SM_BTREE) {
+ if (H5F_addr_defined(table->indexes[x].index_addr)) {
+ if (H5B2_info_iterate(f, dxpl_id, H5SM_INDEX,
+ table->indexes[x].index_addr, &(finfo->sohm.msgs_info.index_size)) < 0)
+ HGOTO_ERROR(H5E_BTREE, H5E_CANTGET, FAIL, "can't retrieve B-tree storage info")
+ }
+ }
+ if (table->indexes[x].index_type==H5SM_LIST)
+ finfo->sohm.msgs_info.index_size += H5SM_LIST_SIZE(f, table->indexes[x].list_max);
+
+ huge_bt_size = 0;
+ if (H5F_addr_defined(table->indexes[x].heap_addr)) {
+ if (H5HF_fheap_info(f, dxpl_id, table->indexes[x].heap_addr, &(finfo->sohm.msgs_info.heap_size), &huge_bt_size) < 0)
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't retrieve fractal heap storage info")
+ }
+ finfo->sohm.msgs_info.index_size += huge_bt_size;
+ } /* end for */
+
+ /* Release resources */
+ if(table && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_TABLE, f->shared->sohm_addr, table, H5AC__NO_FLAGS_SET) < 0)
+ HDONE_ERROR(H5E_CACHE, H5E_CANTRELEASE, FAIL, "unable to close SOHM master table")
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5SM_ih_info() */