summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2012-09-27 21:32:35 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2012-09-27 21:32:35 (GMT)
commitd179489d46c95e068ed6fc7f4c413c88cd9da28d (patch)
treef50592c82d4a496b67d047a59f88c99be605bf3f /src
parentf5afdf8e2af0b423ab23ba6b675bd3e97065b8ad (diff)
downloadhdf5-d179489d46c95e068ed6fc7f4c413c88cd9da28d.zip
hdf5-d179489d46c95e068ed6fc7f4c413c88cd9da28d.tar.gz
hdf5-d179489d46c95e068ed6fc7f4c413c88cd9da28d.tar.bz2
[svn-r22833] Purpose:
Basic SWMR and flush dependency plumbing for fractal heaps. Does not include flush dependency creation code. Changes to the H5EA* code were just some indenting issues. Tested on jam
Diffstat (limited to 'src')
-rw-r--r--src/H5EAhdr.c28
-rw-r--r--src/H5HF.c113
-rw-r--r--src/H5HFhdr.c43
-rw-r--r--src/H5HFint.c146
-rw-r--r--src/H5HFpkg.h17
-rw-r--r--src/H5HFprivate.h2
-rw-r--r--src/Makefile.am10
-rw-r--r--src/Makefile.in13
8 files changed, 308 insertions, 64 deletions
diff --git a/src/H5EAhdr.c b/src/H5EAhdr.c
index 0d283ea..480e7e0 100644
--- a/src/H5EAhdr.c
+++ b/src/H5EAhdr.c
@@ -128,7 +128,7 @@ H5EA__hdr_alloc(H5F_t *f))
/* Allocate space for the shared information */
if(NULL == (hdr = H5FL_CALLOC(H5EA_hdr_t)))
- H5E_THROW(H5E_CANTALLOC, "memory allocation failed for extensible array shared header")
+ H5E_THROW(H5E_CANTALLOC, "memory allocation failed for extensible array shared header")
/* Set non-zero internal fields */
hdr->addr = HADDR_UNDEF;
@@ -391,35 +391,35 @@ HDfprintf(stderr, "%s: Called\n", FUNC);
/* Check for valid parameters */
if(cparam->raw_elmt_size == 0)
- H5E_THROW(H5E_BADVALUE, "element size must be greater than zero")
+ H5E_THROW(H5E_BADVALUE, "element size must be greater than zero")
if(cparam->max_nelmts_bits == 0)
- H5E_THROW(H5E_BADVALUE, "max. # of elements bits must be greater than zero")
+ H5E_THROW(H5E_BADVALUE, "max. # of elements bits must be greater than zero")
if(cparam->max_nelmts_bits > H5EA_MAX_NELMTS_IDX_MAX)
- H5E_THROW(H5E_BADVALUE, "max. # of elements bits must be <= %u", (unsigned)H5EA_MAX_NELMTS_IDX_MAX)
+ H5E_THROW(H5E_BADVALUE, "max. # of elements bits must be <= %u", (unsigned)H5EA_MAX_NELMTS_IDX_MAX)
if(cparam->sup_blk_min_data_ptrs < 2)
- H5E_THROW(H5E_BADVALUE, "min # of data block pointers in super block must be >= two")
+ H5E_THROW(H5E_BADVALUE, "min # of data block pointers in super block must be >= two")
if(!POWER_OF_TWO(cparam->sup_blk_min_data_ptrs))
- H5E_THROW(H5E_BADVALUE, "min # of data block pointers in super block must be power of two")
+ H5E_THROW(H5E_BADVALUE, "min # of data block pointers in super block must be power of two")
if(!POWER_OF_TWO(cparam->data_blk_min_elmts))
- H5E_THROW(H5E_BADVALUE, "min # of elements per data block must be power of two")
+ H5E_THROW(H5E_BADVALUE, "min # of elements per data block must be power of two")
dblk_page_nelmts = (size_t)1 << cparam->max_dblk_page_nelmts_bits;
if(dblk_page_nelmts < cparam->idx_blk_elmts)
- H5E_THROW(H5E_BADVALUE, "# of elements per data block page must be greater than # of elements in index block")
+ H5E_THROW(H5E_BADVALUE, "# of elements per data block page must be greater than # of elements in index block")
/* Compute the number of elements in data blocks for first actual super block */
sblk_idx = H5EA_SBLK_FIRST_IDX(cparam->sup_blk_min_data_ptrs);
dblk_nelmts = H5EA_SBLK_DBLK_NELMTS(sblk_idx, cparam->data_blk_min_elmts);
if(dblk_page_nelmts < dblk_nelmts)
- H5E_THROW(H5E_BADVALUE, "max. # of elements per data block page bits must be > # of elements in first data block from super block")
+ H5E_THROW(H5E_BADVALUE, "max. # of elements per data block page bits must be > # of elements in first data block from super block")
if(cparam->max_dblk_page_nelmts_bits > cparam->max_nelmts_bits)
- H5E_THROW(H5E_BADVALUE, "max. # of elements per data block page bits must be <= max. # of elements bits")
+ H5E_THROW(H5E_BADVALUE, "max. # of elements per data block page bits must be <= max. # of elements bits")
}
#endif /* NDEBUG */
/* Allocate space for the shared information */
if(NULL == (hdr = H5EA__hdr_alloc(f)))
- H5E_THROW(H5E_CANTALLOC, "memory allocation failed for extensible array shared header")
+ H5E_THROW(H5E_CANTALLOC, "memory allocation failed for extensible array shared header")
/* Set the internal parameters for the array */
hdr->idx_blk_addr = HADDR_UNDEF;
@@ -429,15 +429,15 @@ HDfprintf(stderr, "%s: Called\n", FUNC);
/* Finish initializing extensible array header */
if(H5EA__hdr_init(hdr, ctx_udata) < 0)
- H5E_THROW(H5E_CANTINIT, "initialization failed for extensible array header")
+ H5E_THROW(H5E_CANTINIT, "initialization failed for extensible array header")
/* Allocate space for the header on disk */
if(HADDR_UNDEF == (hdr->addr = H5MF_alloc(f, H5FD_MEM_EARRAY_HDR, dxpl_id, (hsize_t)hdr->size)))
- H5E_THROW(H5E_CANTALLOC, "file allocation failed for extensible array header")
+ H5E_THROW(H5E_CANTALLOC, "file allocation failed for extensible array header")
/* Cache the new extensible array header */
if(H5AC_insert_entry(f, dxpl_id, H5AC_EARRAY_HDR, hdr->addr, hdr, H5AC__NO_FLAGS_SET) < 0)
- H5E_THROW(H5E_CANTINSERT, "can't add extensible array header to cache")
+ H5E_THROW(H5E_CANTINSERT, "can't add extensible array header to cache")
/* Set address of array header to return */
ret_value = hdr->addr;
diff --git a/src/H5HF.c b/src/H5HF.c
index 64e8af2..166f5a7 100644
--- a/src/H5HF.c
+++ b/src/H5HF.c
@@ -15,16 +15,16 @@
/*-------------------------------------------------------------------------
*
- * Created: H5HF.c
- * Feb 24 2006
- * Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Created: H5HF.c
+ * Feb 24 2006
+ * Quincey Koziol <koziol@hdfgroup.org>
*
- * Purpose: Implements a "fractal heap" for storing variable-
- * length objects in a file.
+ * Purpose: Implements a "fractal heap" for storing variable-
+ * length objects in a file.
*
- * Please see the documentation in:
- * doc/html/TechNotes/FractalHeap.html for a full description
- * of how they work, etc.
+ * Please see the documentation in:
+ * doc/html/TechNotes/FractalHeap.html for a full description
+ * of how they work, etc.
*
*-------------------------------------------------------------------------
*/
@@ -33,7 +33,7 @@
/* Module Setup */
/****************/
-#define H5HF_PACKAGE /*suppress error about including H5HFpkg */
+#define H5HF_PACKAGE /* Suppress error about including H5HFpkg.h */
/***********/
/* Headers */
@@ -165,7 +165,7 @@ H5HF_create(H5F_t *f, hid_t dxpl_id, const H5HF_create_t *cparam)
/* Create shared fractal heap header */
if(HADDR_UNDEF == (fh_addr = H5HF_hdr_create(f, dxpl_id, cparam)))
- HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, NULL, "can't create fractal heap header")
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, NULL, "can't create fractal heap header")
/* Allocate fractal heap wrapper */
if(NULL == (fh = H5FL_MALLOC(H5HF_t)))
@@ -178,11 +178,11 @@ H5HF_create(H5F_t *f, hid_t dxpl_id, const H5HF_create_t *cparam)
/* Point fractal heap wrapper at header and bump it's ref count */
fh->hdr = hdr;
if(H5HF_hdr_incr(fh->hdr) < 0)
- HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, NULL, "can't increment reference count on shared heap header")
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, NULL, "can't increment reference count on shared heap header")
/* Increment # of files using this heap header */
if(H5HF_hdr_fuse_incr(fh->hdr) < 0)
- HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, NULL, "can't increment file reference count on shared heap header")
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, NULL, "can't increment file reference count on shared heap header")
/* Set file pointer for this heap open context */
fh->f = f;
@@ -249,7 +249,7 @@ H5HF_open(H5F_t *f, hid_t dxpl_id, haddr_t fh_addr)
/* Increment # of files using this heap header */
if(H5HF_hdr_fuse_incr(fh->hdr) < 0)
- HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, NULL, "can't increment file reference count on shared heap header")
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, NULL, "can't increment file reference count on shared heap header")
/* Set file pointer for this heap open context */
fh->f = f;
@@ -886,3 +886,90 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5HF_delete() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5HF_depend
+ *
+ * Purpose: Make a child flush dependency between the fracal heap's
+ * header and another piece of metadata in the file.
+ *
+ * Return: SUCCEED/FAIL
+ *
+ * Programmer: Dana Robinson
+ * Fall 2012
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5HF_depend(H5AC_info_t *parent_entry, H5HF_t *fh)
+{
+ /* Local variables */
+ H5HF_hdr_t *hdr = fh->hdr; /* Header for fractal heap */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+#ifdef QAK
+HDfprintf(stderr, "%s: Called\n", FUNC);
+#endif /* QAK */
+
+ /*
+ * Check arguments.
+ */
+ HDassert(fh);
+ HDassert(hdr);
+
+ /* Set the shared heap header's file context for this operation */
+ hdr->f = fh->f;
+
+ /* Set up flush dependency between parent entry and fractal heap header */
+ if(H5HF__create_flush_depend(parent_entry, (H5AC_info_t *)hdr) < 0)
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTDEPEND, FAIL, "unable to create flush dependency on file metadata")
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5HF_depend() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5HF_undepend
+ *
+ * Purpose: Remove a child flush dependency between the fractal heap's
+ * header and another piece of metadata in the file.
+ *
+ * Return: SUCCEED/FAIL
+ *
+ * Programmer: Dana Robinson
+ * Fall 2012
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5HF_undepend(H5AC_info_t *parent_entry, H5HF_t *fh)
+{
+ /* Local variables */
+ H5HF_hdr_t *hdr = fh->hdr; /* Header for fractal heap */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+#ifdef QAK
+HDfprintf(stderr, "%s: Called\n", FUNC);
+#endif /* QAK */
+
+ /*
+ * Check arguments.
+ */
+ HDassert(fh);
+ HDassert(hdr);
+
+ /* Set the shared heap header's file context for this operation */
+ hdr->f = fh->f;
+
+ /* Remove flush dependency between parent entry and fractal heap header */
+ if(H5HF__destroy_flush_depend(parent_entry, (H5AC_info_t *)hdr) < 0)
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTUNDEPEND, FAIL, "unable to destroy flush dependency on file metadata")
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5HF_undepend() */
diff --git a/src/H5HFhdr.c b/src/H5HFhdr.c
index e4b89ba..a3a037c 100644
--- a/src/H5HFhdr.c
+++ b/src/H5HFhdr.c
@@ -121,10 +121,11 @@ H5HF_hdr_alloc(H5F_t *f)
/* Allocate space for the shared information */
if(NULL == (hdr = H5FL_CALLOC(H5HF_hdr_t)))
- HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, NULL, "allocation failed for fractal heap shared header")
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, NULL, "allocation failed for fractal heap shared header")
/* Set the internal parameters for the heap */
hdr->f = f;
+ hdr->swmr_write = (H5F_INTENT(f) & H5F_ACC_SWMR_WRITE) > 0;
hdr->sizeof_size = H5F_SIZEOF_SIZE(f);
hdr->sizeof_addr = H5F_SIZEOF_ADDR(f);
@@ -220,7 +221,7 @@ H5HF_hdr_finish_init_phase1(H5HF_hdr_t *hdr)
/* Compute/cache some values */
hdr->heap_off_size = (uint8_t)H5HF_SIZEOF_OFFSET_BITS(hdr->man_dtable.cparam.max_index);
if(H5HF_dtable_init(&hdr->man_dtable) < 0)
- HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't initialize doubling table info")
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't initialize doubling table info")
/* Set the size of heap IDs */
hdr->heap_len_size = MIN(hdr->man_dtable.max_dir_blk_off_size,
@@ -313,11 +314,11 @@ H5HF_hdr_finish_init(H5HF_hdr_t *hdr)
/* First phase of header final initialization */
if(H5HF_hdr_finish_init_phase1(hdr) < 0)
- HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't finish phase #1 of header final initialization")
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't finish phase #1 of header final initialization")
/* Second phase of header final initialization */
if(H5HF_hdr_finish_init_phase2(hdr) < 0)
- HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't finish phase #2 of header final initialization")
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't finish phase #2 of header final initialization")
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -355,34 +356,34 @@ H5HF_hdr_create(H5F_t *f, hid_t dxpl_id, const H5HF_create_t *cparam)
#ifndef NDEBUG
/* Check for valid parameters */
if(cparam->managed.width == 0)
- HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, HADDR_UNDEF, "width must be greater than zero")
+ HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, HADDR_UNDEF, "width must be greater than zero")
if(cparam->managed.width > H5HF_WIDTH_LIMIT)
- HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, HADDR_UNDEF, "width too large")
+ HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, HADDR_UNDEF, "width too large")
if(!POWER_OF_TWO(cparam->managed.width))
- HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, HADDR_UNDEF, "width not power of two")
+ HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, HADDR_UNDEF, "width not power of two")
if(cparam->managed.start_block_size == 0)
- HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, HADDR_UNDEF, "starting block size must be greater than zero")
+ HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, HADDR_UNDEF, "starting block size must be greater than zero")
if(!POWER_OF_TWO(cparam->managed.start_block_size))
- HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, HADDR_UNDEF, "starting block size not power of two")
+ HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, HADDR_UNDEF, "starting block size not power of two")
if(cparam->managed.max_direct_size == 0)
- HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, HADDR_UNDEF, "max. direct block size must be greater than zero")
+ HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, HADDR_UNDEF, "max. direct block size must be greater than zero")
if(cparam->managed.max_direct_size > H5HF_MAX_DIRECT_SIZE_LIMIT)
- HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, HADDR_UNDEF, "max. direct block size too large")
+ HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, HADDR_UNDEF, "max. direct block size too large")
if(!POWER_OF_TWO(cparam->managed.max_direct_size))
- HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, HADDR_UNDEF, "max. direct block size not power of two")
+ HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, HADDR_UNDEF, "max. direct block size not power of two")
if(cparam->managed.max_direct_size < cparam->max_man_size)
- HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, HADDR_UNDEF, "max. direct block size not large enough to hold all managed blocks")
+ HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, HADDR_UNDEF, "max. direct block size not large enough to hold all managed blocks")
if(cparam->managed.max_index == 0)
- HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, HADDR_UNDEF, "max. heap size must be greater than zero")
+ HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, HADDR_UNDEF, "max. heap size must be greater than zero")
#endif /* NDEBUG */
/* Allocate & basic initialization for the shared header */
if(NULL == (hdr = H5HF_hdr_alloc(f)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, HADDR_UNDEF, "can't allocate space for shared heap info")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, HADDR_UNDEF, "can't allocate space for shared heap info")
#ifndef NDEBUG
if(cparam->managed.max_index > (8 * hdr->sizeof_size))
- HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, HADDR_UNDEF, "max. heap size too large for file")
+ HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, HADDR_UNDEF, "max. heap size too large for file")
#endif /* NDEBUG */
/* Set the creation parameters for the heap */
@@ -402,7 +403,7 @@ H5HF_hdr_create(H5F_t *f, hid_t dxpl_id, const H5HF_create_t *cparam)
/* First phase of header final initialization */
/* (doesn't need ID length set up) */
if(H5HF_hdr_finish_init_phase1(hdr) < 0)
- HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, HADDR_UNDEF, "can't finish phase #1 of header final initialization")
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, HADDR_UNDEF, "can't finish phase #1 of header final initialization")
/* Copy any I/O filter pipeline */
/* (This code is not in the "finish init phase" routines because those
@@ -487,21 +488,21 @@ H5HF_hdr_create(H5F_t *f, hid_t dxpl_id, const H5HF_create_t *cparam)
/* Second phase of header final initialization */
/* (needs ID and filter lengths set up) */
if(H5HF_hdr_finish_init_phase2(hdr) < 0)
- HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, HADDR_UNDEF, "can't finish phase #2 of header final initialization")
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, HADDR_UNDEF, "can't finish phase #2 of header final initialization")
/* Extra checking for possible gap between max. direct block size minus
* overhead and "huge" object size */
dblock_overhead = H5HF_MAN_ABS_DIRECT_OVERHEAD(hdr);
if((cparam->managed.max_direct_size - dblock_overhead) < cparam->max_man_size)
- HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, HADDR_UNDEF, "max. direct block size not large enough to hold all managed blocks")
+ HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, HADDR_UNDEF, "max. direct block size not large enough to hold all managed blocks")
/* Allocate space for the header on disk */
if(HADDR_UNDEF == (hdr->heap_addr = H5MF_alloc(f, H5FD_MEM_FHEAP_HDR, dxpl_id, (hsize_t)hdr->heap_size)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, HADDR_UNDEF, "file allocation failed for fractal heap header")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, HADDR_UNDEF, "file allocation failed for fractal heap header")
/* Cache the new fractal heap header */
if(H5AC_insert_entry(f, dxpl_id, H5AC_FHEAP_HDR, hdr->heap_addr, hdr, H5AC__NO_FLAGS_SET) < 0)
- HGOTO_ERROR(H5E_HEAP, H5E_CANTINSERT, HADDR_UNDEF, "can't add fractal heap header to cache")
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTINSERT, HADDR_UNDEF, "can't add fractal heap header to cache")
/* Set address of heap header to return */
ret_value = hdr->heap_addr;
diff --git a/src/H5HFint.c b/src/H5HFint.c
new file mode 100644
index 0000000..57d75cf
--- /dev/null
+++ b/src/H5HFint.c
@@ -0,0 +1,146 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Copyright by The HDF Group. *
+ * Copyright by the Board of Trustees of the University of Illinois. *
+ * All rights reserved. *
+ * *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the files COPYING and Copyright.html. COPYING can be found at the root *
+ * of the source code distribution tree; Copyright.html can be found at the *
+ * root level of an installed copy of the electronic HDF5 document set and *
+ * is linked from the top-level documents page. It can also be found at *
+ * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
+ * access to either file, you may request a copy from help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/*-------------------------------------------------------------------------
+ *
+ * Created: H5HFint.c
+ * Fall 2012
+ * Dana Robinson
+ *
+ * Purpose: Internal routines for fractal heaps.
+ *
+ *-------------------------------------------------------------------------
+ */
+
+/**********************/
+/* Module Declaration */
+/**********************/
+
+#define H5HF_PACKAGE
+
+
+/***********************/
+/* Other Packages Used */
+/***********************/
+
+
+/***********/
+/* Headers */
+/***********/
+#include "H5private.h" /* Generic Functions */
+#include "H5ACprivate.h" /* Metadata Cache */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5HFpkg.h" /* Fractal Heaps */
+
+
+/****************/
+/* Local Macros */
+/****************/
+
+
+/******************/
+/* Local Typedefs */
+/******************/
+
+
+/********************/
+/* Package Typedefs */
+/********************/
+
+
+/********************/
+/* Local Prototypes */
+/********************/
+
+
+/*********************/
+/* Package Variables */
+/*********************/
+
+
+/*****************************/
+/* Library Private Variables */
+/*****************************/
+
+
+/*******************/
+/* Local Variables */
+/*******************/
+
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5HF__create_flush_depend
+ *
+ * Purpose: Create a flush dependency between two data structure components
+ *
+ * Return: SUCCEED/FAIL
+ *
+ * Programmer: Dana Robinson
+ * Fall 2012
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5HF__create_flush_depend(H5AC_info_t *parent_entry, H5AC_info_t *child_entry)
+{
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+ /* Sanity check */
+ HDassert(parent_entry);
+ HDassert(child_entry);
+
+ /* Create a flush dependency between parent and child entry */
+ if(H5AC_create_flush_dependency(parent_entry, child_entry) < 0)
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTDEPEND, FAIL, "unable to create flush dependency")
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5HF__create_flush_depend() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5HF__destroy_flush_depend
+ *
+ * Purpose: Destroy a flush dependency between two data structure components
+ *
+ * Return: SUCCEED/FAIL
+ *
+ * Programmer: Dana Robinson
+ * Fall 2012
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5HF__destroy_flush_depend(H5AC_info_t *parent_entry, H5AC_info_t *child_entry)
+{
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+ /* Sanity check */
+ HDassert(parent_entry);
+ HDassert(child_entry);
+
+ /* Destroy a flush dependency between parent and child entry */
+ if(H5AC_destroy_flush_dependency(parent_entry, child_entry) < 0)
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTUNDEPEND, FAIL, "unable to destroy flush dependency")
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5HF__destroy_flush_depend() */
+
diff --git a/src/H5HFpkg.h b/src/H5HFpkg.h
index e0deca7..166b82f 100644
--- a/src/H5HFpkg.h
+++ b/src/H5HFpkg.h
@@ -32,11 +32,11 @@
#include "H5HFprivate.h"
/* Other private headers needed by this file */
-#include "H5ACprivate.h" /* Metadata cache */
-#include "H5B2private.h" /* v2 B-trees */
-#include "H5FLprivate.h" /* Free Lists */
-#include "H5FSprivate.h" /* Free space manager */
-#include "H5SLprivate.h" /* Skip lists */
+#include "H5ACprivate.h" /* Metadata cache */
+#include "H5B2private.h" /* v2 B-trees */
+#include "H5FLprivate.h" /* Free Lists */
+#include "H5FSprivate.h" /* Free space manager */
+#include "H5SLprivate.h" /* Skip lists */
/**************************/
/* Package Private Macros */
@@ -360,6 +360,7 @@ typedef struct H5HF_hdr_t {
uint8_t heap_off_size; /* Size of heap offsets (in bytes) */
uint8_t heap_len_size; /* Size of heap ID lengths (in bytes) */
hbool_t checked_filters; /* TRUE if pipeline passes can_apply checks */
+ hbool_t swmr_write; /* Flag indicating the file is opened with SWMR-write access */
} H5HF_hdr_t;
/* Common indirect block doubling table entry */
@@ -570,6 +571,12 @@ H5FL_BLK_EXTERN(direct_block);
/* Package Private Prototypes */
/******************************/
+/* Generic routines */
+H5_DLL herr_t H5HF__create_flush_depend(H5AC_info_t *parent_entry,
+ H5AC_info_t *child_entry);
+H5_DLL herr_t H5HF__destroy_flush_depend(H5AC_info_t *parent_entry,
+ H5AC_info_t *child_entry);
+
/* Doubling table routines */
H5_DLL herr_t H5HF_dtable_init(H5HF_dtable_t *dtable);
H5_DLL herr_t H5HF_dtable_dest(H5HF_dtable_t *dtable);
diff --git a/src/H5HFprivate.h b/src/H5HFprivate.h
index 55daa30..a32f21f 100644
--- a/src/H5HFprivate.h
+++ b/src/H5HFprivate.h
@@ -125,6 +125,8 @@ H5_DLL herr_t H5HF_op(H5HF_t *fh, hid_t dxpl_id, const void *id,
H5_DLL herr_t H5HF_remove(H5HF_t *fh, hid_t dxpl_id, const void *id);
H5_DLL herr_t H5HF_close(H5HF_t *fh, hid_t dxpl_id);
H5_DLL herr_t H5HF_delete(H5F_t *f, hid_t dxpl_id, haddr_t fh_addr);
+H5_DLL herr_t H5HF_depend(H5AC_info_t *parent_entry, H5HF_t *fh);
+H5_DLL herr_t H5HF_undepend(H5AC_info_t *parent_entry, H5HF_t *fh);
/* Statistics routines */
H5_DLL herr_t H5HF_stat_info(const H5HF_t *fh, H5HF_stat_t *stats);
diff --git a/src/Makefile.am b/src/Makefile.am
index 095b048..36ab249 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -63,15 +63,15 @@ libhdf5_la_SOURCES= H5.c H5checksum.c H5dbg.c H5system.c H5timer.c H5trace.c \
H5FDdirect.c H5FDfamily.c H5FDint.c H5FDlog.c H5FDmpi.c H5FDmpio.c \
H5FDmpiposix.c H5FDmulti.c H5FDsec2.c H5FDspace.c H5FDstdio.c \
H5FL.c H5FO.c H5FS.c H5FScache.c H5FSdbg.c H5FSint.c H5FSsection.c \
- H5FSstat.c H5FStest.c \
+ H5FSstat.c H5FStest.c \
H5G.c H5Gbtree2.c H5Gcache.c \
H5Gcompact.c H5Gdense.c H5Gdeprec.c H5Gent.c \
H5Gint.c H5Glink.c \
H5Gloc.c H5Gname.c H5Gnode.c H5Gobj.c H5Goh.c H5Groot.c H5Gstab.c H5Gtest.c \
H5Gtraverse.c \
H5HF.c H5HFbtree2.c H5HFcache.c H5HFdbg.c H5HFdblock.c H5HFdtable.c \
- H5HFhdr.c H5HFhuge.c H5HFiblock.c H5HFiter.c H5HFman.c H5HFsection.c \
- H5HFspace.c H5HFstat.c H5HFtest.c H5HFtiny.c \
+ H5HFhdr.c H5HFhuge.c H5HFiblock.c H5HFint.c H5HFiter.c H5HFman.c \
+ H5HFsection.c H5HFspace.c H5HFstat.c H5HFtest.c H5HFtiny.c \
H5HG.c H5HGcache.c H5HGdbg.c H5HGquery.c \
H5HL.c H5HLcache.c H5HLdbg.c H5HLint.c H5HLprfx.c H5HLdblk.c\
H5HP.c H5I.c H5Itest.c H5L.c H5Lexternal.c H5lib_settings.c \
@@ -107,8 +107,8 @@ libhdf5_la_SOURCES= H5.c H5checksum.c H5dbg.c H5system.c H5timer.c H5trace.c \
H5Tfloat.c H5Tinit.c H5Tnative.c H5Toffset.c H5Toh.c \
H5Topaque.c \
H5Torder.c \
- H5Tpad.c H5Tprecis.c H5Tstrpad.c H5Tvisit.c H5Tvlen.c H5TS.c H5V.c H5WB.c H5Z.c \
- H5Zdeflate.c H5Zfletcher32.c H5Znbit.c H5Zshuffle.c H5Zszip.c \
+ H5Tpad.c H5Tprecis.c H5Tstrpad.c H5Tvisit.c H5Tvlen.c H5TS.c H5V.c H5WB.c \
+ H5Z.c H5Zdeflate.c H5Zfletcher32.c H5Znbit.c H5Zshuffle.c H5Zszip.c \
H5Zscaleoffset.c H5Ztrans.c
diff --git a/src/Makefile.in b/src/Makefile.in
index c8e6fd7..71a8f80 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -122,7 +122,7 @@ am_libhdf5_la_OBJECTS = H5.lo H5checksum.lo H5dbg.lo H5system.lo \
H5Gname.lo H5Gnode.lo H5Gobj.lo H5Goh.lo H5Groot.lo H5Gstab.lo \
H5Gtest.lo H5Gtraverse.lo H5HF.lo H5HFbtree2.lo H5HFcache.lo \
H5HFdbg.lo H5HFdblock.lo H5HFdtable.lo H5HFhdr.lo H5HFhuge.lo \
- H5HFiblock.lo H5HFiter.lo H5HFman.lo H5HFsection.lo \
+ H5HFiblock.lo H5HFint.lo H5HFiter.lo H5HFman.lo H5HFsection.lo \
H5HFspace.lo H5HFstat.lo H5HFtest.lo H5HFtiny.lo H5HG.lo \
H5HGcache.lo H5HGdbg.lo H5HGquery.lo H5HL.lo H5HLcache.lo \
H5HLdbg.lo H5HLint.lo H5HLprfx.lo H5HLdblk.lo H5HP.lo H5I.lo \
@@ -525,15 +525,15 @@ libhdf5_la_SOURCES = H5.c H5checksum.c H5dbg.c H5system.c H5timer.c H5trace.c \
H5FDdirect.c H5FDfamily.c H5FDint.c H5FDlog.c H5FDmpi.c H5FDmpio.c \
H5FDmpiposix.c H5FDmulti.c H5FDsec2.c H5FDspace.c H5FDstdio.c \
H5FL.c H5FO.c H5FS.c H5FScache.c H5FSdbg.c H5FSint.c H5FSsection.c \
- H5FSstat.c H5FStest.c \
+ H5FSstat.c H5FStest.c \
H5G.c H5Gbtree2.c H5Gcache.c \
H5Gcompact.c H5Gdense.c H5Gdeprec.c H5Gent.c \
H5Gint.c H5Glink.c \
H5Gloc.c H5Gname.c H5Gnode.c H5Gobj.c H5Goh.c H5Groot.c H5Gstab.c H5Gtest.c \
H5Gtraverse.c \
H5HF.c H5HFbtree2.c H5HFcache.c H5HFdbg.c H5HFdblock.c H5HFdtable.c \
- H5HFhdr.c H5HFhuge.c H5HFiblock.c H5HFiter.c H5HFman.c H5HFsection.c \
- H5HFspace.c H5HFstat.c H5HFtest.c H5HFtiny.c \
+ H5HFhdr.c H5HFhuge.c H5HFiblock.c H5HFint.c H5HFiter.c H5HFman.c \
+ H5HFsection.c H5HFspace.c H5HFstat.c H5HFtest.c H5HFtiny.c \
H5HG.c H5HGcache.c H5HGdbg.c H5HGquery.c \
H5HL.c H5HLcache.c H5HLdbg.c H5HLint.c H5HLprfx.c H5HLdblk.c\
H5HP.c H5I.c H5Itest.c H5L.c H5Lexternal.c H5lib_settings.c \
@@ -569,8 +569,8 @@ libhdf5_la_SOURCES = H5.c H5checksum.c H5dbg.c H5system.c H5timer.c H5trace.c \
H5Tfloat.c H5Tinit.c H5Tnative.c H5Toffset.c H5Toh.c \
H5Topaque.c \
H5Torder.c \
- H5Tpad.c H5Tprecis.c H5Tstrpad.c H5Tvisit.c H5Tvlen.c H5TS.c H5V.c H5WB.c H5Z.c \
- H5Zdeflate.c H5Zfletcher32.c H5Znbit.c H5Zshuffle.c H5Zszip.c \
+ H5Tpad.c H5Tprecis.c H5Tstrpad.c H5Tvisit.c H5Tvlen.c H5TS.c H5V.c H5WB.c \
+ H5Z.c H5Zdeflate.c H5Zfletcher32.c H5Znbit.c H5Zshuffle.c H5Zszip.c \
H5Zscaleoffset.c H5Ztrans.c
@@ -843,6 +843,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5HFhdr.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5HFhuge.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5HFiblock.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5HFint.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5HFiter.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5HFman.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5HFsection.Plo@am__quote@