Merge branch 'master' into dap4tests1.dmh

This commit is contained in:
Dennis Heimbigner 2023-03-02 19:59:32 -07:00
commit bec55cb95e
21 changed files with 175 additions and 339 deletions

View File

@ -1215,16 +1215,12 @@ ELSE() # No option specified
SET(PLUGIN_INSTALL_DIR_SETTING "N.A.")
ENDIF()
# See if we have libzip
FIND_PACKAGE(Zip)
# Define a test flag for have zip library
IF(Zip_FOUND)
# Try to enable NCZarr zip support
OPTION(ENABLE_NCZARR_ZIP "Enable NCZarr ZIP support." OFF)
IF (ENABLE_NCZARR_ZIP)
FIND_PACKAGE(Zip REQUIRED)
INCLUDE_DIRECTORIES(${Zip_INCLUDE_DIRS})
SET(ENABLE_NCZARR_ZIP TRUE)
ELSE()
SET(ENABLE_NCZARR_ZIP FALSE)
ENDIF()
ENDIF ()
# libdl is always available; built-in in Windows and OSX
OPTION(ENABLE_PLUGINS "Enable dynamically loaded plugins (default on)." ON)
@ -1414,7 +1410,14 @@ IF(ENABLE_TESTS)
# Option to turn on unit testing. See
# https://github.com/Unidata/netcdf-c/pull/1472 for more information.
###
OPTION(ENABLE_UNIT_TESTS "Run Unit Tests." OFF)
OPTION(ENABLE_UNIT_TESTS "Run Unit Tests." ON)
###
# Option to turn on performance testing.
# See https://github.com/Unidata/netcdf-c/issues/2627 for more information.
###
OPTION(ENABLE_BENCHMARKS "Run benchmark Tests." OFF)
###
# End known-failures.
@ -2008,7 +2011,7 @@ MACRO(GEN_m4 filename)
IF(NOT EXISTS ${fallbackdest})
MESSAGE(FATAL_ERROR "m4 is required to generate ${filename}.c. Please install m4 so that it is on the PATH and try again.")
ELSE()
SET(${dest} ${fallbackdest})
SET(dest ${fallbackdest})
ENDIF()
ELSE()
ADD_CUSTOM_COMMAND(
@ -2367,6 +2370,9 @@ IF(ENABLE_TESTS)
IF(ENABLE_EXAMPLES)
ADD_SUBDIRECTORY(examples)
ENDIF()
IF(ENABLE_BENCHMARKS)
ADD_SUBDIRECTORY(nc_perf)
ENDIF(ENABLE_BENCHMARKS)
IF(ENABLE_UNIT_TESTS)
ADD_SUBDIRECTORY(unit_test)
ENDIF(ENABLE_UNIT_TESTS)
@ -2544,6 +2550,7 @@ is_enabled(HDF5_HAS_PAR_FILTERS HAS_PAR_FILTERS)
is_enabled(ENABLE_NCZARR_S3 HAS_NCZARR_S3)
is_enabled(ENABLE_NCZARR HAS_NCZARR)
is_enabled(ENABLE_NCZARR_S3_TESTS DO_NCZARR_S3_TESTS)
is_enabled(ENABLE_NCZARR_ZIP HAS_NCZARR_ZIP)
is_enabled(ENABLE_MULTIFILTERS HAS_MULTIFILTERS)
is_enabled(ENABLE_NCZARR_ZIP DO_NCZARR_ZIP_TESTS)
is_enabled(ENABLE_QUANTIZE HAS_QUANTIZE)
@ -2555,6 +2562,7 @@ is_enabled(HAVE_ZSTD HAS_ZSTD)
is_enabled(HAVE_BLOSC HAS_BLOSC)
is_enabled(HAVE_BZ2 HAS_BZ2)
# Generate file from template.
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/libnetcdf.settings.in"
"${CMAKE_CURRENT_BINARY_DIR}/libnetcdf.settings"
@ -2607,6 +2615,13 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/nc_test4/findplugin.in ${CMAKE_CURREN
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/nc_test4/findplugin.in ${CMAKE_CURRENT_BINARY_DIR}/plugins/findplugin.sh @ONLY NEWLINE_STYLE LF)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/nc_test4/findplugin.in ${CMAKE_CURRENT_BINARY_DIR}/examples/C/findplugin.sh @ONLY NEWLINE_STYLE LF)
IF(ENABLE_BENCHMARKS)
IF(ENABLE_PARALLEL4)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/nc_perf/run_par_bm_test.sh.in ${CMAKE_CURRENT_BINARY_DIR}/nc_perf/run_par_bm_test.sh @ONLY NEWLINE_STYLE LF)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/nc_perf/run_gfs_test.sh.in ${CMAKE_CURRENT_BINARY_DIR}/nc_perf/run_gfs_test.sh @ONLY NEWLINE_STYLE LF)
ENDIF(ENABLE_PARALLEL4)
ENDIF(ENABLE_BENCHMARKS)
IF(ENABLE_TESTS)
#####
# Build ncdap_test|dap4_test/findtestserver[4].c

