Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deprecate non-relax coord bounds checking, also fix parallel builds for --enable-pnetcdf #1238

Merged
merged 7 commits into from
Jan 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 7 additions & 15 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1101,7 +1101,7 @@ if test "x$enable_hdf5" = xyes ; then
AC_ARG_ENABLE([parallel4],
[AS_HELP_STRING([--disable-parallel4],
[disable parallel I/O for netcdf-4, even if it's enabled in libhdf5])],
[user_set_parallel4=${enableval}])
[user_set_parallel4=${enableval}]2)
test "x$enable_parallel4" = xno || enable_parallel4=yes

# If user wants parallel IO for netCDF-4, make sure HDF5 can provide it.
Expand Down Expand Up @@ -1190,13 +1190,12 @@ AC_ARG_ENABLE([erange_fill],
[enable_erange_fill=${enableval}], [enable_erange_fill=auto]
)

dnl Always build with relaxed coord bound checking, to prevent API
dnl incompatibilities between different installs of netCDF.
AC_ARG_ENABLE([zero-length-coord-bound],
[AS_HELP_STRING([--disable-zero-length-coord-bound],
[Disable a more relaxed boundary error check NC_EINVALCOORDS
to allow coordinate start argument equal to dimension size
when argument count is zero. @<:@default: enabled@:>@])],
[enable_zero_length_coord_bound=${enableval}], [enable_zero_length_coord_bound=auto]
)
[Disable relaxed boundary error check. Deprecated. Using this can cause API incompatibilities. This option will be removed in the next release of netCDF.])])
test "x$enable_zero_length_coord_bound" = xno || enable_zero_length_coord_bound=yes

# check PnetCDF's settings on enable_erange_fill and relax_coord_bound
if test "x$enable_pnetcdf" = xyes; then
Expand Down Expand Up @@ -1226,19 +1225,12 @@ if test "x$enable_pnetcdf" = xyes; then
choke me
#endif]])], [relax_coord_bound_pnetcdf=yes], [relax_coord_bound_pnetcdf=no])
AC_MSG_RESULT([$relax_coord_bound_pnetcdf])
if test "x$enable_zero_length_coord_bound" = xauto ; then
enable_zero_length_coord_bound=$relax_coord_bound_pnetcdf
elif test "$enable_zero_length_coord_bound" != "$relax_coord_bound_pnetcdf"; then
if test "$enable_zero_length_coord_bound" = yes; then
AC_MSG_ERROR([Enabling relax-coord-bound conflicts with PnetCDF setting])
else
AC_MSG_ERROR([Disabling relax-coord-bound conflicts with PnetCDF setting])
fi
if test x"$relax_coord_bound_pnetcdf" != xyes; then
AC_MSG_ERROR([PNetCDF must be built with relax-coord-bound])
fi
else
# default setting
enable_erange_fill=no
enable_zero_length_coord_bound=yes
fi

if test "x$enable_zero_length_coord_bound" = xyes; then
Expand Down
27 changes: 13 additions & 14 deletions include/nc_provenance.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,20 @@
* @internal Contains information for creating provenance
* info and/or displaying provenance info.
*
* It has come to pass that we can't guarantee that this information is
* contained only within netcdf4 files. As a result, we need
* to make printing these hidden attributes available to
* netcdf3 as well.
*
*
* For netcdf4 files, capture state information about the following:
* 1. Global: netcdf library version
* 2. Global: hdf5 library version
* 3. Per file: superblock version
* 4. Per File: was it created by netcdf-4?
* 5. Per file: _NCProperties attribute
*
* @author Dennis Heimbigner, Ward Fisher

It has come to pass that we can't guarantee that this information is
contained only within netcdf4 files. As a result, we need
to make printing these hidden attributes available to
netcdf3 as well.

For netcdf4 files, capture state information about the following:
1. Global: netcdf library version
2. Global: hdf5 library version
3. Per file: superblock version
4. Per File: was it created by netcdf-4?
5. Per file: _NCProperties attribute
*/

#ifndef _NCPROVENANCE_
Expand All @@ -34,10 +35,8 @@ For netcdf4 files, capture state information about the following:
#define NCPROPSSEP1 '|'
#define NCPROPSSEP2 ','


/* Other hidden attributes */
#define ISNETCDF4ATT "_IsNetcdf4"
#define SUPERBLOCKATT "_SuperblockVersion"


