summaryrefslogtreecommitdiffstats
path: root/src/H5FAdbg.c
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2012-09-25 21:29:40 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2012-09-25 21:29:40 (GMT)
commit6edac6e2df7e30807bd41b09765a44c37d1f1bc1 (patch)
treee8d12cb7a41969177179ef7257199862cbe7fd56 /src/H5FAdbg.c
parent6de27c149724322135ad1049e55d2b3f6245a4d7 (diff)
downloadhdf5-6edac6e2df7e30807bd41b09765a44c37d1f1bc1.zip
hdf5-6edac6e2df7e30807bd41b09765a44c37d1f1bc1.tar.gz
hdf5-6edac6e2df7e30807bd41b09765a44c37d1f1bc1.tar.bz2
[svn-r22812] Purpose:
Mainly to add SWMR flush dependencies to the free space manager (H5FS) code. Also fixes a few issues with the local heap and the fixed array code, and brings the MANIFEST up to date. Tested on: jam
Diffstat (limited to 'src/H5FAdbg.c')
-rw-r--r--src/H5FAdbg.c160
1 files changed, 79 insertions, 81 deletions
diff --git a/src/H5FAdbg.c b/src/H5FAdbg.c
index 9bb90af..4995007 100644
--- a/src/H5FAdbg.c
+++ b/src/H5FAdbg.c
@@ -15,9 +15,9 @@
/*-------------------------------------------------------------------------
*
- * Created: H5FAdbg.c
+ * Created: H5FAdbg.c
*
- * Purpose: Dump debugging information about a fixed array.
+ * Purpose: Dump debugging information about a fixed array.
*
*-------------------------------------------------------------------------
*/
@@ -37,11 +37,11 @@
/***********/
/* Headers */
/***********/
-#include "H5private.h" /* Generic Functions */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5FApkg.h" /* Fixed Arrays */
-#include "H5Oprivate.h" /* Object Header */
-#include "H5Vprivate.h" /* Vector functions */
+#include "H5private.h" /* Generic Functions */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5FApkg.h" /* Fixed Arrays */
+#include "H5Oprivate.h" /* Object Header */
+#include "H5Vprivate.h" /* Vector functions */
/****************/
@@ -80,13 +80,13 @@
/*-------------------------------------------------------------------------
- * Function: H5FA__hdr_debug
+ * Function: H5FA__hdr_debug
*
- * Purpose: Prints debugging info about a fixed array header.
+ * Purpose: Prints debugging info about a fixed array header.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: SUCCEED/FAIL
*
- * Programmer: Vailin Choi
+ * Programmer: Vailin Choi
* Thursday, April 30, 2009
*
*-------------------------------------------------------------------------
@@ -97,8 +97,8 @@ H5FA__hdr_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent,
int fwidth, const H5FA_class_t *cls, haddr_t obj_addr))
/* Local variables */
- H5FA_hdr_t *hdr = NULL; /* Shared fixed array header */
- void *dbg_ctx = NULL; /* Fixed array debugging context */
+ H5FA_hdr_t *hdr = NULL; /* Shared fixed array header */
+ void *dbg_ctx = NULL; /* Fixed array debugging context */
/* Check arguments */
HDassert(f);
@@ -113,58 +113,58 @@ H5FA__hdr_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent,
if(cls->crt_dbg_ctx) {
/* Create debugging context */
if(NULL == (dbg_ctx = cls->crt_dbg_ctx(f, dxpl_id, obj_addr)))
- H5E_THROW(H5E_CANTGET, "unable to create fixed array debugging context")
+ H5E_THROW(H5E_CANTGET, "unable to create fixed array debugging context")
} /* end if */
/* Load the fixed array header */
if(NULL == (hdr = (H5FA_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_FARRAY_HDR, addr, dbg_ctx, H5AC_READ)))
- H5E_THROW(H5E_CANTPROTECT, "unable to load fixed array header")
+ H5E_THROW(H5E_CANTPROTECT, "unable to load fixed array header")
/* Print opening message */
HDfprintf(stream, "%*sFixed Array Header...\n", indent, "");
/* Print the values */
HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
- "Array class ID:", hdr->cparam.cls->name);
+ "Array class ID:", hdr->cparam.cls->name);
HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth,
- "Header size:",
- hdr->size);
+ "Header size:",
+ hdr->size);
HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth,
- "Raw Element Size:",
- (unsigned)hdr->cparam.raw_elmt_size);
+ "Raw Element Size:",
+ (unsigned)hdr->cparam.raw_elmt_size);
HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth,
- "Native Element Size (on this platform):",
- hdr->cparam.cls->nat_elmt_size);
+ "Native Element Size (on this platform):",
+ hdr->cparam.cls->nat_elmt_size);
HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth,
- "Max. # of elements in data block page:",
- (unsigned)((size_t)1 << hdr->cparam.max_dblk_page_nelmts_bits));
+ "Max. # of elements in data block page:",
+ (unsigned)((size_t)1 << hdr->cparam.max_dblk_page_nelmts_bits));
HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth,
- "Number of elements in Fixed Array:", hdr->stats.nelmts);
+ "Number of elements in Fixed Array:", hdr->stats.nelmts);
HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth,
- "Fixed Array Data Block Address:", hdr->dblk_addr);
+ "Fixed Array Data Block Address:", hdr->dblk_addr);
CATCH
if(dbg_ctx && cls->dst_dbg_ctx(dbg_ctx) < 0)
- H5E_THROW(H5E_CANTRELEASE, "unable to release fixed array debugging context")
+ H5E_THROW(H5E_CANTRELEASE, "unable to release fixed array debugging context")
if(hdr && H5AC_unprotect(f, dxpl_id, H5AC_FARRAY_HDR, addr, hdr, H5AC__NO_FLAGS_SET) < 0)
- H5E_THROW(H5E_CANTUNPROTECT, "unable to release fixed array header")
+ H5E_THROW(H5E_CANTUNPROTECT, "unable to release fixed array header")
END_FUNC(PKG) /* end H5FA__hdr_debug() */
/*-------------------------------------------------------------------------
- * Function: H5FA__dblock_debug
+ * Function: H5FA__dblock_debug
*
- * Purpose: Prints debugging info about a fixed array data block.
+ * Purpose: Prints debugging info about a fixed array data block.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: SUCCEED/FAIL
*
- * Programmer: Vailin Choi
+ * Programmer: Vailin Choi
* Thursday, April 30, 2009
*
*-------------------------------------------------------------------------
@@ -177,7 +177,7 @@ H5FA__dblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int inde
/* Local variables */
H5FA_hdr_t *hdr = NULL; /* Shared fixed array header */
H5FA_dblock_t *dblock = NULL; /* Fixed array data block */
- void *dbg_ctx = NULL; /* Fixed array context */
+ void *dbg_ctx = NULL; /* Fixed array context */
size_t u; /* Local index variable */
/* Check arguments */
@@ -194,12 +194,12 @@ H5FA__dblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int inde
if(cls->crt_dbg_ctx) {
/* Create debugging context */
if(NULL == (dbg_ctx = cls->crt_dbg_ctx(f, dxpl_id, obj_addr)))
- H5E_THROW(H5E_CANTGET, "unable to create fixed array debugging context")
+ H5E_THROW(H5E_CANTGET, "unable to create fixed array debugging context")
} /* end if */
/* Load the fixed array header */
if(NULL == (hdr = (H5FA_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_FARRAY_HDR, hdr_addr, dbg_ctx, H5AC_READ)))
- H5E_THROW(H5E_CANTPROTECT, "unable to load fixed array header")
+ H5E_THROW(H5E_CANTPROTECT, "unable to load fixed array header")
/* Protect data block */
if(NULL == (dblock = H5FA__dblock_protect(hdr, dxpl_id, addr, hdr->cparam.nelmts, H5AC_READ)))
@@ -210,78 +210,76 @@ H5FA__dblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int inde
/* Print the values */
HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
- "Array class ID:", hdr->cparam.cls->name);
+ "Array class ID:", hdr->cparam.cls->name);
HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, "Address of Data Block:", dblock->addr);
HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth, "Data Block size:", dblock->size);
HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth,
- "Number of elements in Data Block:", hdr->cparam.nelmts);
+ "Number of elements in Data Block:", hdr->cparam.nelmts);
HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth,
- "Number of pages in Data Block:", dblock->npages);
+ "Number of pages in Data Block:", dblock->npages);
HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth,
- "Number of elements per Data Block page:", dblock->dblk_page_nelmts);
+ "Number of elements per Data Block page:", dblock->dblk_page_nelmts);
if(dblock->npages) { /* paging */
- size_t dblk_page_nelmts; /* # of elements in a data block page */
+ size_t dblk_page_nelmts; /* # of elements in a data block page */
haddr_t dblk_page_addr; /* Address of a data block page */
size_t page_idx; /* Page index within data block */
- HDfprintf(stream, "%*sPaging:\n", indent, "");
+ HDfprintf(stream, "%*sPaging:\n", indent, "");
- /* Iterate over the pages */
- dblk_page_addr = dblock->addr + H5FA_DBLOCK_PREFIX_SIZE(dblock);
- dblk_page_nelmts = dblock->dblk_page_nelmts;
+ /* Iterate over the pages */
+ dblk_page_addr = dblock->addr + H5FA_DBLOCK_PREFIX_SIZE(dblock);
+ dblk_page_nelmts = dblock->dblk_page_nelmts;
- /* Read and print each page's elements in the data block */
- for(page_idx = 0; page_idx < dblock->npages; page_idx++) {
- if(!H5V_bit_get(dblock->dblk_page_init, page_idx)) {
- HDfprintf(stream, "%*s%-*s %Hu %s\n", indent, "", fwidth,
- "Page %Zu:", page_idx, "empty");
+ /* Read and print each page's elements in the data block */
+ for(page_idx = 0; page_idx < dblock->npages; page_idx++) {
+ if(!H5V_bit_get(dblock->dblk_page_init, page_idx)) {
+ HDfprintf(stream, "%*s%-*s %Hu %s\n", indent, "", fwidth,
+ "Page %Zu:", page_idx, "empty");
- } /* end if */
+ } /* end if */
else { /* get the page */
H5FA_dblk_page_t *dblk_page; /* Pointer to a data block page */
- hsize_t nelmts_left; /* Remaining elements in the last data block page */
+ hsize_t nelmts_left; /* Remaining elements in the last data block page */
/* Check for last page */
- if(((page_idx + 1) == dblock->npages) && (nelmts_left = hdr->cparam.nelmts % dblock->dblk_page_nelmts))
- dblk_page_nelmts = (size_t)nelmts_left;
-
- if(NULL == (dblk_page = H5FA__dblk_page_protect(hdr, dxpl_id, dblk_page_addr, dblk_page_nelmts, H5AC_READ)))
- H5E_THROW(H5E_CANTPROTECT, "unable to protect fixed array data block page, address = %llu", (unsigned long long)dblk_page_addr)
-
- HDfprintf(stream, "%*sElements in page %Zu:\n", indent, "", page_idx);
- for(u = 0; u < dblk_page_nelmts; u++) {
- /* Call the class's 'debug' callback */
- if((hdr->cparam.cls->debug)(stream, (indent + 3), MAX(0, (fwidth - 3)), (hsize_t)u,
- ((uint8_t *)dblk_page->elmts) + (hdr->cparam.cls->nat_elmt_size * u)) < 0)
- H5E_THROW(H5E_CANTGET, "can't get element for debugging")
- } /* end for */
- if(H5FA__dblk_page_unprotect(dblk_page, dxpl_id, H5AC__NO_FLAGS_SET) < 0)
- H5E_THROW(H5E_CANTUNPROTECT, "unable to release fixed array data block page")
-
- /* Advance to next page address */
- dblk_page_addr += dblock->dblk_page_size;
- } /* paging */
- } /* end for npages */
+ if(((page_idx + 1) == dblock->npages) && (nelmts_left = hdr->cparam.nelmts % dblock->dblk_page_nelmts))
+ dblk_page_nelmts = (size_t)nelmts_left;
+
+ if(NULL == (dblk_page = H5FA__dblk_page_protect(hdr, dxpl_id, dblk_page_addr, dblk_page_nelmts, H5AC_READ)))
+ H5E_THROW(H5E_CANTPROTECT, "unable to protect fixed array data block page, address = %llu", (unsigned long long)dblk_page_addr)
+
+ HDfprintf(stream, "%*sElements in page %Zu:\n", indent, "", page_idx);
+ for(u = 0; u < dblk_page_nelmts; u++) {
+ /* Call the class's 'debug' callback */
+ if((hdr->cparam.cls->debug)(stream, (indent + 3), MAX(0, (fwidth - 3)), (hsize_t)u, ((uint8_t *)dblk_page->elmts) + (hdr->cparam.cls->nat_elmt_size * u)) < 0)
+ H5E_THROW(H5E_CANTGET, "can't get element for debugging")
+ } /* end for */
+ if(H5FA__dblk_page_unprotect(dblk_page, dxpl_id, H5AC__NO_FLAGS_SET) < 0)
+ H5E_THROW(H5E_CANTUNPROTECT, "unable to release fixed array data block page")
+
+ /* Advance to next page address */
+ dblk_page_addr += dblock->dblk_page_size;
+ } /* paging */
+ } /* end for npages */
} /* end if */
else { /* not paging */
- /* Print the elements in the data block */
- HDfprintf(stream, "%*sElements:\n", indent, "");
- for(u = 0; u < hdr->cparam.nelmts; u++) {
- /* Call the class's 'debug' callback */
- if((hdr->cparam.cls->debug)(stream, (indent + 3), MAX(0, (fwidth - 3)), (hsize_t)u,
- ((uint8_t *)dblock->elmts) + (hdr->cparam.cls->nat_elmt_size * u)) < 0)
- H5E_THROW(H5E_CANTGET, "can't get element for debugging")
- } /* end for */
+ /* Print the elements in the data block */
+ HDfprintf(stream, "%*sElements:\n", indent, "");
+ for(u = 0; u < hdr->cparam.nelmts; u++) {
+ /* Call the class's 'debug' callback */
+ if((hdr->cparam.cls->debug)(stream, (indent + 3), MAX(0, (fwidth - 3)), (hsize_t)u, ((uint8_t *)dblock->elmts) + (hdr->cparam.cls->nat_elmt_size * u)) < 0)
+ H5E_THROW(H5E_CANTGET, "can't get element for debugging")
+ } /* end for */
} /* end else */
CATCH
if(dbg_ctx && cls->dst_dbg_ctx(dbg_ctx) < 0)
- H5E_THROW(H5E_CANTRELEASE, "unable to release fixed array debugging context")
+ H5E_THROW(H5E_CANTRELEASE, "unable to release fixed array debugging context")
if(dblock && H5FA__dblock_unprotect(dblock, dxpl_id, H5AC__NO_FLAGS_SET) < 0)
H5E_THROW(H5E_CANTUNPROTECT, "unable to release fixed array data block")
if(hdr && H5AC_unprotect(f, dxpl_id, H5AC_FARRAY_HDR, hdr_addr, hdr, H5AC__NO_FLAGS_SET) < 0)
- H5E_THROW(H5E_CANTUNPROTECT, "unable to release fixed array header")
+ H5E_THROW(H5E_CANTUNPROTECT, "unable to release fixed array header")
END_FUNC(PKG) /* end H5FA__dblock_debug() */