Commit Graph

261 Commits

Author SHA1 Message Date
Ward Fisher
76e5e0f1fa Addressed several minor issues revealed by static analysis (coverity, clang). Mostly to do with extreme corner cases in which a null pointer would be dereferenced, or dereferencing a non-null (but non-initialized) pointer would result in garbage. 2014-03-28 17:11:26 -06:00
Russ Rew
7d36a6c7f3 Fix a couple of warnings 2014-03-27 11:11:06 -06:00
Russ Rew
b95ab08f8f Fix bug in setting default chunksize for 1D record variables 2014-03-27 09:58:53 -06:00
Russ Rew
93878e8816 Fix possibility of divide by zero in rechunking. 2014-02-27 12:19:14 -07:00
Russ Rew
abe9a7d753 Merge branch 'master' of https://github.com/Unidata/netcdf-c 2014-02-26 14:01:51 -07:00
Russ Rew
9212968f54 Fix default chunksize for 1-dimensional record variables 2014-02-26 13:30:12 -07:00
Quincey Koziol
fe9e0b056d Update HDF4 support for recent datatype changes. 2014-02-25 21:05:19 -06:00
Russ Rew
976bc707f3 Fix compile errors in HDF4 support from change of att->xtype to att->nc_typeid and similar var change. Still a bug at runtime with ref count for type ids. 2014-02-23 11:32:35 -07:00
Quincey Koziol
d033f9f6ff Clean up Coverity warnings from last checkin. 2014-02-20 08:24:55 -06:00
Quincey Koziol
b98a475f37 Minor tweaks to comments and LOG messages. 2014-02-17 13:34:05 -06:00
Quincey Koziol
658e298cf8 Merge remote-tracking branch 'upstream/master' 2014-02-17 13:33:55 -06:00
Russ Rew
178e99467a Fix bug in MPI type reported by Chrostopher Bartz 2014-02-16 11:54:25 -07:00
Quincey Koziol
fd981824c1 Correct handling of variablen-length sequences for attributes, plus uncomment a
bunch of tests that stress this area of the library.

Also clean up some compiler warnings in the dispatch code.
2014-02-14 08:07:14 -06:00
Quincey Koziol
36c960c0ca Add a few cases for NC_CHAR type class that were missed earlier. 2014-02-12 08:48:13 -06:00
Quincey Koziol
4bfd9b27a0 Merge remote-tracking branch 'upstream/master'
Conflicts:
	libdap2/common34.c
	oc2/ocutil.c
2014-02-11 17:26:09 -06:00
Quincey Koziol
b2dfacbcfa Big clean up to type handling in libsrc4, which makes fill-values work
correctly for variables with string datatype, plus a few other minor changes.
2014-02-11 17:12:08 -06:00
Russ Rew
0627c82758 Fix for bit-for-bit reproducibility from Rimvydas Jasin, Quincey Koziol 2014-02-10 15:29:14 -07:00
Quincey Koziol
cd71eb525c Corrected "BAIL" macros to avoid infinite loop when logging is disabled and an
error occurs after an "exit:" label.

Corrected a dozen Coverity errors (mainly allocation issues, along with a few
    other things):
        711711, 711802, 711803, 711905, 970825, 996123, 996124, 1025787,
        1047274, 1130013, 1130014, 1139538

Refactored internal fill-value code to correctly handle string types, and
    especially to allow NULL pointers and null strings (ie. "") to be
    distinguished.  The code now avoids partially aliasing the two together
    (which only happened on the 'write' side of things and wasn't reflected on
    the 'read' side, adding to the previous confusion).

    Probably still weak on handling fill-values of variable-length and compound
    datatypes.

Refactored the recursive metadata reads a bit more, to process HDF5 named
    datatypes and datasets immediately, avoiding chewing up memory for those
    types of objects, etc.

Finished uncommenting and updating the nc_test4/tst_fills2.c code (as I'm
    proceeding alphabetically through the nc_test4 code files).
