summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2006-08-26 07:26:07 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2006-08-26 07:26:07 (GMT)
commitf49a8d1afca48329120460f5092bcb3c37f773b0 (patch)
tree82c0d2a0656f639dded3794e4df7fdc238625488 /tools
parente9889fe2d30c46af826f791eba87a8ed816b60db (diff)
downloadhdf5-f49a8d1afca48329120460f5092bcb3c37f773b0.zip
hdf5-f49a8d1afca48329120460f5092bcb3c37f773b0.tar.gz
hdf5-f49a8d1afca48329120460f5092bcb3c37f773b0.tar.bz2
[svn-r12631] Description:
Refactor the file storage of "twig" nodes in the B-tree to allow them to store more records, increasing the average density of the B-tree 30-40%. Increase # of records in "insert lots" regression test to still create B-tree of depth 4 Update h5debug to interpret difference of 'branch' and 'twig' internal nodes in B-tree correctly. Tested on: FreeBSD/32 4.11 (sleipnir) Linux/32 2.4 (heping) Linux/64 2.4 (mir) Solaris/64 2.9 (shanti)
Diffstat (limited to 'tools')
-rw-r--r--tools/misc/h5debug.c61
1 files changed, 54 insertions, 7 deletions
diff --git a/tools/misc/h5debug.c b/tools/misc/h5debug.c
index bbeb1c2..ba7f64f 100644
--- a/tools/misc/h5debug.c
+++ b/tools/misc/h5debug.c
@@ -235,7 +235,7 @@ main(int argc, char *argv[])
HDexit(4);
} /* end switch */
- } else if(!HDmemcmp(sig, H5B2_INT_MAGIC, H5B2_SIZEOF_MAGIC)) {
+ } else if(!HDmemcmp(sig, H5B2_BRCH_MAGIC, H5B2_SIZEOF_MAGIC)) {
/*
* Debug a v2 B-tree. B-trees are debugged through the B-tree
* subclass. The subclass identifier is two bytes after the
@@ -245,31 +245,78 @@ main(int argc, char *argv[])
/* Check for enough valid parameters */
if(extra == 0 || extra2 == 0) {
- fprintf(stderr, "ERROR: Need v2 B-tree header address and number of records in order to dump internal node\n");
+ fprintf(stderr, "ERROR: Need v2 B-tree header address and number of records node in order to dump internal node\n");
fprintf(stderr, "v2 B-tree internal node usage:\n");
fprintf(stderr, "\th5debug <filename> <internal node address> <v2 B-tree header address> <number of records>\n");
HDexit(4);
} /* end if */
+ /* Note: a depth of '2' is used here because the actual depth isn't
+ * important, as long as it's > 1, to indicate a 'branch' internal
+ * node.
+ */
+ switch(subtype) {
+ case H5B2_TEST_ID:
+ status = H5B2_int_debug(f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL, H5B2_TEST, extra, (unsigned)extra2, (unsigned)2);
+ break;
+
+ case H5B2_FHEAP_HUGE_INDIR_ID:
+ status = H5B2_int_debug(f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL, H5HF_BT2_INDIR, extra, (unsigned)extra2, (unsigned)2);
+ break;
+
+ case H5B2_FHEAP_HUGE_FILT_INDIR_ID:
+ status = H5B2_int_debug(f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL, H5HF_BT2_FILT_INDIR, extra, (unsigned)extra2, (unsigned)2);
+ break;
+
+ case H5B2_FHEAP_HUGE_DIR_ID:
+ status = H5B2_int_debug(f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL, H5HF_BT2_DIR, extra, (unsigned)extra2, (unsigned)2);
+ break;
+
+ case H5B2_FHEAP_HUGE_FILT_DIR_ID:
+ status = H5B2_int_debug(f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL, H5HF_BT2_FILT_DIR, extra, (unsigned)extra2, (unsigned)2);
+ break;
+
+ default:
+ fprintf(stderr, "Unknown B-tree subtype %u\n", (unsigned)(subtype));
+ HDexit(4);
+ } /* end switch */
+
+ } else if(!HDmemcmp(sig, H5B2_TWIG_MAGIC, H5B2_SIZEOF_MAGIC)) {
+ /*
+ * Debug a v2 B-tree. B-trees are debugged through the B-tree
+ * subclass. The subclass identifier is two bytes after the
+ * B-tree signature.
+ */
+ H5B2_subid_t subtype = (H5B2_subid_t)sig[H5B2_SIZEOF_MAGIC+1];
+
+ /* Check for enough valid parameters */
+ if(extra == 0 || extra2 == 0) {
+ fprintf(stderr, "ERROR: Need v2 B-tree header address and number of records node in order to dump internal node\n");
+ fprintf(stderr, "v2 B-tree internal node usage:\n");
+ fprintf(stderr, "\th5debug <filename> <internal node address> <v2 B-tree header address> <number of records>\n");
+ HDexit(4);
+ } /* end if */
+
+ /* Note: a depth of '1' is used here to indicate a 'twig' internal node */
switch(subtype) {
case H5B2_TEST_ID:
- status = H5B2_int_debug(f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL, H5B2_TEST, extra, (unsigned)extra2);
+ status = H5B2_int_debug(f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL, H5B2_TEST, extra, (unsigned)extra2, (unsigned)1);
break;
case H5B2_FHEAP_HUGE_INDIR_ID:
- status = H5B2_int_debug(f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL, H5HF_BT2_INDIR, extra, (unsigned)extra2);
+ status = H5B2_int_debug(f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL, H5HF_BT2_INDIR, extra, (unsigned)extra2, (unsigned)1);
break;
case H5B2_FHEAP_HUGE_FILT_INDIR_ID:
- status = H5B2_int_debug(f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL, H5HF_BT2_FILT_INDIR, extra, (unsigned)extra2);
+ status = H5B2_int_debug(f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL, H5HF_BT2_FILT_INDIR, extra, (unsigned)extra2, (unsigned)1);
break;
case H5B2_FHEAP_HUGE_DIR_ID:
- status = H5B2_int_debug(f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL, H5HF_BT2_DIR, extra, (unsigned)extra2);
+ status = H5B2_int_debug(f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL, H5HF_BT2_DIR, extra, (unsigned)extra2, (unsigned)1);
break;
case H5B2_FHEAP_HUGE_FILT_DIR_ID:
- status = H5B2_int_debug(f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL, H5HF_BT2_FILT_DIR, extra, (unsigned)extra2);
+ status = H5B2_int_debug(f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL, H5HF_BT2_FILT_DIR, extra, (unsigned)extra2, (unsigned)1);
break;
default: