Last modified: 15 April 2009
Name: H5Pset_cache
Signature:
  herr_t `H5Pset_cache`( hid_t `plist_id`, int `mdc_nelmts`, size_t `rdcc_nelmts`, size_t `rdcc_nbytes`, double `rdcc_w0` )

Purpose:
  Sets the meta data cache and raw data chunk cache parameters.

Description:
  `H5Pset_cache` sets the number of elements (objects) in the meta data cache and the number of elements, the total number of bytes, and the preemption policy value in the raw data chunk cache.

  The plist_id is a file access property list. The number of elements (objects) in the meta data cache and the raw data chunk cache are mdc_nelmts and rdcc_nelmts, respectively. The total size of the raw data chunk cache and the preemption policy are rdcc_nbytes and rdcc_w0.

  Any (or all) of the `H5Pget_cache` pointer arguments may be null pointers.

  The rdcc_w0 value should be between 0 and 1 inclusive and indicates how much chunks that have been fully read are favored for preemption. A value of zero means fully read chunks are treated no differently than other chunks (the preemption is strictly LRU) while a value of one means fully read chunks are always preempted before other chunks.

Note:
  Raw dataset chunk caching is not currently supported when using the MPI I/O and MPI POSIX file drivers in read/write mode; see `H5Pset_fapl_mpio` and `H5Pset_fapl_mpiposix`, respectively. When using one of these file drivers, all calls to `H5Dread` and `H5Dwrite` will access the disk directly, and `H5Pset_cache` will have no effect on performance.

  Raw dataset chunk caching is supported when these drivers are used in read-only mode.

Parameters:

  hid_t `plist_id` | IN: Identifier of the file access property list.
  int `mdc_nelmts` | IN: Number of elements (objects) in the meta data cache.
  size_t `rdcc_nelmts` | IN: Number of elements (objects) in the raw data chunk cache.
  size_t `rdcc_nbytes` | IN: Total size of the raw data chunk cache, in bytes.
  double `rdcc_w0` | IN: Preemption policy.

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

Fortran90 Interface: h5pset_cache_f

      SUBROUTINE h5pset_cache_f(prp_id, mdc_nelmts,rdcc_nelmts, rdcc_nbytes, rdcc_w0, hdferr)
        IMPLICIT NONE
        INTEGER(HID_T), INTENT(IN) :: prp_id        ! Property list identifier
        INTEGER, INTENT(IN) :: mdc_nelmts           ! Number of elements (objects)
                                                    ! in the meta data cache
        INTEGER(SIZE_T), INTENT(IN) :: rdcc_nelmts  ! Number of elements (objects)
                                                    ! in the meta data cache
        INTEGER(SIZE_T), INTENT(IN) :: rdcc_nbytes  ! Total size of the raw data
                                                    ! chunk cache, in bytes
        REAL, INTENT(IN) :: rdcc_w0                 ! Preemption policy
        INTEGER, INTENT(OUT) :: hdferr              ! Error code
                                                    ! 0 on success and -1 on failure
      END SUBROUTINE h5pset_cache_f

History:

Release | Change
1.6.1 | Fortran `rdcc_nbytes` parameter type changed to `INTEGER(SIZE_T)`.
1.6.0 | In C, the `rdcc_nbytes` and `rdcc_nelmts` parameters changed from type int to size_t.