View File

@ -7,6 +7,10 @@ This file contains a high-level description of this package's evolution. Release
## 4.9.2 - TBD
* Fix 'make distcheck' error in run_interop.sh. See [Github #????](https://github.com/Unidata/netcdf-c/pull/????).
* Update `nc-config` to remove inclusion from automatically-detected `nf-config` and `ncxx-config` files, as the wrong files could be included in the output. This is in support of [GitHub #2274](https://github.com/Unidata/netcdf-c/issues/2274).
* Update H5FDhttp.[ch] to work with HDF5 version 1.14.0. See [Github #2615](https://github.com/Unidata/netcdf-c/pull/2615).
## 4.9.1 - February 2, 2023
## Known Issues

View File

@ -325,13 +325,13 @@ fi
# Does the user want to turn off unit tests (useful for test coverage
# analysis).
AC_MSG_CHECKING([if unit tests should be disabled])
AC_MSG_CHECKING([if unit tests should be enabled])
AC_ARG_ENABLE([unit-tests],
[AS_HELP_STRING([--disable-unit-tests],
[AS_HELP_STRING([--enable-unit-tests],
[Disable tests in unit_test directory. Other tests still run.])])
test "x$enable_unit_tests" = xno || enable_unit_tests=yes
AC_MSG_RESULT($enable_unit_tests)
AM_CONDITIONAL([BUILD_UNIT_TESTS], [test "x$enable_unit_tests" = xyes])
AM_CONDITIONAL(BUILD_UNIT_TESTS, [test "x$enable_unit_tests" = xyes])
# Does the user require dynamic loading?
# This is only for those hdf5 installs that support it.
@ -781,20 +781,18 @@ AC_MSG_RESULT([${have_sz}])
##########
# See if we have libzip for NCZarr
AC_CHECK_LIB([zip],[zip_open],[have_zip=yes],[have_zip=no])
if test "x$have_zip" = "xyes" ; then
AC_SEARCH_LIBS([zip_open],[zip zip.dll cygzip.dll], [], [])
fi
AC_SEARCH_LIBS([zip_open],[zip zip.dll cygzip.dll],[have_zip=yes],[have_zip=no])
AC_MSG_CHECKING([whether libzip library is available])
AC_MSG_RESULT([${have_zip}])
enable_nczarr_zip=${have_zip} # alias
if test "x$enable_nczarr" = xno ; then
enable_nczarr_zip=no
enable_nczarr_zip=no
fi
AC_MSG_CHECKING([whether nczarr zip support is enabled])
AC_MSG_RESULT([${enable_nczarr_zip}])
@ -1226,7 +1224,7 @@ if test "x$enable_hdf5" = "xno" ; then
enable_dap4=no
fi
if test "x$ISOSX" = xyes && "x$have_libxml2" = xno ; then
if test "x$ISOSX" = xyes && test "x$have_libxml2" = xno ; then
AC_MSG_ERROR([Error: OSX requires libxml2 => --disable-dap4.])
enable_dap4=no
fi
@ -1934,6 +1932,7 @@ AC_SUBST([HAS_PAR_FILTERS], [$hdf5_supports_par_filters])
AC_SUBST(HAS_NCZARR_S3,[$enable_nczarr_s3])
AC_SUBST(HAS_NCZARR,[$enable_nczarr])
AC_SUBST(DO_NCZARR_S3_TESTS,[$enable_nczarr_s3_tests])
AC_SUBST(HAS_NCZARR_ZIP,[$enable_nczarr_zip])
AC_SUBST(HAS_MULTIFILTERS,[$has_multifilters])
AC_SUBST(DO_NCZARR_ZIP_TESTS,[$enable_nczarr_zip])
AC_SUBST(HAS_QUANTIZE,[$enable_quantize])

View File

@ -58,7 +58,7 @@ EXTRA_DIST = CMakeLists.txt test_common.h \
CLEANFILES = *.exe
# This should only be left behind if using parallel io
CLEANFILES += tmp_*
CLEANFILES += ${execdir}/baselinethredds/GOES16_CONUS_20170821_020218_0.47_1km_33.3N_91.4W.nc4.thredds
CLEANFILES += ${srcdir}/baselinethredds/GOES16_CONUS_20170821_020218_0.47_1km_33.3N_91.4W.nc4.thredds
DISTCLEANFILES = findtestserver4.c pingurl4.c

View File

@ -288,7 +288,7 @@ typedef struct NC_FILE_INFO
{
NC_OBJ hdr;
NC *controller; /**< Pointer to containing NC. */
#ifdef USE_PARALLEL4
#ifdef USE_PARALLEL
MPI_Comm comm; /**< Copy of MPI Communicator used to open the file. */
MPI_Info info; /**< Copy of MPI Information Object used to open the file. */
#endif

View File

@ -498,6 +498,7 @@ parseVlenField(NCD4parser* parser, NCD4node* container, ncxml_t xml, NCD4node**
if((ret = parseVariable(parser,container,x,&field)))
goto done;
}
if(field == NULL) {ret = NC_EBADTYPE; goto done;}
if(fieldp) *fieldp = field;
done:
return THROW(ret);

View File

@ -258,7 +258,7 @@ nc_http_write(NC_HTTP_STATE* state, const char* objecturl, NCbytes* payload)
Trace("write");
if((stat = nc_http_set_payload(state,ncbyteslength(payload),ncbytescontents(payload)))) goto fail;
if((stat = nc_http_set_method(state,HTTPPUT)));
if((stat = nc_http_set_method(state,HTTPPUT))) goto fail;
if((stat = setupconn(state,objecturl))) goto fail;
if((stat = execute(state)))
goto done;

View File

@ -5,7 +5,6 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
* Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
@ -105,7 +104,7 @@ typedef struct H5FD_http_t {
haddr_t eof; /* end of file; current file size */
haddr_t pos; /* current file I/O position */
unsigned write_access; /* Flag to indicate the file was opened with write access */
H5FD_http_file_op op; /* last operation */
H5FD_http_file_op op; /* last operation */
NC_HTTP_STATE* state; /* Curl handle + extra */
char* url; /* The URL (minus any fragment) for the dataset */
} H5FD_http_t;
@ -163,40 +162,54 @@ static herr_t H5FD_http_unlock(H5FD_t *_file);
/* Beware, not same as H5FD_HTTP_g */
static const H5FD_class_t H5FD_http_g = {
"http", /* name */
MAXADDR, /* maxaddr */
H5F_CLOSE_WEAK, /* fc_degree */
#ifndef H5FDCLASS1
H5FD_http_term, /* terminate */
#if H5_VERSION_GE(1,14,0)
H5FD_CLASS_VERSION, /* struct version */
H5_VFD_HTTP, /* value */
#endif
NULL, /* sb_size */
NULL, /* sb_encode */
NULL, /* sb_decode */
0, /* fapl_size */
NULL, /* fapl_get */
NULL, /* fapl_copy */
NULL, /* fapl_free */
0, /* dxpl_size */
NULL, /* dxpl_copy */
NULL, /* dxpl_free */
H5FD_http_open, /* open */
H5FD_http_close, /* close */
H5FD_http_cmp, /* cmp */
H5FD_http_query, /* query */
NULL, /* get_type_map */
H5FD_http_alloc, /* alloc */
NULL, /* free */
H5FD_http_get_eoa, /* get_eoa */
H5FD_http_set_eoa, /* set_eoa */
H5FD_http_get_eof, /* get_eof */
H5FD_http_get_handle, /* get_handle */
H5FD_http_read, /* read */
H5FD_http_write, /* write */
H5FD_http_flush, /* flush */
NULL, /* truncate */
H5FD_http_lock, /* lock */
H5FD_http_unlock, /* unlock */
H5FD_FLMAP_DICHOTOMY /* fl_map */
"http", /* name */
MAXADDR, /* maxaddr */
H5F_CLOSE_WEAK, /* fc_degree */
#ifndef H5FDCLASS1
H5FD_http_term, /* terminate */
#endif
NULL, /* sb_size */
NULL, /* sb_encode */
NULL, /* sb_decode */
0, /* fapl_size */
NULL, /* fapl_get */
NULL, /* fapl_copy */
NULL, /* fapl_free */
0, /* dxpl_size */
NULL, /* dxpl_copy */
NULL, /* dxpl_free */
H5FD_http_open, /* open */
H5FD_http_close, /* close */
H5FD_http_cmp, /* cmp */
H5FD_http_query, /* query */
NULL, /* get_type_map */
H5FD_http_alloc, /* alloc */
NULL, /* free */
H5FD_http_get_eoa, /* get_eoa */
H5FD_http_set_eoa, /* set_eoa */
H5FD_http_get_eof, /* get_eof */
H5FD_http_get_handle, /* get_handle */
H5FD_http_read, /* read */
H5FD_http_write, /* write */
#if H5_VERSION_GE(1,14,0)
NULL, /* read_vector */
NULL, /* write_vector */
NULL, /* read_selection */
NULL, /* write_selection */
#endif
H5FD_http_flush, /* flush */
NULL, /* truncate */
H5FD_http_lock, /* lock */
H5FD_http_unlock, /* unlock */
#if H5_VERSION_GE(1,14,0)
NULL, /* del */
NULL, /* ctl */
#endif
H5FD_FLMAP_DICHOTOMY /* fl_map */
};

View File

@ -5,7 +5,6 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
* Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
@ -30,7 +29,12 @@
#include "H5Ipublic.h"
#if H5_VERSION_GE(1,14,0)
#define H5_VFD_HTTP ((H5FD_class_value_t)(514))
#define H5FD_HTTP (H5FDperform_init(H5FD_http_init))
#else
#define H5FD_HTTP (H5FD_http_init())
#endif
#ifdef __cplusplus
extern "C" {

View File

@ -39,8 +39,10 @@ PnetCDF Support: @HAS_PNETCDF@
DAP2 Support: @HAS_DAP2@
DAP4 Support: @HAS_DAP4@
Byte-Range Support: @HAS_BYTERANGE@
NCZarr Support: @HAS_NCZARR@
NCZarr S3 Support: @HAS_NCZARR_S3@
NCZarr Zip Support: @HAS_NCZARR_ZIP@
Diskless Support: @HAS_DISKLESS@
MMap Support: @HAS_MMAP@
@ -48,7 +50,6 @@ JNA Support: @HAS_JNA@
ERANGE Fill Support: @HAS_ERANGE_FILL@
Relaxed Boundary Check: @RELAX_COORD_BOUND@
NCZarr Support: @HAS_NCZARR@
Multi-Filter Support: @HAS_MULTIFILTERS@
Quantization: @HAS_QUANTIZE@
Logging: @HAS_LOGGING@

View File

@ -175,10 +175,12 @@ dup_NC_var(const NC_var *rvarp)
return NULL;
}
(void) memcpy(varp->shape, rvarp->shape,
rvarp->ndims * sizeof(size_t));
(void) memcpy(varp->dsizes, rvarp->dsizes,
rvarp->ndims * sizeof(off_t));
if(rvarp->shape != NULL)
(void) memcpy(varp->shape, rvarp->shape,
rvarp->ndims * sizeof(size_t));
if(rvarp->dsizes != NULL)
(void) memcpy(varp->dsizes, rvarp->dsizes,
rvarp->ndims * sizeof(off_t));
varp->xsz = rvarp->xsz;
varp->len = rvarp->len;
varp->begin = rvarp->begin;

View File

@ -139,40 +139,6 @@ fi
version="@PACKAGE@ @VERSION@"
has_fortran="no"
has_f90="no"
has_f03="no"
nfconf=$(which nf-config 2>/dev/null)
if [ -f "$nfconf" ]; then
has_fortran="yes"
fc=`nf-config --fc`
fflags=`nf-config --fflags`
flibs=`nf-config --flibs`
has_f90=`nf-config --has-f90`
has_f03=`nf-config --has-f03`
fi
has_cxx="no"
has_cxx4="no"
ncxxconf=$(which ncxx-config 2>/dev/null)
ncxx4conf=$(which ncxx4-config 2>/dev/null)
if [ -f "$ncxx4conf" ]; then
cxx4=`ncxx4-config --cxx`
cxx4flags=`ncxx4-config --cflags`
cxx4libs=`ncxx4-config --libs`
has_cxx4="yes"
elif [ -f "$ncxxconf" ]; then
cxx=`ncxx-config --cxx`
cxxflags=`ncxx-config --cflags`
cxxlibs=`ncxx-config --libs`
has_cxx="yes"
fi
usage()
{
cat <<EOF
@ -184,9 +150,7 @@ Available values for OPTION include:
--all display all options
--cc C compiler
--cflags pre-processor and compiler flags
--has-c++ whether C++ API is installed
--has-c++4 whether netCDF-4 C++ API is installed
--has-fortran whether Fortran API is installed
--has-dap2 whether OPeNDAP (DAP2) is enabled in this build
--has-dap4 whether DAP4 is enabled in this build
--has-dap same as --has-dap2 (Deprecated)
@ -216,28 +180,7 @@ Available values for OPTION include:
--version Library version
EOF
if [ -f "$ncxx4conf" ]; then
cat <<EOF
--cxx4 C++ compiler for netCDF-4 C++ library
--cxx4flags flags needed to compile a C++ program
--cxx4libs libraries needed to link a C++ program
EOF
elif [ -f "$ncxxconf" ]; then
cat <<EOF
--cxx C++ compiler
--cxxflags flags needed to compile a C++ program
--cxxlibs libraries needed to link a C++ program
EOF
fi
if [ -f "$nfconf" ]; then
cat <<EOF
--fc Fortran compiler
--fflags flags needed to compile a Fortran program
--flibs libraries needed to link a Fortran program
--has-f90 whether Fortran 90 API is installed
--has-f03 whether Fortran 03 API is installed (implies F90).
EOF
fi
exit $1
}
@ -251,30 +194,7 @@ all()
echo " --libs -> $libs"
echo " --static -> $libsprivate"
echo
echo " --has-c++ -> $has_cxx"
echo " --cxx -> $cxx"
if [ -f "$ncxxconf" ]; then
echo " --cxxflags -> $cxxflags"
echo " --cxxlibs -> $cxxlibs"
fi
echo
echo " --has-c++4 -> $has_cxx4"
echo " --cxx4 -> $cxx4"
if [ -f "$ncxx4conf" ]; then
echo " --cxx4flags -> $cxx4flags"
echo " --cxx4libs -> $cxx4libs"
fi
echo
echo " --has-fortran -> $has_fortran"
if [ -f "$nfconf" ]; then
echo " --fc -> $fc"
echo " --fflags -> $fflags"
echo " --flibs -> $flibs"
echo " --has-f90 -> $has_f90"
echo " --has-f03 -> $has_f03"
echo
fi
echo
echo " --has-dap -> $has_dap2"
echo " --has-dap2 -> $has_dap2"

View File

@ -41,40 +41,6 @@ has_stdfilters="@STD_FILTERS@"
version="@PACKAGE_NAME@ @PACKAGE_VERSION@"
HAS_STATIC=""
has_fortran="no"
has_f90="no"
has_f03="no"
nfconf=$(which nf-config 2>/dev/null)
if [ -f "$nfconf" ]; then
has_fortran="yes"
fc=`nf-config --fc`
fflags=`nf-config --fflags`
flibs=`nf-config --flibs`
has_f90=`nf-config --has-f90`
has_f03=`nf-config --has-f03`
fi
has_cxx="no"
has_cxx4="no"
ncxxconf=$(which ncxx-config 2>/dev/null)
ncxx4conf=$(which ncxx4-config 2>/dev/null)
if [ -f "$ncxx4conf" ]; then
cxx4=`ncxx4-config --cxx`
cxx4flags=`ncxx4-config --cflags`
cxx4libs=`ncxx4-config --libs`
has_cxx4="yes"
elif [ -f "$ncxxconf" ]; then
cxx=`ncxx-config --cxx`
cxxflags=`ncxx-config --cflags`
cxxlibs=`ncxx-config --libs`
has_cxx="yes"
fi
usage()
{
cat <<EOF
@ -86,9 +52,7 @@ Available values for OPTION include:
--all display all options
--cc C compiler
--cflags pre-processor and compiler flags
--has-c++ whether C++ API is installed
--has-c++4 whether netCDF-4 C++ API is installed
--has-fortran whether Fortran API is installed
--has-dap2 whether OPeNDAP (DAP2) is enabled in this build
--has-dap4 whether DAP4 is enabled in this build
--has-dap same as --has-dap2 (Deprecated)
@ -118,28 +82,7 @@ Available values for OPTION include:
--version Library version
EOF
if [ -f "$ncxx4conf" ]; then
cat <<EOF
--cxx4 C++ compiler for netCDF-4 C++ library
--cxx4flags flags needed to compile a C++ program
--cxx4libs libraries needed to link a C++ program
EOF
elif [ -f "$ncxxconf" ]; then
cat <<EOF
--cxx C++ compiler
--cxxflags flags needed to compile a C++ program
--cxxlibs libraries needed to link a C++ program
EOF
fi
if [ -f "$nfconf" ]; then
cat <<EOF
--fc Fortran compiler
--fflags flags needed to compile a Fortran program
--flibs libraries needed to link a Fortran program
--has-f90 whether Fortran 90 API is installed
--has-f03 whether Fortran 03 API is installed (implies F90).
EOF
fi
exit $1
}
@ -152,32 +95,6 @@ all()
echo " --cflags -> $cflags"
echo " --libs -> $libs"
echo " --static -> $libsprivate"
echo
echo " --has-c++ -> $has_cxx"
echo " --cxx -> $cxx"
if [ -f "$ncxxconf" ]; then
echo " --cxxflags -> $cxxflags"
echo " --cxxlibs -> $cxxlibs"
fi
echo
echo " --has-c++4 -> $has_cxx4"
echo " --cxx4 -> $cxx4"
if [ -f "$ncxx4conf" ]; then
echo " --cxx4flags -> $cxx4flags"
echo " --cxx4libs -> $cxx4libs"
fi
echo
echo " --has-fortran -> $has_fortran"
if [ -f "$nfconf" ]; then
echo " --fc -> $fc"
echo " --fflags -> $fflags"
echo " --flibs -> $flibs"
echo " --has-f90 -> $has_f90"
echo " --has-f03 -> $has_f03"
echo
fi
echo " --has-dap -> $has_dap"
echo " --has-dap2 -> $has_dap"
echo " --has-dap4 -> $has_dap4"
@ -355,62 +272,6 @@ while test $# -gt 0; do
echo $version
;;
--has-c++)
echo $has_cxx
;;
--cxx)
echo $cxx
;;
--cxxflags)
echo $cxxflags
;;
--cxxlibs)
echo $cxxlibs
;;
--has-c++4)
echo $has_cxx4
;;
--cxx4)
echo $cxx4
;;
--cxx4flags)
echo $cxx4flags
;;
--cxx4libs)
echo $cxx4libs
;;
--has-fortran)
echo $has_fortran
;;
--fc)
echo $fc
;;
--fflags)
echo $fflags
;;
--flibs)
echo $flibs
;;
--has-f90)
echo $has_f90
;;
--has-f03)
echo $has_f03
;;
*)
echo "unknown option: $1"
usage 1

