summaryrefslogtreecommitdiffstats
path: root/src/H5EAcache.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2009-01-31 18:12:20 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2009-01-31 18:12:20 (GMT)
commit940f64156bb08c8875dd18ecb96e9a58f3c8ad82 (patch)
treefaff172323e140a2446f90e935589708f9bd0830 /src/H5EAcache.c
parent9146841b9edd9681dde762985ca595fe8f2800fd (diff)
downloadhdf5-940f64156bb08c8875dd18ecb96e9a58f3c8ad82.zip
hdf5-940f64156bb08c8875dd18ecb96e9a58f3c8ad82.tar.gz
hdf5-940f64156bb08c8875dd18ecb96e9a58f3c8ad82.tar.bz2
[svn-r16391] Description:
Add more metadata statistics to extensible array header. Tested on: FreeBSD 6.3 (duty) (too minor to require h5committest)
Diffstat (limited to 'src/H5EAcache.c')
-rw-r--r--src/H5EAcache.c30
1 files changed, 28 insertions, 2 deletions
diff --git a/src/H5EAcache.c b/src/H5EAcache.c
index bf2bf43..286c6a5 100644
--- a/src/H5EAcache.c
+++ b/src/H5EAcache.c
@@ -254,14 +254,38 @@ H5EA__cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *_cls,
hdr->cparam.max_dblk_page_nelmts_bits = *p++; /* Log2(Max. # of elements in data block page) - i.e. # of bits needed to store max. # of elements in data block page */
/* Array statistics */
- H5F_DECODE_LENGTH(f, p, hdr->stats.max_idx_set); /* Max. index set (+1) */
+ hdr->stats.hdr_size = size; /* Size of header in file */
H5F_DECODE_LENGTH(f, p, hdr->stats.nsuper_blks); /* Number of super blocks created */
+ H5F_DECODE_LENGTH(f, p, hdr->stats.super_blk_size); /* Size of super blocks created */
H5F_DECODE_LENGTH(f, p, hdr->stats.ndata_blks); /* Number of data blocks created */
+ H5F_DECODE_LENGTH(f, p, hdr->stats.data_blk_size); /* Size of data blocks created */
+ H5F_DECODE_LENGTH(f, p, hdr->stats.max_idx_set); /* Max. index set (+1) */
H5F_DECODE_LENGTH(f, p, hdr->stats.nelmts); /* Number of elements 'realized' */
/* Internal information */
H5F_addr_decode(f, &p, &hdr->idx_blk_addr); /* Address of index block */
+ /* Index block statistics */
+ if(H5F_addr_defined(hdr->idx_blk_addr)) {
+ H5EA_iblock_t iblock; /* Fake index block for computing size */
+
+ /* Set index block count for file */
+ hdr->stats.nindex_blks = 1;
+
+ /* Set up fake index block for computing size on disk */
+ iblock.hdr = hdr;
+ iblock.nsblks = H5EA_SBLK_FIRST_IDX(hdr->cparam.sup_blk_min_data_ptrs);
+ iblock.ndblk_addrs = 2 * ((size_t)hdr->cparam.sup_blk_min_data_ptrs - 1);
+ iblock.nsblk_addrs = hdr->nsblks - iblock.nsblks;
+
+ /* Compute size of index block in file */
+ hdr->stats.index_blk_size = H5EA_IBLOCK_SIZE(&iblock);
+ } /* end if */
+ else {
+ hdr->stats.nindex_blks = 0; /* Number of index blocks in file */
+ hdr->stats.index_blk_size = 0; /* Size of index blocks in file */
+ } /* end else */
+
/* Sanity check */
/* (allow for checksum not decoded yet) */
HDassert((size_t)(p - buf) == (size - H5EA_SIZEOF_CHKSUM));
@@ -365,9 +389,11 @@ H5EA__cache_hdr_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr,
*p++ = hdr->cparam.max_dblk_page_nelmts_bits; /* Log2(Max. # of elements in data block page) - i.e. # of bits needed to store max. # of elements in data block page */
/* Array statistics */
- H5F_ENCODE_LENGTH(f, p, hdr->stats.max_idx_set); /* Max. index set (+1) */
H5F_ENCODE_LENGTH(f, p, hdr->stats.nsuper_blks); /* Number of super blocks created */
+ H5F_ENCODE_LENGTH(f, p, hdr->stats.super_blk_size); /* Size of super blocks created */
H5F_ENCODE_LENGTH(f, p, hdr->stats.ndata_blks); /* Number of data blocks created */
+ H5F_ENCODE_LENGTH(f, p, hdr->stats.data_blk_size); /* Size of data blocks created */
+ H5F_ENCODE_LENGTH(f, p, hdr->stats.max_idx_set); /* Max. index set (+1) */
H5F_ENCODE_LENGTH(f, p, hdr->stats.nelmts); /* Number of elements 'realized' */
/* Internal information */