Commit Graph

45 Commits

Author SHA1 Message Date
Edward Hartnett
5ab7bf7796 now always relax! 2019-11-26 05:36:16 -07:00
Dennis Heimbigner
4c92fc3405 Remove netcdf-4 conditional on the dispatch table.
Partially address: https://github.com/Unidata/netcdf-c/issues/1056

Currently, some of the entries in the dispatch table
are conditional'd on USE_NETCDF4.

As a step in upgrading the dispatch table for use
with user-defined tables, we remove that conditional.
This means that all dispatch tables must implement the
netcdf-4 specific functions even if only to make them
return NC_ENOTNC4. To simplify this, a set of default
functions are defined in libdispatch/dnotnc4.c to provide this
behavior. The file libdispatch/dnotnc3.c is also relevant to
this.

The primary fix is to modify the various dispatch tables to
remove the conditional and use the functions in
libdispatch/dnotnc4.c as appropriate. In practice, all of the
existing tables are prepared to handle this, so the only
real change is to remove the conditionals.

Misc. Unrelated fixes
1. Fix some annoying warnings in ncvalidator.

Notes:
1. This has not been tested with either pnetcdf or hdf4 enabled.
   When those are enabled, it is possible that there are still
   some conditionals that need to be fixed.
2019-07-20 13:59:40 -06:00
Dennis Heimbigner
6934aa2e8b Thread safety: step 1: cleanup
re: https://github.com/Unidata/netcdf-c/issues/1373 (partial)

* Mark some global constants be const to indicate to make them easier to track.
* Hide direct access to the ncrc_globalstate behind a function call.
* Convert dispatch tables to constants (except the user defined ones)
  This has some consequences in terms of function arguments needing to be marked
  as const also.
* Remove some no longer needed global fields
* Aggregate all the globals in nclog.c
* Uniformly replace nc_sizevector{0,1} with NC_coord_{zero,one}
* Uniformly replace nc_ptrdffvector1 with NC_stride_one
* Remove some obsolete code
2019-03-30 14:06:20 -06:00
Ward Fisher
25417880f7 Updated libdispatch/ files with copyright notice. 2018-12-06 14:29:57 -07:00
Ed Hartnett
9953e53573 converting NULL checking of put functions 2018-08-14 09:21:45 -06:00
Ed Hartnett
829d9d28ae converting NULL checking of put functions 2018-08-14 09:09:08 -06:00
Ed Hartnett
5f9b7af467 converting NULL checking of put functions 2018-08-14 09:04:16 -06:00
Ed Hartnett
5800fdd617 removing unneeded file lookups 2018-08-14 08:49:23 -06:00
Ed Hartnett
acc22e0c54 checking NULLs in function 2018-08-14 06:28:28 -06:00
Ed Hartnett
a0bea92919 fixed problem of not calling NC_ versions of vars and varm functions for extra error checking 2018-08-14 05:04:09 -06:00
Ed Hartnett
0b13f52766 documentation 2018-08-14 04:44:26 -06:00
Ed Hartnett
5c39fa115a return error for NULL start for varm functions 2018-08-14 04:35:38 -06:00
Ed Hartnett
97c2541a37 put_vars checking for NULL start for non-scalar vars and test 2018-08-13 13:05:32 -06:00
Ed Hartnett
8b26c83379 undid unneeded nc_test changes 2018-08-13 09:15:50 -06:00
Ed Hartnett
ec3d3a3d06 return error for put_vara calls with NULL start 2018-08-13 09:03:49 -06:00
Ed Hartnett
a63f3449c3 return error for put_vara calls with NULL start 2018-08-13 08:54:38 -06:00
Ed Hartnett
19222632b4 return error for put_vars calls with NULL start 2018-08-13 08:48:20 -06:00
Ed Hartnett
df371b2b99 reject NULL start for put_vars 2018-08-13 08:25:54 -06:00
luz.paz
b4d0fe651a Follow-up trivial typos 2018-04-26 23:04:01 -04:00
Ed Hartnett
4de61e21f2 more docs, more cleaning 2017-12-04 12:21:14 -07:00
Greg Sjaardema
a07938194e Move nels==0 check instead of eliminating
The previous change where the `nels==0` check was removed caused problems with nc_test.  
If the check is moved after the `NC_put_vara` call, then it will avoid the parallel hang problem for stride=1, but will still pass all tests in `nc_test`.  Note that this is somewhat of a kluge since there will still be a parallel hang if nels==0 and stride is > 1 and the code falls into the odometer section.
2017-08-02 11:12:04 -06:00
Greg Sjaardema
6f38a0e7cb Fix problem with hangs in parallel collective output
See description in #447
2017-08-01 15:38:21 -06:00
Ward Fisher
8dddd222a3 Merged master, DAP4 support into branch. 2017-04-19 09:29:35 -06:00
Dennis Heimbigner
3db4f013bf Primary change: add dap4 support
Specific changes:
1. Add dap4 code: libdap4 and dap4_test.
   Note that until the d4ts server problem is solved, dap4 is turned off.
2. Modify various files to support dap4 flags:
	configure.ac, Makefile.am, CMakeLists.txt, etc.
3. Add nc_test/test_common.sh. This centralizes
   the handling of the locations of various
   things in the build tree: e.g. where is
   ncgen.exe located. See nc_test/test_common.sh
   for details.
4. Modify .sh files to use test_common.sh
5. Obsolete separate oc2 by moving it to be part of
   netcdf-c. This means replacing code with netcdf-c
   equivalents.
5. Add --with-testserver to configure.ac to allow
   override of the servers to be used for --enable-dap-remote-tests.
6. There were multiple versions of nctypealignment code. Try to
   centralize in libdispatch/doffset.c and include/ncoffsets.h
7. Add a unit test for the ncuri code because of its complexity.
8. Move the findserver code out of libdispatch and into
   a separate, self contained program in ncdap_test and dap4_test.
9. Move the dispatch header files (nc{3,4}dispatch.h) to
   .../include because they are now shared by modules.
10. Revamp the handling of TOPSRCDIR and TOPBUILDDIR for shell scripts.
11. Make use of MREMAP if available
12. Misc. minor changes e.g.
	- #include <config.h> -> #include "config.h"
	- Add some no-install headers to /include
	- extern -> EXTERNL and vice versa as needed
	- misc header cleanup
	- clean up checking for misc. unix vs microsoft functions
13. Change copyright decls in some files to point to LICENSE file.
14. Add notes to RELEASENOTES.md
2017-03-08 17:01:10 -07:00
Wei-keng Liao
2081ae7099 add configure option --enable-relax-coord-bound for issue #243 2016-11-12 23:58:09 -06:00
Wei-keng Liao
dbb9be59d2 temporally disable __arm__ for testing 2016-10-09 22:21:32 -05:00
Ward Fisher
3f27ec6db4 Tightening the Doxygen documentation. 2016-01-14 15:33:50 -07:00
Ward Fisher
d5ce804744 The issue (at least this one) in nctest is solved. In dv2i.c, line 896 (or thereabouts), a long variable was being passed to a function expecting a ptrdiff_t. These are not compatible sizes, on Windows. 2015-10-27 12:04:03 -06:00
dmh
859f105005 merge-squash 2015-08-15 16:26:35 -06:00
Russ Rew
67ad8d89a8 Fix and test resolution of NCF-326, Unlimited Dimensions NC_EEDGE error. 2015-03-10 06:13:07 -06:00
dmh
8a71ed7569 Partially deprecated varm function 2014-10-12 12:38:41 -06:00
Ward Fisher
b43813d821 When using the '-ansi' flag with gcc, netcdf would fail to build because of the use of '//' for one-line comments. I've addressed this by replacing instances of // with enclosing comment blocks. 2014-08-26 11:19:32 -06:00
dmh
9d5c8ba308 1. Previous ci of conversion fixes in libdispatch
was incomplete; complete the fix.
2. There is an inconsistency in the netcdfh interface
   about whether rank (# dimensions) is an int or
   size_t. I inadvertently assumed the latter and that
   breaks some API calls; so revert back.
2014-03-10 12:09:36 -06:00
dmh
1b941d342d 1. Attempted to reduce the number of conversion errors
when -Wconversion is set. Fixed libdispatch, but
   rest of netcdf remains to be done.
2014-03-09 15:51:45 -06:00
Ward Fisher
f43bf8f1da Addressed a handful of issues identified by
Coverity static analysis.
2013-08-05 20:36:33 +00:00
Dennis Heimbigner
11c2083b1c Add note about nc_put/get_varm to discourage their use 2013-03-17 21:23:28 +00:00
Ward Fisher
0444a6c711 Fixed a couple of tests on Windows,
Fixed some compile errors on Windows.
2013-02-21 23:56:15 +00:00
Dennis Heimbigner
b0b6c77a3e 1. corrected the nc_get_varm/put_varm documentation
to indicate that they only work for atomic types,
   not user defined types.

2. modified NCDEFAULT_{get/put}_vars to no longer use
   nc_get/put_varm. They now directly use nc_get/put_vara
   directly. This means that nc_get/put_vars now work
   properly for user defined types as well as atomic types.

3. Added test cases for get_vars/put_vars with a
   user defined type. Tests placed into
   nc_test/tst_compounds.c
2013-02-17 23:42:15 +00:00
Russ Rew
592a120a55 Fixed bug NCF-206 (Fix strided access for NC_STRING type). Verified
fix with new test for strided access for NC_STRING type.
2012-11-19 17:20:53 +00:00
Dennis Heimbigner
5ca78309cc The effect of this change is to make the struct NC structure
contain as little file-type specific info as possible.  It
modifies especially libsrc so that all of the netcdf-3 data
that used to be in struct NC is now kept in a separate chunk
of data pointed to by the struct NC. This makes all of
current protocols consistent: netcdf-3, netcdf-4, and dap.
2012-09-06 19:44:03 +00:00
Russ Rew
b569613737 Fixed // style comments, for IBM XL C/C++ for AIX V10.1 compiler. 2012-04-25 16:29:59 +00:00
Dennis Heimbigner
88f7950d6f fix a bunch of uninitialized variables 2012-03-16 22:29:09 +00:00
Russ Rew
0e48e0a671 Jira NCF-137: Fix documentation of ncid parameter to include group ids 2011-12-15 21:21:38 +00:00
Dennis Heimbigner
5c002466e3 cleanup misc. items 2011-07-14 22:21:46 +00:00
Ed Hartnett
fd4a63c4d2 changed file names to allow visual studio to cope 2011-07-14 09:50:37 +00:00