View File

@ -24,8 +24,10 @@ add_bin_test(nc_perf tst_files3 tst_utils.c)
add_bin_test(nc_perf tst_mem tst_utils.c)
add_bin_test(nc_perf tst_wrf_reads tst_utils.c)
add_bin_test(nc_perf tst_attsperf tst_utils.c)
add_bin_test(nc_perf tst_bm_rando tst_utils.c)
add_bin_test(nc_perf tst_compress tst_utils.c)
add_sh_test(nc_perf run_knmi_bm)
#add_sh_test(nc_perf run_knmi_bm)
add_sh_test(nc_perf perftest)
add_sh_test(nc_perf run_tst_chunks)
add_sh_test(nc_perf run_bm_elena)
@ -36,9 +38,11 @@ add_sh_test(nc_perf run_bm_test2)
# This will run a parallel I/O benchmark for parallel builds.
IF(TEST_PARALLEL4)
add_bin_test(nc_perf tst_compress_par tst_utils.c)
add_sh_test(nc_perf run_par_bm_test)
ENDIF()
ENDIF()
ENDIF(TEST_PARALLEL4)
ENDIF(BUILD_UTILITIES)
FILE(GLOB COPY_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.sh)
FILE(COPY ${COPY_FILES} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/ FILE_PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE)
ADD_EXTRA_DIST(run_par_bm_test.sh.in run_knmi_bm.sh CMakeLists.txt
perftest.sh run_bm_test1.sh run_bm_test2.sh)

