[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Use of NcVar::Put method



> Sorry, but we have not used mmap calls in netCDF, because we needed
> netCDF to work on systems that don't support memory mapping.
>
> However, I'm forwarding this reply to Glenn Davis, because he did some
> experiments with this at one time and may have a suggestion for how to
> most easily modify netCDF to use memory mapping.
>
> --Russ

The main reason I've avoided putting mmap access in netcdf is that it
is a portability nightmare. We have a product, LDM, which we support
on a much more restricted set of platforms than netcdf. It does use mmap
where it can. The main problem beyond portabilty is shakey interoperability
when one mmap()'s a NFS file. Sometimes it works, sometimes it doesn't
depending on which NFS client and which NFS server. Many netcdf users
aren't aware which files are NFS mounted on their systems :-).

Having said all that, netcdf-3 _is_ layered so that an mmap-based "ncio"
layer could be easily slid in underneath. For read-only, non-shared
access, it would be a simple as mmap'ping the whole file in ncio_open()
and calculating an offset for ncio->get().
The interface is defined in libsrc/ncio.h and an implementation is
libsrc/posixio.c.

Hope this helps.

-glenn