H5Dprivate.h

00001 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
00002  * Copyright by The HDF Group.                                               *
00003  * Copyright by the Board of Trustees of the University of Illinois.         *
00004  * All rights reserved.                                                      *
00005  *                                                                           *
00006  * This file is part of HDF5.  The full HDF5 copyright notice, including     *
00007  * terms governing use, modification, and redistribution, is contained in    *
00008  * the files COPYING and Copyright.html.  COPYING can be found at the root   *
00009  * of the source code distribution tree; Copyright.html can be found at the  *
00010  * root level of an installed copy of the electronic HDF5 document set and   *
00011  * is linked from the top-level documents page.  It can also be found at     *
00012  * http://hdfgroup.org/HDF5/doc/Copyright.html.  If you do not have          *
00013  * access to either file, you may request a copy from help@hdfgroup.org.     *
00014  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
00015 
00016 /*
00017  * This file contains private information about the H5D module
00018  */
00019 #ifndef _H5Dprivate_H
00020 #define _H5Dprivate_H
00021 
00022 /* Include package's public header */
00023 #include "H5Dpublic.h"
00024 
00025 /* Private headers needed by this file */
00026 #include "H5FDprivate.h"        /* File drivers                         */
00027 #include "H5Oprivate.h"         /* Object headers                       */
00028 #include "H5Sprivate.h"         /* Dataspaces                           */
00029 #include "H5Zprivate.h"         /* Data filters                         */
00030 
00031 
00032 /**************************/
00033 /* Library Private Macros */
00034 /**************************/
00035 
00036 /*
00037  * Feature: Define H5D_DEBUG on the compiler command line if you want to
00038  *          debug dataset I/O. NDEBUG must not be defined in order for this
00039  *          to have any effect.
00040  */
00041 #ifdef NDEBUG
00042 #  undef H5D_DEBUG
00043 #endif
00044 
00045 /* ========  Dataset creation property names ======== */
00046 #define H5D_CRT_LAYOUT_NAME        "layout"             /* Storage layout */
00047 #define H5D_CRT_FILL_VALUE_NAME    "fill_value"         /* Fill value */
00048 #define H5D_CRT_ALLOC_TIME_STATE_NAME "alloc_time_state" /* Space allocation time state */
00049 #define H5D_CRT_EXT_FILE_LIST_NAME "efl"                /* External file list */
00050 
00051 /* ========  Dataset access property names ======== */
00052 #define H5D_ACS_DATA_CACHE_NUM_SLOTS_NAME   "rdcc_nslots"   /* Size of raw data chunk cache(slots) */
00053 #define H5D_ACS_DATA_CACHE_BYTE_SIZE_NAME   "rdcc_nbytes"   /* Size of raw data chunk cache(bytes) */
00054 #define H5D_ACS_PREEMPT_READ_CHUNKS_NAME    "rdcc_w0"       /* Preemption read chunks first */
00055 
00056 /* ======== Data transfer properties ======== */
00057 #define H5D_XFER_MAX_TEMP_BUF_NAME      "max_temp_buf"  /* Maximum temp buffer size */
00058 #define H5D_XFER_TCONV_BUF_NAME         "tconv_buf"     /* Type conversion buffer */
00059 #define H5D_XFER_BKGR_BUF_NAME          "bkgr_buf"      /* Background buffer */
00060 #define H5D_XFER_BKGR_BUF_TYPE_NAME     "bkgr_buf_type" /* Background buffer type */
00061 #define H5D_XFER_BTREE_SPLIT_RATIO_NAME "btree_split_ratio" /* B-tree node splitting ratio */
00062 #define H5D_XFER_VLEN_ALLOC_NAME        "vlen_alloc"    /* Vlen allocation function */
00063 #define H5D_XFER_VLEN_ALLOC_INFO_NAME   "vlen_alloc_info" /* Vlen allocation info */
00064 #define H5D_XFER_VLEN_FREE_NAME         "vlen_free"     /* Vlen free function */
00065 #define H5D_XFER_VLEN_FREE_INFO_NAME    "vlen_free_info" /* Vlen free info */
00066 #define H5D_XFER_VFL_ID_NAME            "vfl_id"        /* File driver ID */
00067 #define H5D_XFER_VFL_INFO_NAME          "vfl_info"      /* File driver info */
00068 #define H5D_XFER_HYPER_VECTOR_SIZE_NAME "vec_size"      /* Hyperslab vector size */
00069 #ifdef H5_HAVE_PARALLEL
00070 #define H5D_XFER_IO_XFER_MODE_NAME      "io_xfer_mode"  /* I/O transfer mode */
00071 #define H5D_XFER_MPIO_COLLECTIVE_OPT_NAME "mpio_collective_opt" /* Optimization of MPI-IO transfer mode */
00072 #define H5D_XFER_MPIO_CHUNK_OPT_HARD_NAME "mpio_chunk_opt_hard"
00073 #define H5D_XFER_MPIO_CHUNK_OPT_NUM_NAME "mpio_chunk_opt_num"
00074 #define H5D_XFER_MPIO_CHUNK_OPT_RATIO_NAME "mpio_chunk_opt_ratio"
00075 #endif /* H5_HAVE_PARALLEL */
00076 #define H5D_XFER_EDC_NAME               "err_detect"    /* EDC */
00077 #define H5D_XFER_FILTER_CB_NAME         "filter_cb"     /* Filter callback function */
00078 #define H5D_XFER_CONV_CB_NAME           "type_conv_cb"  /* Type conversion callback function */
00079 #define H5D_XFER_XFORM_NAME             "data_transform" /* Data transform */
00080 #ifdef H5_HAVE_INSTRUMENTED_LIBRARY
00081 /* Collective chunk instrumentation properties */
00082 #define H5D_XFER_COLL_CHUNK_LINK_HARD_NAME "coll_chunk_link_hard"
00083 #define H5D_XFER_COLL_CHUNK_MULTI_HARD_NAME "coll_chunk_multi_hard"
00084 #define H5D_XFER_COLL_CHUNK_LINK_NUM_TRUE_NAME "coll_chunk_link_true"
00085 #define H5D_XFER_COLL_CHUNK_LINK_NUM_FALSE_NAME "coll_chunk_link_false"
00086 #define H5D_XFER_COLL_CHUNK_MULTI_RATIO_COLL_NAME "coll_chunk_multi_coll"
00087 #define H5D_XFER_COLL_CHUNK_MULTI_RATIO_IND_NAME "coll_chunk_multi_ind"
00088 #define H5D_XFER_COLL_CHUNK_LINK_TO_MULTI "coll_chunk_link_mul"/* Internal transferring from link to multiple chunk */
00089 #define H5D_XFER_COLL_CHUNK_LINK_TO_MULTI_OPT "coll_chunk_link_mul_opt"/* Internal transferring from link opt to multiple chunk opt*/
00090 
00091 /* Definitions for all collective chunk instrumentation properties */
00092 #define H5D_XFER_COLL_CHUNK_SIZE        sizeof(unsigned)
00093 #define H5D_XFER_COLL_CHUNK_DEF         1
00094 #define H5D_XFER_COLL_CHUNK_FIX         0
00095 #endif /* H5_HAVE_INSTRUMENTED_LIBRARY */
00096 
00097 /* Default temporary buffer size */
00098 #define H5D_TEMP_BUF_SIZE       (1024 * 1024)
00099 
00100 /* Default I/O vector size */
00101 #define H5D_IO_VECTOR_SIZE      1024
00102 
00103 /* Default VL allocation & free info */
00104 #define H5D_VLEN_ALLOC          NULL
00105 #define H5D_VLEN_ALLOC_INFO     NULL
00106 #define H5D_VLEN_FREE           NULL
00107 #define H5D_VLEN_FREE_INFO      NULL
00108 
00109 
00110 /****************************/
00111 /* Library Private Typedefs */
00112 /****************************/
00113 
00114 /* Typedef for dataset in memory (defined in H5Dpkg.h) */
00115 typedef struct H5D_t H5D_t;
00116 
00117 /* Typedef for cached dataset transfer property list information */
00118 typedef struct H5D_dxpl_cache_t {
00119     size_t max_temp_buf;        /* Maximum temporary buffer size (H5D_XFER_MAX_TEMP_BUF_NAME) */
00120     void *tconv_buf;            /* Temporary conversion buffer (H5D_XFER_TCONV_BUF_NAME) */
00121     void *bkgr_buf;             /* Background conversion buffer (H5D_XFER_BKGR_BUF_NAME) */
00122     H5T_bkg_t bkgr_buf_type;    /* Background buffer type (H5D_XFER_BKGR_BUF_NAME) */
00123     H5Z_EDC_t err_detect;       /* Error detection info (H5D_XFER_EDC_NAME) */
00124     double btree_split_ratio[3];/* B-tree split ratios (H5D_XFER_BTREE_SPLIT_RATIO_NAME) */
00125     size_t vec_size;            /* Size of hyperslab vector (H5D_XFER_HYPER_VECTOR_SIZE_NAME) */
00126 #ifdef H5_HAVE_PARALLEL
00127     H5FD_mpio_xfer_t xfer_mode; /* Parallel transfer for this request (H5D_XFER_IO_XFER_MODE_NAME) */
00128     H5FD_mpio_collective_opt_t coll_opt_mode; /* Parallel transfer with independent IO or collective IO with this mode */
00129 #endif /*H5_HAVE_PARALLEL*/
00130     H5Z_cb_t filter_cb;         /* Filter callback function (H5D_XFER_FILTER_CB_NAME) */
00131     H5Z_data_xform_t *data_xform_prop; /* Data transform prop (H5D_XFER_XFORM_NAME) */
00132 } H5D_dxpl_cache_t;
00133 
00134 /* Typedef for cached dataset creation property list information */
00135 typedef struct H5D_dcpl_cache_t {
00136     H5O_fill_t fill;            /* Fill value info (H5D_CRT_FILL_VALUE_NAME) */
00137     H5O_pline_t pline;          /* I/O pipeline info (H5O_CRT_PIPELINE_NAME) */
00138     H5O_efl_t efl;              /* External file list info (H5D_CRT_EXT_FILE_LIST_NAME) */
00139 } H5D_dcpl_cache_t;
00140 
00141 /* Callback information for copying datasets */
00142 typedef struct H5D_copy_file_ud_t {
00143     H5O_copy_file_ud_common_t common;   /* Shared information (must be first) */
00144     struct H5S_extent_t *src_space_extent;     /* Copy of dataspace extent for dataset */
00145     H5T_t *src_dtype;                   /* Copy of datatype for dataset */
00146 } H5D_copy_file_ud_t;
00147 
00148 
00149 /*****************************/
00150 /* Library Private Variables */
00151 /*****************************/
00152 
00153 
00154 /******************************/
00155 /* Library Private Prototypes */
00156 /******************************/
00157 
00158 H5_DLL herr_t H5D_init(void);
00159 H5_DLL H5D_t *H5D_open(const H5G_loc_t *loc, hid_t dapl_id, hid_t dxpl_id);
00160 H5_DLL herr_t H5D_close(H5D_t *dataset);
00161 H5_DLL H5O_loc_t *H5D_oloc(H5D_t *dataset);
00162 H5_DLL H5G_name_t *H5D_nameof(H5D_t *dataset);
00163 H5_DLL H5T_t *H5D_typeof(const H5D_t *dset);
00164 H5_DLL herr_t H5D_flush(const H5F_t *f, hid_t dxpl_id);
00165 
00166 /* Functions that operate on vlen data */
00167 H5_DLL herr_t H5D_vlen_reclaim(hid_t type_id, H5S_t *space, hid_t plist_id,
00168     void *buf);
00169 
00170 /* Functions that operate on contiguous storage */
00171 H5_DLL herr_t H5D_contig_delete(H5F_t *f, hid_t dxpl_id,
00172     const H5O_storage_t *store);
00173 
00174 /* Functions that operate on chunked storage */
00175 H5_DLL herr_t H5D_chunk_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_addr);
00176 H5_DLL herr_t H5D_chunk_delete(H5F_t *f, hid_t dxpl_id, H5O_t *oh,
00177     H5O_storage_t *store);
00178 
00179 /* Functions that operate on indexed storage */
00180 H5_DLL herr_t H5D_btree_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream,
00181                                 int indent, int fwidth, unsigned ndims);
00182 
00183 #endif /* _H5Dprivate_H */
00184