Cacheless NetCDF

What does the cache do?

For files in the classic format, the NetCDF-Library uses a private cache. It works by dividing the NetCDF-file into pages (the size depends on the system prefered IO block size or is set to 8 kiB by default), that can be paged in/out separately. This has a number of effects:

What we have done

After we understood the impact of the cache on large input/output operations, we decided to change the NetCDF source code to deactivate the cache completely and prepared a patch for it. This patch will be handed back to the NetCDF-developers, so we hope that there will be an official version soon which allows the user to switch off the cache.

What to do to get a cachefree NetCDF

Applying the patch:

  1. Get the source code of NetCDF version 4.1.3 and extract it (NetCDF download page). Unfortunately, our patch does not work with newer versions of the library since it conflicts with other changes.
  2. Apply the patch to the NetCDF source code by running “patch -p1 < netcdf-cacheless.patch” inside the NetCDF directory.
  3. Run “./configure”, “make” and “make install” as usual.

Changing the caching behavior:

Changes

2012-07-30: Eliminated a bug in the handling of incomplete reads/writes.