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

slow write on large files




I'm using NetCDF to stream video to disk real time.  I'm doing this on a
PC, running windows, and C, Windows implementation of NetCDF.  Using Visual
C++ 6.0.

The data is coming in at about 7.5 MB/second.
I'm using successive calls to nc_put_vara_short() to write each frame of
video data.
When my file size is small (1000 frames of data or less), I have no
problem.  When my file size is much larger (1500 frames or more), my
application runs horribly.  It appears that the calls to nc_put_vara_short
are not keeping up with the incoming data.  Yes, I'm buffering in RAM, but
my buffer is limited, and eventually I overflow my buffer.  The real bugger
is that the problems start occuring very early in a large file, it's not
like it's fine for the first 1000 frames, then starts lagging.  I'm seeing
problems very early on in a large file.

Is there something about the way that nc_put_vara_short is coded that it
slows down based on the TOTAL SIZE of the file (or just the Variable
portion of the file).

When I write the data out to disk, using just CFile::Write() instead of
using the NetCDF library, I have no problems.


Thanks,

Jim



* CFile is an MFC (Microsoft Foundation Classes) provided class to make
disk i/o simple.


 
 
  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