HDF5 documents and links 
Introduction to HDF5 
HDF5 User’s Guide 
In the HDF5 Reference Manual 
H5DS   H5IM   H5LT   H5PT   H5TB  Optimized 
H5   H5A   H5D   H5E   H5F   H5G   H5I   H5L 
H5O   H5P   H5PL   H5R   H5S   H5T   H5Z 
Tools   Datatypes   Fortran   Compatibility Macros 
Collective Calls in Parallel 

H5F: File Interface

File API Functions

These functions are designed to provide file-level access to HDF5 files. Further manipulation of objects inside a file is performed through one of APIs documented below.
In the following lists, italic type indicates a configurable macro.

The C Interfaces:
             
Use of this function is deprecated in Release 1.8.0.

Alphabetical Listing
             

The Fortran Interface:
In general, each Fortran subroutine performs exactly the same task as the corresponding C function.
             


Last modified: 11 May 2011
Name: H5Fclear_elink_file_cache
Signature:
herr_t H5Fclear_elink_file_cache( hid_t file_id )

Purpose:
Clears the external link open file cache.

Motivation:
H5Fclear_elink_file_cache releases all the child files cached in a file’s external link open file cache, possibly causing them to be closed. This function can be used to release memory and to allow files to be accessed by another process.

Description:
H5Fclear_elink_file_cache evicts all the cached child files in the specified file’s external file cache, causing them to be closed if there is nothing else holding them open.

H5Fclear_elink_file_cache does not close the cache itself; subsequent external link traversals from the parent file will again cache the target file. See H5Pset_elink_file_cache_size for information on closing the file cache.

Parameters:
hid_t file_id      IN: File identifier

Returns:
Returns a non-negative value if successful; otherwise returns a negative value.

Example Usage:
The following code clears the external file cache for the file specified by file_id:
    status = H5Fclear_elink_file_cache(file_id)         

See Also:
H5Pset_elink_file_cache_size
H5Pget_elink_file_cache_size

History:
Release     Change
1.8.7 C function introduced in this release.

Last modified: 9 April 2009
Name: H5Fclose
Signature:
herr_t H5Fclose( hid_t file_id )

Purpose:
Terminates access to an HDF5 file.

Description:
H5Fclose terminates access to an HDF5 file by flushing all data to storage and terminating access to the file through file_id.

If this is the last file identifier open for the file and no other access identifier is open (e.g., a dataset identifier, group identifier, or shared datatype identifier), the file will be fully closed and access will end.

Delayed close:
Note the following deviation from the above-described behavior. If H5Fclose is called for a file but one or more objects within the file remain open, those objects will remain accessible until they are individually closed. Thus, if the dataset data_sample is open when H5Fclose is called for the file containing it, data_sample will remain open and accessible (including writable) until it is explicitely closed. The file will be automatically closed once all objects in the file have been closed.

Be warned, however, that there are circumstances where it is not possible to delay closing a file. For example, an MPI-IO file close is a collective call; all of the processes that opened the file must close it collectively. The file cannot be closed at some time in the future by each process in an independent fashion. Another example is that an application using an AFS token-based file access privilage may destroy its AFS token after H5Fclose has returned successfully. This would make any future access to the file, or any object within it, illegal.

In such situations, applications must close all open objects in a file before calling H5Fclose. It is generally recommended to do so in all cases.

Parameters:

Returns:
Returns a non-negative value if successful; otherwise returns a negative value.

Fortran90 Interface: h5fclose_f
SUBROUTINE h5fclose_f(file_id, hdferr) 
  IMPLICIT NONE
  INTEGER(HID_T), INTENT(IN) :: file_id ! File identifier
  INTEGER, INTENT(OUT) :: hdferr        ! Error code
                                        ! 0 on success and -1 on failure
END SUBROUTINE h5fclose_f 
    

Last modified: 1 June 2015
Name: H5Fcreate

Signature:
hid_t H5Fcreate( const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id )

Purpose:
Creates an HDF5 file.

Description:
H5Fcreate is the primary function for creating HDF5 files; it creates a new HDF5 file with the specified name and property lists and specifies whether an existing file of same name should be overwritten.

The name parameter specifies the name of the new file.

The flags parameter specifies whether an existing file is to be overwritten. It should be set to either H5F_ACC_TRUNC to overwrite an existing file or H5F_ACC_EXCL, instructing the function to fail if the file already exists.

New files are always created in read-write mode, so the read-write and read-only flags, H5F_ACC_RDWR and H5F_ACC_RDONLY, respectively, are not relevant in this function. Further note that a specification of H5F_ACC_RDONLY will be ignored; the file will be created in read-write mode, regardless.

More complex behaviors of file creation and access are controlled through the file creation and file access property lists, fcpl_id and fapl_id, respectively. The value of H5P_DEFAULT for any property list value indicates that the library should use the default values for that appropriate property list.

The return value is a file identifier for the newly-created file; this file identifier should be closed by calling H5Fclose when it is no longer needed.

Special case -- File creation in the case of an already-open file:
If a file being created is already opened, by either a previous H5Fopen or H5Fcreate call, the HDF5 library may or may not detect that the open file and the new file are the same physical file. (See H5Fopen regarding the limitations in detecting the re-opening of an already-open file.)

If the library detects that the file is already opened, H5Fcreate will return a failure, regardless of the use of H5F_ACC_TRUNC.

If the library does not detect that the file is already opened and H5F_ACC_TRUNC is not used, H5Fcreate will return a failure because the file already exists. Note that this is correct behavior.

But if the library does not detect that the file is already opened and H5F_ACC_TRUNC is used, H5Fcreate will truncate the existing file and return a valid file identifier. Such a truncation of a currently-opened file will almost certainly result in errors. While unlikely, the HDF5 library may not be able to detect, and thus report, such errors.

Applications should avoid calling H5Fcreate with an already opened file.

