odd timings from netcdf

Philippe Poilbarbe Philippe.Poilbarbe at cls.fr
Tue Feb 6 04:45:13 MST 2007


Dan Kokron a écrit :
> Hello all,
> I have an application that can use either NetCDF-3.5.0 or HDF to write
> files.  Both libraries give about the same performance, but the routines
> where each library spends it's time are very different.  HDF spends most
> of it's time writing while NetCDF spends most of it's time
> creating files.  Specifically, NetCDF spends time in these calls ... 
>
> (32 seconds for 21 calls)
> call ncvpt (fid, timeid, corner, edges, 0, rc)
>
> (104 seconds for 168 calls)
> call ncendf ( fid, rc  )
>
> I'm using a build of netCDF that someone else compiled.  I'm not sure
> what compile flags he used.
>
> Has anyone else seen this behavior before?
>
>   
When creating files with netcdf if the flag NC_FILL (see function
nc_set_fill) is set each time a nc_enddef call is issued all
new var data is written with the _FillValue (specified or
implicit).
If you are sure to write all data you may set the flag
NC_NOFILL gaining many time since data is written only
once.
On an other hand a way to gain more time (if it is possible)
is to create the file and define all dim/var/attributes at
the beginning: only one nc_enddef call (instead of 168 as
it seams according to your output).
Defining a variable writing its value, defining another var,
writing it's value(...) is very time consuming
since the var values are to be moved each time because
of the increasing size of the file header (which contains
the definitions) and maybe the data values also if new
variables belongs to the unlimited dimension.

If you cannot define everything on file creation
you may have a look at the nc__enddef (double
underscore '_') in order to allocate enough space in
header and avoid its growth.

Expecting it can help,

-- 
Ph. Poilbarbe
CLS, Space Oceanography Division



-- 
Philippe Poilbarbe 	CLS Océanographie Spatiale

mailto:Philippe.Poilbarbe at cls.fr
phoneto:+33(5)61394727
	
Parc technologique du canal
8-10, Rue Hermes
31520 Ramonville St-Agne

==============================================================================
To unsubscribe netcdfgroup, visit:
http://www.unidata.ucar.edu/mailing-list-delete-form.html
==============================================================================



More information about the netcdfgroup mailing list