2013-12-29 01:12:43 -06:00
dmh
582410a407 [NCF-273]/HZY-708311
Add a new function called nc_inq_format_extended that
returns more detailed format information (vis-a-vis
nc_inq_format) about an open dataset.

Note that the netcdf API will present the file as if it had
the format specified by nc_inq_format.  The true file
format, however, may not even be a netcdf file; it might be
DAP, HDF4, or PNETCDF, for example. This function returns
that true file type.  It also returns the effective mode for
the file.

signature: nc_inq_format_extended(int ncid, int* formatp, int* modep)
where
* ncid is the NetCDF ID from a previous call to nc_open() or
  nc_create().
* formatp is a pointer to a location for returned true format.
* modep is a pointer to a location for returned mode flags.

Refer to the actual list in the file netcdf.h to see the
currently defined set.

Also added test cases (tst_formatx*).
2013-12-22 12:53:20 -07:00
Quincey Koziol
0d42ac7e87 Switch test for nc_inq_unlimdim and nc_inq_unlimdims to use the same ordering as
the rest of the dimension queries.  Correct error in library where types used
in sub-group variables but that were added to the file after the sub-group was
created weren't available for sub-group variables to use.  Start cleaning up
test suite and un-commenting tests that were commented out (got up to
nc_test4/tst_fills2.c, alphabetically) before running into an error in HDF5.
2013-12-15 19:55:41 -06:00
Quincey Koziol
b3044de434 Refactored read_scale(), memio_new(), var_create_dataset() and makespecial()
to clean up resources properly on failure.

Refactored doubly-linked list code for objects in the libsrc4 directory,
    cleaning up the add/del routines, breaking out the common next/prev
    pointers into a struct and extracting the add/del operations on them,
    changed the list of dims to add new dims in the same order as the other
    types, made all add routines able to optionally return a pointer to the
    newly created object.

Removed some dead code (pg_var(), nc4_pg_var1(), nc4_pg_varm(), misc. small
    routines, etc)

Fixed fill value handling for string types in nc4_get_vara().

Changed many malloc()+strcpy() pairs into calls to strdup().

Cleaned up misc. other minor Coverity issues.
2013-12-08 03:29:26 -06:00
Quincey Koziol
5ccb8a24b5 Merge branch 'master' into ncf-177 2013-11-30 23:40:26 -06:00
Quincey Koziol
e66e6e2b3a Merge remote-tracking branch 'upstream/master' 2013-11-30 23:24:44 -06:00
Quincey Koziol
e1fc13b215 Many changes to address NCF-177 (renaming dimensions and variables). Also
many cleanups to fix compiler warnings, streamline iteration over objects
in HDF5 file when opening the file, and generally straightening out the code
to be cleaner and simpler.

