|
|
|||
|
||||
Stephen Leak writes:
I've been building and tweaking netCDF for the Australian BOM/CSIRO site for a little while, and have collected together a few patches that may be of more general interest. These were originally made with the NEC-SX in mind, but are more general than that (we have also tested and used them on x86, ia64 and HP machines).
The most important fixes a bug in libsrc/v2i.c which affects machines whose SIZEOF_SIZE_T != SIZEOF_LONG. If it is not too late it's probably a good idea to get this one into v3.6.2
The other patches are against netcdf-3.6.1 and are independant of each other. An explanation of each is:
(to use them: patch -p0 < xxxx-patch in src/ directory).
blksz-361-patch: Normally, netCDF uses stat(2) to determine the size of the buffer. On NEC SX systems using GFS (Global file System), there are performance benefits in using a larger buffer. This patch adds support to libsrc/posixio.c for an environment variable NC_BLKSZ, for the buffer block size (the actual buffer size is twice this, this is an aspect of the implementaiton of buffering in posixio.c).
The buffer size can be set for individual files, too, using and environment variable NC_BLKSZ_filename, where filename is the file name from the final "/" to the first "." (so /tmp/myfile.nc corresponds to NC_BLKSZ_myfile).
The values of NC_BLKSZ is the number of bytes, or kb or mb is the suffix "kb" or "mb" is added (eg NC_BLKSZ_myfile 2MB). A README-blksz file is included explaining the use of this feature
f90-361-patch: On machines such as the NEC SX, one, two and sometimes four-byte data is normally promoted to 4 or 8 bytes. This causes compile errors because the f90 interface for netcdf specifies functions for each datatype, and some cannot be distinguished. This patch uses the C preprocessor to select which datatypes are available, via #defines: -DHAVE_1BYTE_INT -DHAVE_2BYTE_INT -DHAVE_4BYTE_INT -DHAVE_4BYTE_REAL. (the patch includes a file "env-vars" with examples of how to use them)
Several patches with similar functionality have been developed independantly by several people, this one is an extension of one submitted by (iirc) Jacob Poulsen of DMI to the NetCDF mailing list some time ago.
This patch file is quite long, because a couple of .f90 files are re-named as .F90 to indicate (and automatically trigger) preprocessing (the actual difference in the .f90->.F90 files are much smaller)
nec_sx_vector_ncx-361-patch: This is based on an earlier patch from Harvey Davies. I've cleaned it up a bit, most notably removing the FLOAT2 support, since hardware support for this option was discontinued almost 10 years ago now. The patch vectorises type conversion when reading or writing to a file.
The SX-specific parts are encapsulated in "#ifdef _SX" preprocessing, so this patch is safe for non-NEC machines.
A similar patch has been submitted by Takashi Kagimoto of JAMSTEC (see netcdf web site:netcdf/docs/other-builds.html#nec-sx-n)
fileinf-361-patch: The NEC SX Fortran runtime environment supports various performance reports, including a "FILEINF" report showing I/O details and performance. This patch provides similar functionality for netcdf files.
The patch is portable - all NEC-specific calls are in "#ifdef _SX" preprocessing - but the NEC-specific calls provide more metrics than the standard UNIX ones.
This patch also includes env-vars and README-fileinf files with notes on how to compile and use it.
cheers,
Stephen
-- +---------------------------------------------------------------------+ | Stephen Leak email: leak (at) sx.nec.com.au | | Applications Analyst tel: +61 (3) 9669 8121 | | High Performance Computing Systems fax: +61 (3) 9669 8124 | | NEC Australia Pty. Ltd. | | "Quidquid latine dictum sit, altum viditur" -anon | +---------------------------------------------------------------------+
| Contact Us Site Map Search Terms and Conditions Privacy Policy Participation Policy | ||||||
|
||||||