NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.
To learn about what's going on, see About the Archive Site.
On Nov 17, 2009, at 12:25 PM, Ed Hartnett wrote:
Jennifer Adams <jma@xxxxxxxxxxxxx> writes:Dear Experts,ÂI am working with the 4.1 snapshot of 20091102. I have been using the nc_inq_libvers() routine to discover the version of the library that islinked with my program (GrADS). Now I am testing various configure options, specifically "--with-chunk-cache-size=n" and"--with-chunk-cache-nelems=n".  Is there any way to discover these cache parameters from within my program -- something like nc_inq_cache()?  Proper settings for cacheing and chunking are critical for optimizing performance when working with compressed netcdf files. It would be good if the userscould know these settings before setting chunk sizes for creating compressed netcdf files. --Jennifer -- Jennifer M. Adams IGES/COLA 4041 Powder Mill Road, Suite 302 Calverton, MD 20705 [1]jma@xxxxxxxxxxxxxHowdy Jennifer!Thanks for asking a question for which there is an easy answer. Some ofthe recent support issues have been real stumpers!
I'm glad it wasn't too tough, and also that the answer was 'YES'.
There are functions to both set and learn about the chunkcache. Changing the cache settings only applies to future opens/ creates,it does not affect already-open files.
Let me see if I have understood properly ... The cache parameters are set on a per-file basis, but copied from global settings at the moment I open the file? And the original global settings are those used at compile time?These don't tell you what the file was opened/created with, just thecurrent settings. So if you change them, and want to know what they arefor each file you open/create, then you must remember what they were when the file was opened/created.
What if I open a file, query the chunk and the cache sizes, and discover that the cache isn't big enough to hold a single chunk and my I/O is doomed. Do I have to close the file, reset the cache size, then open the file again?
/* Set the cache size, nelems, and preemption policy. */ EXTERNL int nc_set_chunk_cache(size_t size, size_t nelems, float preemption); /* Get the cache size, nelems, and preemption policy. */ EXTERNL intnc_get_chunk_cache(size_t *sizep, size_t *nelemsp, float *preemptionp);Your question makes me note that these functions are not documented. I am adding them now, and they will be in the snapshot documentation tomorrow.
OK. That will be a big help. Thanks! --Jennifer
netcdfgroup
archives: