Commit Graph

3442 Commits

Author SHA1 Message Date
Ward Fisher
87964e97bb Merge pull request #309 from gsjaardema/patch-1
Fix invalid array access
2016-08-26 12:34:40 -06:00
Greg Sjaardema
2d059f4580 Fix invalid array access
If an empty line is passed to this routine, then there is an invalid memory access at the cp[nn-1] line.  This becomes cp[-1] which is invalid.
2016-08-25 11:32:49 -06:00
Ward Fisher
07bfaf7e41 Merge branch 'nc-config-usage-fix' of https://github.com/ZedThree/netcdf-c into usage-pr 2016-08-18 12:53:52 -06:00
Ward Fisher
6198af95ad Turned of netcdf-4 where appropriate for AC checks. 2016-08-18 11:21:19 -06:00
Peter Hill
d455718f40 Usage function called wrong in nc-config
`usage` needs to be called with an exit value. Incorrect options won't
set the exit value, so are trickier to detect
2016-08-18 16:48:30 +01:00
Ward Fisher
f629bbad8d Merge pull request #301 from Unidata/gh300.dmh
Fix for Github issue netcdf-c 300
2016-08-17 13:59:50 -06:00
Ward Fisher
0f4ac41494 Merge branch 'master' into gh300.dmh 2016-08-17 09:31:26 -06:00
Ward Fisher
bf7e5b3a32 Merge pull request #305 from ZedThree/nc-config-fixes
Some small fixes for nc-config
2016-08-17 09:22:55 -06:00
Peter Hill
6c028fbf5c Get C++ flags from ncxx{4}-config 2016-08-17 14:45:40 +01:00
Peter Hill
ce15b1cc2d Add couple of missing flags to nc-config
- Add --has-fortran, in addition to the specific --has-f90, --has-f03
- Add --libdir to print just the libdir
- Also 'which nf-config' will spit out errors if nf-config is not found.
  Silence these errors
2016-08-17 14:45:05 +01:00
Peter Hill
a49816ad43 Use libs variable instead of pkg-config
pkg-config isn't used in the cmake version of nc-config, so probably
shouldn't be used in autotools version either?
2016-08-17 14:03:38 +01:00
Peter Hill
86c7575f97 Use correct autotools variables in nc-config
This was fixed in a previous commit for nc-config.cmake.in, but not for
the autotools version
2016-08-17 14:01:25 +01:00
Ward Fisher
6c9041cdb6 Merge branch 'master' into gh300.dmh 2016-08-10 23:57:15 -06:00
Ward Fisher
69c70e487f Further refinement. 2016-08-10 09:50:36 -06:00
Ward Fisher
5204c3728f Carrying cmake options into autotools based builds. 2016-08-10 09:40:15 -06:00
Ward Fisher
c2929b77c9 Updated release notes to reference https://github.com/Unidata/netcdf-c/issues/gh300.dmh and https://github.com/Unidata/netcdf-c/pull/301 2016-08-09 13:37:10 -06:00
Dennis Heimbigner
ddfb6d6279 Make sure that the _NcProperties attr is null terminated and stored as such 2016-08-08 21:54:23 -06:00
Dennis Heimbigner
f205989d59 Undo debug output because Travis won't show it 2016-08-08 11:23:14 -06:00
Dennis Heimbigner
7701bc932c travis failing; add debug output 2016-08-08 10:39:34 -06:00
Dennis Heimbigner
0cf1e2c49f re: Github issue netcdf-c 300
Modified provenance code to allocate the minimal space
needed for _NCProperties attribute in file.  Basically
required using malloc in the provenance code and in ncdump.
Otherwise should cause no externally visible effects.
Also removed the ENABLE_FILEINFO from configure.ac since
the provenance code is no longer optional.
2016-08-08 09:24:19 -06:00
Ward Fisher
ec879abca6 Updated release notes. 2016-07-27 14:14:32 -06:00
Ward Fisher
05cbb8444b Propegated previous change into cmake-based builds. 2016-07-27 14:10:05 -06:00
Ward Fisher
792322dc4b Got nc-config to properly parse nf-config in support of https://github.com/Unidata/netcdf-c/issues/296 2016-07-27 14:05:47 -06:00
Greg Sjaardema
2bfd984fad Update testing -- not error if start==size 2016-07-21 09:30:18 -06:00
Greg Sjaardema
c7ccdfa543 More pedantically correct check
This modifies the previous change to be more pedantically correct.  It should always be an NC_EINVALCOORDS error if start exceeds fdims[2]; however, if start equals fdims[2], then it is only an error if count is non-zero.
2016-07-21 09:30:18 -06:00
Greg Sjaardema
9290b31c9d Fix variable bounds check for parallel output
The following code is in nc4hdf.c, function `nc4_put_vara`.

```
  /* Check dimension bounds. Remember that unlimited dimnsions can
   * put data beyond their current length. */
  for (d2 = 0; d2 < var->ndims; d2++)
    {
      dim = var->dim[d2];
      assert(dim && dim->dimid == var->dimids[d2]);
      if (!dim->unlimited)
        {
          if (start[d2] >= (hssize_t)fdims[d2])
            BAIL_QUIET(NC_EINVALCOORDS);
          if (start[d2] + count[d2] > fdims[d2])
            BAIL_QUIET(NC_EEDGE);
        }
    }
```

There is an issue when the process with the highest rank has zero items to output.  As an example, if I have 4 mpi processes which are each writing the following amount of data:
 * rank 0: 0 items
 * rank 1: 2548 items
 * rank 2: 4352 items
 * rank 3: 0 items.

I will define the variable to have a length of 6900 items (0 + 2548 + 4352 + 0).  When I am outputting data to the variable, each rank will call nc_put_vara_longlong with the following start and count values:
 * rank 0: start = 0, count = 0
 * rank 1: start = 0, count = 2548
 * rank 2: start = 2548, count = 4352
 * rank 3: start = 6900, count = 0.

In each case, the `start` for rank N is equal to `start` for rank N-1 + `count` for rank N-1.  This all works ok until the highest rank is writing 0 items.  In that case, the `start` value for that rank is equal to the total size of the variable and the check in the code fragment shown above fails since `start[] == fdims[]`.

This could be fixed in the application code by checking whether the `count` is zero and if so, then set `start` to 0 also, but I think that is a kluge that should not be required.

Note that this test appears three times in this file.  In one case, the check for non-zero count already exists, but not in the other two.  This pull request adds the check to the other two tests.
2016-07-21 09:30:18 -06:00
Ward Fisher
fa6d64d018 Merge branch 'patch-6' of https://github.com/gsjaardema/netcdf-c into gh-squash 2016-07-21 09:27:24 -06:00
Ward Fisher
31722a98ef Merge pull request #294 from tbeu/patch-1
Test all three files for compatibility
2016-07-18 15:32:19 -06:00
tbeu
eae6d75d47 Test all three files for compatibility 2016-07-18 22:18:42 +02:00
Greg Sjaardema
4ba6005ff2 Merge branch 'master' into patch-6 2016-07-18 07:05:27 -04:00
Ward Fisher
c1ec950d70 Merge branch 'extent-llu' of https://github.com/brtnfld/netcdf-c into consolidate-gh 2016-07-15 14:42:49 -06:00
Ward Fisher
d419b53925 Merge branch 'patch-1' of https://github.com/gsjaardema/netcdf-c into consolidate-gh 2016-07-15 14:40:32 -06:00
Ward Fisher
9fde5ed227 Merge branch 'patch-3' of https://github.com/gsjaardema/netcdf-c into consolidate-gh 2016-07-15 14:37:55 -06:00
Greg Sjaardema
033712ef1e Use correct symbol
As best I can tell, this should be ENABLE_PARALLEL4 instead of ENABLE_PARALLEL.  ENABLE_PARALLEL is not used other than in a couple documentation files.  But, ENABLE_PARALLEL4 is set in the top-level CMakeLists.txt file if a parallel hdf5 library is detected.
2016-07-15 07:47:40 -04:00
Ward Fisher
373e3ae87e Merge branch 'master' into gh277 2016-07-13 15:17:30 -06:00
Ward Fisher
cd6b94f2f4 Merge branch 'nc3-hashmap-fix' of https://github.com/gsjaardema/netcdf-c into gh282 2016-07-13 11:35:09 -06:00
Ward Fisher
2fe943d32e Wiring in test contributed by Greg Sjaardema in support of https://github.com/Unidata/netcdf-c/issues/282 2016-07-12 16:58:49 -06:00
Ward Fisher
55e4b7acfd Merge branch 'master' into gh277 2016-07-12 13:48:00 -06:00
Ward Fisher
ad8a85769d Merge pull request #287 from Unidata/typedef
mutiple typedefs causing compile problems
2016-07-12 13:22:35 -06:00
Greg Sjaardema
fcb1455b28 Update nc4hdf.c
If H5Aopen_idx on line 1964 fails, then attid will be < 0.  The BAIL will goto exit at line 1989 and then the test of "if (attid ...)" at line 1995 will pass (attd != 0) and then call H5Aclose(attid) with a negative attid.    Similar issue for spaceid.  

Result of function if probably the same since there is a failure somewhere, but more difficult to track down if looks like failure is happening in the wrong place.
2016-07-12 08:59:01 -04:00
Greg Sjaardema
c361938c8e Fix att_name size
There was a mismatch between the allocated size of att_name and the size that H5Aget_name was told the size was.
2016-07-12 08:12:23 -04:00
Ward Fisher
af26592f50 Filled in short description for group-related functions in support of https://github.com/Unidata/netcdf-c/issues/277 full documentation still pending. 2016-07-11 16:55:30 -06:00
Ward Fisher
c5d1b664f3 refactoring of documentation. 2016-07-11 14:43:39 -06:00
Dennis Heimbigner
d3f44747f1 A couple of people have reported that
the multiple definitions of
    typedef struct DCEparsestate
near lines 10 and 42 causes compiler
problems with some versions of gcc.
remove the second typedef.
2016-07-11 14:11:20 -06:00
Greg Sjaardema
586e832f64 Fix variable and dimension renaming for nc3 with hashmap
The problem is that the name was being updated prior to the old
variable being removed from the hashmap. It checks whether the key and
the name of the variable being removed match, but since the name had
already been updated, the names did not match so the variable was not
removed. This patch removes the variable from the hashmap first,
then updates the name, and then adds the variable with the new name to
the hashmap.

Similar change for renaming dimensions.
2016-07-11 15:44:40 -04:00
Ward Fisher
ca49086a32 Cleaned up warnings about undocumented parameters for NC_inq_var_all. 2016-07-11 13:43:19 -06:00
Ward Fisher
37162e55cc Roughed in documentation blocks for the group-related functions in dgroup.c. Details for the bulk of the code still need to be filled in. 2016-07-11 11:27:26 -06:00
Ward Fisher
6da5d38dde Started filling out group documentation. See https://github.com/Unidata/netcdf-c/issues/277 for more information. 2016-07-08 15:38:05 -06:00
Ward Fisher
13fabc4036 Merge branch 'doc-update' 2016-07-08 10:26:31 -06:00
Ward Fisher
973ec5f2ad Updated hdf5 version in documentation for pre-built Windows installers. 2016-07-07 15:14:48 -06:00