Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-06-20 08:49:44

0001 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
0002  * Copyright by The HDF Group.                                               *
0003  * All rights reserved.                                                      *
0004  *                                                                           *
0005  * This file is part of HDF5.  The full HDF5 copyright notice, including     *
0006  * terms governing use, modification, and redistribution, is contained in    *
0007  * the COPYING file, which can be found at the root of the source code       *
0008  * distribution tree, or in https://www.hdfgroup.org/licenses.               *
0009  * If you do not have access to either file, you may request a copy from     *
0010  * help@hdfgroup.org.                                                        *
0011  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
0012 
0013 #ifndef H5DOpublic_H
0014 #define H5DOpublic_H
0015 
0016 #ifdef __cplusplus
0017 extern "C" {
0018 #endif
0019 
0020 /** \page H5DO_UG HDF5 High Level Optimizations
0021  * @todo Under Construction
0022  */
0023 
0024 /**\defgroup H5DO HDF5 Optimizations APIs (H5DO)
0025  *
0026  * <em>Bypassing default HDF5 behavior in order to optimize for specific
0027  * use cases (H5DO)</em>
0028  *
0029  * HDF5 functions described is this section are implemented in the HDF5 High-level
0030  * library as optimized functions. These functions generally require careful setup
0031  * and testing as they enable an application to bypass portions of the HDF5
0032  * library's I/O pipeline for performance purposes.
0033  *
0034  * These functions are distributed in the standard HDF5 distribution and are
0035  * available any time the HDF5 High-level library is available.
0036  *
0037  * - \ref H5DOappend
0038  *    \n Appends data to a dataset along a specified dimension.
0039  * - \ref H5DOread_chunk
0040  *   \n Reads a raw data chunk directly from a dataset in a file into a buffer (DEPRECATED)
0041  * - \ref H5DOwrite_chunk
0042  *   \n  Writes a raw data chunk from a buffer directly to a dataset in a file (DEPRECATED)
0043  *
0044  */
0045 
0046 /*-------------------------------------------------------------------------
0047  *
0048  * "Optimized dataset" routines.
0049  *
0050  *-------------------------------------------------------------------------
0051  */
0052 
0053 /**
0054  * --------------------------------------------------------------------------
0055  * \ingroup H5DO
0056  *
0057  * \brief Appends data to a dataset along a specified dimension.
0058  *
0059  * \param[in] dset_id   Dataset identifier
0060  * \param[in] dxpl_id   Dataset transfer property list identifier
0061  * \param[in] axis      Dataset Dimension (0-based) for the append
0062  * \param[in] extension Number of elements to append for the
0063  *                      axis-th dimension
0064  * \param[in] memtype   The memory datatype identifier
0065  * \param[in] buf       Buffer with data for the append
0066  *
0067  * \return \herr_t
0068  *
0069  * \details The H5DOappend() routine extends a dataset by \p extension
0070  *          number of elements along a dimension specified by a
0071  *          dimension \p axis and writes \p buf of elements to the
0072  *          dataset. Dimension \p axis is 0-based. Elements’ type
0073  *          is described by \p memtype.
0074  *
0075  *          This routine combines calling H5Dset_extent(),
0076  *          H5Sselect_hyperslab(), and H5Dwrite() into a single routine
0077  *          that simplifies application development for the common case
0078  *          of appending elements to an existing dataset.
0079  *
0080  *          For a multi-dimensional dataset, appending to one dimension
0081  *          will write a contiguous hyperslab over the other dimensions.
0082  *          For example, if a 3-D dataset has dimension sizes (3, 5, 8),
0083  *          extending the 0th dimension (currently of size 3) by 3 will
0084  *          append 3*5*8 = 120 elements (which must be pointed to by the
0085  *          \p buffer parameter) to the dataset, making its final
0086  *          dimension sizes (6, 5, 8).
0087  *
0088  *          If a dataset has more than one unlimited dimension, any of
0089  *          those dimensions may be appended to, although only along
0090  *          one dimension per call to H5DOappend().
0091  *
0092  * \since   1.10.0
0093  *
0094  */
0095 H5_HLDLL herr_t H5DOappend(hid_t dset_id, hid_t dxpl_id, unsigned axis, size_t extension, hid_t memtype,
0096                            const void *buf);
0097 
0098 /* Symbols defined for compatibility with previous versions of the HDF5 API.
0099  *
0100  * Use of these symbols is deprecated.
0101  */
0102 #ifndef H5_NO_DEPRECATED_SYMBOLS
0103 
0104 /* Compatibility wrappers for functionality moved to H5D */
0105 
0106 /**
0107  * --------------------------------------------------------------------------
0108  * \ingroup H5DO
0109  *
0110  * \brief Writes a raw data chunk from a buffer directly to a dataset in a file.
0111  *
0112  * \param[in] dset_id       Identifier for the dataset to write to
0113  * \param[in] dxpl_id       Transfer property list identifier for
0114  *                          this I/O operation
0115  * \param[in] filters       Mask for identifying the filters in use
0116  * \param[in] offset        Logical position of the chunk's first element
0117  *                          in the dataspace
0118  * \param[in] data_size     Size of the actual data to be written in bytes
0119  * \param[in] buf           Buffer containing data to be written to the chunk
0120  *
0121  * \return \herr_t
0122  *
0123  * \deprecated This function was deprecated in favor of the function
0124  *             H5Dwrite_chunk() of HDF5-1.10.3.
0125  *             The functionality of H5DOwrite_chunk() was moved
0126  *             to H5Dwrite_chunk().
0127  * \deprecated For compatibility, this API call has been left as a stub which
0128  *             simply calls H5Dwrite_chunk(). New code should use H5Dwrite_chunk().
0129  *
0130  * \details The H5DOwrite_chunk() writes a raw data chunk as specified by its
0131  *          logical \p offset in a chunked dataset \p dset_id from the application
0132  *          memory buffer \p buf to the dataset in the file. Typically, the data
0133  *          in \p buf is preprocessed in memory by a custom transformation, such as
0134  *          compression. The chunk will bypass the library's internal data
0135  *          transfer pipeline, including filters, and will be written directly to the file.
0136  *
0137  *          \p dxpl_id is a data transfer property list identifier.
0138  *
0139  *          \p filters is a mask providing a record of which filters are used
0140  *          with the chunk. The default value of the mask is zero (\c 0),
0141  *          indicating that all enabled filters are applied. A filter is skipped
0142  *          if the bit corresponding to the filter's position in the pipeline
0143  *          (<tt>0 ≤ position < 32</tt>) is turned on. This mask is saved
0144  *          with the chunk in the file.
0145  *
0146  *          \p offset is an array specifying the logical position of the first
0147  *          element of the chunk in the dataset's dataspace. The length of the
0148  *          offset array must equal the number of dimensions, or rank, of the
0149  *          dataspace. The values in \p offset must not exceed the dimension limits
0150  *          and must specify a point that falls on a dataset chunk boundary.
0151  *
0152  *          \p data_size is the size in bytes of the chunk, representing the number of
0153  *          bytes to be read from the buffer \p buf. If the data chunk has been
0154  *          precompressed, \p data_size should be the size of the compressed data.
0155  *
0156  *          \p buf is the memory buffer containing data to be written to the chunk in the file.
0157  *
0158  * \attention   Exercise caution when using H5DOread_chunk() and H5DOwrite_chunk(),
0159  *              as they read and write data chunks directly in a file.
0160  *              H5DOwrite_chunk() bypasses hyperslab selection, the conversion of data
0161  *              from one datatype to another, and the filter pipeline to write the chunk.
0162  *              Developers should have experience with these processes before
0163  *              using this function. Please see
0164  *              <a href="https://\DOCURL/advanced_topics/UsingDirectChunkWrite.pdf">
0165  *              Using the Direct Chunk Write Function</a>
0166  *              for more information.
0167  *
0168  * \note    H5DOread_chunk() and H5DOwrite_chunk() are not
0169  *          supported under parallel and do not support variable length types.
0170  *
0171  * \par Example
0172  * The following code illustrates the use of H5DOwrite_chunk to write
0173  * an entire dataset, chunk by chunk:
0174  * \snippet H5DO_examples.c H5DOwrite
0175  *
0176  * \version 1.10.3  Function deprecated in favor of H5Dwrite_chunk.
0177  *
0178  * \since   1.8.11
0179  */
0180 H5_HLDLL herr_t H5DOwrite_chunk(hid_t dset_id, hid_t dxpl_id, uint32_t filters, const hsize_t *offset,
0181                                 size_t data_size, const void *buf);
0182 
0183 /**
0184  * --------------------------------------------------------------------------
0185  * \ingroup H5DO
0186  *
0187  * \brief Reads a raw data chunk directly from a dataset in a file into a buffer.
0188  *
0189  * \param[in] dset_id           Identifier for the dataset to be read
0190  * \param[in] dxpl_id           Transfer property list identifier for
0191  *                              this I/O operation
0192  * \param[in] offset            Logical position of the chunk's first
0193                                 element in the dataspace
0194  * \param[in,out] filters       Mask for identifying the filters used
0195  *                              with the chunk
0196  * \param[in] buf               Buffer containing the chunk read from
0197  *                              the dataset
0198  *
0199  * \return \herr_t
0200  *
0201  * \deprecated This function was deprecated in favor of the function
0202  *             H5Dread_chunk() as of HDF5-1.10.3.
0203  *             In HDF5 1.10.3, the functionality of H5DOread_chunk()
0204  *             was moved to H5Dread_chunk().
0205  * \deprecated For compatibility, this API call has been left as a stub which
0206  *             simply calls H5Dread_chunk().  New code should use H5Dread_chunk().
0207  *
0208  * \details The H5DOread_chunk() reads a raw data chunk as specified
0209  *          by its logical \p offset in a chunked dataset \p dset_id
0210  *          from the dataset in the file into the application memory
0211  *          buffer \p buf. The data in \p buf is read directly from the file
0212  *          bypassing the library's internal data transfer pipeline,
0213  *          including filters.
0214  *
0215  *          \p dxpl_id is a data transfer property list identifier.
0216  *
0217  *          The mask \p filters indicates which filters are used with the
0218  *          chunk when written. A zero value indicates that all enabled filters
0219  *          are applied on the chunk. A filter is skipped if the bit corresponding
0220  *          to the filter's position in the pipeline
0221  *          (<tt>0 ≤ position < 32</tt>) is turned on.
0222  *
0223  *          \p offset is an array specifying the logical position of the first
0224  *          element of the chunk in the dataset's dataspace. The length of the
0225  *          offset array must equal the number of dimensions, or rank, of the
0226  *          dataspace. The values in \p offset must not exceed the dimension
0227  *          limits and must specify a point that falls on a dataset chunk boundary.
0228  *
0229  *          \p buf is the memory buffer containing the chunk read from the dataset
0230  *          in the file.
0231  *
0232  * \par Example
0233  * The following code illustrates the use of H5DOread_chunk()
0234  * to read a chunk from a dataset:
0235  * \snippet H5DO_examples.c H5DOread
0236  *
0237  * \version 1.10.3  Function deprecated in favor of H5Dread_chunk.
0238  *
0239  * \since   1.10.2, 1.8.19
0240  */
0241 H5_HLDLL herr_t H5DOread_chunk(hid_t dset_id, hid_t dxpl_id, const hsize_t *offset, uint32_t *filters /*out*/,
0242                                void *buf /*out*/);
0243 
0244 #endif /* H5_NO_DEPRECATED_SYMBOLS */
0245 
0246 #ifdef __cplusplus
0247 }
0248 #endif
0249 
0250 #endif