0
nc_perf/run_gfs_test.sh.in Normal file → Executable file
View File

0
nc_perf/run_par_bm_test.sh.in Normal file → Executable file
View File

View File

@ -23,7 +23,6 @@
#include <string.h>
#include <math.h>
#include <netcdf.h>
#include <netcdf_par.h>
#include <netcdf_meta.h>
#define TEST_NAME "tst_compress"

View File

@ -170,8 +170,8 @@ equal(const double x,
/* because in-memory data type char can be signed or unsigned,
* type cast the value from external NC_CHAR before the comparison
*/
char x2 = (char) x;
char y2 = (char) y;
char x2 = *(char *)&x;
char y2 = *(char *)&y;
return ABS(x2-y2) <= epsilon * MAX( ABS(x2), ABS(y2));
}
@ -194,8 +194,8 @@ equal2(const double x,
/* because in-memory data type char can be signed or unsigned,
* type cast the value from external NC_CHAR before the comparison
*/
char x2 = (char) x;
char y2 = (char) y;
char x2 = *(char *)&x;
char y2 = *(char *)&y;
return ABS(x2-y2) <= epsilon * MAX( ABS(x2), ABS(y2));
}
@ -343,7 +343,7 @@ int dbl2nc ( const double d, const nc_type xtype, void *p)
* reporting it as a range error.
*/
if ( r < X_CHAR_MIN || r > X_CHAR_MAX ) return 2;
*((signed char*) p) = (signed char)r;
*((unsigned char*) p) = (unsigned char)r;
break;
case NC_BYTE:
r = floor(0.5+d);
@ -413,8 +413,8 @@ int dbl2nc ( const double d, const nc_type xtype, void *p)
double
hash( const nc_type xtype, const int rank, const size_t *index )
{
double base;
double result;
double base = 0;
double result = 0;
int d; /* index of dimension */
/* If vector then elements 0 & 1 are min & max. Elements 2 & 3 are */
@ -841,7 +841,7 @@ put_atts(int ncid)
for (j = 0; j < NATTS(i); j++) {
if (ATT_TYPE(i,j) == NC_CHAR) {
for (k = 0; k < ATT_LEN(i,j); k++) {
catt[k] = (char) hash(ATT_TYPE(i,j), -1, &k);
catt[k] = (unsigned char) hash(ATT_TYPE(i,j), -1, &k);
}
err = nc_put_att_text(ncid, i, ATT_NAME(i,j),
ATT_LEN(i,j), catt);
@ -969,7 +969,7 @@ check_dims(int ncid)
void
check_vars(int ncid)
{
size_t index[MAX_RANK];
size_t index[MAX_RANK] = {0};
char text, name[NC_MAX_NAME];
int i, err; /* status */
size_t j;
@ -1006,7 +1006,7 @@ check_vars(int ncid)
err = nc_get_var1_text(ncid, i, index, &text);
IF (err)
error("nc_get_var1_text: %s", nc_strerror(err));
IF (text != (char)expect) {
IF ((unsigned char)text != (unsigned char)expect) {
error("Var %s [%lu] value read %hhd not that expected %g ",
var_name[i], j, text, expect);
print_n_size_t(var_rank[i], index);
@ -1073,8 +1073,9 @@ check_atts(int ncid)
error("nc_get_att_text: %s", nc_strerror(err));
for (k = 0; k < ATT_LEN(i,j); k++) {
expect = hash(xtype, -1, &k);
IF (text[k] != (char)expect) {
error("nc_get_att_text: unexpected value");
IF ((unsigned char)text[k] != (unsigned char)expect) {
error("Var %s [%lu] value read %hhd not that expected %g ",
var_name[i], j, text, expect);
} else {
nok++;
}

View File

@ -164,7 +164,8 @@ ref_string.cdl ref_string_nczarr.baseline ref_string_zarr.baseline ref_scalar.cd
ref_nulls_nczarr.baseline ref_nulls_zarr.baseline ref_nulls.cdl
# Interoperability files
EXTRA_DIST += ref_power_901_constants_orig.zip ref_power_901_constants.cdl ref_quotes_orig.zip ref_quotes.cdl
EXTRA_DIST += ref_power_901_constants_orig.zip ref_power_901_constants.cdl ref_quotes_orig.zip ref_quotes.cdl \
ref_zarr_test_data.cdl.gz
CLEANFILES = ut_*.txt ut*.cdl tmp*.nc tmp*.cdl tmp*.txt tmp*.dmp tmp*.zip tmp*.nc tmp*.dump tmp*.tmp tmp_ngc.c ref_zarr_test_data.cdl tst_*.nc.zip ref_quotes.zip ref_power_901_constants.zip

View File

@ -17,35 +17,35 @@ UB="${NCZARR_S3_TEST_BUCKET}"
testcasefile() {
zext=file
ref=$1
base=$1
mode=$2
metaonly=$3
if test "x$metaonly" = xmetaonly ; then flags="-h"; fi
fileargs ${execdir}/$ref "mode=$mode,$zext"
rm -f tmp_${ref}_${zext}.cdl
${NCDUMP} $flags $fileurl > tmp_${ref}_${zext}.cdl
diff -b ${srcdir}/${ref}.cdl tmp_${ref}_${zext}.cdl
fileargs ${builddir}/ref_$base "mode=$mode,$zext"
rm -f tmp_${base}_${zext}.cdl
${NCDUMP} $flags $fileurl > tmp_${base}_${zext}.cdl
diff -b ${srcdir}/ref_${base}.cdl tmp_${base}_${zext}.cdl
}
testcasezip() {
zext=zip
ref=$1
base=$1
mode=$2
fileargs $ref "mode=$mode,$zext"
rm -f tmp_${ref}_${zext}.cdl
${NCDUMP} -h $flags $fileurl > tmp_${ref}_${zext}.cdl
diff -b ${srcdir}/${ref}.cdl tmp_${ref}_${zext}.cdl
fileargs ${builddir}/ref_$base "mode=$mode,$zext"
rm -f tmp_${base}_${zext}.cdl
${NCDUMP} -h $flags $fileurl > tmp_${base}_${zext}.cdl
diff -b ${srcdir}/ref_${base}.cdl tmp_${base}_${zext}.cdl
}
testcases3() {
zext=s3
zarr=$1
ref=$2
mode=$3
rm -f tmp_${zarr}_${zext}.cdl
url="https://${UH}/${UB}/${zarr}#mode=${mode},s3"
${NCDUMP} $url > tmp_${zarr}_${zext}.cdl
diff -b ${srcdir}/${ref}.cdl tmp_${zarr}_${zext}.cdl
base=$1
mode=$2
rm -f tmp_${base}_${zext}.cdl
url="https://${UH}/${UB}/${base}.zarr#mode=${mode},s3"
${NCDUMP} $url > tmp_${base}_${zext}.cdl
# Find the proper ref file
diff -b ${builddir}/ref_${base}.cdl tmp_${base}_${zext}.cdl
}
testallcases() {
@ -54,27 +54,35 @@ case "$zext" in
file)
# need to unpack
rm -fr ref_power_901_constants ref_power_901_constants.file
unzip ${srcdir}/ref_power_901_constants_orig.zip > /dev/null
mv ref_power_901_constants ref_power_901_constants.file
testcasefile ref_power_901_constants zarr metaonly; # test xarray as default
if ! test -f ${builddir}/ref_power_901_constants_orig.zip ; then
cp -f ${srcdir}/ref_power_901_constants_orig.zip ${builddir}/ref_power_901_constants_orig.zip
fi
unzip ${builddir}/ref_power_901_constants_orig.zip > /dev/null
mv ${builddir}/ref_power_901_constants ${builddir}/ref_power_901_constants.file
testcasefile power_901_constants zarr metaonly; # test xarray as default
;;
zip)
# Move into position
cp ${srcdir}/ref_power_901_constants_orig.zip ${execdir}/ref_power_901_constants.zip
cp ${srcdir}/ref_quotes_orig.zip ${execdir}/ref_quotes.zip
testcasezip ref_power_901_constants xarray metaonly
if ! test -f ${builddir}/ref_power_901_constants.zip ; then
cp -f ${srcdir}/ref_power_901_constants_orig.zip ${builddir}/ref_power_901_constants.zip
fi
if ! test -f ${builddir}/ref_quotes.zip ; then
cp -f ${srcdir}/ref_quotes_orig.zip ${builddir}/ref_quotes.zip
fi
testcasezip power_901_constants xarray metaonly
# Test large constant interoperability
testcasezip ref_quotes zarr metaonly
testcasezip quotes zarr metaonly
;;
s3)
# Read a test case created by netcdf-java zarr.
# Move into position
rm -f ${execdir}/ref_zarr_test_data.cdl
# Use gunzip because it always appears to be available
if ! test -f ${srcdir}/ref_zarr_test_data.cdl ; then
gunzip -c ${srcdir}/ref_zarr_test_data.cdl.gz > ${srcdir}/ref_zarr_test_data.cdl
rm -f ${builddir}/ref_zarr_test_data.cdl
if ! test -f ${builddir}/ref_zarr_test_data.cdl.gz ; then
cp -f ${srcdir}/ref_zarr_test_data.cdl.gz ${builddir}/ref_zarr_test_data.cdl.gz
fi
testcases3 zarr_test_data.zarr ref_zarr_test_data xarray
# Use gunzip because it always appears to be available
gunzip -c ${builddir}/ref_zarr_test_data.cdl.gz > ${builddir}/ref_zarr_test_data.cdl
testcases3 zarr_test_data xarray
;;
*) echo "unimplemented kind: $1" ; exit 1;;
esac
@ -83,9 +91,9 @@ esac
testallcases file
if test "x$FEATURE_NCZARR_ZIP" = xyes ; then testallcases zip; fi
if test "x$FEATURE_S3TESTS" = xyes ; then testallcases s3; fi
exit
# Cleanup
rm -fr ${execdir}/ref_power_901_constants.file
rm -f ${execdir}/ref_zarr_test_data.cdl
rm -fr ${builddir}/ref_power_901_constants_orig.zip
rm -fr ${builddir}/ref_zarr_test_data.cdl.gz
exit 0

View File

@ -128,7 +128,7 @@ main(int argc, char** argv)
dumpoptions.nctype = NC_UBYTE; /* default */
while ((c = getopt(argc, argv, "df:k:p:t:T:u:v")) != EOF) {
while ((c = getopt(argc, argv, "df:hk:p:t:T:u:v")) != EOF) {
switch(c) {
case 'd':
dumpoptions.debug = 1;
@ -136,6 +136,9 @@ main(int argc, char** argv)
case 'f':
dumpoptions.filename = strdup(optarg);
break;
case 'h':
usage();
return 0;
case 'k': {
size_t len = strlen(optarg);
dumpoptions.key = (char*)malloc(len+1+1);