summaryrefslogtreecommitdiffstats
path: root/src/H5Dpkg.h
diff options
context:
space:
mode:
authorRaymond Lu <songyulu@hdfgroup.org>2007-07-21 19:50:43 (GMT)
committerRaymond Lu <songyulu@hdfgroup.org>2007-07-21 19:50:43 (GMT)
commit7f2a3a97c3d157946319ba1e656cff54fb0cbbd0 (patch)
tree087a149674ba4d2271adaea49fbf9d3c168370ec /src/H5Dpkg.h
parent774ee2fbf0b34f90a3dfe9a99bb9a80fc51a964f (diff)
downloadhdf5-7f2a3a97c3d157946319ba1e656cff54fb0cbbd0.zip
hdf5-7f2a3a97c3d157946319ba1e656cff54fb0cbbd0.tar.gz
hdf5-7f2a3a97c3d157946319ba1e656cff54fb0cbbd0.tar.bz2
[svn-r13997] Moved H5D_istore_lock and H5D_istore_unlock from H5D_istore_writevv and H5D_istore_readvv to
H5D_chunk_write and H5D_chunk_read to avoid frequent lock and unlock and to improve some performance. Tested with h5committest on THG machines.
Diffstat (limited to 'src/H5Dpkg.h')
-rw-r--r--src/H5Dpkg.h82
1 files changed, 64 insertions, 18 deletions
diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h
index f28a5db..1f92bf8 100644
--- a/src/H5Dpkg.h
+++ b/src/H5Dpkg.h
@@ -71,24 +71,24 @@ struct H5D_io_info_t;
typedef herr_t (*H5D_io_read_func_t)(struct H5D_io_info_t *io_info,
size_t nelmts, size_t elmt_size,
const H5S_t *file_space, const H5S_t *mem_space, haddr_t addr,
- void *buf/*out*/);
+ void *chunk, void *buf/*out*/);
/* Write directly from app buffer to file */
typedef herr_t (*H5D_io_write_func_t)(struct H5D_io_info_t *io_info,
size_t nelmts, size_t elmt_size,
const H5S_t *file_space, const H5S_t *mem_space, haddr_t addr,
- const void *buf);
+ void *chunk, const void *buf);
/* Function pointers for I/O on particular types of dataset layouts */
typedef ssize_t (*H5D_io_readvv_func_t)(const struct H5D_io_info_t *io_info,
size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_len_arr[], hsize_t dset_offset_arr[],
size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[],
- void *buf);
+ haddr_t chunk_addr, void *chunk, void *buf);
typedef ssize_t (*H5D_io_writevv_func_t)(const struct H5D_io_info_t *io_info,
size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_len_arr[], hsize_t dset_offset_arr[],
size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[],
- const void *buf);
+ haddr_t chunk_addr, void *chunk, const void *buf);
/* Typedef for raw data I/O framework info */
typedef struct H5D_io_ops_t {
@@ -250,6 +250,46 @@ typedef struct {
hbool_t has_vlen_fill_type; /* Whether the datatype for the fill value has a variable-length component */
} H5D_fill_buf_info_t;
+/*************************/
+/* For chunk lock */
+/*************************/
+/*
+ * B-tree key. A key contains the minimum logical N-dimensional address and
+ * the logical size of the chunk to which this key refers. The
+ * fastest-varying dimension is assumed to reference individual bytes of the
+ * array, so a 100-element 1-d array of 4-byte integers would really be a 2-d
+ * array with the slow varying dimension of size 100 and the fast varying
+ * dimension of size 4 (the storage dimensionality has very little to do with
+ * the real dimensionality).
+ *
+ * Only the first few values of the OFFSET and SIZE fields are actually
+ * stored on disk, depending on the dimensionality.
+ *
+ * The chunk's file address is part of the B-tree and not part of the key.
+ */
+typedef struct H5D_istore_key_t {
+ size_t nbytes; /*size of stored data */
+ hsize_t offset[H5O_LAYOUT_NDIMS]; /*logical offset to start*/
+ unsigned filter_mask; /*excluded filters */
+} H5D_istore_key_t;
+
+
+/*
+ * Common data exchange structure for indexed storage nodes. This structure is
+ * passed through the B-link tree layer to the methods for the objects
+ * to which the B-link tree points.
+ */
+typedef struct H5D_istore_bt_ud_common_t {
+ /* downward */
+ H5D_istore_key_t key; /*key values */
+ const H5O_layout_t *mesg; /*layout message */
+} H5D_istore_bt_ud_common_t;
+
+/* B-tree callback info for various operations */
+typedef struct H5D_istore_ud1_t {
+ H5D_istore_bt_ud_common_t common; /* Common info for B-tree user data (must be first) */
+ haddr_t addr; /*file address of chunk */
+} H5D_istore_ud1_t;
/*****************************/
/* Package Private Variables */
@@ -272,10 +312,10 @@ H5_DLL herr_t H5D_alloc_storage(H5F_t *f, hid_t dxpl_id, H5D_t *dset, H5D_time_a
/* Functions that perform serial I/O operations */
H5_DLL herr_t H5D_select_fscat (H5D_io_info_t *io_info,
const H5S_t *file_space, H5S_sel_iter_t *file_iter, size_t nelmts,
- const void *_buf);
+ haddr_t chunk_addr, void *chunk, const void *_buf);
H5_DLL size_t H5D_select_fgath (H5D_io_info_t *io_info,
const H5S_t *file_space, H5S_sel_iter_t *file_iter, size_t nelmts,
- void *buf);
+ haddr_t chunk_addr, void *chunk, void *buf);
H5_DLL herr_t H5D_select_mscat (const void *_tscat_buf,
const H5S_t *space, H5S_sel_iter_t *iter, size_t nelmts,
const H5D_dxpl_cache_t *dxpl_cache, void *_buf/*out*/);
@@ -285,11 +325,11 @@ H5_DLL size_t H5D_select_mgath (const void *_buf,
H5_DLL herr_t H5D_select_read(H5D_io_info_t *io_info,
size_t nelmts, size_t elmt_size,
const H5S_t *file_space, const H5S_t *mem_space,
- haddr_t addr, void *buf/*out*/);
+ haddr_t addr, void *chunk/*in*/, void *buf/*out*/);
H5_DLL herr_t H5D_select_write(H5D_io_info_t *io_info,
size_t nelmts, size_t elmt_size,
const H5S_t *file_space, const H5S_t *mem_space,
- haddr_t addr, const void *buf/*out*/);
+ haddr_t addr, void *chunk/*in*/, const void *buf/*out*/);
/* Functions that operate on contiguous storage */
H5_DLL herr_t H5D_contig_create(H5F_t *f, hid_t dxpl_id, H5O_layout_t *layout);
@@ -298,11 +338,11 @@ H5_DLL haddr_t H5D_contig_get_addr(const H5D_t *dset);
H5_DLL ssize_t H5D_contig_readvv(const H5D_io_info_t *io_info,
size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_len_arr[], hsize_t dset_offset_arr[],
size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[],
- void *buf);
+ haddr_t UNUSED address, void UNUSED *pointer, void *buf);
H5_DLL ssize_t H5D_contig_writevv(const H5D_io_info_t *io_info,
size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_len_arr[], hsize_t dset_offset_arr[],
size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[],
- const void *buf);
+ haddr_t UNUSED address, void UNUSED *pointer, const void *buf);
H5_DLL herr_t H5D_contig_copy(H5F_t *f_src, const H5O_layout_t *layout_src, H5F_t *f_dst,
H5O_layout_t *layout_dst, H5T_t *src_dtype, H5O_copy_t *cpy_info, hid_t dxpl_id);
@@ -311,11 +351,11 @@ H5_DLL herr_t H5D_compact_fill(H5D_t *dset, hid_t dxpl_id);
H5_DLL ssize_t H5D_compact_readvv(const H5D_io_info_t *io_info,
size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_size_arr[], hsize_t dset_offset_arr[],
size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_size_arr[], hsize_t mem_offset_arr[],
- void *buf);
+ haddr_t UNUSED addr, void UNUSED *pointer/*in*/, void *buf);
H5_DLL ssize_t H5D_compact_writevv(const H5D_io_info_t *io_info,
size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_size_arr[], hsize_t dset_offset_arr[],
size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_size_arr[], hsize_t mem_offset_arr[],
- const void *buf);
+ haddr_t UNUSED addr, void UNUSED *pointer/*in*/, const void *buf);
H5_DLL herr_t H5D_compact_copy(H5F_t *f_src, H5O_layout_t *layout_src,
H5F_t *f_dst, H5O_layout_t *layout_dst, H5T_t *src_dtype, H5O_copy_t *cpy_info, hid_t dxpl_id);
@@ -344,26 +384,32 @@ H5_DLL herr_t H5D_istore_stats (H5D_t *dset, hbool_t headers);
H5_DLL ssize_t H5D_istore_readvv(const H5D_io_info_t *io_info,
size_t chunk_max_nseq, size_t *chunk_curr_seq, size_t chunk_len_arr[],
hsize_t chunk_offset_arr[], size_t mem_max_nseq, size_t *mem_curr_seq,
- size_t mem_len_arr[], hsize_t mem_offset_arr[], void *buf);
+ size_t mem_len_arr[], hsize_t mem_offset_arr[], haddr_t chunk_addr, void *chunk, void *buf);
H5_DLL ssize_t H5D_istore_writevv(const H5D_io_info_t *io_info,
size_t chunk_max_nseq, size_t *chunk_curr_seq, size_t chunk_len_arr[],
hsize_t chunk_offset_arr[], size_t mem_max_nseq, size_t *mem_curr_seq,
- size_t mem_len_arr[], hsize_t mem_offset_arr[], const void *buf);
+ size_t mem_len_arr[], hsize_t mem_offset_arr[], haddr_t chunk_addr, void *chunk,
+ const void *buf);
H5_DLL haddr_t H5D_istore_get_addr(const H5D_io_info_t *io_info,
struct H5D_istore_ud1_t *_udata);
H5_DLL herr_t H5D_istore_copy(H5F_t *f_src, H5O_layout_t *layout_src,
H5F_t *f_dst, H5O_layout_t *layout_dst, H5T_t *src_dtype,
H5O_copy_t *cpy_info, H5O_pline_t *pline, hid_t dxpl_id);
+H5_DLL void * H5D_istore_lock(const H5D_io_info_t *io_info, H5D_istore_ud1_t *udata,
+ hbool_t relax, unsigned *idx_hint/*in,out*/);
+H5_DLL herr_t H5D_istore_unlock(const H5D_io_info_t *io_info,
+ hbool_t dirty, unsigned idx_hint, void *chunk, size_t naccessed);
+H5_DLL hbool_t H5D_istore_if_load(H5D_t *dataset, haddr_t caddr);
/* Functions that operate on external file list (efl) storage */
H5_DLL ssize_t H5D_efl_readvv(const H5D_io_info_t *io_info,
size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_len_arr[], hsize_t dset_offset_arr[],
size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[],
- void *buf);
+ haddr_t UNUSED addr, void UNUSED *pointer/*in*/, void *buf);
H5_DLL ssize_t H5D_efl_writevv(const H5D_io_info_t *io_info,
size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_len_arr[], hsize_t dset_offset_arr[],
size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[],
- const void *buf);
+ haddr_t UNUSED addr, void UNUSED *pointer/*in*/, const void *buf);
/* Functions that perform fill value operations on datasets */
H5_DLL herr_t H5D_fill(const void *fill, const H5T_t *fill_type, void *buf,
@@ -390,13 +436,13 @@ H5_DLL herr_t H5D_fill_term(H5D_fill_buf_info_t *fb_info);
H5_DLL herr_t H5D_mpio_select_read(H5D_io_info_t *io_info,
size_t nelmts, size_t elmt_size,
const struct H5S_t *file_space, const struct H5S_t *mem_space,
- haddr_t addr,void *buf/*out*/);
+ haddr_t addr, void UNUSED *pointer/*in*/, void *buf/*out*/);
/* MPI-IO function to read , it will select either regular or irregular read */
H5_DLL herr_t H5D_mpio_select_write(H5D_io_info_t *io_info,
size_t nelmts, size_t elmt_size,
const struct H5S_t *file_space, const struct H5S_t *mem_space,
- haddr_t addr,const void *buf);
+ haddr_t addr, void UNUSED *pointer/*in*/, const void *buf);
/* MPI-IO function to handle contiguous collective IO */
H5_DLL herr_t