Unidata - To provide the data services, tools, and cyberinfrastructure leadership that advance Earth system science, enhance educational opportunities, and broaden participation. Unidata
         
  advanced  
 

Re: [netcdfgroup] Wondering about when NetCDF data hits the disk...

Am Wed, 28 Oct 2009 10:15:01 -0500
schrieb Rob Ross <rross@xxxxxxxxxxx>:

> Hi Thomas,

Hi Rob (I did't want to be rude before;-)!

> I agree that there should be a way to force an fsync() of the file
> via nc_ calls.  

Well, the most difficult thing would be to figure out a proper name, then;-)
nc_fsync() would be a short possiblity. Well, then one needs to read up on 
equivalent functionality on non-UNIX systems (well, MS Windows), but that 
function may also simply be a no-op for systems that don't support it.

While at it, I suggest adding nc_readlock(), nc_writelock() and nc_unlock() ... 
as proxies for fcntl(SETLK, ...) with types F_RDLCK, F_WRLCK and F_UNLCK, 
respectively. Even on the same machine, without network file systems around, 
one might want to be a bit careful with concurrent access to NetCDF files and 
rather use file system locking to synchronize processes.
Well, but here it again could get a bit hairy with portability to different 
platforms...

Main point of this discussion is the nc_fsync(), or any better named function, 
to time actual data write action, and I would be happy if it could make its way 
into a future NetCDF release.
Would there possibly be someone of the dev team hack this up trivially or is it 
preferred that someone like me starts to dig into the code, tries to figure it 
out, and then posts a hacky patch? I could only test the UNIX side of things, 
though (Solaris, Linux... given enough time even Tru64;-).


Alrighy then,

Thomas.

-- 
Dipl. Phys. Thomas Orgis
Atmospheric Modelling
Alfred-Wegener-Institute for Polar and Marine Research


 
 
  Contact Us     Site Map     Search     Terms and Conditions     Privacy Policy     Participation Policy
 
National Science Foundation (NSF) UCAR Community Programs   Unidata is a member of the UCAR Community Programs, is managed by the University Corporation for Atmospheric Research, and is sponsored by the National Science Foundation.
P.O. Box 3000     Boulder, CO 80307-3000 USA     Tel: 303-497-8643     Fax: 303-497-8690