#endif /* _NCPROVENANCE_ */
21 changes: 11 additions & 10 deletions nc_test/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
# This file builds and runs the nc_test program, which tests the
# netCDF-3 API for all formats.

# Ed Hartnett, Dennis Heimbigner, Ward Fisher

# Put together AM_CPPFLAGS and AM_LDFLAGS.
include $(top_srcdir)/lib_flags.am
AM_CPPFLAGS += -I$(top_srcdir)/libsrc
Expand All @@ -12,19 +14,20 @@ AM_CPPFLAGS += -DTOPBINDIR=${abs_top_bindir}
LDADD = ${top_builddir}/liblib/libnetcdf.la
AM_CPPFLAGS += -I$(top_builddir)/liblib -I$(top_builddir)/include -I$(top_srcdir)/libsrc

# Note which tests depend on other tests. necessary for make -j check
TEST_EXTENSIONS = .sh

check_PROGRAMS =

# These are the tests which are always run.
TESTPROGRAMS = t_nc tst_small nc_test tst_misc tst_norm tst_names \
tst_nofill tst_nofill2 tst_nofill3 tst_atts3 tst_meta tst_inq_type \
tst_utf8_validate tst_utf8_phrases tst_global_fillval \
tst_max_var_dims tst_formats tst_def_var_fill tst_err_enddef \
TESTPROGRAMS = t_nc tst_small nc_test tst_misc tst_norm tst_names \
tst_nofill tst_nofill2 tst_nofill3 tst_atts3 tst_meta tst_inq_type \
tst_utf8_validate tst_utf8_phrases tst_global_fillval \
tst_max_var_dims tst_formats tst_def_var_fill tst_err_enddef \
tst_default_format

if USE_PNETCDF
TESTPROGRAMS += tst_parallel2 tst_pnetcdf tst_addvar tst_formatx_pnetcdf \
tst_default_format_pnetcdf
check_PROGRAMS += tst_parallel2 tst_pnetcdf tst_addvar
TESTPROGRAMS += tst_formatx_pnetcdf tst_default_format_pnetcdf
endif

if TEST_PARALLEL4
Expand All @@ -48,16 +51,14 @@ endif # LARGE_FILE_TESTS

if BUILD_BENCHMARKS
TESTPROGRAMS += testnc3perf
testnc3perf_SOURCES = testnc3perf.c
endif

if USE_HDF5
TESTPROGRAMS += tst_diskless6
tst_diskless6_SOURCES = tst_diskless6.c
endif

# Set up the tests.
check_PROGRAMS = $(TESTPROGRAMS)
check_PROGRAMS += $(TESTPROGRAMS)

# Build Diskless test helpers
check_PROGRAMS += tst_diskless tst_diskless3 tst_diskless4 \
Expand Down
2 changes: 1 addition & 1 deletion nc_test/tst_default_format_pnetcdf.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ create_check_pnetcdf(char *fname, int cmode, int exp_format)

int main(int argc, char *argv[])
{
char *fname="tst_default_format.nc";
char *fname="tst_default_format_pnetcdf.nc";
int err, exp_err=NC_NOERR, nerrs=0, ncid, cmode;

MPI_Init(&argc, &argv);
Expand Down
1 change: 1 addition & 0 deletions nc_test/tst_pnetcdf.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ int main(int argc, char* argv[])
}
}
st = nc_close(ncid); CHK_ERR(st)
free(buf);

fn_exit:
MPI_Finalize();
Expand Down
13 changes: 2 additions & 11 deletions nc_test4/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -41,29 +41,20 @@ if !ISCYGWIN
NC4_TESTS += tst_h_strbug tst_h_refs
endif

check_PROGRAMS =
TESTS =

# Build test programs plus programs used in test scripts.
if USE_NETCDF4
check_PROGRAMS += $(NC4_TESTS) renamegroup tst_empty_vlen_unlim
TESTS += $(NC4_TESTS)
endif
check_PROGRAMS = $(NC4_TESTS) renamegroup tst_empty_vlen_unlim
TESTS = $(NC4_TESTS) run_empty_vlen_test.sh

# Add these if large file tests are turned on.
if LARGE_FILE_TESTS
check_PROGRAMS += tst_large tst_large2
TESTS += tst_large tst_large2
endif

if USE_NETCDF4
if BUILD_UTILITIES
TESTS += run_grp_rename.sh tst_misc.sh
endif

TESTS += run_empty_vlen_test.sh
endif

# If the v2 API was built, add its test program.
if BUILD_V2
check_PROGRAMS += tst_v2
Expand Down