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

[netCDF #CBQ-986702]: Why is nc_put_varm unbearable slow?



Florian-

nc_put_varm (and nc_get_varm) are inherently
slow in their general form because of the nature
of the algorithm required. Bottom line
is that nc_put_varm has a loop that writes
a single value at a time. Thus the total
time is roughly |nc_put_var1| * N
where |nc_put_var1| is the time to write one
element of the array and N is the total number
of writes, which in your program is 640*412.
The nc_put_vara is significantly faster because
its operation is optimized into the netcdf library.
These optimizations cannot be used when the imapp argument
to nc_put_varm is used or the stride is something other than
all ones. If the imapp argument is NULL,
and the stride is NULL or all ones,
then nc_put_varm is equivalent
to and is converted to a call to nc_put_vara.

=Dennis Heimbigner
  Unidata


Ticket Details
===================
Ticket ID: CBQ-986702
Department: Support netCDF
Priority: Normal
Status: Closed


NOTE: All email exchanges with Unidata User Support are recorded in the Unidata inquiry tracking system and then made publicly available through the web. If you do not want to have your interactions made available in this way, you must let us know in each email you send to us.