Tested on Mac OS/X with gcc 4.8 and OpenMPI (which uses clang).
2013-11-30 23:20:28 -06:00
dmh
2bc308432d sync with oc2.0 2013-11-14 15:13:20 -07:00
Russ Rew
751ac82ef7 For chunk computations that might overflow ints, use double instead of
float.
2013-10-17 14:25:39 -06:00
Ward Fisher
23cf133b39 Addressed Coverity issues 711911, 1102823 2013-10-07 16:25:30 -06:00
Quincey Koziol
d9069aaeaa More progress toward fixing NCF-177. 2013-09-28 12:40:21 -05:00
Russ Rew
68c8303743 Quincey's patch for NCF-269 parallel I/O bug. 2013-09-16 20:06:54 -06:00
Quincey Koziol
a5d23868b7 Merge branch 'master' into ncf-177 2013-09-14 13:22:12 -05:00
Quincey Koziol
7a4479be6b Minor cleanups to reduce warnings in headers, and switch from MPI_BYTE to MPI_INT
for MPI_Allreduce() call.
2013-09-14 13:19:58 -05:00
Ward Fisher
c238435853 Added stanza in nc4file.c, read_var, to avoid crashes when reading an h5 file with layout == "H5D_COMPACT". 2013-09-09 15:03:03 -06:00
Quincey Koziol
e808067582 Merge branch 'master' into ncf-177 2013-08-24 14:35:21 -05:00
Quincey Koziol
3cdce9e3af Correct error when a parallel application writes different amounts of data to
an unlimited-dimension variable, and different processes don't agree on the
whether to extend the underlying HDF5 dataset, or don't agree on the amount
to extend the dataset.
2013-08-18 20:45:17 -05:00
Quincey Koziol
a7ecaeb327 Work in progress on NCF-177. 2013-08-17 12:53:29 -05:00
Ward Fisher
f43bf8f1da Addressed a handful of issues identified by
Coverity static analysis.
2013-08-05 20:36:33 +00:00
Dennis Heimbigner
05369372f7 Debugged previously added
code to support group rename.
Also added a simple test case.
2013-07-21 01:08:39 +00:00
Dennis Heimbigner
b85d3568ec Added the necessary code to support
group renaming. The primary API
is 'nc_rename_grp(int grpid, const char* name)'.
No test cases provided yet.
This also required adding a rename_grp entry
to the dispatch tables.
2013-07-19 21:48:37 +00:00
Ward Fisher
1c23ec06b8 Merging latest from netcdf-cmake branch. Includes a handful
of fixes for coverity-identified errors.
2013-07-19 21:32:27 +00:00
Russ Rew
e4f9350c23 Quincey's fixes for NCF-56, "netcdf-4 can't read HDF5 scalar atts".
Also added ability capability for netCDF-4 to write and read NIL
values for string type attributes and variables, so these can be read
if used in HDF5 files.

Include are additions to CMakeLists files to reflect new tests.
2013-07-10 20:09:31 +00:00
Russ Rew
6cd8fca60d Quincey's fixes for NCF-250, netCDF-4 parallel independent access with
unlimited dimension hanging.  Extending the size of an unlimited
dimension in HDF5 must be a collective operation, so now an error is
returned if trying to extend in independent access mode.

Quincey's bug fixes for parallel build portability, particularly
OpenMPI on MacOS-X.
2013-07-08 21:31:13 +00:00
Russ Rew
58a63708cc Fix contributed by Nath Gopalaswamy to large file problem reading
netCDF classic or 64-bit offset files that have a UINT32_MAX flag for
large last record size of a variable that has values larger than 1
byte.  This problem had previously been fixed for *writing* such data,
but was only tested with an ncbyte variable.  Fixed test to
demonstrate problem and the fix.

More updates to chunking documentation, cosmetic fixes for some
"--option=" documentation that doxygen turns into mdash.
2013-06-25 17:04:10 +00:00
Ward Fisher
33d3d06971 Added initial 'make dist', 'make distcheck' support to
CMake-based builds.
2013-06-03 16:42:04 +00:00
Russ Rew
3152893da0 Updated documentation on default chunk size for unlimited dimensions.
Removed old heuristic for dims several orders of magnitude smaller
than the max dimension.
2013-05-28 15:34:55 +00:00
Dennis Heimbigner
de34ed2d5b merge from netcdf/trunk prior to merge back to trunk 2013-05-11 19:37:38 +00:00
Dennis Heimbigner
c583f91992 merge with trunk and fix conflicts 2013-05-10 17:04:28 +00:00
Dennis Heimbigner
4070bcf946 Fix (again) jira NCF-248.
So, it turns out that just freeing
the nc4_info is not enough;
The root group must also be reclaimed.
So, it appears the best approach
is to invoke an abort on the
failed file.
2013-04-24 22:11:44 +00:00
Ward Fisher
67f96188ff Merged latest from netCDF-cmake branch in preparation for 4.3.0 release. 2013-04-23 21:50:07 +00:00
Dennis Heimbigner
e960416761 Fix JIRA NCF-248 2013-04-23 18:02:35 +00:00
Russ Rew
3a87936711 New RELEASE_NOTES entry and a couple of Coverity fixes. 2013-04-23 16:27:28 +00:00