Can chunk caching be used with the high-level NetCDF functions?
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
MathWorks Support Team
le 11 Jan 2021
Réponse apportée : MathWorks Support Team
le 13 Jan 2021
I am using the high-level NetCDF interface to read a NetCDF file. My code might have to access the same data multiple times. In order to increase performance, I want to use chunk caching. The low-level interface includes the function "netcdf.setChunkCache" that is used to configure the default chunk cache size. If I use this low-level function to configure the chunk cache, can I expect a performance increase when I call functions in the high-level interface like "ncread"?
Réponse acceptée
MathWorks Support Team
le 11 Jan 2021
When the default chunk cache is configured with the low-level interface, those settings will be respected by the high-level functions such as "ncread". However, if you intend on using multiple calls to "ncread" to access the same data, the performance improvement from caching may not be fully realized. This is because the "ncread" function always closes the file before it returns. This action of closing the file will clear the chunk cache, and subsequent calls to "ncread" will start with an empty cache.
To fully realize the performance improvements offered by the chunk cache, you may wish to exclusively use the low-level interface. This interface offers much more control over when the file is opened and closed, and therefore enables greater persistence of the chunk cache. For more information regarding the low-level NetCDF interface, please consult the functions described under the section "NetCDF Library Package" at the documentation link below.
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur NetCDF dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!