This function changes the default chunk cache settings in the HDF5 library for all variables in the file. The settings apply for subsequent file opens/creates. This function does not change the chunk cache settings of already open files.
For more information, see the documentation for the H5Pset_cache() function in the HDF5 library at the HDF5 website: http://hdfgroup.org/HDF5/.
int nc_set_chunk_cache(size_t size, size_t nelems, float preemption);
size
nelems
preemption
NC_NOERR
NC_EINVAL
This example is from libsrc4/tst_files.c:
#include <netcdf.h> ... #define NEW_CACHE_SIZE 32000000 #define NEW_CACHE_NELEMS 2000 #define NEW_CACHE_PREEMPTION .75 /* Change chunk cache. */ if (nc_set_chunk_cache(NEW_CACHE_SIZE, NEW_CACHE_NELEMS, NEW_CACHE_PREEMPTION)) ERR; /* Create a file with two dims, two vars, and two atts. */ if (nc_create(FILE_NAME, cflags|NC_CLOBBER, &ncid)) ERR; ...