Parameters:
const char *name     IN: Name of the file to access.
unsigned flags IN: File access flags. Allowable values are:
    H5F_ACC_TRUNC
    Truncate file, if it already exists, erasing all data previously stored in the file.
    H5F_ACC_EXCL
    Fail if file already exists.
  • H5F_ACC_TRUNC and H5F_ACC_EXCL are mutually exclusive; use exactly one.
  • An additional flag, H5F_ACC_DEBUG, prints debug information. This flag can be combined with one of the above values using the bit-wise OR operator (`|'), but it is used only by HDF5 Library developers; it is neither tested nor supported for use in applications.
  • hid_t fcpl_id IN: File creation property list identifier, used when modifying default file meta-data. Use H5P_DEFAULT to specify default file creation properties.
    hid_t fapl_id IN: File access property list identifier. If parallel file access is desired, this is a collective call according to the communicator stored in the fapl_id. Use H5P_DEFAULT for default file access properties.

    Returns:
    Returns a file identifier if successful; otherwise returns a negative value.

    Fortran90 Interface: h5fcreate_f
    SUBROUTINE h5fcreate_f(name, access_flags, file_id, hdferr, &  
                           creation_prp, access_prp)
      IMPLICIT NONE 
      CHARACTER(LEN=*), INTENT(IN) :: name   ! Name of the file
      INTEGER, INTENT(IN) :: access_flag     ! File access flags 
                                             ! Valid values are:
                                             !     H5F_ACC_TRUNC_F  
                                             !     H5F_ACC_EXCL_F    
                                             !     H5F_ACC_DEBUG_F   
      INTEGER(HID_T), INTENT(OUT) :: file_id ! File identifier 
      INTEGER, INTENT(OUT) :: hdferr         ! Error code 
                                             ! 0 on success and -1 on failure
      INTEGER(HID_T), OPTIONAL, INTENT(IN) :: creation_prp 
                                             ! File creation propertly 
                                             ! list identifier, if not 
                                             ! specified its value is
                                             ! H5P_DEFAULT_F  
      INTEGER(HID_T), OPTIONAL, INTENT(IN) :: access_prp  
                                             ! File access property list 
                                             ! identifier, if not 
                                             ! specified its value is
                                             ! H5P_DEFAULT_F  
    END SUBROUTINE h5fcreate_f
        
    See Also:
    “Using Identifiers”

    History:
    Release     Change
    1.8.10 Removed H5F_ACC_RDWR_F and H5F_ACC_RDONLY_F from comments for access_flag field in Fortran subroutine, and changed “Possible values” to “Valid values”.

    Name: H5Fflush
    Signature:
    herr_t H5Fflush(hid_t object_id, H5F_scope_t scope )
    Purpose:
    Flushes all buffers associated with a file to disk.
    Description:
    H5Fflush causes all buffers associated with a file to be immediately flushed to disk without removing the data from the cache.

    object_id can be any object associated with the file, including the file itself, a dataset, a group, an attribute, or a named datatype.

    scope specifies whether the scope of the flushing action is global or local. Valid values are as follows:
         H5F_SCOPE_GLOBAL      Flushes the entire virtual file.
      H5F_SCOPE_LOCAL   Flushes only the specified file.

    Note:
    HDF5 does not possess full control over buffering. H5Fflush flushes the internal HDF5 buffers then asks the operating system (the OS) to flush the system buffers for the open files. After that, the OS is responsible for ensuring that the data is actually flushed to disk.
    Parameters:
    Returns:
    Returns a non-negative value if successful; otherwise returns a negative value.
    Fortran90 Interface: h5fflush_f
    SUBROUTINE h5fflush_f(obj_id, scope, hdferr)
      IMPLICIT NONE 
      INTEGER(HID_T), INTENT(IN)  :: obj_id      ! Object identifier
      INTEGER, INTENT(IN)         :: scope       ! Flag with two possible values:
                                                 !     H5F_SCOPE_GLOBAL_F  
                                                 !     H5F_SCOPE_LOCAL_F  
      INTEGER, INTENT(OUT)        :: hdferr      ! Error code 
                                                 ! 0 on success and -1 on failure
    END SUBROUTINE h5fflush_f
        

    Last modified: 16 September 2014
    Name: H5Fget_access_plist
    Signature:
    hid_t H5Fget_access_plist(hid_t file_id)
    Purpose:
    Returns a file access property list identifier.
    Description:
    H5Fget_access_plist returns the file access property list identifier of the specified file.

    See “File Access Properties” in H5P: Property List Interface in this reference manual and “File Access Properties” in “The HDF5 File” chapter in the HDF5 User’s Guide for more information.

    Parameters:
    Returns:
    Returns a file access property list identifier if successful; otherwise returns a negative value.
    Fortran90 Interface: h5fget_access_plist_f
    SUBROUTINE h5fget_access_plist_f(file_id, fcpl_id, hdferr)
    
      IMPLICIT NONE 
      INTEGER(HID_T), INTENT(IN)   :: file_id ! File identifier
      INTEGER(HID_T), INTENT(OUT)  :: fapl_id ! File access property list identifier
      INTEGER, INTENT(OUT)         :: hdferr  ! Error code 
                                              ! 0 on success and -1 on failure
    END SUBROUTINE h5fget_access_plist_f
        

    Last modified: 16 September 2014
    Name: H5Fget_create_plist
    Signature:
    hid_t H5Fget_create_plist(hid_t file_id )
    Purpose:
    Returns a file creation property list identifier.
    Description:
    H5Fget_create_plist returns a file creation property list identifier identifying the creation properties used to create this file. This function is useful for duplicating properties when creating another file.

    See “File Creation Properties” in H5P: Property List Interface in this reference manual and “File Creation Properties” in “The HDF5 File” chapter in the HDF5 User’s Guide for more information.

    The creation property list identifier should be released with H5Pclose.

    Parameters:
    Returns:
    Returns a file creation property list identifier if successful; otherwise returns a negative value.
    Fortran90 Interface: h5fget_create_plist_f
    SUBROUTINE h5fget_create_plist_f(file_id, fcpl_id, hdferr)
    
      IMPLICIT NONE 
      INTEGER(HID_T), INTENT(IN)   :: file_id ! File identifier
      INTEGER(HID_T), INTENT(OUT)  :: fcpl_id ! File creation property list 
                                              ! identifier
      INTEGER, INTENT(OUT)         :: hdferr  ! Error code 
                                              ! 0 on success and -1 on failure
    END SUBROUTINE h5fget_create_plist_f
        

    Last modified: 2 May 2014
    Name: H5Fget_file_image
    Signature:
    ssize_t H5Fget_file_image( hid_t file_id, void *buf_ptr, size_t buf_len )

    Purpose:
    Retrieves a copy of the image of an existing, open file.

    Motivation:
    H5Fget_file_image and other elements of HDF5 are used to load an image of an HDF5 file into system memory and open that image as a regular HDF5 file. An application can then use the file without the overhead of disk I/O.

    Recommended Reading:
    This function is part of the file image operations feature set. It is highly recommended to study the guide “HDF5 File Image Operations” before using this feature set.

    See the “See Also” section below for links to other elements of HDF5 file image operations.

    Description:
    H5Fget_file_image retrieves a copy of the image of an existing, open file. This routine can be used with files opened using the SEC2 (or POSIX), STDIO, and Core (or Memory) virtual file drivers (VFDs).

    If the return value of H5Fget_file_image is a positive value, it will be the length in bytes of the buffer required to store the file image. So if the file size is unkown, it can be safely determined with an initial H5Fget_file_image call with buf_ptr set to NULL. The file image can then be retrieved with a second H5Fget_file_image with buf_len set to the initial call’s return value.

    While the current file size can also be retrieved with H5Fget_filesize, that call may produce a larger value than is needed. The value returned by H5Fget_filesize includes the user block, if it exists, and any unallocated space at the end of the file. It is safe in all situations to get the file size with H5Fget_file_image and it often produces a value that is more appropriate for the size of a file image buffer.

    Note/Warning: Anything here?

    Parameters:
    hid_t file_id      IN: Target file identifier
    void *buf_ptr   IN: Pointer to the buffer into which the image of the HDF5 file is to be copied

    If buf_ptr is NULL, no data will be copied but the function’s return value will still indicate the buffer size required (or a negative value on error).

    size_t *buf_len   IN: Size of the supplied buffer

    Returns:
    If successful, returns the size in bytes of the buffer required to store the file image if successful; otherwise returns a negative value.

    Failure Modes:
    H5Pget_file_image will fail, returning a negative value, if the file is too large for the supplied buffer.

    Others?

    Fortran2003 Interface: h5fget_file_image_f

    Signature:

      SUBROUTINE h5fget_file_image_f(file_id, buf_ptr, buf_len, hdferr, buf_size)
        USE, INTRINSIC :: ISO_C_BINDING
        IMPLICIT NONE
        INTEGER(HID_T) , INTENT(IN)              :: file_id
        TYPE(C_PTR)    , INTENT(INOUT)           :: buf_ptr
        INTEGER(SIZE_T), INTENT(IN)              :: buf_len
        INTEGER        , INTENT(OUT)             :: hdferr
        INTEGER(SIZE_T), INTENT(OUT)  , OPTIONAL :: buf_size
    

    Inputs:

      file_id    - Target file identifier.
      buf_ptr    - Pointer to the buffer into which the image of the HDF5 file is to be copied.
      buf_len    - Size of the supplied buffer.
    

    Outputs:

      hdferr     - error code:
                     0 on success and -1 on failure
    

    Optional parameters:

      buf_size   - Returns the size in bytes of the buffer required to store the file image,
                   no data will be copied.
    

    See Also:
    H5LTopen_file_image
     
    H5Pset_file_image
    H5Pget_file_image
     
    H5Pset_file_image_callbacks
    H5Pget_file_image_callbacks
         HDF5 File Image Operations
         in Advanced Topics in HDF5
     
    Within H5Pset_file_image_callbacks:
    Callback struct   H5_file_image_callbacks_t
    Callback ENUM   H5_file_image_op_t

    History:
    Release     Change
    1.8.13 Fortran subroutine added in this release.
    1.8.9 C function introduced in this release.

    Last modified: 17 November 2010
    Name: H5Fget_filesize
    Signature:
    herr_t H5Fget_filesize( hid_t file_id, hsize_t *size )

    Purpose:
    Returns the size of an HDF5 file.

    Description:
    H5Fget_filesize returns the size of the HDF5 file specified by file_id.

    The returned size is that of the entire file, as opposed to only the HDF5 portion of the file. I.e., size includes the user block, if any, the HDF5 portion of the file, and any data that may have been appended beyond the data written through the HDF5 Library.

    Parameters:
    hid_t file_id
    IN: Identifier of a currently-open HDF5 file
    hsize_t *size
    OUT: Size of the file, in bytes.

    Returns:
    Returns a non-negative value if successful; otherwise returns a negative value.

    Fortran90 Interface: h5fget_filesize_f
    SUBROUTINE h5fget_filesize_f(file_id, size, hdferr)
    
      IMPLICIT NONE
      INTEGER(HID_T), INTENT(IN) :: file_id    ! file identifier
      INTEGER(HSIZE_T), INTENT(OUT) :: size    ! Size of the file 
      INTEGER, INTENT(OUT) :: hdferr           ! Error code: 0 on success,
                                               ! -1 if fail
    END SUBROUTINE h5fget_filesize_f 
        

    History:

    Last modified: 4 April 2016
    Name: H5Fget_free_sections
    Signature:
    ssize_t H5Fget_free_sections( hid_t fcpl_id, H5F_mem_t type, size_t nsects, H5F_sect_info_t * sect_info )

    Purpose:
    Retrieves free-space section information for a file.

    Description:
    H5Fget_free_sections retrieves free-space section information for the free-space manager with type that is associated with file fcpl_id. If type is H5FD_MEM_DEFAULT, this routine retrieves free-space section information for all the free-space managers in the file.

    This routine retrieves free-space section information for nsects sections or at most the maximum number of sections in the specified free-space manager. If the number of sections is not known, a preliminary H5Fget_free_sections() call can be made by setting sect_info to NULL and the total number of free-space sections for the specified free-space manager will be returned. Users can then allocate space for entries in sect_info, each of which is defined as an H5F_sect_info_t struct (see Parameters section).

    Parameters:
    hid_t fcpl_id      IN: The file creation property list identifier.
    H5F_mem_t type      IN: The file memory allocation type.

    Valid values are as follows:
    H5FD_MEM_DEFAULT   The default file memory allocation type.
    H5FD_MEM_SUPER File memory allocated for Superblock.
    H5FD_MEM_BTREE File memory allocated for B-tree.
    H5FD_MEM_DRAW File memory allocated for raw data.
    H5FD_MEM_GHEAP File memory allocated for Global Heap.
    H5FD_MEM_LHEAP File memory allocated for Local Heap.
    H5FD_MEM_OHDR File memory allocated for Object Header.

    There are other file memory allocation types that are mapped to the above six basic types.

    hsize_t nsects   IN: The number of free-space sections.
    H5F_sect_info_t *sect_info   IN/OUT: Pointer to instances of H5F_sect_info_t in which the free-space section information is to be returned.

    An H5F_sect_info_t struct is defined as follows (in H5Fpublic.h):

            typedef struct H5F_sect_info_t {
                haddr_t     addr;     /* address of the     */
                                      /* free-space section */
                hsize_t     size;     /* size of the        */
                                      /* free-space section */
            } H5F_sect_info_t;
            

    Returns:
    Returns the number of free-space sections for the specified free-space manager in the file; otherwise returns a negative value.

    Failure Modes:
    This routine will fail when the following is true:

    Example Usage:
    The first example shows that the first call to H5Fget_free_sections() returns the total number of free-space sections in nsects for all the free-space managers in the file that is associated with fcpl. The second call to H5Fget_free_sections() retrieves free-space section information in sect_info for nsects sections. The value in ret is the same as nsects.
    nsects = H5Fget_free_sections(fcpl, H5FD_MEM_DEFAULT, 0, NULL);
    :
    : Allocate space for entries in sect_info
    :
    ret = H5F_get_free_sections(fcpl, H5FD_MEM_DEFAULT, nsects, sect_info);
    

    The second example shows that the first call to H5Fget_free_sections() returns the total number of free-space sections in nsects for the H5FD_MEM_SUPER free-space manager in the file that is associated with fcpl. Even though there are nsects sections for the specified free-space manager, the second call to H5Fget_free_sections() retrieves free-space section information in sect_info for nsects-1 sections as requested. The value in ret is the same as nsects.
    nsects = H5Fget_free_sections(fcpl, H5FD_MEM_SUPER, 0, NULL);
    :
    : Allocate space for entries in sect_info
    :
    ret = H5F_get_free_sections(fcpl, H5FD_MEM_SUPER, nsects-1, sect_info);
    

    The third example shows that the first call to H5Fget_free_sections() returns the total number of free-space sections in nsects for the H5FD_MEM_BTREE free-space manager in the file that is associated with fcpl. Even though the second call to H5Fget_free_sections() requests nsects+1 sections, the routine retrieves free-space section information in sect_info for only nsects sections. The value in ret is the same as nsects.
    nsects = H5Fget_free_sections(fcpl, H5FD_MEM_BTREE, 0, NULL);
    :
    : Allocate space for entries in sect_info
    :
    ret = H5F_get_free_sections(fcpl, H5FD_MEM_BTREE, nsects+1, sect_info);
    

    See Also:
    H5Pset_file_space
    H5Pget_file_space

    H5Fget_freespace
    H5Fget_info

    h5repack
    h5dump
    h5stat

    HDF5 Guide to File Space Management    (Not yet available.)

    History:
    Release     Change
    1.10.0 C function introduced in this release.

    Last modified: 15 October 2003
    Name: H5Fget_freespace
    Signature:
    hssize_t H5Fget_freespace( hid_t file_id )

    Purpose:
    Returns the amount of free space in a file.

    Description:
    Given the identifier of an open file, file_id, H5Fget_freespace returns the amount of space that is unused by any objects in the file.

    Currently, the HDF5 library only tracks free space in a file from a file open or create until that file is closed, so this routine will only report the free space that has been created during that interval.

    Parameters:
    hid_t file_id    IN: Identifier of a currently-open HDF5 file

    Returns:
    Returns the amount of free space in the file if successful; otherwise returns a negative value.

    Fortran90 Interface: h5fget_freespace_f
    SUBROUTINE h5fget_freespace_f(file_id, free_space, hdferr)
    
      IMPLICIT NONE 
      INTEGER(HID_T), INTENT(IN)  :: file_id       ! File identifier
      INTEGER(HSSIZE_T), INTENT(OUT) :: free_space ! Amount of free space in file
      INTEGER, INTENT(OUT)        :: hdferr        ! Error code 
                                                   ! 0 on success and -1 on failure
    END SUBROUTINE h5fget_freespace_f 
        

    History:
    Release     Change
    1.6.1 Function introduced in this release.

    Last modified: 3 March 2016
    Name: H5Fget_info
    Signature:
    herr_t H5Fget_info( hid_t obj_id, H5F_info_t *file_info )

    herr_t H5Fget_info( hid_t obj_id, H5F_info_t *file_info )

    Purpose:
    Opens the HDF5 object referenced.

    Description:
    H5Fget_info is a macro that is mapped to either H5Fget_info1 or H5Fget_info2, depending on the needs of the application.

    Similarly, the macro for the H5F_info_t struct is mapped to either H5F_info1_t or H5F_info2_t.

    Such macros are provided to facilitate application compatibility. Their use and mappings are fully described in “API Compatibility Macros in HDF5”; we urge you to read that document closely.

    When both the HDF5 Library and the application are built and installed with no specific compatibility flags, H5Fget_info is mapped to the most recent version of the function, currently H5Fget_info2. If the library and/or application is compiled for Release 1.8 emulation, H5Fget_info will be mapped to H5Fget_info1. Since there was no H5Fget_info function in Release 1.6, if the library and/or application is compiled for Release 1.6 emulation, H5Fget_info will be mapped to the most recent version of the function, currently H5Fget_info2. Function-specific flags are available to override these settings on a function-by-function basis when the application is compiled.

    Specific compile-time compatibility flags and the resulting mappings are as follows:

    Compatibility setting H5Fget_info and H5F_info_t mappings

    Global settings
    No compatibility flag H5Fget_info2 and H5F_info2_t 
    Enable deprecated symbols H5Fget_info2 and H5F_info2_t 
    Disable deprecated symbols H5Fget_info2 and H5F_info2_t 
    Emulate Release 1.6 interface     H5Fget_info2 and H5F_info2_t 
    Emulate Release 1.8 interface  H5Fget_info1 and H5F_info1_t 

    Function- and struct-level macros
    H5Fget_info_vers = 2 H5Fget_info2
    H5Fget_info_vers = 1 H5Fget_info1
    H5F_info_t_vers = 2 H5F_info2_t
    H5F_info_t_vers = 1 H5F_info1_t

    Fortran90 Interface:
    None.

    History:
    Release     Change
    1.10.0 The C function H5Fget_info and H5F_info_t renamed to H5Fget_info1 and H5F_info1_t, respectively, and deprecated in this release.
    The C macro H5Fget_info, the C function H5Fget_info2, and the struct H5F_info2_t introduced in this release.

    Last modified: 4 March 2016
    Name: H5Fget_info1
    Signature:
    herr_t H5Fget_info1( hid_t obj_id, H5F_info1_t *file_info )

    Purpose:
    Returns global information for a file.

    Notice:
    This function has been renamed from H5Fget_info and is deprecated in favor of the macro H5Fget_info or the function H5Fget_info2.

    Description:
    H5Fget_info1 returns global information for the file associated with the object identifier obj_id in the H5F_info1_t struct named file_info.

    obj_id is an identifier for any object in the file of interest.

    An H5F_info1_t struct is defined as follows (in H5Fpublic.h):

            typedef struct H5F_info1_t {
                hsize_t           super_ext_size; 
                struct {
                    hsize_t       hdr_size;      
                    H5_ih_info_t  msgs_info;      
                } sohm;
            } H5F_info1_t; 
    
    super_ext_size is the size of the superblock extension.

    The sohm sub-struct contains shared object header message information: hdr_size is the size of shared of object header messages. msgs_info is a H5_ih_info_t struct containing the cumulative shared object header message index size and heap size; an H5_ih_info1_t struct is defined as follows (in H5public.h):

            typedef struct H5_ih_info_t {
                hsize_t     index_size;     
                hsize_t     heap_size;
            } H5_ih_info_t;
    
    index_size is the summed size of all of the shared of object header indexes. Each index might be either a B-tree or a list. heap_size is the size of the heap.

    Parameters:
    hid_t obj_id, IN: Object identifier for any object in the file.
    H5F_info1_t *file_info   OUT: Struct containing global file information.

    Returns:
    Returns a non-negative value if successful; otherwise returns a negative value.

    Fortran90 Interface:
    None.

    History:
    Release     C
    1.8.0 Function introduced in this release.
    1.10.0 C function H5Fget_info renamed to H5Fget_info1 and deprecated in this release.

    Last modified: 3 March 2016
    Name: H5Fget_info2
    Signature:
    herr_t H5Fget_info2( hid_t obj_id, H5F_info2_t *file_info )

    Purpose:
    Returns global information for a file.

    Description:
    H5Fget_info2 returns global information for the file associated with the object identifier obj_id in the H5F_info2_t struct named file_info.

    obj_id is an identifier for any object in the file of interest.

    An H5F_info2_t struct is defined in H5Fpublic.h as follows:

            typedef struct H5F_info2_t {
    	    struct {
    		unsigned      vers;	
    		hsize_t	      super_size;
    		hsize_t	      super_ext_size;	
    	    } super;
    	    struct {
    		unsigned      vers;
    		hsize_t	      hdr_size;
    		hsize_t	      tot_space;
    	    } free;
                struct {
    		unsigned      vers;
                    hsize_t       hdr_size;		
                    H5_ih_info_t  msgs_info; 
                } sohm;
            } H5F_info2_t; 
    
    The super sub-struct contains the following information:

    The free sub-struct contains the following information:

    The sohm sub-struct contains shared object header message information as follows:

    Parameters:
    hid_t obj_id, IN: Object identifier for any object in the file.
    H5F_info2_t *file_info   OUT: Struct containing global file information.

    Returns:
    Returns a non-negative value if successful; otherwise returns a negative value.

    Fortran90 Interface:
    None.

    History:
    Release     C
    1.10.0 C function H5Fget_info2 introduced in this release.

    Last modified: 1 June 2016

    Name: H5Fget_intent

    Signature:
    herr_t H5Fget_intent( hid_t file_id, unsigned *intent )

    Purpose:
    Determines the read/write or read-only status of a file.

    Description:
    Given the identifier of an open file, file_id, H5Fget_intent retrieves the “intended access mode” flag passed with H5Fopen when the file was opened.

    The value of the flag is returned in intent. Valid values are as follows:

    H5F_ACC_RDWR  File was opened with read/write access.
    H5F_ACC_RDONLY  File was opened with read-only access.
    H5F_ACC_SWMR_WRITE    File was opened with read/write access for a single-writer/multiple-reader (SWMR) scenario. Note that the writer process must also open the file with the H5F_ACC_RDWR flag.
    H5F_ACC_SWMR_READ  File was opened with read-only access for a single-writer/multiple-reader (SWMR) scenario. Note that the reader process must also open the file with the H5F_ACC_RDONLY flag.

    The function will not return an error if intent is NULL; it will simply do nothing.

    Parameters:
    hid_t file_id IN: File identifier for a currently-open HDF5 file.
    unsigned *intent    OUT: Intended access mode flag as originally passed with H5Fopen.

    Returns:
    Returns a non-negative value if successful; otherwise returns a negative value.

    Fortran90 Interface:
    None

    History:
    Release     Change
    1.8.0 C function introduced in this release.
    1.10.0 C function enhanced to work with SWMR functionality.




    Name: H5Fget_mdc_config
    Signature:
    herr_t H5Fget_mdc_config(hid_t file_id, H5AC_cache_config_t *config_ptr)
    Purpose:
    Obtain current metadata cache configuration for target file.
    Description:
    H5Fget_mdc_config loads the current metadata cache configuration into the instance of H5AC_cache_config_t pointed to by the config_ptr parameter.

    Note that the version field of *config_ptr must be initialized --this allows the library to support old versions of the H5AC_cache_config_t structure.

    See the overview of the metadata cache in the special topics section of the user manual for details on metadata cache configuration. If you haven't read and understood that documentation, the results of this call will not make much sense.

    Parameters:
    Returns:
    Returns a non-negative value if successful; otherwise returns a negative value.

    Name: H5Fget_mdc_hit_rate
    Signature:
    herr_t H5Fget_mdc_hit_rate(hid_t file_id, double *hit_rate_ptr)
    Purpose:
    Obtain target file's metadata cache hit rate.
    Description:
    H5Fget_mdc_hit_rate queries the metadata cache of the target file to obtain its hit rate (cache hits / (cache hits + cache misses)) since the last time hit rate statistics were reset. If the cache has not been accessed since the last time the hit rate stats were reset, the hit rate is defined to be 0.0.

    The hit rate stats can be reset either manually (via H5Freset_mdc_hit_rate_stats()), or automatically. If the cache's adaptive resize code is enabled, the hit rate stats will be reset once per epoch. If they are reset manually as well, the cache may behave oddly.

    See the overview of the metadata cache in the special topics section of the user manual for details on the metadata cache and its adaptive resize algorithms.

    Parameters:
    Returns:
    Returns a non-negative value if successful; otherwise returns a negative value.

    Name: H5Fget_mdc_image_info
    Signature:
    herr_t H5Fget_mdc_image_info(hid_t file_id, haddr_t *image_addr, hsize_t *image_len)
    Purpose:
    Obtain information about a cache image if it exists.
    Description:
    H5Fget_mdc_image_info returns information about a cache image if it exists.

    When an HDF5 file is opened in Read/Write mode, any metadata cache image will be read and deleted from the file on the first metadata cache access (or, if persistent free space managers are enabled, on the first file space allocation / deallocation, or read of free space manager status, whichever comes first).

    Thus, if the file is opened Read/Write, H5Fget_mdc_image_info should be called immediately after file open and before any other operation. If H5Fget_mdc_image_info is called after the cache image is loaded, it will correctly report that no cache image exists, as the image will have already been read and deleted from the file. In the Read Only case, the function may be called at any time, as any cache image will not be deleted from the file.

    Parameters:
    Returns:
    Returns a non-negative value if successful; otherwise returns a negative value.
    History:
    Release     Change
    1.10.1 C function introduced with this release.

    Last modified: 18 March 2014

    Name: H5Fget_mdc_logging_status

    Signature:
    herr_t H5Fget_mdc_logging_status( hid_t file_id, hbool_t *is_enabled, hbool_t *is_currently_logging )

    Purpose:
    Gets the current metadata cache logging status.

    Description:
    The metadata cache is a central part of the HDF5 library through which all file metadata reads and writes take place. File metadata is normally invisible to the user and is used by the library for purposes such as locating and indexing data. File metadata should not be confused with user metadata, which consists of attributes created by users and attached to HDF5 objects such as datasets via H5A API calls.

    Due to the complexity of the cache, a trace/logging feature has been created that can be used by HDF5 developers for debugging and performance analysis. The functions that control this functionality will normally be of use to a very limited number of developers outside of The HDF Group. The functions have been documented to help users create logs that can be sent with bug reports.

    Control of the log functionality is straightforward. Logging is enabled via the H5Pset_mdc_log_options() function, which will modify the file access property list used to open or create a file. This function has a flag that determines whether logging begins at file open or starts in a paused state. Log messages can then be controlled via the H5Fstart/stop_logging() functions. H5Pget_mdc_log_options() can be used to examine a file access property list, and H5Fget_mdc_logging_status() will return the current state of the logging flags.

    The log format is described in the Metadata Cache Logging document.


    Notes:
    Unlike H5Fstart/stop_mdc_logging(), this function can be called on any open file identifier.

    Parameters:
    hid_t file_id  IN: Identifier of an open HDF5 file.
    hbool_t *is_enabled  OUT: Whether logging is enabled.
    hbool_t *is_currently_logging    OUT: Whether events are currently being logged.

    Returns:
    Returns a non-negative value if successful. Otherwise returns a negative value.

    Fortran Interface:
    None

    See Also:

    History:
    Release Change
    1.10.0 C function introduced with this release.




    Name: H5Fget_mdc_size
    Signature:
    herr_t H5Fget_mdc_size(hid_t file_id, size_t *max_size_ptr, size_t *min_clean_size_ptr, size_t *cur_size_ptr, int *cur_num_entries_ptr)
    Purpose:
    Obtain current metadata cache size data for specified file.
    Description:
    H5Fget_mdc_size queries the metadata cache of the target file for the desired size information, and returns this information in the locations indicated by the pointer parameters. If any pointer parameter is NULL, the associated data is not returned.

    If the API call fails, the values returned via the pointer parameters are undefined.

    If adaptive cache resizing is enabled, the cache maximum size and minimum clean size may change at the end of each epoch. Current size and current number of entries can change on each cache access.

    Current size can exceed maximum size under certain conditions. See the overview of the metadata cache in the special topics section of the user manual for a discussion of this.

    Parameters:
    Returns:
    Returns a non-negative value if successful; otherwise returns a negative value.

    Last modified: 31 March 2016

    Name: H5Fget_metadata_read_retry_info

    Signature:
    herr_t H5Fget_metadata_read_retry_info( hid_t file_id, H5F_retry_info_t *info )

    Purpose:
    Retrieves the collection of read retries for metadata entries with checksum.

    Motivation:
    On a system that is not atomic, the library might possibly read inconsistent metadata with checksum when performing single-writer/multiple-reader (SWMR) operations for an HDF5 file. Upon encountering such situations, the library will try reading the metadata again for a set number of times to attempt to obtain consistent data. The maximum number of read attempts used by the library will be either the value set via H5Pset_metadata_read_attempts or the library default value when a value is not set.

    When the current number of metadata read attempts used in the library is unable to remedy the reading of inconsistent metadata on a system, the user can assess the information obtained via this routine to derive a different maximum value. The information can also be helpful for debugging purposes to identify potential issues with metadata flush dependencies and SWMR implementation in general.

    Description:
    H5Fget_metadata_read_retry_info retrieves information regarding the number of read retries for metadata entries with checksum for the file file_id. This information is reported in the H5F_retry_info_t struct defined in H5Fpublic.h as follows:
            /* The number of metadata entries with checksum */
            #define NUM_METADATA_READ_RETRIES         21        
    
            typedef struct H5F_retry_info_t {
                unsigned nbins;
                uint32_t *retries[H5F_NUM_METADATA_READ_RETRY_TYPES];
            } H5F_retry_info_t;
        

    nbins is the number of bins for each retries[i] of metadata entry i. It is calculated based on the current number of read attempts used in the library and logarithmic 10.

    If read retries are incurred for a metadata entry i, the library will allocate memory for retries[i] (nbins * sizeof(uint32_t) and store the collection of retries there. If there are no retries for a metadata entry i, retries[i] will be NULL. After a call to this routine, users should free each retries[i] that is non-NULL, otherwise resource leak will occur.

    For the library default read attempts of 100 for SWMR access, nbins will be 2 as depicted below:

    For the library default read attempts of 1 for non-SWMR access, nbins will be 0 and each retries[i] will be NULL.

    The following table lists the 21 metadata entries of retries[]:

        

    Index for retries[]      Metadata entries*

    0     Object header (version 2)
    1     Object header chunk (version 2)

    2     B-tree header (version 2)
    3     B-tree internal node (version 2)
    4     B-tree leaf node (version 2)

    5     Fractal heap header
    6     Fractal heap direct block (optional checksum)  
    7     Fractal heap indirect block

    8     Free-space header
    9     Free-space sections

    10     Shared object header message table
    11     Shared message record list

    12     Extensive array header
    13     Extensive array index block

    14     Extensive array super block
    15     Extensive array data block
    16     Extensive array data block page

    17     Fixed array header
    18     Fixed array data block
    19     Fixed array data block page

    20     File’s superblock (version 2)

    * All entries are of version 0 (zero) unless indicated otherwise.

    Parameters:
    hid_t file_id IN: Identifier for a currently opened HDF5 file.
    H5F_retry_info_t *info    OUT: Struct containing the collection of read retries for metadata entries with checksum.

    Returns:
    Returns a non-negative value if successful; otherwise returns a negative value.

    Failure Modes:
    When the input identifier is not a file identifier.

    When the pointer to the output structure is NULL.

    When memory allocation failed for retries.


    Example Usage:
    This example illustrates the case on retrieving the collection of read retries for a file opened with SWMR access.
    
    H5F_retry_info_t info;
    
    /* Get a copy of file access property list */
    fapl = H5Pcreate(H5P_FILE_ACCESS);
    
    /* Set to use the latest library format */
    H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST);
    
    /* Create a file with the latest library format */
    fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
    
    /* Create groups/datasets etc. in the file */
    :
    :
    :
    
    /* Close the file */
    H5Fclose(fid);
    
    /* Open and perform operations via a writer. */
    fidw = H5Fopen(filename, H5F_ACC_RDWR |H5F_ACC_SWMR_WRITE, fapl);
    :
    :
    :
    :
    :
    /* Open and perform operations via a reader */
    fidr = H5Fopen(FILE, H5F_ACC_RDONLY|H5F_ACC_SWMR_READ, fapl);
    :
    :
    :
    :
    :
    /* Retrieve the collection of read retries for the file */
    H5Fget_metadata_read_retry_info(fidr, &info);
    
    /* Print the collection of read retries */
    for(i = 0; i < NUM_METADATA_READ_RETRIES; i++) {
        if(info. retries[i] != NULL) {
            printf("Read retries for metadata entry %u:\n", i);
    
            /* info.nbins will be 2 */
            for(j = 0; j < info.nbins; j++)
                /* 
                 * Print the following if nonzero:
                 * info.retries[i][0] for # of 1-9 read retries
                 * info.retries[i][1] for # of 10-99 read retries
                 */
        } /* end if */
    } /* end for */
    
    /* Free the array of retries */
    for(i = 0; i < NUM_ METADATA_READ_RETRIES; i++)
        if(info.retries[i] != NULL)
            free(info.retries[i];
    :
    :
    :
    

    Fortran Interface:
    None

    See Also:
    History:
    Release     Change
    1.10.0 C function introduced with this release.




    Last modified: 18 April 2012
    Name: H5Fget_mpi_atomicity
    Signature:
    herr_t H5Fget_mpi_atomicity( hid_t file_id, hbool_t *flag )

    Purpose:
    Retrieves the atomicity mode in use.

    Description:
    H5Fget_mpi_atomicity retrieves the current consistency semantics mode for data access for the file file_id.

    Upon successful return, flag will be set to TRUE if file access is set to atomic mode and FALSE if file access is set to nonatomic mode.

    Parameters:
    hid_t file_id      IN: HDF5 file identifier
    hbool_t *flag   OUT: Logical flag for atomicity setting
    Valid values are:
  • TRUE    MPI file access is set to atomic mode.
  • FALSE   MPI file access is set to nonatomic mode.
  • Returns:
    Returns a non-negative value if successful; otherwise returns a negative value.

    Fortran90 Interface: h5fget_mpi_atomicity_f
    SUBROUTINE h5fget_mpi_atomicity_f(file_id, flag, hdferr) 
      IMPLICIT NONE
      INTEGER(HID_T), INTENT(IN) :: file_id ! File identifier
      INTEGER(HBOOL_T), INTENT(OUT) :: flag ! Atomicity flag
      INTEGER, INTENT(OUT) :: hdferr        ! Error code:
                                            ! 0 on success, -1 on failure
    END SUBROUTINE h5fget_mpi_atomicity_f 

    See Also:
    Enabling a Strict Consistency Semantics Model in Parallel HDF5

    H5Fset_mpi_atomicity

    History:
    Release     Change
    1.8.9 C function and Fortran subroutine introduced in this release.

    Name: H5Fget_name
    Signature:
    ssize_t H5Fget_name(hid_t obj_id, char *name, size_t size )
    Purpose:
    Retrieves name of file to which object belongs.
    Description:
    H5Fget_name retrieves the name of the file to which the object obj_id belongs. The object can be a group, dataset, attribute, or named datatype.

    Up to size characters of the filename are returned in name; additional characters, if any, are not returned to the user application.

    If the length of the name, which determines the required value of size, is unknown, a preliminary H5Fget_name call can be made by setting name to NULL. The return value of this call will be the size of the filename; that value plus one (1) can then be assigned to size for a second H5Fget_name call, which will retrieve the actual name. (The value passed in with the parameter size must be one greater than size in bytes of the actual name in order to accommodate the null terminator; if size is set to the exact size of the name, the last byte passed back will contain the null terminator and the last character will be missing from the name passed back to the calling application.)

    If an error occurs, the buffer pointed to by name is unchanged and the function returns a negative value.

    Parameters:
    hid_t obj_id
    IN: Identifier of the object for which the associated filename is sought. The object can be a group, dataset, attribute, or named datatype.
    char *name
    OUT: Buffer to contain the returned filename.
    size_t size
    IN: Size, in bytes, of the name buffer.
    Returns:
    Returns the length of the filename if successful; otherwise returns a negative value.
    Fortran90 Interface: h5fget_name_f
    SUBROUTINE h5fget_name_f(obj_id, buf, size, hdferr)
    
      IMPLICIT NONE
      INTEGER(HID_T), INTENT(IN) :: obj_id     ! Object identifier 
      CHARACTER(LEN=*), INTENT(INOUT) :: buf   ! Buffer to hold filename
      INTEGER(SIZE_T), INTENT(OUT) :: size     ! Size of the filename
      INTEGER, INTENT(OUT) :: hdferr           ! Error code: 0 on success,
                                               ! -1 if fail
    END SUBROUTINE h5fget_name_f
        
    History:

    Name: H5Fget_obj_count
    Last modified: 5 November 2009
    Signature:
    ssize_t H5Fget_obj_count( hid_t file_id, unsigned int types )

    Purpose:
    Returns the number of open object identifiers for an open file.

    Description:
    Given the identifier of an open file, file_id, and the desired object types, types, H5Fget_obj_count returns the number of open object identifiers for the file.

    To retrieve a count of open identifiers for open objects in all HDF5 application files that are currently open, pass the value (hid_t)H5F_OBJ_ALL (Fortran: INT(H5F_OBJ_ALL_F,HID_T)) in file_id.

    The types of objects to be counted are specified in types as follows:

    H5F_OBJ_FILE Files only
    H5F_OBJ_DATASET Datasets only
    H5F_OBJ_GROUP Groups only
    H5F_OBJ_DATATYPE   Named datatypes only
    H5F_OBJ_ATTR   Attributes only
    H5F_OBJ_ALL All of the above
    (That is, H5F_OBJ_FILE | H5F_OBJ_DATASET | H5F_OBJ_GROUP | H5F_OBJ_DATATYPE | H5F_OBJ_ATTR)
    H5F_OBJ_LOCAL Restrict search to objects opened through current file identifier.
    Note: H5F_OBJ_LOCAL does not stand alone; it is effective only when used in combination with one or more of the preceding types. For example,
        H5F_OBJ_DATASET | H5F_OBJ_GROUP | H5F_OBJ_LOCAL
    would count all datasets and groups opened through the current file identifier.

    Multiple object types can be combined with the logical OR operator (|). For example, the expression (H5F_OBJ_DATASET|H5F_OBJ_GROUP) would call for datasets and groups.

    Parameters:

    Returns:
    Returns the number of open objects if successful; otherwise returns a negative value.

    Fortran90 Interface: h5fget_obj_count_f
    SUBROUTINE h5fget_obj_count_f(file_id, obj_type, obj_count, hdferr)
    
      IMPLICIT NONE 
      INTEGER(HID_T), INTENT(IN)  :: file_id    ! File identifier
      INTEGER, INTENT(IN)         :: obj_type   ! Object types, possible values are:
                                                !     H5F_OBJ_FILE_F
                                                !     H5F_OBJ_GROUP_F
                                                !     H5F_OBJ_DATASET_F
                                                !     H5F_OBJ_DATATYPE_F
                                                !     H5F_OBJ_ALL_F
      INTEGER(SIZE_T), INTENT(OUT) :: obj_count ! Number of opened objects
      INTEGER, INTENT(OUT)         :: hdferr    ! Error code 
                                                ! 0 on success and -1 on failure
    END SUBROUTINE h5fget_obj_count_f
        

    History:

    Name: H5Fget_obj_ids

    Signature:
    ssize_t H5Fget_obj_ids( hid_t file_id, unsigned int types, size_t max_objs, hid_t *obj_id_list )

    Purpose:
    Returns a list of open object identifiers.

    Description:
    Given the file identifier file_id and the type of objects to be identified, types, H5Fget_obj_ids returns the list of identifiers for all open HDF5 objects fitting the specified criteria.

    To retrieve identifiers for open objects in all HDF5 application files that are currently open, pass the value H5F_OBJ_ALL in file_id.

    The types of object identifiers to be retrieved are specified in types using the codes listed for the same parameter in H5Fget_obj_count.

    To retrieve identifiers for all open objects, pass a negative value for max_objs.

    To retrieve a count of open objects, use the H5Fget_obj_count function. This count can be used to set the max_objs parameter.


    Parameters:

    Returns:
    Returns number of objects placed into obj_id_list if successful; otherwise returns a negative value.

    Fortran90 Interface: h5fget_obj_ids_f
    SUBROUTINE h5fget_obj_ids_f(file_id, obj_type, max_objs, obj_ids, hdferr, num_objs)
    
      IMPLICIT NONE 
      INTEGER(HID_T), INTENT(IN)   :: file_id  ! File identifier
      INTEGER,        INTENT(IN)   :: obj_type ! Object types, possible values are:
                                               !     H5F_OBJ_FILE_F
                                               !     H5F_OBJ_GROUP_F
                                               !     H5F_OBJ_DATASET_F
                                               !     H5F_OBJ_DATATYPE_F
                                               !     H5F_OBJ_ALL_F
      INTEGER(SIZE_T), INTENT(IN)  :: max_objs ! Maximum number of object 
                                               ! identifiers to retrieve
      INTEGER(HID_T), DIMENSION(*), INTENT(OUT) :: obj_ids
                                               ! Array of requested object 
                                               ! identifiers
      INTEGER, INTENT(OUT)        :: hdferr    ! Error code 
                                               ! 0 on success and -1 on failure
      INTEGER(SIZE_T), INTENT(OUT), OPTIONAL :: num_objs 
                                               ! number of open objects of the specified type
    END SUBROUTINE h5fget_obj_ids_f
        

    History:


    Last modified: 2016

    Name: H5Fget_page_buffering_stats

    Signature:
    herr_t H5Fget_page_buffering_stats( hid_t file_id, int accesses[2], int hits[2], int misses[2], int evictions[2], int bypasses[2] )

    Purpose:
    Retrieves statistics about page access when it is enabled.

    Description:

    H5Fget_page_buffering_stats retrieves page buffering statistics such as the number of metadata and raw data accesses (accesses), hits (hits), misses ( misses), evictions ( evictions), and accesses that bypass the page buffer (bypasses).

    Parameters:
    hid_t file_id   IN: File identifier
    int accesses   OUT: Two integer array for the number of metadata and raw data accesses to the page buffer
    int hits   OUT: Two integer array for the number of metadata and raw data hits in the page buffer
    int misses   OUT: Two integer array for the number of metadata and raw data misses in the page buffer
    int evictions   OUT: Two integer array for the number of metadata and raw data evictions from the page buffer
    int bypasses   OUT: Two integer array for the number of metadata and raw data accesses that bypass the page buffer
    Returns:
    Returns a non-negative value if successful. Otherwise returns a negative value.

    Fortran Interface:
    None

    See Also:
    History:
    Release     Change
    1.10.1 C function introduced with this release.




    Name: H5Fget_vfd_handle
    Signature:
    herr_t H5Fget_vfd_handle(hid_t file_id, hid_t fapl_id, void **file_handle )
    Purpose:
    Returns pointer to the file handle from the virtual file driver.
    Description:
    Given the file identifier file_id and the file access property list fapl_id, H5Fget_vfd_handle returns a pointer to the file handle from the low-level file driver currently being used by the HDF5 library for file I/O.
    Notes:
    Users are not supposed to modify any file through this file handle.

    This file handle is dynamic and is valid only while the file remains open; it will be invalid if the file is closed and reopened or opened during a subsequent session.

    Parameters:
    Returns:
    Returns a non-negative value if successful; otherwise returns a negative value.
    Fortran90 Interface:
    None.
    History:

    Last modified: 10 December 2015
    Name: H5Fis_hdf5

    Signature:
    htri_t H5Fis_hdf5(const char *name )

    Purpose:
    Determines whether a file is in the HDF5 format.

    Description:
    H5Fis_hdf5 determines whether a file is in the HDF5 format.

    Parameters:
    Returns:
    Returns a positive value if the file name is an HDF5 file.
    Returns 0 if the file name is not an HDF5 file.
    Returns a negative value when the function fails. This includes the case where the file does not exist.

    Fortran90 Interface: h5fis_hdf5_f
    SUBROUTINE h5fis_hdf5_f(name, status, hdferr)   
      IMPLICIT NONE 
      CHARACTER(LEN=*), INTENT(IN) :: name   ! Name of the file
      LOGICAL, INTENT(OUT) :: status         ! This parameter indicates 
                                             ! whether file is an HDF5 file 
                                             ! ( TRUE or FALSE ) 
      INTEGER, INTENT(OUT) :: hdferr         ! Error code 
                                             ! 0 on success and -1 on failure
    END SUBROUTINE h5fis_hdf5_f
        

    Last modified: 26 March 2014
    Name: H5Fmount
    Signature:
    herr_t H5Fmount(hid_t loc_id, const char *name, hid_t child_id, hid_t fmpl_id )

    Purpose:
    Mounts a file.

    Description:
    H5Fmount mounts the file specified by child_id onto the group specified by loc_id and name using the mount properties fmpl_id.

    loc_id can be either a file or group identifier; name is relative to loc_id.

    Note:
    To date, no file mount properties have been defined in HDF5. The proper value to pass for fmpl_id is H5P_DEFAULT, indicating the default file mount property list.

    Parameters:
    hid_t loc_id IN: Identifier for of file or group in which name is defined.
    const char *name     IN: Name of the group onto which the file specified by child_id is to be mounted.
    hid_t child_id IN: Identifier of the file to be mounted.
    hid_t fmpl_id IN: File mount property list identifier.
    Pass H5P_DEFAULT (see note above).

    Returns:
    Returns a non-negative value if successful; otherwise returns a negative value.

    Fortran90 Interface: h5fmount_f
    SUBROUTINE h5fmount_f(loc_id, name, child_id, hdferr)
      IMPLICIT NONE 
      INTEGER(HID_T), INTENT(IN)  :: loc_id      ! File or group identifier
      CHARACTER(LEN=*), INTENT(IN):: name        ! Group name at locationloc_id
      INTEGER(HID_T), INTENT(IN)  :: child_id    ! File(to be mounted) identifier
      INTEGER, INTENT(OUT)        :: hdferr      ! Error code 
                                                 ! 0 on success and -1 on failure
    END SUBROUTINE h5fmount_f
        

    Last modified: 9 October 2014
    Name: H5Fopen

    Signature:
    hid_t H5Fopen( const char *name, unsigned flags, hid_t fapl_id )

    Purpose:
    Opens an existing HDF5 file.

    Description:
    H5Fopen is the primary function for accessing existing HDF5 files. This function opens the named file in the specified access mode and with the specified access property list.

    Note that H5Fopen does not create a file if it does not already exist; see H5Fcreate.

    The name parameter specifies the name of the file to be opened.

    The fapl_id parameter specifies the file access property list. Use of H5P_DEFAULT specifies that default I/O access properties are to be used

    The flags parameter specifies whether the file will be opened in read-write or read-only mode, H5F_ACC_RDWR or H5F_ACC_RDONLY, respectively. More complex behaviors of file access are controlled through the file-access property list.

    The return value is a file identifier for the open file; this file identifier should be closed by calling H5Fclose when it is no longer needed.

    Special cases — Multiple opens:
    A file can often be opened with a new H5Fopen call without closing an already-open identifier established in a previous H5Fopen or H5Fcreate call. Each such H5Fopen call will return a unique identifier and the file can be accessed through any of these identifiers as long as the identifier remains valid. In such multiply-opened cases, the open calls must use the same flags argument and the file access property lists must use the same file close degree property setting (see the external link discussion below and H5Pset_fclose_degree).

    In some cases, such as files on a local Unix file system, the HDF5 library can detect that a file is multiply opened and will maintain coherent access among the file identifiers.

    But in many other cases, such as parallel file systems or networked file systems, it is not always possible to detect multiple opens of the same physical file. In such cases, HDF5 will treat the file identifiers as though they are accessing different files and will be unable to maintain coherent access. Errors are likely to result in these cases. While unlikely, the HDF5 library may not be able to detect, and thus report, such errors.

    It is generally recommended that applications avoid multiple opens of the same file.

    Special restriction on multiple opens of a file first opened by means of an external link: When an external link is followed, the external file is always opened with the weak file close degree property setting, H5F_CLOSE_WEAK (see H5Lcreate_external and H5Pset_fclose_degree). If the file is reopened with H5Fopen while it remains held open from such an external link call, the file access proeprty list used in the open call must include the file close degree setting H5F_CLOSE_WEAK or the open will fail.

    Parameters:
    const char *name     IN: Name of the file to be opened.
    unsigned flags IN: File access flags. Allowable values are:
      H5F_ACC_RDWR
      Allow read and write access to file.
      H5F_ACC_RDONLY
      Allow read-only access to file.

    H5F_ACC_RDWR and H5F_ACC_RDONLY are mutually exclusive; use exactly one.

    An additional flag, H5F_ACC_DEBUG, prints debug information. This flag can be combined with one of the above values using the bit-wise OR operator (`|'), but it is used only by HDF5 Library developers; it is neither tested nor supported for use in applications.

    hid_t fapl_id IN: Identifier for the file access properties list. If parallel file access is desired, this is a collective call according to the communicator stored in the fapl_id. Use H5P_DEFAULT for default file access properties.

    Returns:
    Returns a file identifier if successful; otherwise returns a negative value.

    Fortran90 Interface: h5fopen_f
    SUBROUTINE h5fopen_f(name, access_flags, file_id, hdferr, &  
                         access_prp)
      IMPLICIT NONE 
      CHARACTER(LEN=*), INTENT(IN) :: name   ! Name of the file
      INTEGER, INTENT(IN) :: access_flag     ! File access flags  
                                             ! Possible values are:
                                             !     H5F_ACC_RDWR_F   
                                             !     H5F_ACC_RDONLY_F    
      INTEGER(HID_T), INTENT(OUT) :: file_id ! File identifier 
      INTEGER, INTENT(OUT) :: hdferr         ! Error code 
                                             ! 0 on success and -1 on failure
      INTEGER(HID_T), OPTIONAL, INTENT(IN) :: access_prp  
                                             ! File access property list 
                                             ! identifier  
    END SUBROUTINE h5fopen_f
        
    See Also:
    “Using Identifiers”

    Last modified: 9 October 2014
    Name: H5Freopen

    Signature:
    hid_t H5Freopen(hid_t file_id )

    Purpose:
    Returns a new identifier for a previously-opened HDF5 file.

    Description:
    H5Freopen returns a new file identifier for an already-open HDF5 file, as specified by file_id. Both identifiers share caches and other information. The only difference between the identifiers is that the new identifier is not mounted anywhere and no files are mounted on it.

    Note that there is no circumstance under which H5Freopen can actually open a closed file; the file must already be open and have an active file_id. E.g., one cannot close a file with H5Fclose (file_id) then use H5Freopen (file_id) to reopen it.

    The new file identifier should be closed by calling H5Fclose when it is no longer needed.


    Parameters:

    Returns:
    Returns a new file identifier if successful; otherwise returns a negative value.

    Fortran90 Interface: h5freopen_f
    SUBROUTINE h5freopen_f(file_id, new_file_id, hdferr)
      IMPLICIT NONE 
      INTEGER(HID_T), INTENT(IN)  :: file_id     ! File identifier 
      INTEGER(HID_T), INTENT(OUT) :: new_file_id ! New file identifier 
      INTEGER, INTENT(OUT)        :: hdferr      ! Error code 
                                                 ! 0 on success and -1 on failure
    END SUBROUTINE h5freopen_f 
        
    See Also:
    “Using Identifiers”

    Name: H5Freset_mdc_hit_rate_stats
    Signature:
    herr_t H5Freset_mdc_hit_rate_stats(hid_t file_id)
    Purpose:
    Reset hit rate statistics counters for the target file.
    Description:
    H5Freset_mdc_hit_rate_stats resets the hit rate statistics counters in the metadata cache associated with the specified file.

    If the adaptive cache resizing code is enabled, the hit rate statistics are reset at the beginning of each epoch. This API call allows you to do the same thing from your program.

    The adaptive cache resizing code may behave oddly if you use this call when adaptive cache resizing is enabled. However, the call should be useful if you choose to control metadata cache size from your program.

    See the overview of the metadata cache in the special topics section of the user manual for details of the metadata cache and the adaptive cache resizing algorithms. If you haven't read, understood, and thought about the material covered in that documentation, you shouldn't be using this API call.

    Parameters:
    Returns:
    Returns a non-negative value if successful; otherwise returns a negative value.

    Last modified: 2016

    Name: H5Freset_page_buffering_stats

    Signature:
    herr_t H5PBreset_stats( hid_t file_id )

    Purpose:
    Resets the page buffer statistics.

    Description:

    H5Freset_page_buffering_stats resets the page buffer statistics for a specified file identifier file_id.

    Parameters:
    hid_t file_id IN: File identifier  
    Returns:
    Returns a non-negative value if successful. Otherwise returns a negative value.

    Fortran Interface:
    None

    See Also:
    History:
    Release     Change
    1.10.1 C function introduced with this release.




    Last modified: 18 November 2011
    Name: H5Fset_mdc_config
    Signature:
    herr_t H5Fset_mdc_config(hid_t file_id, H5AC_cache_config_t *config_ptr)

    Purpose:
    Attempt to configure metadata cache of target file.

    Description:
    H5Fset_mdc_config attempts to configure the file's metadata cache according configuration supplied in *config_ptr.

    See the overview of the metadata cache in the special topics section of the user manual for details on what is being configured. If you haven't read and understood that documentation, you really shouldn't be using this API call.

    Parameters:
    hid_t file_id
      IN: Identifier of the target file
    H5AC_cache_config_t * config_ptr
      IN: Pointer to the instance of H5AC_cache_config_t containing the desired configuration. The fields in this structure can be placed in several categories:
         General configuration
         Increment configuration
         Decrement configuration
         Parallel configuration
    Specific fields are described below.
     
    General configuration fields:
    int version
      IN: Integer field indicating the the version of the H5AC_cache_config_t in use. This field should be set to H5AC__CURR_CACHE_CONFIG_VERSION (defined in H5ACpublic.h).
    hbool_t rpt_fcn_enabled
      IN: Boolean flag indicating whether the adaptive cache resize report function is enabled. This field should almost always be set to FALSE. Since resize algorithm activity is reported via stdout, it MUST be set to FALSE on Windows machines.

    The report function is not supported code, and can be expected to change between versions of the library. Use it at your own risk.

    hbool_t open_trace_File
      IN: Boolean field indicating whether the trace_file_name field should be used to open a trace file for the cache.

    The trace file is a debuging feature that allows the capture of top level metadata cache requests for purposes of debugging and/or optimization. This field should normally be set to FALSE, as trace file collection imposes considerable overhead.

    This field should only be set to TRUE when the trace_file_name contains the full path of the desired trace file, and either there is no open trace file on the cache, or the close_trace_file field is also TRUE.

    The trace file feature is unsupported unless used at the direction of The HDF Group. It is intended to allow The HDF Group to collect a trace of cache activity in cases of occult failures and/or poor performance seen in the field, so as to aid in reproduction in the lab. If you use it absent the direction of The HDF Group, you are on your own.

    hbool_t close_trace_file
      IN: Boolean field indicating whether the current trace file (if any) should be closed.

    See the above comments on the open_trace_file field. This field should be set to FALSE unless there is an open trace file on the cache that you wish to close.

    The trace file feature is unsupported unless used at the direction of The HDF Group. It is intended to allow The HDF Group to collect a trace of cache activity in cases of occult failures and/or poor performance seen in the field, so as to aid in reproduction in the lab. If you use it absent the direction of The HDF Group, you are on your own.

    char trace_file_name[]
      IN: Full path of the trace file to be opened if the open_trace_file field is TRUE.

    In the parallel case, an ascii representation of the mpi rank of the process will be appended to the file name to yield a unique trace file name for each process.

    The length of the path must not exceed H5AC__MAX_TRACE_FILE_NAME_LEN characters.

    The trace file feature is unsupported unless used at the direction of The HDF Group. It is intended to allow The HDF Group to collect a trace of cache activity in cases of occult failures and/or poor performance seen in the field, so as to aid in reproduction in the lab. If you use it absent the direction of The HDF Group, you are on your own.

    hbool_t evictions_enabled
      IN: A boolean flag indicating whether evictions from the metadata cache are enabled. This flag is initially set to TRUE.

    In rare circumstances, the raw data throughput requirements may be so high that the user wishes to postpone metadata writes so as to reserve I/O throughput for raw data. The evictions_enabled field exists to allow this. However, this is an extreme step, and you have no business doing it unless you have read the User Guide section on metadata caching, and have considered all other options carefully.

    The evictions_enabled field may not be set to FALSE unless all adaptive cache resizing code is disabled via the incr_mode, flash_incr_mode, and decr_mode fields.

    When this flag is set to FALSE, the metadata cache will not attempt to evict entries to make space for new entries, and thus will grow without bound.

    Evictions will be re-enabled when this field is set back to TRUE. This should be done as soon as possible.

    hbool_t set_initial_size
      IN: Boolean flag indicating whether the cache should be forced to the user specified initial size.
    size_t initial_size
      IN: If set_initial_size is TRUE, initial_size must contains the desired initial size in bytes. This value must lie in the closed interval [min_size, max_size]. (see below)
    double min_clean_fraction
      IN: This field specifies the minimum fraction of the cache that must be kept either clean or empty.

    The value must lie in the interval [0.0, 1.0]. 0.01 is a good place to start in the serial case. In the parallel case, a larger value is needed -- see “Metadata Caching in HDF5” in the collection “Advanced Topics in HDF5.”

    size_t max_size
      IN: Upper bound (in bytes) on the range of values that the adaptive cache resize code can select as the maximum cache size.
    size_t min_size
      IN: Lower bound (in bytes) on the range of values that the adaptive cache resize code can select as the maximum cache size.
    long int epoch_length
      IN: Number of cache accesses between runs of the adaptive cache resize code. 50,000 is a good starting number.
     
    Increment configuration fields:
    enum H5C_cache_incr_mode incr_mode
      IN: Enumerated value indicating the operational mode of the automatic cache size increase code. At present, only two values are legal:

    H5C_incr__off: Automatic cache size increase is disabled, and the remaining increment fields are ignored.

    H5C_incr__threshold: Automatic cache size increase is enabled using the hit rate threshold algorithm.

    double lower_hr_threshold
      IN: Hit rate threshold used by the hit rate threshold cache size increment algorithm.

    When the hit rate over an epoch is below this threshold and the cache is full, the maximum size of the cache is multiplied by increment (below), and then clipped as necessary to stay within max_size, and possibly max_increment.

    This field must lie in the interval [0.0, 1.0]. 0.8 or 0.9 is a good starting point.

    double increment
      IN: Factor by which the hit rate threshold cache size increment algorithm multiplies the current maximum cache size to obtain a tentative new cache size.

    The actual cache size increase will be clipped to satisfy the max_size specified in the general configuration, and possibly max_increment below.

    The parameter must be greater than or equal to 1.0 -- 2.0 is a reasonable value.

    If you set it to 1.0, you will effectively disable cache size increases.

    hbool_t apply_max_increment
      IN: Boolean flag indicating whether an upper limit should be applied to the size of cache size increases.
    size_t max_increment
      IN: Maximum number of bytes by which cache size can be increased in a single step -- if applicable.
    enum H5C_cache_flash_incr_mode flash_incr_mode
      IN: Enumerated value indicating the operational mode of the flash cache size increase code. At present, only the following values are legal:

    H5C_flash_incr__off: Flash cache size increase is disabled.

    H5C_flash_incr__add_space: Flash cache size increase is enabled using the add space algorithm.

    double flash_threshold
      IN: The factor by which the current maximum cache size is multiplied to obtain the minimum size entry / entry size increase which may trigger a flash cache size increase.

    At present, this value must lie in the range [0.1, 1.0].

    double flash_multiple
      IN: The factor by which the size of the triggering entry / entry size increase is multiplied to obtain the initial cache size increment. This increment may be reduced to reflect existing free space in the cache and the max_size field above.

    At present, this field must lie in the range [0.1, 10.0].

     
    Decrement configuration fields:
    enum H5C_cache_decr_mode decr_mode
      IN: Enumerated value indicating the operational mode of the automatic cache size decrease code. At present, the following values are legal:

    H5C_decr__off: Automatic cache size decrease is disabled.

    H5C_decr__threshold: Automatic cache size decrease is enabled using the hit rate threshold algorithm.

    H5C_decr__age_out: Automatic cache size decrease is enabled using the ageout algorithm.

    H5C_decr__age_out_with_threshold: Automatic cache size decrease is enabled using the ageout with hit rate threshold algorithm

    double upper_hr_threshold
      IN: Hit rate threshold for the hit rate threshold and ageout with hit rate threshold cache size decrement algorithms.

    When decr_mode is H5C_decr__threshold, and the hit rate over a given epoch exceeds the supplied threshold, the current maximum cache size is multiplied by decrement to obtain a tentative new (and smaller) maximum cache size.

    When decr_mode is H5C_decr__age_out_with_threshold, there is no attempt to find and evict aged out entries unless the hit rate in the previous epoch exceeded the supplied threshold.

    This field must lie in the interval [0.0, 1.0].

    For H5C_incr__threshold, .9995 or .99995 is a good place to start.

    For H5C_decr__age_out_with_threshold, .999 might be more useful.

    double decrement
      IN: In the hit rate threshold cache size decrease algorithm, this parameter contains the factor by which the current max cache size is multiplied to produce a tentative new cache size.

    The actual cache size decrease will be clipped to satisfy the min_size specified in the general configuration, and possibly max_decrement below.

    The parameter must be be in the interval [0.0, 1.0].

    If you set it to 1.0, you will effectively disable cache size decreases. 0.9 is a reasonable starting point.

    hbool_t apply_max_decrement
      IN: Boolean flag indicating whether an upper limit should be applied to the size of cache size decreases.
    size_t max_decrement
      IN: Maximum number of bytes by which the maximum cache size can be decreased in any single step -- if applicable.
    int epochs_before_eviction
      IN: In the ageout based cache size reduction algorithms, this field contains the minimum number of epochs an entry must remain unaccessed in cache before the cache size reduction algorithm tries to evict it. 3 is a reasonable value.
    hbool_t apply_empty_reserve
      IN: Boolean flag indicating whether the ageout based decrement algorithms will maintain a empty reserve when decreasing cache size.
    double empty_reserve
      IN: Empty reserve as a fraction of maximum cache size if applicable.

    When so directed, the ageout based algorithms will not decrease the maximum cache size unless the empty reserve can be met.

    The parameter must lie in the interval [0.0, 1.0]. 0.1 or 0.05 is a good place to start.

     
    Parallel configuration field:
    int dirty_bytes_threshold
      IN: Threshold number of bytes of dirty metadata generation for triggering synchronizations of the metadata caches serving the target file in the parallel case.

    Synchronization occurs whenever the number of bytes of dirty metadata created since the last synchronization exceeds this limit.

    This field only applies to the parallel case. While it is ignored elsewhere, it can still draw a value out of bounds error.

    It must be consistant across all caches on any given file.

    By default, this field is set to 256 KB. It shouldn't be more than half the current maximum cache size times the minimum clean fraction.

    Returns:
    Returns a non-negative value if successful; otherwise returns a negative value.

    Last modified: 18 April 2012
    Name: H5Fset_mpi_atomicity
    Signature:
    herr_t H5Fset_mpi_atomicity( hid_t file_id, hbool_t flag )

    Purpose:
    Sets the MPI atomicity mode.

    Motivation:
    H5Fset_mpi_atomicity is applicable only in parallel environments using MPI I/O. The function is one of the tools used to ensure sequential consistency. This means that a set of operations will behave as though they were performed in a serial order consistent with the program order.

    Description:
    H5Fset_mpi_atomicity sets MPI consistency semantics for data access to the file, file_id.

    If flag is set to TRUE, all file access operations will appear atomic, guaranteeing sequential consistency. If flag is set to FALSE, enforcement of atomic file access will be turned off.

    H5Fset_mpi_atomicity is a collective function and all participating processes must pass the same values for file_id and flag.

    This function is available only when the HDF5 Library is configured with parallel support (--enable-parallel). It is useful only when used with the H5FD_MPIO driver (see H5Pset_fapl_mpio).

    Limitations:
    H5Fset_mpi_atomicity calls MPI_File_set_atomicity underneath and is not supported if the execution platform does not support MPI_File_set_atomicity. When it is supported and used, the performance of data access operations may drop significantly.

    In certain scenarios, even when MPI_File_set_atomicity is supported, setting atomicity with H5Fset_mpi_atomicity and flag set to TRUE does not always yield strictly atomic updates. For example, some H5Dwrite calls translate to multiple MPI_File_write_at calls. This happens in all cases where the high-level file access routine translates to multiple lower level file access routines. The following scenarios will raise this issue:

    This issue arises because MPI atomicity is a matter of MPI file access operations rather than HDF5 access operations. But the user is normally seeking atomicity at the HDF5 level. To accomplish this, the application must set a barrier after a write, H5Dwrite, but before the next read, H5Dread, in addition to calling H5Fset_mpi_atomicity. The barrier will guarantee that all underlying write operations execute atomically before the read operations starts. This ensures additional ordering semantics and will normally produce the desired behavior.

    Parameters:
    hid_t file_id,      IN: HDF5 file identifier
    hbool_t flag   IN: Logical flag for atomicity setting
    Valid values are:
  • TRUE    Sets MPI file access to atomic mode.
  • FALSE   Sets MPI file access to nonatomic mode.
  • Returns:
    Returns a non-negative value if successful; otherwise returns a negative value.

    Fortran90 Interface: h5fset_mpi_atomicity_f
    SUBROUTINE h5fset_mpi_atomicity_f(file_id, flag, hdferr) 
      IMPLICIT NONE
      INTEGER(HID_T), INTENT(IN) :: file_id    ! File identifier
      INTEGER(HBOOL_T), INTENT(IN) :: flag     ! Atomicity flag
      INTEGER, INTENT(OUT) :: hdferr           ! Error code
                                               ! 0 on success; -1 on failure
    END SUBROUTINE h5fset_mpi_atomicity_f 

    See Also:
    Enabling a Strict Consistency Semantics Model in Parallel HDF5

    H5Fget_mpi_atomicity

    History:
    Release     Change
    1.8.9 C function and Fortran subroutine introduced in this release.

    Last modified: 27 May 2014

    Name: H5Fstart_swmr_write

    Signature:
    herr_t H5Fstart_swmr_write(hid_t file_id)

    Purpose:
    Enables SWMR writing mode for a file.

    Description:
    H5Fstart_swmr_write will activate SWMR writing mode for a file associated with file_id. This routine will prepare and ensure the file is safe for SWMR writing as follows:

    Library objects are groups, datasets, and committed datatypes. For the current implementation, groups and datasets can remain open when activating SWMR writing mode, but not committed datatypes. Attributes attached to objects cannot remain open either.


    Parameters:
    hid_t file_id    IN: A file identifier.

    Returns:
    Returns a non-negative value if successful; otherwise returns a negative value.

    Example Usage:
    The example below illustrates the usage of this routine to activate the SWMR writing mode for an opened file.
    /*
     *   The writer process
     */
    /* Create a copy of the file access property list */
    fapl_id = H5Pcreate(H5P_FILE_ACCESS);
    
    /* Set to use the latest library format */
    H5Pset_libver_bounds(fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST); 
    
    /* Create a file with the latest library format */ 
    file_id = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id);
    :
    :
    :
    /* Perform operations that are not SWMR-safe. */
    :
    :
    :
    /* Start a concurrent SWMR reader process (see coding below) at this point 
       will fail because the file is not marked as SWMR-safe */
    
    /* Enable SWMR writing mode */
    H5Fstart_swmr_write(file_id);
    
    /* Start a concurrent SWMR reader process (see coding below) at this point 
       will succeed because the file is marked as SWMR-safe */
    
    
    /* Perform SWMR-safe operations */
    :
    :
    :
    /* Close the file */
    H5Fclose(file_id);
    
    /* Close the property list */
    H5Pclose(fapl_id);
    
    
    /*
     *   The SWMR reader process
     */
    read_file_id = H5Fopen(filename, H5F_ACC_RDONLY|H5F_ACC_SWMR_READ, fapl_id);
    
    /* Perform reading operations */
    :
    :
    :
    /* Close the file */
    H5Fclose(read_file_id);
    

    Fortran Interface:
    None

    See Also:



    History:
    Release     Change
    1.10.0 C function introduced with this release.




    Last modified: 7 December 2015

    Name: H5Fstart_mdc_logging

    Signature:
    herr_t H5Fstart_mdc_logging( hid_t file_id )

    Purpose:
    Starts logging metadata cache events if logging was previously enabled.

    Description:
    The metadata cache is a central part of the HDF5 library through which all file metadata reads and writes take place. File metadata is normally invisible to the user and is used by the library for purposes such as locating and indexing data. File metadata should not be confused with user metadata, which consists of attributes created by users and attached to HDF5 objects such as datasets via H5A API calls.

    Due to the complexity of the cache, a trace/logging feature has been created that can be used by HDF5 developers for debugging and performance analysis. The functions that control this functionality will normally be of use to a very limited number of developers outside of The HDF Group. The functions have been documented to help users create logs that can be sent with bug reports.

    Control of the log functionality is straightforward. Logging is enabled via the H5Pset_mdc_log_options() function, which will modify the file access property list used to open or create a file. This function has a flag that determines whether logging begins at file open or starts in a paused state. Log messages can then be controlled via the H5Fstart/stop_logging() functions. H5Pget_mdc_log_options() can be used to examine a file access property list, and H5Fget_mdc_logging_status() will return the current state of the logging flags.

    The log format is described in the Metadata Cache Logging document.


    Notes:
    Logging can only be started or stopped if metadata cache logging was enabled via H5Pset_mdc_log_options().

    When enabled and currently logging, the overhead of the logging feature will almost certainly be significant.

    The log file is opened when the HDF5 file is opened or created and not when this function is called for the first time.

    This function opens the log file and starts logging metadata cache operations for a particular file. Calling this function when logging has already been enabled will be considered an error.


    Parameters:
    hid_t file_id    IN: Identifier of an open HDF5 file.

    Returns:
    Returns a non-negative value if successful. Otherwise returns a negative value.

    Fortran Interface:
    None

    See Also:
  • H5Pset_mdc_log_options
  • H5Pget_mdc_log_options
  • H5Fget_mdc_logging_status
  • H5Fstop_mdc_logging

  • History:
    Release Change
    1.10.0 C function introduced with this release.




    Last modified: 7 December 2015

    Name: H5Fstop_mdc_logging

    Signature:
    herr_t H5Fstop_mdc_logging( hid_t file_id )

    Purpose:
    Stops logging metadata cache events if logging was previously enabled and is currently ongoing.

    Description:
    The metadata cache is a central part of the HDF5 library through which all file metadata reads and writes take place. File metadata is normally invisible to the user and is used by the library for purposes such as locating and indexing data. File metadata should not be confused with user metadata, which consists of attributes created by users and attached to HDF5 objects such as datasets via H5A API calls.

    Due to the complexity of the cache, a trace/logging feature has been created that can be used by HDF5 developers for debugging and performance analysis. The functions that control this functionality will normally be of use to a very limited number of developers outside of The HDF Group. The functions have been documented to help users create logs that can be sent with bug reports.

    Control of the log functionality is straightforward. Logging is enabled via the H5Pset_mdc_log_options() function, which will modify the file access property list used to open or create a file. This function has a flag that determines whether logging begins at file open or starts in a paused state. Log messages can then be controlled via the H5Fstart/stop_logging() functions. H5Pget_mdc_log_options() can be used to examine a file access property list, and H5Fget_mdc_logging_status() will return the current state of the logging flags.

    The log format is described in the Metadata Cache Logging document.


    Notes:
    Logging can only be started or stopped if metadata cache logging was enabled via H5Pset_mdc_log_options().

    This function only suspends the logging operations. The log file will remain open and will not be closed until the HDF5 file is closed.


    Parameters:
    hid_t file_id    IN: Identifier of an open HDF5 file.

    Returns:
    Returns a non-negative value if successful. Otherwise returns a negative value.

    Fortran Interface:
    None

    See Also:
  • H5Pset_mdc_log_options
  • H5Pget_mdc_log_options
  • H5Fget_mdc_logging_status
  • H5Fstart_mdc_logging

  • History:
    Release Change
    1.10.0 C function introduced with this release.




    Name: H5Funmount
    Signature:
    herr_t H5Funmount(hid_t loc_id, const char *name )
    Purpose:
    Unmounts a file.
    Description:
    Given a mount point, H5Funmount dissassociates the mount point's file from the file mounted there. This function does not close either file.

    The mount point can be either the group in the parent or the root group of the mounted file (both groups have the same name). If the mount point was opened before the mount then it is the group in the parent; if it was opened after the mount then it is the root group of the child.

    Note that loc_id is either a file or group identifier and name is relative to loc_id.

    Parameters:
    Returns:
    Returns a non-negative value if successful; otherwise returns a negative value.
    Fortran90 Interface: h5funmount_f
    SUBROUTINE h5funmount_f(loc_id, name, child_id, hdferr)
      IMPLICIT NONE 
      INTEGER(HID_T), INTENT(IN)  :: loc_id      ! File or group identifier
      CHARACTER(LEN=*), INTENT(IN):: name        ! Group name at location loc_id
      INTEGER, INTENT(OUT)        :: hdferr      ! Error code 
                                                 ! 0 on success and -1 on failure
    END SUBROUTINE h5funmount_f
        

    HDF5 documents and links 
    Introduction to HDF5 
    HDF5 User’s Guide 
    In the HDF5 Reference Manual 
    H5DS   H5IM   H5LT   H5PT   H5TB  Optimized 
    H5   H5A   H5D   H5E   H5F   H5G   H5I   H5L 
    H5O   H5P   H5PL   H5R   H5S   H5T   H5Z 
    Tools   Datatypes   Fortran   Compatibility Macros 
    Collective Calls in Parallel 

    The HDF Group Help Desk:
    Describes HDF5 Release 1.10.
      Copyright by The HDF Group
    and the Board of Trustees of the University of Illinois