summaryrefslogtreecommitdiffstats
path: root/src/H5PBprivate.h
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2017-03-14 04:30:37 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2017-03-14 04:30:37 (GMT)
commit0313cbb91d974b153dbe8747d193ac3c619eea3b (patch)
treeaf6c4a631d5753685ee0033a6a8415a25fc97672 /src/H5PBprivate.h
parent847d675f2743ec420ef6c9efdd6e52ae93b4fe44 (diff)
downloadhdf5-0313cbb91d974b153dbe8747d193ac3c619eea3b.zip
hdf5-0313cbb91d974b153dbe8747d193ac3c619eea3b.tar.gz
hdf5-0313cbb91d974b153dbe8747d193ac3c619eea3b.tar.bz2
Final merge of page buffering branch to develop
Diffstat (limited to 'src/H5PBprivate.h')
-rw-r--r--src/H5PBprivate.h108
1 files changed, 108 insertions, 0 deletions
diff --git a/src/H5PBprivate.h b/src/H5PBprivate.h
new file mode 100644
index 0000000..3b5dcae
--- /dev/null
+++ b/src/H5PBprivate.h
@@ -0,0 +1,108 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * 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: H5PBprivate.h
+ * June 2014
+ * Mohamad Chaarawi
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#ifndef _H5PBprivate_H
+#define _H5PBprivate_H
+
+/* Include package's public header */
+#ifdef NOT_YET
+#include "H5PBpublic.h"
+#endif /* NOT_YET */
+
+/* Private headers needed by this header */
+#include "H5private.h" /* Generic Functions */
+#include "H5Fprivate.h" /* File access */
+#include "H5FLprivate.h" /* Free Lists */
+#include "H5SLprivate.h" /* Skip List */
+
+
+/**************************/
+/* Library Private Macros */
+/**************************/
+
+
+/****************************/
+/* Library Private Typedefs */
+/****************************/
+
+/* Forward declaration for a page buffer entry */
+struct H5PB_entry_t;
+
+/* Typedef for the main structure for the page buffer */
+typedef struct H5PB_t {
+ size_t max_size; /* The total page buffer size */
+ size_t page_size; /* Size of a single page */
+ unsigned min_meta_perc; /* Minimum ratio of metadata entries required before evicting meta entries */
+ unsigned min_raw_perc; /* Minimum ratio of raw data entries required before evicting raw entries */
+ unsigned meta_count; /* Number of entries for metadata */
+ unsigned raw_count; /* Number of entries for raw data */
+ unsigned min_meta_count; /* Minimum # of entries for metadata */
+ unsigned min_raw_count; /* Minimum # of entries for raw data */
+
+ H5SL_t *slist_ptr; /* Skip list with all the active page entries */
+ H5SL_t *mf_slist_ptr; /* Skip list containing newly allocated page entries inserted from the MF layer */
+
+ size_t LRU_list_len; /* Number of entries in the LRU (identical to slist_ptr count) */
+ struct H5PB_entry_t *LRU_head_ptr; /* Head pointer of the LRU */
+ struct H5PB_entry_t *LRU_tail_ptr; /* Tail pointer of the LRU */
+
+ H5FL_fac_head_t *page_fac; /* Factory for allocating pages */
+
+ /* Statistics */
+ unsigned accesses[2];
+ unsigned hits[2];
+ unsigned misses[2];
+ unsigned evictions[2];
+ unsigned bypasses[2];
+} H5PB_t;
+
+/*****************************/
+/* Library-private Variables */
+/*****************************/
+
+
+/***************************************/
+/* Library-private Function Prototypes */
+/***************************************/
+
+/* General routines */
+H5_DLL herr_t H5PB_create(H5F_t *file, size_t page_buffer_size, unsigned page_buf_min_meta_perc, unsigned page_buf_min_raw_perc);
+H5_DLL herr_t H5PB_flush(const H5F_io_info2_t *fio_info);
+H5_DLL herr_t H5PB_dest(H5F_t *file);
+H5_DLL herr_t H5PB_add_new_page(H5F_t *f, H5FD_mem_t type, haddr_t page_addr);
+H5_DLL herr_t H5PB_update_entry(H5PB_t *page_buf, haddr_t addr, size_t size, const void *buf);
+H5_DLL herr_t H5PB_remove_entry(const H5F_t *f, haddr_t addr);
+H5_DLL herr_t H5PB_read(const H5F_io_info2_t *fio_info, H5FD_mem_t type,
+ haddr_t addr, size_t size, void *buf/*out*/);
+H5_DLL herr_t H5PB_write(const H5F_io_info2_t *f, H5FD_mem_t type, haddr_t addr,
+ size_t size, const void *buf);
+
+/* Statistics routines */
+H5_DLL herr_t H5PB_reset_stats(H5PB_t *page_buf);
+H5_DLL herr_t H5PB_get_stats(const H5PB_t *page_buf, unsigned accesses[2],
+ unsigned hits[2], unsigned misses[2], unsigned evictions[2], unsigned bypasses[2]);
+H5_DLL herr_t H5PB_print_stats(const H5PB_t *page_buf);
+
+#endif /* !_H5PBprivate_H */
+