![]() |
|
|||
File indexing completed on 2025-04-18 09:16:02
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 /* 0014 * This file contains public declarations for the H5F module. 0015 */ 0016 #ifndef H5Fpublic_H 0017 #define H5Fpublic_H 0018 0019 #include "H5public.h" /* Generic Functions */ 0020 #include "H5ACpublic.h" /* Metadata Cache */ 0021 #include "H5Ipublic.h" /* Identifiers */ 0022 0023 /* When this header is included from a private header, don't make calls to H5check() */ 0024 #undef H5CHECK 0025 #ifndef H5private_H 0026 #define H5CHECK H5check(), 0027 #else /* H5private_H */ 0028 #define H5CHECK 0029 #endif /* H5private_H */ 0030 0031 /* When this header is included from a private HDF5 header, don't make calls to H5open() */ 0032 #undef H5OPEN 0033 #ifndef H5private_H 0034 #define H5OPEN H5open(), 0035 #else /* H5private_H */ 0036 #define H5OPEN 0037 #endif /* H5private_H */ 0038 0039 /* 0040 * These are the bits that can be passed to the `flags' argument of 0041 * H5Fcreate() and H5Fopen(). Use the bit-wise OR operator (|) to combine 0042 * them as needed. As a side effect, they call H5check_version() to make sure 0043 * that the application is compiled with a version of the hdf5 header files 0044 * which are compatible with the library to which the application is linked. 0045 * We're assuming that these constants are used rather early in the hdf5 0046 * session. 0047 */ 0048 #define H5F_ACC_RDONLY (H5CHECK H5OPEN 0x0000u) /**< Absence of RDWR: read-only */ 0049 #define H5F_ACC_RDWR (H5CHECK H5OPEN 0x0001u) /**< Open for read and write */ 0050 #define H5F_ACC_TRUNC (H5CHECK H5OPEN 0x0002u) /**< Overwrite existing files */ 0051 #define H5F_ACC_EXCL (H5CHECK H5OPEN 0x0004u) /**< Fail if file already exists*/ 0052 /* NOTE: 0x0008u was H5F_ACC_DEBUG, now deprecated */ 0053 #define H5F_ACC_CREAT (H5CHECK H5OPEN 0x0010u) /**< Create non-existing files */ 0054 #define H5F_ACC_SWMR_WRITE \ 0055 (H5CHECK 0x0020u) /**< Indicate that this file is open for writing in a \ 0056 * single-writer/multi-reader (SWMR) scenario. \ 0057 * Note that the process(es) opening the file for reading \ 0058 * must open the file with #H5F_ACC_RDONLY and use the \ 0059 * #H5F_ACC_SWMR_READ access flag. */ 0060 #define H5F_ACC_SWMR_READ \ 0061 (H5CHECK 0x0040u) /**< Indicate that this file is open for reading in a \ 0062 * single-writer/multi-reader (SWMR) scenario. Note that \ 0063 * the process(es) opening the file for SWMR reading must \ 0064 * also open the file with the #H5F_ACC_RDONLY flag. */ 0065 0066 /** 0067 * Default property list identifier 0068 * 0069 * \internal Value passed to H5Pset_elink_acc_flags to cause flags to be taken from the parent file. 0070 * \internal ignore setting on lapl 0071 */ 0072 #define H5F_ACC_DEFAULT (H5CHECK H5OPEN 0xffffu) 0073 0074 /* Flags for H5Fget_obj_count() & H5Fget_obj_ids() calls */ 0075 #define H5F_OBJ_FILE (0x0001u) /**< File objects */ 0076 #define H5F_OBJ_DATASET (0x0002u) /**< Dataset objects */ 0077 #define H5F_OBJ_GROUP (0x0004u) /**< Group objects */ 0078 #define H5F_OBJ_DATATYPE (0x0008u) /**< Datatype objects */ 0079 #define H5F_OBJ_ATTR (0x0010u) /**< Attribute objects */ 0080 #define H5F_OBJ_ALL (H5F_OBJ_FILE | H5F_OBJ_DATASET | H5F_OBJ_GROUP | H5F_OBJ_DATATYPE | H5F_OBJ_ATTR) 0081 #define H5F_OBJ_LOCAL \ 0082 (0x0020u) /**< Restrict search to objects opened through current file ID \ 0083 (as opposed to objects opened through any file ID accessing this file) */ 0084 0085 #define H5F_FAMILY_DEFAULT 0 /* (hsize_t) */ 0086 0087 #ifdef H5_HAVE_PARALLEL 0088 /** 0089 * Use this constant string as the MPI_Info key to set H5Fmpio debug flags. 0090 * To turn on H5Fmpio debug flags, set the MPI_Info value with this key to 0091 * have the value of a string consisting of the characters that turn on the 0092 * desired flags. 0093 */ 0094 #define H5F_MPIO_DEBUG_KEY "H5F_mpio_debug_key" 0095 #endif /* H5_HAVE_PARALLEL */ 0096 0097 /** 0098 * The scope of an operation such as H5Fflush(), e.g., 0099 * a single file vs. a set of mounted files 0100 */ 0101 typedef enum H5F_scope_t { 0102 H5F_SCOPE_LOCAL = 0, /**< The specified file handle only */ 0103 H5F_SCOPE_GLOBAL = 1 /**< The entire virtual file */ 0104 } H5F_scope_t; 0105 0106 /** 0107 * Unlimited file size for H5Pset_external() 0108 */ 0109 #define H5F_UNLIMITED HSIZE_UNDEF 0110 0111 /** 0112 * How does file close behave? 0113 */ 0114 typedef enum H5F_close_degree_t { 0115 H5F_CLOSE_DEFAULT = 0, /**< Use the degree pre-defined by underlying VFD */ 0116 H5F_CLOSE_WEAK = 1, /**< File closes only after all opened objects are closed */ 0117 H5F_CLOSE_SEMI = 2, /**< If no opened objects, file is closed; otherwise, file close fails */ 0118 H5F_CLOSE_STRONG = 3 /**< If there are opened objects, close them first, then close file */ 0119 } H5F_close_degree_t; 0120 0121 /** 0122 * Current "global" information about file 0123 */ 0124 //! <!-- [H5F_info2_t_snip] --> 0125 typedef struct H5F_info2_t { 0126 struct { 0127 unsigned version; /**< Superblock version number */ 0128 hsize_t super_size; /**< Superblock size */ 0129 hsize_t super_ext_size; /**< Superblock extension size */ 0130 } super; 0131 struct { 0132 unsigned version; /**< Version number of file free space management */ 0133 hsize_t meta_size; /**< Free space manager metadata size */ 0134 hsize_t tot_space; /**< Amount of free space in the file */ 0135 } free; 0136 struct { 0137 unsigned version; /**< Version number of shared object header info */ 0138 hsize_t hdr_size; /**< Shared object header message header size */ 0139 H5_ih_info_t msgs_info; /**< Shared object header message index & heap size */ 0140 } sohm; 0141 } H5F_info2_t; 0142 //! <!-- [H5F_info2_t_snip] --> 0143 0144 /** 0145 * Types of allocation requests. The values larger than #H5FD_MEM_DEFAULT 0146 * should not change other than adding new types to the end. These numbers 0147 * might appear in files. 0148 * 0149 * \internal Please change the log VFD flavors array if you change this 0150 * enumeration. 0151 */ 0152 typedef enum H5F_mem_t { 0153 H5FD_MEM_NOLIST = -1, /**< Data should not appear in the free list. 0154 * Must be negative. 0155 */ 0156 H5FD_MEM_DEFAULT = 0, /**< Value not yet set. Can also be the 0157 * datatype set in a larger allocation 0158 * that will be suballocated by the library. 0159 * Must be zero. 0160 */ 0161 H5FD_MEM_SUPER = 1, /**< Superblock data */ 0162 H5FD_MEM_BTREE = 2, /**< B-tree data */ 0163 H5FD_MEM_DRAW = 3, /**< Raw data (content of datasets, etc.) */ 0164 H5FD_MEM_GHEAP = 4, /**< Global heap data */ 0165 H5FD_MEM_LHEAP = 5, /**< Local heap data */ 0166 H5FD_MEM_OHDR = 6, /**< Object header data */ 0167 0168 H5FD_MEM_NTYPES /**< Sentinel value - must be last */ 0169 } H5F_mem_t; 0170 0171 /** 0172 * Free space section information 0173 */ 0174 //! <!-- [H5F_sect_info_t_snip] --> 0175 typedef struct H5F_sect_info_t { 0176 haddr_t addr; /**< Address of free space section */ 0177 hsize_t size; /**< Size of free space section */ 0178 } H5F_sect_info_t; 0179 //! <!-- [H5F_sect_info_t_snip] --> 0180 0181 /** 0182 * Library's format versions 0183 */ 0184 typedef enum H5F_libver_t { 0185 H5F_LIBVER_ERROR = -1, 0186 H5F_LIBVER_EARLIEST = 0, /**< Use the earliest possible format for storing objects */ 0187 H5F_LIBVER_V18 = 1, /**< Use the latest v18 format for storing objects */ 0188 H5F_LIBVER_V110 = 2, /**< Use the latest v110 format for storing objects */ 0189 H5F_LIBVER_V112 = 3, /**< Use the latest v112 format for storing objects */ 0190 H5F_LIBVER_V114 = 4, /**< Use the latest v114 format for storing objects */ 0191 H5F_LIBVER_NBOUNDS /**< Sentinel */ 0192 } H5F_libver_t; 0193 0194 #define H5F_LIBVER_LATEST H5F_LIBVER_V114 0195 0196 /** 0197 * File space handling strategy 0198 */ 0199 //! <!-- [H5F_fspace_strategy_t_snip] --> 0200 typedef enum H5F_fspace_strategy_t { 0201 H5F_FSPACE_STRATEGY_FSM_AGGR = 0, /**< Mechanisms: free-space managers, aggregators, and virtual file 0202 drivers This is the library default when not set */ 0203 H5F_FSPACE_STRATEGY_PAGE = 0204 1, /**< Mechanisms: free-space managers with embedded paged aggregation and virtual file drivers */ 0205 H5F_FSPACE_STRATEGY_AGGR = 2, /**< Mechanisms: aggregators and virtual file drivers */ 0206 H5F_FSPACE_STRATEGY_NONE = 3, /**< Mechanisms: virtual file drivers */ 0207 H5F_FSPACE_STRATEGY_NTYPES /**< Sentinel */ 0208 } H5F_fspace_strategy_t; 0209 //! <!-- [H5F_fspace_strategy_t_snip] --> 0210 0211 /** 0212 * File space handling strategy for release 1.10.0 0213 * 0214 * \deprecated 1.10.1 0215 */ 0216 typedef enum H5F_file_space_type_t { 0217 H5F_FILE_SPACE_DEFAULT = 0, /**< Default (or current) free space strategy setting */ 0218 H5F_FILE_SPACE_ALL_PERSIST = 1, /**< Persistent free space managers, aggregators, virtual file driver */ 0219 H5F_FILE_SPACE_ALL = 2, /**< Non-persistent free space managers, aggregators, virtual file driver 0220 This is the library default */ 0221 H5F_FILE_SPACE_AGGR_VFD = 3, /**< Aggregators, Virtual file driver */ 0222 H5F_FILE_SPACE_VFD = 4, /**< Virtual file driver */ 0223 H5F_FILE_SPACE_NTYPES /**< Sentinel */ 0224 } H5F_file_space_type_t; 0225 0226 //! <!-- [H5F_retry_info_t_snip] --> 0227 #define H5F_NUM_METADATA_READ_RETRY_TYPES 21 0228 0229 /** 0230 * Data structure to report the collection of read retries for metadata items with checksum as 0231 * used by H5Fget_metadata_read_retry_info() 0232 */ 0233 typedef struct H5F_retry_info_t { 0234 unsigned nbins; 0235 uint32_t *retries[H5F_NUM_METADATA_READ_RETRY_TYPES]; 0236 } H5F_retry_info_t; 0237 //! <!-- [H5F_retry_info_t_snip] --> 0238 0239 /** 0240 * Callback for H5Pset_object_flush_cb() in a file access property list 0241 */ 0242 typedef herr_t (*H5F_flush_cb_t)(hid_t object_id, void *udata); 0243 0244 /* 0245 * These are the bits that can be passed to the `flags' argument of 0246 * H5Pset_relax_file_integrity_checks(). Use the bit-wise OR operator (|) to 0247 * combine them as needed. 0248 */ 0249 #define H5F_RFIC_UNUSUAL_NUM_UNUSED_NUMERIC_BITS \ 0250 (0x0001u) /**< Suppress errors for numeric datatypes with an unusually \ 0251 * high number of unused bits. See documentation for \ 0252 * H5Pset_relax_file_integrity_checks for details. */ 0253 #define H5F_RFIC_ALL \ 0254 (H5F_RFIC_UNUSUAL_NUM_UNUSED_NUMERIC_BITS) /**< Suppress all format integrity check errors. See \ 0255 * documentation for H5Pset_relax_file_integrity_checks \ 0256 * for details. */ 0257 0258 /*********************/ 0259 /* Public Prototypes */ 0260 /*********************/ 0261 #ifdef __cplusplus 0262 extern "C" { 0263 #endif 0264 0265 /** 0266 * \ingroup H5F 0267 * 0268 * \brief Checks if a file can be opened with a given file access property 0269 * list 0270 * 0271 * \param[in] container_name Name of a file 0272 * \fapl_id 0273 * 0274 * \return \htri_t 0275 * 0276 * \details H5Fis_accessible() checks if the file specified by \p 0277 * container_name can be opened with the file access property list 0278 * \p fapl_id. 0279 * 0280 * \note The H5Fis_accessible() function enables files to be checked with a 0281 * given file access property list, unlike H5Fis_hdf5(), which only uses 0282 * the default file driver when opening a file. 0283 * 0284 * \since 1.12.0 0285 * 0286 */ 0287 H5_DLL htri_t H5Fis_accessible(const char *container_name, hid_t fapl_id); 0288 /** 0289 * \ingroup H5F 0290 * 0291 * \brief Creates an HDF5 file 0292 * 0293 * \param[in] filename Name of the file to create 0294 * \param[in] flags File access flags. Allowable values are: 0295 * - #H5F_ACC_TRUNC: Truncate file, if it already exists, 0296 * erasing all data previously stored in the file 0297 * - #H5F_ACC_EXCL: Fail if file already exists 0298 * \fcpl_id 0299 * \fapl_id 0300 * \return \hid_t{file} 0301 * 0302 * \details H5Fcreate() is the primary function for creating HDF5 files; it 0303 * creates a new HDF5 file with the specified name and property lists. 0304 * 0305 * The \p filename parameter specifies the name of the new file. 0306 * 0307 * The \p flags parameter specifies whether an existing file is to be 0308 * overwritten. It should be set to either #H5F_ACC_TRUNC to overwrite 0309 * an existing file or #H5F_ACC_EXCL, instructing the function to fail 0310 * if the file already exists. 0311 * 0312 * New files are always created in read-write mode, so the read-write 0313 * and read-only flags, #H5F_ACC_RDWR and #H5F_ACC_RDONLY, 0314 * respectively, are not relevant in this function. Further note that 0315 * a specification of #H5F_ACC_RDONLY will be ignored; the file will 0316 * be created in read-write mode, regardless. 0317 * 0318 * More complex behaviors of file creation and access are controlled 0319 * through the file creation and file access property lists, 0320 * \p fcpl_id and \p fapl_id, respectively. The value of #H5P_DEFAULT 0321 * for any property list value indicates that the library should use 0322 * the default values for that appropriate property list. 0323 * 0324 * The return value is a file identifier for the newly-created file; 0325 * this file identifier should be closed by calling H5Fclose() when 0326 * it is no longer needed. 0327 * 0328 * \par Example 0329 * \snippet H5F_examples.c minimal 0330 * 0331 * \note #H5F_ACC_TRUNC and #H5F_ACC_EXCL are mutually exclusive; use 0332 * exactly one. 0333 * 0334 * \note An additional flag, #H5F_ACC_DEBUG, prints debug information. This 0335 * flag can be combined with one of the above values using the bit-wise 0336 * OR operator (\c |), but it is used only by HDF5 library developers; 0337 * \Emph{it is neither tested nor supported for use in applications}. 0338 * 0339 * \attention \Bold{Special case — File creation in the case of an already-open file:} 0340 * If a file being created is already opened, by either a previous 0341 * H5Fopen() or H5Fcreate() call, the HDF5 library may or may not 0342 * detect that the open file and the new file are the same physical 0343 * file. (See H5Fopen() regarding the limitations in detecting the 0344 * re-opening of an already-open file.)\n 0345 * If the library detects that the file is already opened, 0346 * H5Fcreate() will return a failure, regardless of the use of 0347 * #H5F_ACC_TRUNC.\n 0348 * If the library does not detect that the file is already opened 0349 * and #H5F_ACC_TRUNC is not used, H5Fcreate() will return a failure 0350 * because the file already exists. Note that this is correct 0351 * behavior.\n 0352 * But if the library does not detect that the file is already 0353 * opened and #H5F_ACC_TRUNC is used, H5Fcreate() will truncate the 0354 * existing file and return a valid file identifier. Such a 0355 * truncation of a currently-opened file will almost certainly 0356 * result in errors. While unlikely, the HDF5 library may not be 0357 * able to detect, and thus report, such errors.\n 0358 * Applications should avoid calling H5Fcreate() with an already 0359 * opened file. 0360 * 0361 * \since 1.0.0 0362 * 0363 * \see H5Fopen(), H5Fclose() 0364 * 0365 */ 0366 H5_DLL hid_t H5Fcreate(const char *filename, unsigned flags, hid_t fcpl_id, hid_t fapl_id); 0367 /** 0368 * -------------------------------------------------------------------------- 0369 * \ingroup ASYNC 0370 * \async_variant_of{H5Fcreate} 0371 * 0372 * \since 1.12.0 0373 * 0374 */ 0375 #ifndef H5_DOXYGEN 0376 H5_DLL hid_t H5Fcreate_async(const char *app_file, const char *app_func, unsigned app_line, 0377 const char *filename, unsigned flags, hid_t fcpl_id, hid_t fapl_id, hid_t es_id); 0378 #else 0379 H5_DLL hid_t H5Fcreate_async(const char *filename, unsigned flags, hid_t fcpl_id, hid_t fapl_id, hid_t es_id); 0380 #endif 0381 /** 0382 * \ingroup H5F 0383 * 0384 * \brief Opens an existing HDF5 file 0385 * 0386 * \param[in] filename Name of the file to be opened 0387 * \param[in] flags File access flags. Allowable values are: 0388 * - #H5F_ACC_RDWR: Allows read and write access to file 0389 * - #H5F_ACC_RDONLY: Allows read-only access to file 0390 * - #H5F_ACC_RDWR \c | #H5F_ACC_SWMR_WRITE: Indicates that 0391 * the file is open for writing in a 0392 * single-writer/multi-writer (SWMR) scenario. 0393 * - #H5F_ACC_RDONLY \c | #H5F_ACC_SWMR_READ: Indicates 0394 * that the file is open for reading in a 0395 * single-writer/multi-reader (SWMR) scenario. 0396 * - An additional flag, #H5F_ACC_DEBUG, prints debug 0397 * information. This flag can be combined with one of the 0398 * above values using the bit-wise OR operator (\c |), but 0399 * it is used only by HDF5 library developers; 0400 * \Emph{it is neither tested nor supported} for use in 0401 * applications. 0402 * \fapl_id 0403 * \return \hid_t{file} 0404 * 0405 * \details H5Fopen() is the primary function for accessing existing HDF5 files. 0406 * This function opens the named file in the specified access mode and 0407 * with the specified access property list. 0408 * 0409 * Note that H5Fopen() does not create a file if it does not already 0410 * exist; see H5Fcreate(). 0411 * 0412 * The \p filename parameter specifies the name of the file to be 0413 * opened. 0414 * 0415 * The \p fapl_id parameter specifies the file access property list. 0416 * The use of #H5P_DEFAULT specifies that default I/O access properties 0417 * are to be used. 0418 * 0419 * The \p flags parameter specifies whether the file will be opened in 0420 * read-write or read-only mode, #H5F_ACC_RDWR or #H5F_ACC_RDONLY, 0421 * respectively. More complex behaviors of file access are controlled 0422 * through the file-access property list. 0423 * 0424 * The return value is a file identifier for the open file; this file 0425 * identifier should be closed by calling H5Fclose() when it is no 0426 * longer needed. 0427 * 0428 * \par Example 0429 * \snippet H5F_examples.c open 0430 * 0431 * \note #H5F_ACC_RDWR and #H5F_ACC_RDONLY are mutually exclusive; use 0432 * exactly one. 0433 * 0434 * \attention \Bold{Special cases — Multiple opens:} A file can often be opened 0435 * with a new H5Fopen() call without closing an already-open 0436 * identifier established in a previous H5Fopen() or H5Fcreate() 0437 * call. Each such H5Fopen() call will return a unique identifier 0438 * and the file can be accessed through any of these identifiers as 0439 * long as the identifier remains valid. In such multiply-opened 0440 * cases, the open calls must use the same flags argument and the 0441 * file access property lists must use the same file close degree 0442 * property setting (see the external link discussion below and 0443 * H5Pset_fclose_degree()).\n 0444 * In some cases, such as files on a local Unix file system, the 0445 * HDF5 library can detect that a file is multiply opened and will 0446 * maintain coherent access among the file identifiers.\n 0447 * But in many other cases, such as parallel file systems or 0448 * networked file systems, it is not always possible to detect 0449 * multiple opens of the same physical file. In such cases, HDF5 0450 * will treat the file identifiers as though they are accessing 0451 * different files and will be unable to maintain coherent access. 0452 * Errors are likely to result in these cases. While unlikely, the 0453 * HDF5 library may not be able to detect, and thus report, 0454 * such errors.\n 0455 * It is generally recommended that applications avoid multiple 0456 * opens of the same file. 0457 * 0458 * \attention \Bold{Special restriction on multiple opens of a file first 0459 * opened by means of an external link:} When an external link is 0460 * followed, the external file is always opened with the weak file 0461 * close degree property setting, #H5F_CLOSE_WEAK (see 0462 * H5Lcreate_external() and H5Pset_fclose_degree()). If the file is 0463 * reopened with H5Fopen while it remains held open from such an 0464 * external link call, the file access property list used in the 0465 * open call must include the file close degree setting 0466 * #H5F_CLOSE_WEAK or the open will fail. 0467 * 0468 * \version 1.10.0 The #H5F_ACC_SWMR_WRITE and #H5F_ACC_SWMR_READ flags were added. 0469 * 0470 * \since 1.0.0 0471 * 0472 * \see H5Fclose() 0473 * 0474 * 0475 */ 0476 H5_DLL hid_t H5Fopen(const char *filename, unsigned flags, hid_t fapl_id); 0477 /** 0478 * -------------------------------------------------------------------------- 0479 * \ingroup ASYNC 0480 * \async_variant_of{H5Fopen} 0481 * 0482 * \since 1.12.0 0483 * 0484 */ 0485 #ifndef H5_DOXYGEN 0486 H5_DLL hid_t H5Fopen_async(const char *app_file, const char *app_func, unsigned app_line, 0487 const char *filename, unsigned flags, hid_t access_plist, hid_t es_id); 0488 #else 0489 H5_DLL hid_t H5Fopen_async(const char *filename, unsigned flags, hid_t access_plist, hid_t es_id); 0490 #endif 0491 /** 0492 * \ingroup H5F 0493 * 0494 * \brief Returns a new identifier for a previously-opened HDF5 file 0495 * 0496 * \param[in] file_id Identifier of a file for which an additional identifier 0497 * is required 0498 * 0499 * \return \hid_t{file} 0500 * 0501 * \details H5Freopen() returns a new file identifier for an already-open HDF5 0502 * file, as specified by \p file_id. Both identifiers share caches and 0503 * other information. The only difference between the identifiers is 0504 * that the new identifier is not mounted anywhere and no files are 0505 * mounted on it. 0506 * 0507 * The new file identifier should be closed by calling H5Fclose() when 0508 * it is no longer needed. 0509 * 0510 * \note Note that there is no circumstance under which H5Freopen() can 0511 * actually open a closed file; the file must already be open and have an 0512 * active \p file_id. E.g., one cannot close a file with H5Fclose() on 0513 * \p file_id then use H5Freopen() on \p file_id to reopen it. 0514 * 0515 * \since 1.0.0 0516 * 0517 */ 0518 H5_DLL hid_t H5Freopen(hid_t file_id); 0519 /** 0520 * -------------------------------------------------------------------------- 0521 * \ingroup ASYNC 0522 * \async_variant_of{H5Freopen} 0523 * 0524 * \since 1.12.0 0525 * 0526 */ 0527 #ifndef H5_DOXYGEN 0528 H5_DLL hid_t H5Freopen_async(const char *app_file, const char *app_func, unsigned app_line, hid_t file_id, 0529 hid_t es_id); 0530 #else 0531 H5_DLL hid_t H5Freopen_async(hid_t file_id, hid_t es_id); 0532 #endif 0533 /** 0534 * \ingroup H5F 0535 * 0536 * \brief Flushes all buffers associated with a file to storage 0537 * 0538 * \loc_id{object_id} 0539 * \param[in] scope The scope of the flush action 0540 * 0541 * \return \herr_t 0542 * 0543 * \details H5Fflush() causes all buffers associated with a file to be 0544 * immediately flushed to storage without removing the data from the 0545 * cache. 0546 * 0547 * \p object_id can be any object associated with the file, including 0548 * the file itself, a dataset, a group, an attribute, or a named 0549 * datatype. 0550 * 0551 * \p scope specifies whether the scope of the flush action is 0552 * global or local. Valid values are as follows: 0553 * \scopes 0554 * 0555 * \par Example 0556 * \snippet H5F_examples.c flush 0557 * 0558 * \attention HDF5 does not possess full control over buffering. H5Fflush() 0559 * flushes the internal HDF5 buffers and then asks the operating system 0560 * (the OS) to flush the system buffers for the open files. After 0561 * that, the OS is responsible for ensuring that the data is 0562 * actually flushed to disk. 0563 * 0564 * \since 1.0.0 0565 * 0566 */ 0567 H5_DLL herr_t H5Fflush(hid_t object_id, H5F_scope_t scope); 0568 /** 0569 * -------------------------------------------------------------------------- 0570 * \ingroup ASYNC 0571 * \async_variant_of{H5Fflush} 0572 * 0573 * \since 1.12.0 0574 * 0575 */ 0576 #ifndef H5_DOXYGEN 0577 H5_DLL herr_t H5Fflush_async(const char *app_file, const char *app_func, unsigned app_line, hid_t object_id, 0578 H5F_scope_t scope, hid_t es_id); 0579 #else 0580 H5_DLL herr_t H5Fflush_async(hid_t object_id, H5F_scope_t scope, hid_t es_id); 0581 #endif 0582 /** 0583 * \ingroup H5F 0584 * 0585 * \brief Terminates access to an HDF5 file 0586 * 0587 * \file_id 0588 * \return \herr_t 0589 * 0590 * \details H5Fclose() terminates access to an HDF5 file (specified by 0591 * \p file_id) by flushing all data to storage. 0592 * 0593 * If this is the last file identifier open for the file and no other 0594 * access identifier is open (e.g., a dataset identifier, group 0595 * identifier, or shared datatype identifier), the file will be fully 0596 * closed and access will end. 0597 * 0598 * \par Example 0599 * \snippet H5F_examples.c minimal 0600 * 0601 * \note \Bold{Delayed close:} Note the following deviation from the 0602 * above-described behavior. If H5Fclose() is called for a file, but one 0603 * or more objects within the file remain open, those objects will remain 0604 * accessible until they are individually closed. Thus, if the dataset 0605 * \c data_sample is open when H5Fclose() is called for the file 0606 * containing it, \c data_sample will remain open and accessible 0607 * (including writable) until it is explicitly closed. The file will be 0608 * automatically closed once all objects in the file have been closed.\n 0609 * Be warned, however, that there are circumstances where it is not 0610 * possible to delay closing a file. For example, an MPI-IO file close is 0611 * a collective call; all of the processes that open the file must 0612 * close it collectively. The file cannot be closed at some time in the 0613 * future by each process in an independent fashion. Another example is 0614 * that an application using an AFS token-based file access privilege may 0615 * destroy its AFS token after H5Fclose() has returned successfully. This 0616 * would make any future access to the file, or any object within it, 0617 * illegal.\n 0618 * In such situations, applications must close all open objects in a file 0619 * before calling H5Fclose. It is generally recommended to do so in all 0620 * cases. 0621 * 0622 * \since 1.0.0 0623 * 0624 * \see H5Fopen() 0625 * 0626 */ 0627 H5_DLL herr_t H5Fclose(hid_t file_id); 0628 /** 0629 * -------------------------------------------------------------------------- 0630 * \ingroup ASYNC 0631 * \async_variant_of{H5Fclose} 0632 * 0633 * \since 1.12.0 0634 * 0635 */ 0636 #ifndef H5_DOXYGEN 0637 H5_DLL herr_t H5Fclose_async(const char *app_file, const char *app_func, unsigned app_line, hid_t file_id, 0638 hid_t es_id); 0639 #else 0640 H5_DLL herr_t H5Fclose_async(hid_t file_id, hid_t es_id); 0641 #endif 0642 /** 0643 * \ingroup H5F 0644 * 0645 * \brief Deletes an HDF5 file 0646 * 0647 * \param[in] filename Name of the file to delete 0648 * \fapl_id 0649 * 0650 * \return \herr_t 0651 * 0652 * \details H5Fdelete() deletes an HDF5 file \p filename with a file access 0653 * property list \p fapl_id. The \p fapl_id should be configured with 0654 * the same VOL connector or VFD that was used to open the file. 0655 * 0656 * This API was introduced for use with the Virtual Object Layer 0657 * (VOL). With the VOL, HDF5 "files" can map to arbitrary storage 0658 * schemes such as object stores and relational database tables. The 0659 * data created by these implementations may be inconvenient for a 0660 * user to remove without a detailed knowledge of the storage scheme. 0661 * H5Fdelete() gives VOL connector authors the ability to add 0662 * connector-specific delete code to their connectors so that users 0663 * can remove these "files" without detailed knowledge of the storage 0664 * scheme. 0665 * 0666 * For a VOL connector, H5Fdelete() deletes the file in a way that 0667 * makes sense for the specified VOL connector. 0668 * 0669 * For the native HDF5 connector, HDF5 files will be deleted via the 0670 * VFDs, each of which will have to be modified to delete the files it 0671 * creates. 0672 * 0673 * For all implementations, H5Fdelete() will first check if the file 0674 * is an HDF5 file via H5Fis_accessible(). This is done to ensure that 0675 * H5Fdelete() cannot be used as an arbitrary file deletion call. 0676 * 0677 * \since 1.12.0 0678 * 0679 */ 0680 H5_DLL herr_t H5Fdelete(const char *filename, hid_t fapl_id); 0681 /** 0682 * \ingroup H5F 0683 * 0684 * \brief Returns a file creation property list identifier 0685 * 0686 * \file_id 0687 * \return \hid_t{file creation property list} 0688 * 0689 * \details H5Fget_create_plist() returns the file creation property list 0690 * identifier identifying the creation properties used to create this 0691 * file. This function is useful for duplicating properties when 0692 * creating another file. 0693 * 0694 * The creation property list identifier should be released with 0695 * H5Pclose(). 0696 * 0697 * \since 1.0.0 0698 * 0699 */ 0700 H5_DLL hid_t H5Fget_create_plist(hid_t file_id); 0701 /** 0702 * \ingroup H5F 0703 * 0704 * \brief Returns a file access property list identifier 0705 * 0706 * \file_id 0707 * \return \hid_t{file access property list} 0708 * 0709 * \details H5Fget_access_plist() returns the file access property list 0710 * identifier of the specified file. 0711 * 0712 * \since 1.0.0 0713 * 0714 */ 0715 H5_DLL hid_t H5Fget_access_plist(hid_t file_id); 0716 /** 0717 * \ingroup H5F 0718 * 0719 * \brief Determines the read/write or read-only status of a file 0720 * 0721 * \file_id 0722 * \param[out] intent Access mode flag as originally passed with H5Fopen() 0723 * 0724 * \return \herr_t 0725 * 0726 * \details Given the identifier of an open file, \p file_id, H5Fget_intent() 0727 * retrieves the intended access mode" flag passed with H5Fopen() when 0728 * the file was opened. 0729 * 0730 * The value of the flag is returned in \p intent. Valid values are as 0731 * follows: 0732 * \file_access 0733 * 0734 * \note The function will not return an error if intent is NULL; it will 0735 * simply do nothing. 0736 * 0737 * \version 1.10.0 Function enhanced to work with SWMR functionality. 0738 * 0739 * \since 1.8.0 0740 * 0741 */ 0742 H5_DLL herr_t H5Fget_intent(hid_t file_id, unsigned *intent); 0743 /** 0744 * \ingroup H5F 0745 * 0746 * \brief Retrieves a file's file number that uniquely identifies an open file 0747 * 0748 * \file_id 0749 * \param[out] fileno A buffer to hold the file number 0750 * 0751 * \return \herr_t 0752 * 0753 * \details H5Fget_fileno() retrieves a file number for a file specified by the 0754 * file identifier \p file_id and the pointer \p fnumber to the file 0755 * number. 0756 * 0757 * This file number is the same for all open instances of the same 0758 * file, as long as 1. The active VFD implements the file comparison operator, 0759 * and 2. The current filesystem is able to determine if the same file is opened more 0760 * than once. If these conditions are not met, it is the application's 0761 * responsibility to avoid opening multiple handles into the same file, 0762 * which results in undefined behavior. 0763 * 0764 * \since 1.12.0 0765 * 0766 */ 0767 H5_DLL herr_t H5Fget_fileno(hid_t file_id, unsigned long *fileno); 0768 /** 0769 * \ingroup H5F 0770 * 0771 * \brief Returns the number of open object identifiers for an open file 0772 * 0773 * \file_id or #H5F_OBJ_ALL for all currently-open HDF5 files 0774 * \param[in] types Type of object for which identifiers are to be returned 0775 * 0776 * \return Returns the number of open objects if successful; otherwise returns 0777 * a negative value. 0778 * 0779 * \details Given the identifier of an open file, file_id, and the desired 0780 * object types, types, H5Fget_obj_count() returns the number of open 0781 * object identifiers for the file. 0782 * 0783 * To retrieve a count of open identifiers for open objects in all 0784 * HDF5 application files that are currently open, as well as transient 0785 * datatype objects that are not associated with any file, pass the value 0786 * #H5F_OBJ_ALL in \p file_id. 0787 * 0788 * The types of objects to be counted are specified in types as 0789 * follows: 0790 * \obj_types 0791 * 0792 * Multiple object types can be combined with the 0793 * logical \c OR operator (|). For example, the expression 0794 * \c (#H5F_OBJ_DATASET|#H5F_OBJ_GROUP) would call for datasets and 0795 * groups. 0796 * 0797 * \version 1.6.8, 1.8.2 Function return type changed to \c ssize_t. 0798 * \version 1.6.5 #H5F_OBJ_LOCAL has been added as a qualifier on the types 0799 * of objects to be counted. #H5F_OBJ_LOCAL restricts the 0800 * search to objects opened through current file identifier. 0801 * 0802 * \since 1.6.0 0803 * 0804 */ 0805 H5_DLL ssize_t H5Fget_obj_count(hid_t file_id, unsigned types); 0806 /** 0807 *------------------------------------------------------------------------- 0808 * \ingroup H5F 0809 * 0810 * \brief Returns a list of open object identifiers 0811 * 0812 * \file_id or #H5F_OBJ_ALL for all currently-open HDF5 files 0813 * \param[in] types Type of object for which identifiers are to be returned 0814 * \param[in] max_objs Maximum number of object identifiers to place into 0815 * \p obj_id_list 0816 * \param[out] obj_id_list Pointer to the returned buffer of open object 0817 * identifiers 0818 * 0819 * \return Returns number of objects placed into \p obj_id_list if successful; 0820 * otherwise returns a negative value. 0821 * 0822 * \details Given the file identifier \p file_id and the type of objects to be 0823 * identified, types, H5Fget_obj_ids() returns the list of identifiers 0824 * for all open HDF5 objects fitting the specified criteria. 0825 * 0826 * To retrieve identifiers for open objects in all HDF5 application 0827 * files that are currently open, pass the value #H5F_OBJ_ALL in 0828 * \p file_id. 0829 * 0830 * The types of object identifiers to be retrieved are specified in 0831 * types using the codes listed for the same parameter in 0832 * H5Fget_obj_count(). 0833 * 0834 * To retrieve a count of open objects, use the H5Fget_obj_count() 0835 * function. This count can be used to set the \p max_objs parameter. 0836 * 0837 * \version 1.8.2 Function return type changed to \c ssize_t and \p 0838 * max_objs parameter datatype changed to \c size_t. 0839 * \version 1.6.8 Function return type changed to \c ssize_t and \p 0840 * max_objs parameter datatype changed to \c size_t. 0841 * \since 1.6.0 0842 * 0843 */ 0844 H5_DLL ssize_t H5Fget_obj_ids(hid_t file_id, unsigned types, size_t max_objs, hid_t *obj_id_list); 0845 /** 0846 * \ingroup H5F 0847 * 0848 * \brief Returns pointer to the file handle from the virtual file driver 0849 * 0850 * \file_id 0851 * \fapl_id{fapl} 0852 * \param[out] file_handle Pointer to the file handle being used by the 0853 * low-level virtual file driver 0854 * 0855 * \return \herr_t 0856 * 0857 * \details Given the file identifier \p file_id and the file access property 0858 * list \p fapl_id, H5Fget_vfd_handle() returns a pointer to the file 0859 * handle from the low-level file driver currently being used by the 0860 * HDF5 library for file I/O. 0861 * 0862 * \note For most drivers, the value of \p fapl_id will be #H5P_DEFAULT. For 0863 * the \c FAMILY or \c MULTI drivers, this value should be defined 0864 * through the property list functions: H5Pset_family_offset() for the 0865 * \c FAMILY driver and H5Pset_multi_type() for the \c MULTI driver 0866 * 0867 * \since 1.6.0 0868 * 0869 */ 0870 H5_DLL herr_t H5Fget_vfd_handle(hid_t file_id, hid_t fapl, void **file_handle); 0871 /** 0872 * \ingroup H5F 0873 * 0874 * \brief Mounts an HDF5 file 0875 * 0876 * \fg_loc_id{loc_id} 0877 * \param[in] name Name of the group onto which the file specified by \p child 0878 * is to be mounted 0879 * \file_id{child} 0880 * \param[in] plist File mount property list identifier. Pass #H5P_DEFAULT! 0881 * 0882 * \return \herr_t 0883 * 0884 * \details H5Fmount() mounts the file specified by \p child onto the object 0885 * specified by \p loc and \p name using the mount properties \p plist 0886 * If the object specified by \p loc is a dataset, named datatype or 0887 * attribute, then the file will be mounted at the location where the 0888 * attribute, dataset, or named datatype is attached. 0889 * 0890 * \par Example 0891 * \snippet H5F_examples.c mount 0892 * 0893 * \note To date, no file mount properties have been defined in HDF5. The 0894 * proper value to pass for \p plist is #H5P_DEFAULT, indicating the 0895 * default file mount property list. 0896 * 0897 * \since 1.0.0 0898 * 0899 */ 0900 H5_DLL herr_t H5Fmount(hid_t loc_id, const char *name, hid_t child, hid_t plist); 0901 /** 0902 * \ingroup H5F 0903 * 0904 * \brief Un-mounts an HDF5 file 0905 * 0906 * \fg_loc_id{loc_id} 0907 * \param[in] name Name of the mount point 0908 * 0909 * \return \herr_t 0910 * 0911 * \details Given a mount point, H5Funmount() dissociates the mount point's 0912 * file from the file mounted there. This function does not close 0913 * either file. 0914 * 0915 * The mount point can be either the group in the parent or the root 0916 * group of the mounted file (both groups have the same name). If the 0917 * mount point was opened before the mount then it is the group in the 0918 * parent; if it was opened after the mount then it is the root group 0919 * of the child. 0920 * 0921 * \since 1.0.0 0922 * 0923 */ 0924 H5_DLL herr_t H5Funmount(hid_t loc_id, const char *name); 0925 /** 0926 * \ingroup H5F 0927 * 0928 * \brief Returns the amount of free space in a file (in bytes) 0929 * 0930 * \file_id 0931 * 0932 * \return Returns the amount of free space in the file if successful; 0933 * otherwise returns a negative value. 0934 * 0935 * \details Given the identifier of an open file, \p file_id, 0936 * H5Fget_freespace() returns the amount of space that is unused by 0937 * any objects in the file. 0938 * 0939 * The interpretation of this number depends on the configured free space 0940 * management strategy. For example, if the HDF5 library only tracks free 0941 * space in a file from a file open or create until that file is closed, 0942 * then this routine will report the free space that has been created 0943 * during that interval. 0944 * 0945 * \since 1.6.1 0946 * 0947 */ 0948 H5_DLL hssize_t H5Fget_freespace(hid_t file_id); 0949 /** 0950 * \ingroup H5F 0951 * 0952 * \brief Returns the size of an HDF5 file (in bytes) 0953 * 0954 * \file_id 0955 * \param[out] size Size of the file, in bytes 0956 * 0957 * \return \herr_t 0958 * 0959 * \details H5Fget_filesize() returns the size of the HDF5 file specified by 0960 * \p file_id. 0961 * 0962 * The returned size is that of the entire file, as opposed to only 0963 * the HDF5 portion of the file. I.e., size includes the user block, 0964 * if any, the HDF5 portion of the file, and any data that may have 0965 * been appended beyond the data written through the HDF5 library. 0966 * 0967 * \since 1.6.3 0968 * 0969 */ 0970 H5_DLL herr_t H5Fget_filesize(hid_t file_id, hsize_t *size); 0971 /** 0972 * \ingroup H5F 0973 * 0974 * \brief Retrieves the file's end-of-allocation (EOA) 0975 * 0976 * \file_id 0977 * \param[out] eoa The file's EOA 0978 * 0979 * \return \herr_t 0980 * 0981 * \details H5Fget_eoa() retrieves the file's EOA and returns it in the 0982 * parameter eoa. 0983 * 0984 * \since 1.10.2 0985 * 0986 */ 0987 H5_DLL herr_t H5Fget_eoa(hid_t file_id, haddr_t *eoa); 0988 /** 0989 * \ingroup H5F 0990 * 0991 * \brief Sets the file' EOA to the maximum of (EOA, EOF) + increment 0992 * 0993 * \file_id 0994 * \param[in] increment The number of bytes to be added to the maximum of 0995 * (EOA, EOF) 0996 * 0997 * \return \herr_t 0998 * 0999 * \details H5Fincrement_filesize() sets the file's EOA to the maximum of (EOA, 1000 * EOF) + \p increment. The EOA is the end-of-file address stored in 1001 * the file's superblock while EOF is the file's actual end-of-file. 1002 * 1003 * \since 1.10.2 1004 * 1005 */ 1006 H5_DLL herr_t H5Fincrement_filesize(hid_t file_id, hsize_t increment); 1007 /** 1008 * \ingroup H5F 1009 * 1010 * \brief Retrieves a copy of the image of an existing, open file 1011 * 1012 * \file_id 1013 * \param[out] buf_ptr Pointer to the buffer into which the image of the 1014 * HDF5 file is to be copied. If \p buf_ptr is NULL, 1015 * no data will be copied but the function's return value 1016 * will still indicate the buffer size required (or a 1017 * negative value on error). 1018 * \param[out] buf_len Size of the supplied buffer 1019 * 1020 * \return ssize_t 1021 * 1022 * \details H5Fget_file_image() retrieves a copy of the image of an existing, 1023 * open file. This routine can be used with files opened using the 1024 * SEC2 (or POSIX), STDIO, and Core (or Memory) virtual file drivers 1025 * (VFDs). 1026 * 1027 * If the return value of H5Fget_file_image() is a positive value, it 1028 * will be the length in bytes of the buffer required to store the 1029 * file image. So if the file size is unknown, it can be safely 1030 * determined with an initial H5Fget_file_image() call with buf_ptr 1031 * set to NULL. The file image can then be retrieved with a second 1032 * H5Fget_file_image() call with \p buf_len set to the initial call's 1033 * return value. 1034 * 1035 * While the current file size can also be retrieved with 1036 * H5Fget_filesize(), that call may produce a larger value than is 1037 * needed. The value returned by H5Fget_filesize() includes the user 1038 * block, if it exists, and any unallocated space at the end of the 1039 * file. It is safe in all situations to get the file size with 1040 * H5Fget_file_image() and it often produces a value that is more 1041 * appropriate for the size of a file image buffer. 1042 * 1043 * \note \Bold{Recommended Reading:} This function is part of the file image 1044 * operations feature set. It is highly recommended to study the guide 1045 * \ref_file_image_ops before using this feature set. 1046 * 1047 * \attention H5Pget_file_image() will fail, returning a negative value, if the 1048 * file is too large for the supplied buffer. 1049 * 1050 * \see H5LTopen_file_image(), H5Pset_file_image(), H5Pget_file_image(), 1051 * H5Pset_file_image_callbacks(), H5Pget_file_image_callbacks() 1052 * 1053 * \since 1.8.0 1054 * 1055 */ 1056 H5_DLL ssize_t H5Fget_file_image(hid_t file_id, void *buf_ptr, size_t buf_len); 1057 /** 1058 * \ingroup MDC 1059 * 1060 * \brief Obtains current metadata cache configuration for target file 1061 * 1062 * \file_id 1063 * \param[in,out] config_ptr Pointer to the H5AC_cache_config_t instance in which 1064 * the current metadata cache configuration is to be 1065 * reported. The fields of this structure are discussed 1066 * \ref H5AC-cache-config-t "here". 1067 * \return \herr_t 1068 * 1069 * \note The \c in direction applies only to the H5AC_cache_config_t::version 1070 * field. All other fields are out parameters. 1071 * 1072 * \details H5Fget_mdc_config() loads the current metadata cache configuration 1073 * into the instance of H5AC_cache_config_t pointed to by the \p config_ptr 1074 * parameter.\n 1075 * The fields of the H5AC_cache_config_t structure are shown below: 1076 * \snippet H5ACpublic.h H5AC_cache_config_t_snip 1077 * \click4more 1078 * 1079 * \since 1.8.0 1080 * 1081 */ 1082 H5_DLL herr_t H5Fget_mdc_config(hid_t file_id, H5AC_cache_config_t *config_ptr); 1083 /** 1084 * \ingroup MDC 1085 * 1086 * \brief Attempts to configure metadata cache of target file 1087 * 1088 * \file_id 1089 * \param[in,out] config_ptr Pointer to the H5AC_cache_config_t instance 1090 * containing the desired configuration. 1091 * The fields of this structure are discussed 1092 * \ref H5AC-cache-config-t "here". 1093 * \return \herr_t 1094 * 1095 * \details H5Fset_mdc_config() attempts to configure the file's metadata cache 1096 * according configuration supplied in \p config_ptr. 1097 * \snippet H5ACpublic.h H5AC_cache_config_t_snip 1098 * \click4more 1099 * 1100 * \since 1.8.0 1101 * 1102 */ 1103 H5_DLL herr_t H5Fset_mdc_config(hid_t file_id, const H5AC_cache_config_t *config_ptr); 1104 /** 1105 * \ingroup MDC 1106 * 1107 * \brief Obtains target file's metadata cache hit rate 1108 * 1109 * \file_id 1110 * \param[out] hit_rate_ptr Pointer to the double in which the hit rate is returned. Note that 1111 * \p hit_rate_ptr is undefined if the API call fails 1112 * \return \herr_t 1113 * 1114 * \details H5Fget_mdc_hit_rate() queries the metadata cache of the target file to obtain its hit rate 1115 * \TText{(cache hits / (cache hits + cache misses))} since the last time hit rate statistics 1116 * were reset. If the cache has not been accessed since the last time the hit rate stats were 1117 * reset, the hit rate is defined to be 0.0. 1118 * 1119 * The hit rate stats can be reset either manually (via H5Freset_mdc_hit_rate_stats()), or 1120 * automatically. If the cache's adaptive resize code is enabled, the hit rate stats will be 1121 * reset once per epoch. If they are reset manually as well, the cache may behave oddly. 1122 * 1123 * See the overview of the metadata cache in the special topics section of the user manual for 1124 * details on the metadata cache and its adaptive resize algorithms. 1125 * 1126 * \since 1.8.0 1127 * 1128 */ 1129 H5_DLL herr_t H5Fget_mdc_hit_rate(hid_t file_id, double *hit_rate_ptr); 1130 /** 1131 * \ingroup MDC 1132 * 1133 * \brief Obtains current metadata cache size data for specified file 1134 * 1135 * \file_id 1136 * \param[out] max_size_ptr Pointer to the location in which the current cache maximum size is to be 1137 * returned, or NULL if this datum is not desired 1138 * \param[out] min_clean_size_ptr Pointer to the location in which the current cache minimum clean 1139 * size is to be returned, or NULL if that datum is not desired 1140 * \param[out] cur_size_ptr Pointer to the location in which the current cache size is to be returned, 1141 * or NULL if that datum is not desired 1142 * \param[out] cur_num_entries_ptr Pointer to the location in which the current number of entries in 1143 * the cache is to be returned, or NULL if that datum is not desired 1144 * \return \herr_t 1145 * 1146 * \details H5Fget_mdc_size() queries the metadata cache of the target file for the desired size 1147 * information, and returns this information in the locations indicated by the pointer 1148 * parameters. If any pointer parameter is NULL, the associated data is not returned. 1149 * 1150 * If the API call fails, the values returned via the pointer parameters are undefined. 1151 * 1152 * If adaptive cache resizing is enabled, the cache maximum size and minimum clean size 1153 * may change at the end of each epoch. Current size and current number of entries can 1154 * change on each cache access. 1155 * 1156 * Current size can exceed maximum size under certain conditions. See the overview of the 1157 * metadata cache in the special topics section of the user manual for a discussion of this. 1158 * 1159 * \since 1.8.0 1160 * 1161 */ 1162 H5_DLL herr_t H5Fget_mdc_size(hid_t file_id, size_t *max_size_ptr, size_t *min_clean_size_ptr, 1163 size_t *cur_size_ptr, int *cur_num_entries_ptr); 1164 /** 1165 * \ingroup MDC 1166 * 1167 * \brief Resets hit rate statistics counters for the target file 1168 * 1169 * \file_id 1170 * \return \herr_t 1171 * 1172 * \details 1173 * \parblock 1174 * H5Freset_mdc_hit_rate_stats() resets the hit rate statistics counters in the metadata cache 1175 * associated with the specified file. 1176 * 1177 * If the adaptive cache resizing code is enabled, the hit rate statistics are reset at the beginning 1178 * of each epoch. This API call allows you to do the same thing from your program. 1179 * 1180 * The adaptive cache resizing code may behave oddly if you use this call when adaptive cache resizing 1181 * is enabled. However, the call should be useful if you choose to control metadata cache size from your 1182 * program. 1183 * 1184 * See \ref_mdc_in_hdf5 for details about the metadata cache and the adaptive cache resizing 1185 * algorithms. If you have not read, understood, and thought about the material covered in that 1186 * documentation, 1187 * you should not be using this API call. 1188 * \endparblock 1189 * 1190 * \since 1.8.0 1191 * 1192 */ 1193 H5_DLL herr_t H5Freset_mdc_hit_rate_stats(hid_t file_id); 1194 /** 1195 * \ingroup H5F 1196 * 1197 * \brief Retrieves name of file to which object belongs 1198 * 1199 * \obj_id 1200 * \param[out] name Buffer for the file name 1201 * \param[in] size The size, in bytes, of the \p name buffer. Must be the 1202 * size of the file name in bytes plus 1 for a NULL 1203 * terminator 1204 * 1205 * \return Returns the length of the file name if successful; otherwise returns 1206 * a negative value. 1207 * 1208 * \details H5Fget_name() retrieves the name of the file to which the object \p 1209 * obj_id belongs. The object can be a file, group, dataset, 1210 * attribute, or named datatype. 1211 * 1212 * Up to \p size characters of the file name are returned in \p name; 1213 * additional characters, if any, are not returned to the user 1214 * application. 1215 * 1216 * \details_namelen{file,H5Fget_name} 1217 * 1218 * If an error occurs, the buffer pointed to by \p name is unchanged 1219 * and the function returns a negative value. 1220 * 1221 * \since 1.6.3 1222 * 1223 */ 1224 H5_DLL ssize_t H5Fget_name(hid_t obj_id, char *name, size_t size); 1225 /** 1226 * \ingroup H5F 1227 * 1228 * \brief Retrieves global file information 1229 * 1230 * \fgdta_obj_id 1231 * \param[out] file_info Buffer for global file information 1232 * 1233 * \return \herr_t 1234 * 1235 * \details H5Fget_info2() returns global information for the file associated 1236 * with the object identifier \p obj_id in the H5F_info2_t \c struct 1237 * named \p file_info. 1238 * 1239 * \p obj_id is an identifier for any object in the file of interest. 1240 * 1241 * H5F_info2_t struct is defined in H5Fpublic.h as follows: 1242 * \snippet this H5F_info2_t_snip 1243 * 1244 * The \c super sub-struct contains the following information: 1245 * \li \c vers is the version number of the superblock. 1246 * \li \c super_size is the size of the superblock. 1247 * \li \c super_ext_size is the size of the superblock extension. 1248 * 1249 * The \c free sub-struct contains the following information: 1250 * \li vers is the version number of the free-space manager. 1251 * \li \c hdr_size is the size of the free-space manager header. 1252 * \li \c tot_space is the total amount of free space in the file. 1253 * 1254 * The \c sohm sub-struct contains shared object header message 1255 * information as follows: 1256 * \li \c vers is the version number of the shared object header information. 1257 * \li \c hdr_size is the size of the shared object header message. 1258 * \li \c msgs_info is an H5_ih_info_t struct defined in H5public.h as 1259 * follows: \snippet H5public.h H5_ih_info_t_snip 1260 * \li \p index_size is the summed size of all the shared object 1261 * header indexes. Each index might be either a B-tree or 1262 * a list. 1263 * \li \p heap_size is the size of the heap. 1264 * 1265 * 1266 * \since 1.10.0 1267 * 1268 */ 1269 H5_DLL herr_t H5Fget_info2(hid_t obj_id, H5F_info2_t *file_info); 1270 /** 1271 * \ingroup SWMR 1272 * 1273 * \brief Retrieves the collection of read retries for metadata entries with checksum 1274 * 1275 * \file_id 1276 * \param[out] info Struct containing the collection of read retries for metadata 1277 * entries with checksum 1278 * \return \herr_t\n 1279 * 1280 * \details \Bold{Failure Modes:} 1281 * \li When the input identifier is not a file identifier. 1282 * \li When the pointer to the output structure is NULL. 1283 * \li When the memory allocation for \p retries failed. 1284 * 1285 * \details H5Fget_metadata_read_retry_info() retrieves information regarding the number 1286 * of read retries for metadata entries with checksum for the file \p file_id. 1287 * This information is reported in the H5F_retry_info_t struct defined in 1288 * H5Fpublic.h as follows: 1289 * \snippet this H5F_retry_info_t_snip 1290 * \c nbins is the number of bins for each \c retries[i] of metadata entry \c i. 1291 * It is calculated based on the current number of read attempts used in the 1292 * library and logarithmic base 10. 1293 * 1294 * If read retries are incurred for a metadata entry \c i, the library will 1295 * allocate memory for \TText{retries[i] (nbins * sizeof(uint32_t)} and store 1296 * the collection of retries there. If there are no retries for a metadata entry 1297 * \c i, \TText{retries[i]} will be NULL. After a call to this routine, users should 1298 * free each \TText{retries[i]} that is non-NULL, otherwise resource leak will occur. 1299 * 1300 * For the library default read attempts of 100 for SWMR access, nbins will be 2 1301 * as depicted below: 1302 * \li \TText{retries[i][0]} is the number of 1 to 9 read retries. 1303 * \li \TText{retries[i][1]} is the number of 10 to 99 read retries. 1304 * For the library default read attempts of 1 for non-SWMR access, \c nbins will 1305 * be 0 and each \TText{retries[i]} will be NULL. 1306 * 1307 * The following table lists the 21 metadata entries of \TText{retries[]}: 1308 * <table> 1309 * <tr> 1310 * <th>Index for \TText{retries[]}</th> 1311 * <th>Metadata entries<sup>*</sup></th> 1312 * </tr> 1313 * <tr><td>0</td><td>Object header (version 2)</td></tr> 1314 * <tr><td>1</td><td>Object header chunk (version 2)</td></tr> 1315 * <tr><td>2</td><td>B-tree header (version 2)</td></tr> 1316 * <tr><td>3</td><td>B-tree internal node (version 2)</td></tr> 1317 * <tr><td>4</td><td>B-tree leaf node (version 2)</td></tr> 1318 * <tr><td>5</td><td>Fractal heap header</td></tr> 1319 * <tr><td>6</td><td>Fractal heap direct block (optional checksum)</td></tr> 1320 * <tr><td>7</td><td>Fractal heap indirect block</td></tr> 1321 * <tr><td>8</td><td>Free-space header</td></tr> 1322 * <tr><td>9</td><td>Free-space sections</td></tr> 1323 * <tr><td>10</td><td>Shared object header message table</td></tr> 1324 * <tr><td>11</td><td>Shared message record list</td></tr> 1325 * <tr><td>12</td><td>Extensive array header</td></tr> 1326 * <tr><td>13</td><td>Extensive array index block</td></tr> 1327 * <tr><td>14</td><td>Extensive array super block</td></tr> 1328 * <tr><td>15</td><td>Extensive array data block</td></tr> 1329 * <tr><td>16</td><td>Extensive array data block page</td></tr> 1330 * <tr><td>17</td><td>Fixed array super block</td></tr> 1331 * <tr><td>18</td><td>Fixed array data block</td></tr> 1332 * <tr><td>19</td><td>Fixed array data block page</td></tr> 1333 * <tr><td>20</td><td>File's superblock (version 2)</td></tr> 1334 * <tr><td colspan=2><sup>*</sup> All entries are of version 0 (zero) unless indicated 1335 * otherwise.</td></tr> 1336 * </table> 1337 * 1338 * \note On a system that is not atomic, the library might possibly read inconsistent 1339 * metadata with checksum when performing single-writer/multiple-reader (SWMR) 1340 * operations for an HDF5 file. Upon encountering such situations, the library 1341 * will try reading the metadata again for a set number of times to attempt to 1342 * obtain consistent data. The maximum number of read attempts used by the library 1343 * will be either the value set via H5Pset_metadata_read_attempts() or the library 1344 * default value when a value is not set.\n 1345 * When the current number of metadata read attempts used in the library is unable 1346 * to remedy the reading of inconsistent metadata on a system, the user can assess 1347 * the information obtained via this routine to derive a different maximum value. 1348 * The information can also be helpful for debugging purposes to identify potential 1349 * issues with metadata flush dependencies and SWMR implementation in general. 1350 * 1351 * \since 1.10.0 1352 * 1353 */ 1354 H5_DLL herr_t H5Fget_metadata_read_retry_info(hid_t file_id, H5F_retry_info_t *info); 1355 /** 1356 * \ingroup SWMR 1357 * 1358 * \brief Retrieves free-space section information for a file 1359 * 1360 * \file_id 1361 * 1362 * \return \herr_t 1363 * 1364 * \details H5Fstart_swmr_write() will activate SWMR writing mode for a file 1365 * associated with \p file_id. This routine will prepare and ensure 1366 * the file is safe for SWMR writing as follows: 1367 * \li Check that the file is opened with write access (#H5F_ACC_RDWR). 1368 * \li Check that the file is opened with the latest library format to 1369 * ensure data structures with check-summed metadata are used. 1370 * \li Check that the file is not already marked in SWMR writing mode. 1371 * \li Enable reading retries for check-summed metadata to remedy 1372 * possible checksum failures from reading inconsistent metadata 1373 * on a system that is not atomic. 1374 * \li Turn off usage of the library's accumulator to avoid possible 1375 * ordering problem on a system that is not atomic. 1376 * \li Perform a flush of the file's data buffers and metadata to set 1377 * a consistent state for starting SWMR write operations. 1378 * 1379 * Library objects are groups, datasets, and committed datatypes. For 1380 * the current implementation, groups and datasets can remain open when 1381 * activating SWMR writing mode, but not committed datatypes. Attributes 1382 * attached to objects cannot remain open either. 1383 * 1384 * \since 1.10.0 1385 * 1386 */ 1387 H5_DLL herr_t H5Fstart_swmr_write(hid_t file_id); 1388 /** 1389 * \ingroup H5F 1390 * 1391 * \brief Retrieves free-space section information for a file 1392 * 1393 * \file_id 1394 * \param[in] type The file memory allocation type 1395 * \param[in] nsects The number of free-space sections 1396 * \param[out] sect_info Array of instances of H5F_sect_info_t in which 1397 * the free-space section information is to be returned 1398 * 1399 * \return Returns the number of free-space sections for the specified 1400 * free-space manager in the file; otherwise returns a negative value. 1401 * 1402 * \details H5Fget_free_sections() retrieves free-space section information for 1403 * the free-space manager with type that is associated with file 1404 * \p file_id. If type is #H5FD_MEM_DEFAULT, this routine retrieves 1405 * free-space section information for all the free-space managers in 1406 * the file. 1407 * 1408 * Valid values for \p type are the following: 1409 * \mem_types 1410 * 1411 * H5F_sect_info_t is defined as follows (in H5Fpublic.h): 1412 * \snippet this H5F_sect_info_t_snip 1413 * 1414 * This routine retrieves free-space section information for \p nsects 1415 * sections or, at most, the maximum number of sections in the specified 1416 * free-space manager. If the number of sections is not known, a 1417 * preliminary H5Fget_free_sections() call can be made by setting \p 1418 * sect_info to NULL and the total number of free-space sections for 1419 * the specified free-space manager will be returned. Users can then 1420 * allocate space for entries in \p sect_info, each of which is 1421 * defined as an H5F_sect_info_t \c struct. 1422 * 1423 * \attention \Bold{Failure Modes:} This routine will fail when the following 1424 * is true: 1425 * \li The library fails to retrieve the file creation property list 1426 * associated with \p file_id. 1427 * \li If the parameter \p sect_info is non-null, but the parameter 1428 * \p nsects is equal to 0. 1429 * \li The library fails to retrieve free-space section information 1430 * for the file. 1431 * 1432 * \since 1.10.0 1433 * 1434 */ 1435 H5_DLL ssize_t H5Fget_free_sections(hid_t file_id, H5F_mem_t type, size_t nsects, 1436 H5F_sect_info_t *sect_info /*out*/); 1437 /** 1438 * \ingroup H5F 1439 * 1440 * \brief Clears the external link open file cache 1441 * 1442 * \file_id 1443 * \return \herr_t 1444 * 1445 * \details H5Fclear_elink_file_cache() evicts all the cached child files in 1446 * the specified file's external file cache, causing them to be closed 1447 * if there is nothing else holding them open. 1448 * 1449 * H5Fclear_elink_file_cache() does not close the cache itself; 1450 * subsequent external link traversals from the parent file will again 1451 * cache the target file. See H5Pset_elink_file_cache_size() for 1452 * information on closing the file cache. 1453 * 1454 * \see H5Pset_elink_file_cache_size(), H5Pget_elink_file_cache_size() 1455 * 1456 * \since 1.8.7 1457 * 1458 */ 1459 H5_DLL herr_t H5Fclear_elink_file_cache(hid_t file_id); 1460 /** 1461 * \ingroup H5F 1462 * 1463 * \brief Enables the switch of version bounds setting for a file 1464 * 1465 * \file_id 1466 * \param[in] low The earliest version of the library that will be used for 1467 * writing objects 1468 * \param[in] high The latest version of the library that will be used for 1469 * writing objects 1470 * 1471 * \return \herr_t 1472 * 1473 * \details H5Fset_libver_bounds() enables the switch of version bounds setting 1474 * for an open file associated with \p file_id. 1475 * 1476 * For the parameters \p low and \p high, see the description for 1477 * H5Pset_libver_bounds(). 1478 * 1479 * \par Example 1480 * \snippet H5F_examples.c libver_bounds 1481 * 1482 * \since 1.10.2 1483 * 1484 */ 1485 H5_DLL herr_t H5Fset_libver_bounds(hid_t file_id, H5F_libver_t low, H5F_libver_t high); 1486 /** 1487 * \ingroup MDC 1488 * 1489 * \brief Starts logging metadata cache events if logging was previously enabled 1490 * 1491 * \file_id 1492 * 1493 * \return \herr_t 1494 * 1495 * \details The metadata cache is a central part of the HDF5 library through 1496 * which all \Emph{file metadata} reads and writes take place. File 1497 * metadata is normally invisible to the user and is used by the 1498 * library for purposes such as locating and indexing data. File 1499 * metadata should not be confused with user metadata, which consists 1500 * of attributes created by users and attached to HDF5 objects such 1501 * as datasets via H5A API calls. 1502 * 1503 * Due to the complexity of the cache, a trace/logging feature has been 1504 * created that can be used by HDF5 developers for debugging and performance 1505 * analysis. The functions that control this functionality will normally be 1506 * of use to a very limited number of developers outside of The HDF Group. 1507 * The functions have been documented to help users create logs that can 1508 * be sent with bug reports. 1509 * 1510 * Control of the log functionality is straightforward. Logging is enabled 1511 * via the H5Pset_mdc_log_options() function, which will modify the file 1512 * access property list used to open or create a file. This function has 1513 * a flag that determines whether logging begins at file open or starts 1514 * in a paused state. Log messages can then be controlled via the 1515 * H5Fstart_mdc_logging() and H5Fstop_mdc_logging() functions. 1516 * H5Pget_mdc_log_options() can be used to examine a file access property 1517 * list, and H5Fget_mdc_logging_status() will return the current state of 1518 * the logging flags. 1519 * 1520 * The log format is described in the \ref_mdc_logging document. 1521 * 1522 * \note Logging can only be started or stopped if metadata cache logging was enabled 1523 * via H5Pset_mdc_log_options().\n 1524 * When enabled and currently logging, the overhead of the logging feature will 1525 * almost certainly be significant.\n 1526 * The log file is opened when the HDF5 file is opened or created and not when 1527 * this function is called for the first time.\n 1528 * This function opens the log file and starts logging metadata cache operations 1529 * for a particular file. Calling this function when logging has already been 1530 * enabled will be considered an error. 1531 * 1532 * \since 1.10.0 1533 * 1534 */ 1535 H5_DLL herr_t H5Fstart_mdc_logging(hid_t file_id); 1536 /** 1537 * \ingroup MDC 1538 * 1539 * \brief Stops logging metadata cache events if logging was previously enabled and is currently ongoing 1540 * 1541 * \file_id 1542 * 1543 * \return \herr_t 1544 * 1545 * \details The metadata cache is a central part of the HDF5 library through 1546 * which all \Emph{file metadata} reads and writes take place. File 1547 * metadata is normally invisible to the user and is used by the 1548 * library for purposes such as locating and indexing data. File 1549 * metadata should not be confused with user metadata, which consists 1550 * of attributes created by users and attached to HDF5 objects such 1551 * as datasets via H5A API calls. 1552 * 1553 * Due to the complexity of the cache, a trace/logging feature has been 1554 * created that can be used by HDF5 developers for debugging and performance 1555 * analysis. The functions that control this functionality will normally be 1556 * of use to a very limited number of developers outside of The HDF Group. 1557 * The functions have been documented to help users create logs that can 1558 * be sent with bug reports. 1559 * 1560 * Control of the log functionality is straightforward. Logging is enabled 1561 * via the H5Pset_mdc_log_options() function, which will modify the file 1562 * access property list used to open or create a file. This function has 1563 * a flag that determines whether logging begins at file open or starts 1564 * in a paused state. Log messages can then be controlled via the 1565 * H5Fstart_mdc_logging() and H5Fstop_mdc_logging() functions. 1566 * H5Pget_mdc_log_options() can be used to examine a file access property 1567 * list, and H5Fget_mdc_logging_status() will return the current state of 1568 * the logging flags. 1569 * 1570 * The log format is described in the \ref_mdc_logging document. 1571 * 1572 * \note Logging can only be started or stopped if metadata cache logging was enabled 1573 * via H5Pset_mdc_log_options().\n 1574 * This function only suspends the logging operations. The log file will remain 1575 * open and will not be closed until the HDF5 file is closed. 1576 * 1577 * \since 1.10.0 1578 * 1579 */ 1580 H5_DLL herr_t H5Fstop_mdc_logging(hid_t file_id); 1581 /** 1582 * \ingroup MDC 1583 * 1584 * \brief Gets the current metadata cache logging status 1585 * 1586 * \file_id 1587 * \param[out] is_enabled Whether logging is enabled 1588 * \param[out] is_currently_logging Whether events are currently being logged 1589 * \return \herr_t 1590 * 1591 * \details The metadata cache is a central part of the HDF5 library through 1592 * which all \Emph{file metadata} reads and writes take place. File 1593 * metadata is normally invisible to the user and is used by the 1594 * library for purposes such as locating and indexing data. File 1595 * metadata should not be confused with user metadata, which consists 1596 * of attributes created by users and attached to HDF5 objects such 1597 * as datasets via H5A API calls. 1598 * 1599 * Due to the complexity of the cache, a trace/logging feature has been 1600 * created that can be used by HDF5 developers for debugging and performance 1601 * analysis. The functions that control this functionality will normally be 1602 * of use to a very limited number of developers outside of The HDF Group. 1603 * The functions have been documented to help users create logs that can 1604 * be sent with bug reports. 1605 * 1606 * Control of the log functionality is straightforward. Logging is enabled 1607 * via the H5Pset_mdc_log_options() function, which will modify the file 1608 * access property list used to open or create a file. This function has 1609 * a flag that determines whether logging begins at file open or starts 1610 * in a paused state. Log messages can then be controlled via the 1611 * H5Fstart_mdc_logging() and H5Fstop_mdc_logging() functions. 1612 * H5Pget_mdc_log_options() can be used to examine a file access property 1613 * list, and H5Fget_mdc_logging_status() will return the current state of 1614 * the logging flags. 1615 * 1616 * The log format is described in the \ref_mdc_logging document. 1617 * 1618 * \note Unlike H5Fstart_mdc_logging() and H5Fstop_mdc_logging(), this function can 1619 * be called on any open file identifier. 1620 * 1621 * \since 1.10.0 1622 */ 1623 H5_DLL herr_t H5Fget_mdc_logging_status(hid_t file_id, hbool_t *is_enabled, hbool_t *is_currently_logging); 1624 /** 1625 * \ingroup H5F 1626 * 1627 * \brief Resets the page buffer statistics 1628 * 1629 * \file_id 1630 * 1631 * \return \herr_t 1632 * 1633 * \details H5Freset_page_buffering_stats() resets the page buffer statistics 1634 * for a specified file identifier \p file_id. 1635 * 1636 * \since 1.10.1 1637 * 1638 */ 1639 H5_DLL herr_t H5Freset_page_buffering_stats(hid_t file_id); 1640 /** 1641 * \ingroup H5F 1642 * 1643 * \brief Retrieves statistics about page access when it is enabled 1644 * 1645 * \file_id 1646 * \param[out] accesses Two integer array for the number of metadata and raw 1647 * data accesses to the page buffer 1648 * \param[out] hits Two integer array for the number of metadata and raw data 1649 * hits in the page buffer 1650 * \param[out] misses Two integer array for the number of metadata and raw data 1651 * misses in the page buffer 1652 * \param[out] evictions Two integer array for the number of metadata and raw 1653 * data evictions from the page buffer 1654 * \param[out] bypasses Two integer array for the number of metadata and raw 1655 * data accesses that bypass the page buffer 1656 * 1657 * \return \herr_t 1658 * 1659 * \details H5Fget_page_buffering_stats() retrieves page buffering statistics 1660 * such as the number of metadata and raw data accesses (\p accesses), 1661 * hits (\p hits), misses (\p misses), evictions (\p evictions), and 1662 * accesses that bypass the page buffer (\p bypasses). 1663 * 1664 * \since 1.10.1 1665 * 1666 */ 1667 H5_DLL herr_t H5Fget_page_buffering_stats(hid_t file_id, unsigned accesses[2], unsigned hits[2], 1668 unsigned misses[2], unsigned evictions[2], unsigned bypasses[2]); 1669 /** 1670 * \ingroup MDC 1671 * 1672 * \brief Obtains information about a cache image if it exists 1673 * 1674 * \file_id 1675 * \param[out] image_addr Offset of the cache image if it exists, or #HADDR_UNDEF if it does not 1676 * \param[out] image_size Length of the cache image if it exists, or 0 if it does not 1677 * \return \herr_t 1678 * 1679 * \details 1680 * \parblock 1681 * H5Fget_mdc_image_info() returns information about a cache image if it exists. 1682 * 1683 * When an HDF5 file is opened in Read/Write mode, any metadata cache image will 1684 * be read and deleted from the file on the first metadata cache access (or, if 1685 * persistent free space managers are enabled, on the first file space 1686 * allocation / deallocation, or read of free space manager status, whichever 1687 * comes first). 1688 * 1689 * Thus, if the file is opened Read/Write, H5Fget_mdc_image_info() should be called 1690 * immediately after file open and before any other operation. If H5Fget_mdc_image_info() 1691 * is called after the cache image is loaded, it will correctly report that no cache image 1692 * exists, as the image will have already been read and deleted from the file. In the Read Only 1693 * case, the function may be called at any time, as any cache image will not be deleted 1694 * from the file. 1695 * \endparblock 1696 * 1697 * \since 1.10.1 1698 */ 1699 H5_DLL herr_t H5Fget_mdc_image_info(hid_t file_id, haddr_t *image_addr, hsize_t *image_size); 1700 /** 1701 * \ingroup H5F 1702 * 1703 * \brief Retrieves the setting for whether or not a file will create minimized 1704 * dataset object headers 1705 * 1706 * \file_id 1707 * \param[out] minimize Flag indicating whether the library will or will not 1708 * create minimized dataset object headers 1709 * 1710 * \return \herr_t 1711 * 1712 * \details H5Fget_dset_no_attrs_hint() retrieves the no dataset attributes 1713 * hint setting for the file specified by the file identifier \p 1714 * file_id. This setting is used to inform the library to create 1715 * minimized dataset object headers when \c true. 1716 * 1717 * The setting's value is returned in the boolean pointer minimized. 1718 * 1719 * \since 1.10.5 1720 * 1721 */ 1722 H5_DLL herr_t H5Fget_dset_no_attrs_hint(hid_t file_id, hbool_t *minimize); 1723 /** 1724 * \ingroup H5F 1725 * 1726 * \brief Sets the flag to create minimized dataset object headers 1727 * 1728 * \file_id 1729 * \param[in] minimize Flag indicating whether the library will or will not 1730 * create minimized dataset object headers 1731 * 1732 * \return \herr_t 1733 * 1734 * \details H5Fset_dset_no_attrs_hint() sets the no dataset attributes hint 1735 * setting for the file specified by the file identifier \p file_id. 1736 * If the boolean flag \p minimize is set to \c true, then the library 1737 * will create minimized dataset object headers in the file. 1738 * \Bold{All} files that refer to the same file-on-disk will be 1739 * affected by the most recent setting, regardless of the file 1740 * identifier/handle (e.g., as returned by H5Fopen()). By setting the 1741 * \p minimize flag to \c true, the library expects that no attributes 1742 * will be added to the dataset - attributes can be added, but they 1743 * are appended with a continuation message, which can reduce 1744 * performance. 1745 * 1746 * \attention This setting interacts with H5Pset_dset_no_attrs_hint(): if 1747 * either is set to \c true, then the created dataset's object header 1748 * will be minimized. 1749 * 1750 * \since 1.10.5 1751 * 1752 */ 1753 H5_DLL herr_t H5Fset_dset_no_attrs_hint(hid_t file_id, hbool_t minimize); 1754 1755 #ifdef H5_HAVE_PARALLEL 1756 /** 1757 * \ingroup PH5F 1758 * 1759 * \brief Sets the MPI atomicity mode 1760 * 1761 * \file_id 1762 * \param[in] flag Logical flag for atomicity setting. Valid values are: 1763 * \li \c 1 -- Sets MPI file access to atomic mode. 1764 * \li \c 0 -- Sets MPI file access to nonatomic mode. 1765 * \return \herr_t 1766 * 1767 * \par Motivation 1768 * H5Fset_mpi_atomicity() is applicable only in parallel environments using MPI I/O. 1769 * The function is one of the tools used to ensure sequential consistency. This means 1770 * that a set of operations will behave as though they were performed in a serial 1771 * order consistent with the program order. 1772 * 1773 * \details 1774 * \parblock 1775 * H5Fset_mpi_atomicity() sets MPI consistency semantics for data access to the file, 1776 * \p file_id. 1777 * 1778 * If \p flag is set to \c 1, all file access operations will appear atomic, guaranteeing 1779 * sequential consistency. If \p flag is set to \c 0, enforcement of atomic file access 1780 * will be turned off. 1781 * 1782 * H5Fset_mpi_atomicity() is a collective function and all participating processes must 1783 * pass the same values for \p file_id and \p flag. 1784 * 1785 * This function is available only when the HDF5 library is configured with parallel support 1786 * (\TText{--enable-parallel | HDF5_ENABLE_PARALLEL}). It is useful only when used with the #H5FD_MPIO driver 1787 * (see H5Pset_fapl_mpio()). 1788 * \endparblock 1789 * 1790 * \attention 1791 * \parblock 1792 * H5Fset_mpi_atomicity() calls \TText{MPI_File_set_atomicity} underneath and is not supported 1793 * if the execution platform does not support \TText{MPI_File_set_atomicity}. When it is 1794 * supported and used, the performance of data access operations may drop significantly. 1795 * 1796 * In certain scenarios, even when \TText{MPI_File_set_atomicity} is supported, setting 1797 * atomicity with H5Fset_mpi_atomicity() and \p flag set to 1 does not always yield 1798 * strictly atomic updates. For example, some H5Dwrite() calls translate to multiple 1799 * \TText{MPI_File_write_at} calls. This happens in all cases where the high-level file 1800 * access routine translates to multiple lower level file access routines. 1801 * The following scenarios will raise this issue: 1802 * \li Non-contiguous file access using independent I/O 1803 * \li Partial collective I/O using chunked access 1804 * \li Collective I/O using filters or when data conversion is required 1805 * 1806 * This issue arises because MPI atomicity is a matter of MPI file access operations rather 1807 * than HDF5 access operations. But the user is normally seeking atomicity at the HDF5 level. 1808 * To accomplish this, the application must set a barrier after a write, H5Dwrite(), but before 1809 * the next read, H5Dread(), in addition to calling H5Fset_mpi_atomicity().The barrier will 1810 * guarantee that all underlying write operations execute atomically before the read 1811 * operations starts. This ensures additional ordering semantics and will normally produce 1812 * the desired behavior. 1813 * \endparblock 1814 * 1815 * \see \ref_cons_semantics 1816 * 1817 * \since 1.8.9 1818 * 1819 */ 1820 H5_DLL herr_t H5Fset_mpi_atomicity(hid_t file_id, hbool_t flag); 1821 /** 1822 * \ingroup PH5F 1823 * 1824 * \brief Retrieves the atomicity mode in use 1825 * 1826 * \file_id 1827 * \param[out] flag Logical flag for atomicity setting. Valid values are: 1828 * \li 1 -- MPI file access is set to atomic mode. 1829 * \li 0 -- MPI file access is set to nonatomic mode. 1830 * \return \herr_t 1831 * 1832 * \details H5Fget_mpi_atomicity() retrieves the current consistency semantics mode for 1833 * data access for the file \p file_id. 1834 * 1835 * Upon successful return, \p flag will be set to \c 1 if file access is set 1836 * to atomic mode and \c 0 if file access is set to nonatomic mode. 1837 * 1838 * \see \ref_cons_semantics 1839 * 1840 * \since 1.8.9 1841 * 1842 */ 1843 H5_DLL herr_t H5Fget_mpi_atomicity(hid_t file_id, hbool_t *flag); 1844 #endif /* H5_HAVE_PARALLEL */ 1845 1846 /// \cond DEV 1847 /* Internal API routines */ 1848 H5_DLL herr_t H5Fformat_convert(hid_t fid); 1849 /// \endcond 1850 1851 /// \cond DEV 1852 /* API Wrappers for async routines */ 1853 /* (Must be defined _after_ the function prototype) */ 1854 /* (And must only defined when included in application code, not the library) */ 1855 #ifndef H5F_MODULE 1856 #define H5Fcreate_async(...) H5Fcreate_async(__FILE__, __func__, __LINE__, __VA_ARGS__) 1857 #define H5Fopen_async(...) H5Fopen_async(__FILE__, __func__, __LINE__, __VA_ARGS__) 1858 #define H5Freopen_async(...) H5Freopen_async(__FILE__, __func__, __LINE__, __VA_ARGS__) 1859 #define H5Fflush_async(...) H5Fflush_async(__FILE__, __func__, __LINE__, __VA_ARGS__) 1860 #define H5Fclose_async(...) H5Fclose_async(__FILE__, __func__, __LINE__, __VA_ARGS__) 1861 1862 /* Define "wrapper" versions of function calls, to allow compile-time values to 1863 * be passed in by language wrapper or library layer on top of HDF5. 1864 */ 1865 #define H5Fcreate_async_wrap H5_NO_EXPAND(H5Fcreate_async) 1866 #define H5Fopen_async_wrap H5_NO_EXPAND(H5Fopen_async) 1867 #define H5Freopen_async_wrap H5_NO_EXPAND(H5Freopen_async) 1868 #define H5Fflush_async_wrap H5_NO_EXPAND(H5Fflush_async) 1869 #define H5Fclose_async_wrap H5_NO_EXPAND(H5Fclose_async) 1870 #endif /* H5F_MODULE */ 1871 /// \endcond 1872 1873 /* Symbols defined for compatibility with previous versions of the HDF5 API. 1874 * 1875 * Use of these symbols is deprecated. 1876 */ 1877 #ifndef H5_NO_DEPRECATED_SYMBOLS 1878 1879 /* Macros */ 1880 #define H5F_ACC_DEBUG (H5CHECK H5OPEN 0x0000u) /**< Print debug info \deprecated In which version? */ 1881 1882 /* Typedefs */ 1883 1884 /** 1885 * Current "global" information about file 1886 */ 1887 //! <!-- [H5F_info1_t_snip] --> 1888 typedef struct H5F_info1_t { 1889 hsize_t super_ext_size; /**< Superblock extension size */ 1890 struct { 1891 hsize_t hdr_size; /**< Shared object header message header size */ 1892 H5_ih_info_t msgs_info; /**< Shared object header message index & heap size */ 1893 } sohm; 1894 } H5F_info1_t; 1895 //! <!-- [H5F_info1_t_snip] --> 1896 1897 /* Function prototypes */ 1898 /** 1899 * \ingroup H5F 1900 * 1901 * \brief Retrieves global file information 1902 * 1903 * \fgdta_obj_id 1904 * \param[out] file_info Buffer for global file information 1905 * 1906 * \return \herr_t 1907 * 1908 * \deprecated This function has been renamed from H5Fget_info() and is 1909 * deprecated in favor of the macro #H5Fget_info or the function 1910 * H5Fget_info2(). 1911 * 1912 * \details H5Fget_info1() returns global information for the file associated 1913 * with the object identifier \p obj_id in the H5F_info1_t \c struct 1914 * named \p file_info. 1915 * 1916 * \p obj_id is an identifier for any object in the file of interest. 1917 * 1918 * H5F_info1_t struct is defined in H5Fpublic.h as follows: 1919 * \snippet this H5F_info1_t_snip 1920 * 1921 * \c super_ext_size is the size of the superblock extension. 1922 * 1923 * The \c sohm sub-struct contains shared object header message 1924 * information as follows: 1925 * \li \c hdr_size is the size of the shared object header message. 1926 * \li \c msgs_info is an H5_ih_info_t struct defined in H5public.h as 1927 * follows: \snippet H5public.h H5_ih_info_t_snip 1928 * 1929 * \li \p index_size is the summed size of all the shared object 1930 * header indexes. Each index might be either a B-tree or 1931 * a list. 1932 * 1933 * \version 1.10.0 Function H5Fget_info() renamed to H5Fget_info1() and 1934 * deprecated in this release. 1935 * 1936 * \since 1.8.0 1937 * 1938 */ 1939 H5_DLL herr_t H5Fget_info1(hid_t obj_id, H5F_info1_t *file_info); 1940 /** 1941 * \ingroup H5F 1942 * 1943 * \brief Sets the latest version of the library to be used for writing objects 1944 * 1945 * \file_id 1946 * \param[in] latest_format Latest format flag 1947 * 1948 * \return \herr_t 1949 * 1950 * \since 1.10.1 1951 * \deprecated 1.10.2 Deprecated in favor of the function H5Fset_libver_bounds() 1952 * 1953 */ 1954 H5_DLL herr_t H5Fset_latest_format(hid_t file_id, hbool_t latest_format); 1955 /** 1956 * \ingroup H5F 1957 * 1958 * \brief Determines whether a file is in the HDF5 format 1959 * 1960 * \param[in] file_name File name 1961 * 1962 * \return \htri_t 1963 * 1964 * \details H5Fis_hdf5() determines whether a file is in the HDF5 format. 1965 * 1966 * \since 1.0.0 1967 * \deprecated 1.12.0 Deprecated in favor of the function H5Fis_accessible() 1968 * 1969 */ 1970 H5_DLL htri_t H5Fis_hdf5(const char *file_name); 1971 1972 #endif /* H5_NO_DEPRECATED_SYMBOLS */ 1973 1974 #ifdef __cplusplus 1975 } 1976 #endif 1977 #endif /* H5Fpublic_H */
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
![]() ![]() |