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

[netCDF #FRW-605076]: netcdf - ncx.c



Hello Alan,

Thanks for the suggested patch; I'll take a look at it.  Anything to make the 
code more efficient at run time is very much appreciated! I'll be interested to 
see how much this helps the performance.  Regarding the VAX #ifdefs; there are 
some out there and some of those are running netCDF.  While our commitment to 
always maintaining backwards compatibility extends primarily to the API and the 
file/model format, I'm loathe to break any platforms unless it can't be avoided.

Thanks again; I'll probably enter this into our JIRA system (as it's a system 
improvement) and will follow up with a link for your reference.

Have a great day,

-Ward

> Hello,
> I am Alan Scott, the support manager for ParaView (a scientific visualization 
> application) at Sandia National Laboratories.  One of our primary data 
> formats (Exodus) uses the netcdf library.  I have been looking at performance 
> of our code, and find that a very large percent of time is spent moving 
> datasets from large endian to small endian.  Specifically, the time is spent 
> in ncx.c here:
> 
> static void
> swap4b(void *dst, const void *src)
> {
> char *op = dst;
> const char *ip = src;
> op[0] = ip[3];
> op[1] = ip[2];
> op[2] = ip[1];
> op[3] = ip[0];
> }
> 
> This code basically creates four loads and four stores.  Almost all CPU's now 
> days are load/store bound.  I would like to propose the following 
> replacement, which basically does one 32 bit load to register, moves the 
> bytes around, and one 32 bit store.
> 
> static void
> swap4b(void *dst, const void *src)
> {
> uint32_t* op32 = (uint32_t*)(dst);
> const uint32_t* ip32 = (const uint32_t*)(src);
> 
> *op32 = (((*ip32)                              ) << 24) |
> (((*ip32) & 0x0000ff00u) <<  8) |
> (((*ip32) & 0x00ff0000u) >>  8) |
> (((*ip32)                              ) >> 24);
> }
> 
> By the way, do we still need code that ifdef's Vax's?  Do those still exist?
> 
> 
> Thanks,
> 
> Alan
> 
> p.s. - cc'ing the ParaView manager at Kitware - Utkarsh Ayachit
> 
> --------------------------------------------------------
> W. Alan Scott
> ParaView Support Manager
> 
> SAIC
> Sandia National Laboratories, MS 0822
> Org 9326 - Building 880 A1-C
> (505) 284-0932   FAX (505) 284-5619
> ---------------------------------------------------------
> 
> 
> 

Ticket Details
===================
Ticket ID: FRW-605076
Department: Support netCDF
Priority: Normal
Status: Closed