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 #define H5D_CRT_DATA_PIPELINE_NAME "pline"              /* Data filter pipeline */
00051 
00052 /* ========  Dataset access property names ======== */
00053 #define H5D_ACS_DATA_CACHE_NUM_SLOTS_NAME   "rdcc_nslots"   /* Size of raw data chunk cache(slots) */
00054 #define H5D_ACS_DATA_CACHE_BYTE_SIZE_NAME   "rdcc_nbytes"   /* Size of raw data chunk cache(bytes) */
00055 #define H5D_ACS_PREEMPT_READ_CHUNKS_NAME    "rdcc_w0"       /* Preemption read chunks first */
00056 
00057 /* ======== Data transfer properties ======== */
00058 #define H5D_XFER_MAX_TEMP_BUF_NAME      "max_temp_buf"  /* Maximum temp buffer size */
00059 #define H5D_XFER_TCONV_BUF_NAME         "tconv_buf"     /* Type conversion buffer */
00060 #define H5D_XFER_BKGR_BUF_NAME          "bkgr_buf"      /* Background buffer */
00061 #define H5D_XFER_BKGR_BUF_TYPE_NAME     "bkgr_buf_type" /* Background buffer type */
00062 #define H5D_XFER_BTREE_SPLIT_RATIO_NAME "btree_split_ratio" /* B-tree node splitting ratio */
00063 #define H5D_XFER_VLEN_ALLOC_NAME        "vlen_alloc"    /* Vlen allocation function */
00064 #define H5D_XFER_VLEN_ALLOC_INFO_NAME   "vlen_alloc_info" /* Vlen allocation info */
00065 #define H5D_XFER_VLEN_FREE_NAME         "vlen_free"     /* Vlen free function */
00066 #define H5D_XFER_VLEN_FREE_INFO_NAME    "vlen_free_info" /* Vlen free info */
00067 #define H5D_XFER_VFL_ID_NAME            "vfl_id"        /* File driver ID */
00068 #define H5D_XFER_VFL_INFO_NAME          "vfl_info"      /* File driver info */
00069 #define H5D_XFER_HYPER_VECTOR_SIZE_NAME "vec_size"      /* Hyperslab vector size */
00070 #ifdef H5_HAVE_PARALLEL
00071 #define H5D_XFER_IO_XFER_MODE_NAME      "io_xfer_mode"  /* I/O transfer mode */
00072 #define H5D_XFER_MPIO_COLLECTIVE_OPT_NAME "mpio_collective_opt" /* Optimization of MPI-IO transfer mode */
00073 #define H5D_XFER_MPIO_CHUNK_OPT_HARD_NAME "mpio_chunk_opt_hard"
00074 #define H5D_XFER_MPIO_CHUNK_OPT_NUM_NAME "mpio_chunk_opt_num"
00075 #define H5D_XFER_MPIO_CHUNK_OPT_RATIO_NAME "mpio_chunk_opt_ratio"
00076 #endif /* H5_HAVE_PARALLEL */
00077 #define H5D_XFER_EDC_NAME               "err_detect"    /* EDC */
00078 #define H5D_XFER_FILTER_CB_NAME         "filter_cb"     /* Filter callback function */
00079 #define H5D_XFER_CONV_CB_NAME           "type_conv_cb"  /* Type conversion callback function */
00080 #define H5D_XFER_XFORM_NAME             "data_transform" /* Data transform */
00081 #ifdef H5_HAVE_INSTRUMENTED_LIBRARY
00082 /* Collective chunk instrumentation properties */
00083 #define H5D_XFER_COLL_CHUNK_LINK_HARD_NAME "coll_chunk_link_hard"
00084 #define H5D_XFER_COLL_CHUNK_MULTI_HARD_NAME "coll_chunk_multi_hard"
00085 #define H5D_XFER_COLL_CHUNK_LINK_NUM_TRUE_NAME "coll_chunk_link_true"
00086 #define H5D_XFER_COLL_CHUNK_LINK_NUM_FALSE_NAME "coll_chunk_link_false"
00087 #define H5D_XFER_COLL_CHUNK_MULTI_RATIO_COLL_NAME "coll_chunk_multi_coll"
00088 #define H5D_XFER_COLL_CHUNK_MULTI_RATIO_IND_NAME "coll_chunk_multi_ind"
00089 #define H5D_XFER_COLL_CHUNK_LINK_TO_MULTI "coll_chunk_link_mul"/* Internal transferring from link to multiple chunk */
00090 #define H5D_XFER_COLL_CHUNK_LINK_TO_MULTI_OPT "coll_chunk_link_mul_opt"/* Internal transferring from link opt to multiple chunk opt*/
00091 
00092 /* Definitions for all collective chunk instrumentation properties */
00093 #define H5D_XFER_COLL_CHUNK_SIZE        sizeof(unsigned)
00094 #define H5D_XFER_COLL_CHUNK_DEF         1
00095 #define H5D_XFER_COLL_CHUNK_FIX         0
00096 #endif /* H5_HAVE_INSTRUMENTED_LIBRARY */
00097 
00098 /* Default temporary buffer size */
00099 #define H5D_TEMP_BUF_SIZE       (1024 * 1024)
00100 
00101 /* Default I/O vector size */
00102 #define H5D_IO_VECTOR_SIZE      1024
00103 
00104 /* Default VL allocation & free info */
00105 #define H5D_VLEN_ALLOC          NULL
00106 #define H5D_VLEN_ALLOC_INFO     NULL
00107 #define H5D_VLEN_FREE           NULL
00108 #define H5D_VLEN_FREE_INFO      NULL
00109 
00110 
00111 /****************************/
00112 /* Library Private Typedefs */
00113 /****************************/
00114 
00115 /* Typedef for dataset in memory (defined in H5Dpkg.h) */
00116 typedef struct H5D_t H5D_t;
00117 
00118 /* Typedef for cached dataset transfer property list information */
00119 typedef struct H5D_dxpl_cache_t {
00120     size_t max_temp_buf;        /* Maximum temporary buffer size (H5D_XFER_MAX_TEMP_BUF_NAME) */
00121     void *tconv_buf;            /* Temporary conversion buffer (H5D_XFER_TCONV_BUF_NAME) */
00122     void *bkgr_buf;             /* Background conversion buffer (H5D_XFER_BKGR_BUF_NAME) */
00123     H5T_bkg_t bkgr_buf_type;    /* Background buffer type (H5D_XFER_BKGR_BUF_NAME) */
00124     H5Z_EDC_t err_detect;       /* Error detection info (H5D_XFER_EDC_NAME) */
00125     double btree_split_ratio[3];/* B-tree split ratios (H5D_XFER_BTREE_SPLIT_RATIO_NAME) */
00126     size_t vec_size;            /* Size of hyperslab vector (H5D_XFER_HYPER_VECTOR_SIZE_NAME) */
00127 #ifdef H5_HAVE_PARALLEL
00128     H5FD_mpio_xfer_t xfer_mode; /* Parallel transfer for this request (H5D_XFER_IO_XFER_MODE_NAME) */
00129     H5FD_mpio_collective_opt_t coll_opt_mode; /* Parallel transfer with independent IO or collective IO with this mode */
00130 #endif /*H5_HAVE_PARALLEL*/
00131     H5Z_cb_t filter_cb;         /* Filter callback function (H5D_XFER_FILTER_CB_NAME) */
00132     H5Z_data_xform_t *data_xform_prop; /* Data transform prop (H5D_XFER_XFORM_NAME) */
00133 } H5D_dxpl_cache_t;
00134 
00135 /* Typedef for cached dataset creation property list information */
00136 typedef struct H5D_dcpl_cache_t {
00137     H5O_fill_t fill;            /* Fill value info (H5D_CRT_FILL_VALUE_NAME) */
00138     H5O_pline_t pline;          /* I/O pipeline info (H5D_CRT_DATA_PIPELINE_NAME) */
00139     H5O_efl_t efl;              /* External file list info (H5D_CRT_EXT_FILE_LIST_NAME) */
00140 } H5D_dcpl_cache_t;
00141 
00142 
00143 /*****************************/
00144 /* Library Private Variables */
00145 /*****************************/
00146 
00147 
00148 /******************************/
00149 /* Library Private Prototypes */
00150 /******************************/
00151 
00152 H5_DLL herr_t H5D_init(void);
00153 H5_DLL H5D_t *H5D_open(const H5G_loc_t *loc, hid_t dapl_id, hid_t dxpl_id);
00154 H5_DLL herr_t H5D_close(H5D_t *dataset);
00155 H5_DLL H5O_loc_t *H5D_oloc(H5D_t *dataset);
00156 H5_DLL H5G_name_t *H5D_nameof(H5D_t *dataset);
00157 H5_DLL H5T_t *H5D_typeof(const H5D_t *dset);
00158 H5_DLL herr_t H5D_flush(const H5F_t *f, hid_t dxpl_id, unsigned flags);
00159 
00160 /* Functions that operate on vlen data */
00161 H5_DLL herr_t H5D_vlen_reclaim(hid_t type_id, H5S_t *space, hid_t plist_id,
00162     void *buf);
00163 
00164 /* Functions that operate on contiguous storage */
00165 H5_DLL herr_t H5D_contig_delete(H5F_t *f, hid_t dxpl_id,
00166     const H5O_layout_t *layout);
00167 
00168 /* Functions that operate on chunked storage */
00169 H5_DLL herr_t H5D_chunk_idx_reset(H5O_layout_t *layout);
00170 H5_DLL herr_t H5D_chunk_delete(H5F_t *f, hid_t dxpl_id, H5O_layout_t *layout);
00171 
00172 /* Functions that operate on indexed storage */
00173 H5_DLL herr_t H5D_btree_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream,
00174                                 int indent, int fwidth, unsigned ndims);
00175 
00176 #endif /* _H5Dprivate_H */
00177