Next: , Previous: NF_SET_VAR_CHUNK_CACHE, Up: Variables


6.7 Get the HDF5 Chunk Cache Settings for a variable: NF_GET_VAR_CHUNK_CACHE

This function gets the current chunk cache settings for a variable in a netCDF-4/HDF5 file.

For more information, see the documentation for the H5Pget_cache() function in the HDF5 library at the HDF5 website: http://hdfgroup.org/HDF5/.

Usage

     INTEGER NF_GET_VAR_CHUNK_CACHE(INTEGER NCID, INTEGER VARID, INTEGER SIZE, INTEGER NELEMS,
                                    INTEGER PREEMPTION);
ncid
NetCDF ID, from a previous call to NF_OPEN or NF_CREATE.
varid
Variable ID.
sizep
The total size of the raw data chunk cache, in megabytes, will be put here.
nelemsp
The number of chunk slots in the raw data chunk cache hash table will be put here.
preemptionp
The preemption will be put here. The preemtion value is between 0 and 100 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 100 means fully read chunks are always preempted before other chunks.

Return Codes

NC_NOERR
No error.

Example

This example is from nf_test/ftst_vars2.c:

           include 'netcdf.inc'
     ...
     C     These will be used to set the per-variable chunk cache.
           integer CACHE_SIZE, CACHE_NELEMS, CACHE_PREEMPTION
           parameter (CACHE_SIZE = 8, CACHE_NELEMS = 571)
           parameter (CACHE_PREEMPTION = 42)
     
     C     These will be used to check the setting of the per-variable chunk
     C     cache.
           integer cache_size_in, cache_nelems_in, cache_preemption_in
     
     ...
              retval = nf_get_var_chunk_cache(ncid, varid(i), cache_size_in,
          &        cache_nelems_in, cache_preemption_in)
              if (retval .ne. nf_noerr) call handle_err(retval)
              if (cache_size_in .ne. CACHE_SIZE .or. cache_nelems_in .ne.
          &        CACHE_NELEMS .or. cache_preemption .ne. CACHE_PREEMPTION)
          &        stop 8