mirror of
https://github.com/Unidata/netcdf-c.git
synced 2024-11-27 07:30:33 +08:00
Merge branch 'master' into cleanncgen.dmh
This commit is contained in:
commit
61a6c0c183
@ -381,13 +381,6 @@ OPTION(ENABLE_MMAP "Use MMAP." ON)
|
||||
# Option to use examples.
|
||||
OPTION(ENABLE_EXAMPLES "Build Examples" ON)
|
||||
|
||||
# Option to use Diskless
|
||||
OPTION(ENABLE_DISKLESS "Build Diskless." ON)
|
||||
IF(ENABLE_DISKLESS)
|
||||
SET(BUILD_DISKLESS ON)
|
||||
SET(USE_DISKLESS ON)
|
||||
ENDIF()
|
||||
|
||||
# Option Logging, only valid for netcdf4.
|
||||
OPTION(ENABLE_LOGGING "Enable Logging." OFF)
|
||||
IF(ENABLE_LOGGING)
|
||||
@ -1174,6 +1167,10 @@ IF(ENABLE_DOXYGEN)
|
||||
ENDIF(NC_DOT)
|
||||
ENDIF()
|
||||
|
||||
# Always enable DISKLESS
|
||||
OPTION(ENABLE_DISKLESS "Enable in-memory files" ON)
|
||||
|
||||
|
||||
# By default, MSVC has a stack size of 1000000.
|
||||
# Allow a user to override this.
|
||||
IF(MSVC)
|
||||
@ -1857,7 +1854,7 @@ is_enabled(ENABLE_PARALLEL4 HAS_PARALLEL4)
|
||||
is_enabled(ENABLE_DAP HAS_DAP)
|
||||
is_enabled(ENABLE_DAP HAS_DAP2)
|
||||
is_enabled(ENABLE_DAP4 HAS_DAP4)
|
||||
is_enabled(USE_DISKLESS HAS_DISKLESS)
|
||||
is_enabled(ENABLE_DISKLESS HAS_DISKLESS)
|
||||
is_enabled(USE_MMAP HAS_MMAP)
|
||||
is_enabled(JNA HAS_JNA)
|
||||
is_enabled(STATUS_RELAX_COORD_BOUND RELAX_COORD_BOUND)
|
||||
|
6
cf
6
cf
@ -108,7 +108,7 @@ FLAGS="$FLAGS --enable-extreme-numbers"
|
||||
#FLAGS="$FLAGS --enable-dap-auth-tests" -- requires a new remotetest server
|
||||
#FLAGS="$FLAGS --enable-doxygen --enable-internal-docs"
|
||||
FLAGS="$FLAGS --enable-logging"
|
||||
#FLAGS="$FLAGS --disable-diskless"
|
||||
FLAGS="$FLAGS --disable-diskless"
|
||||
#FLAGS="$FLAGS --enable-mmap"
|
||||
#FLAGS="$FLAGS --with-udunits"
|
||||
#FLAGS="$FLAGS --with-libcf"
|
||||
@ -116,8 +116,8 @@ FLAGS="$FLAGS --enable-logging"
|
||||
#FLAGS="$FLAGS --disable-properties-attribute"
|
||||
#FLAGS="$FLAGS --disable-silent-rules"
|
||||
#FLAGS="$FLAGS --with-testservers=remotestserver.localhost:8083"
|
||||
#FLAGS="$FLAGS --disable-filter-testing"
|
||||
FLAGS="$FLAGS --enable-metadata-perf"
|
||||
FLAGS="$FLAGS --disable-filter-testing"
|
||||
#FLAGS="$FLAGS --enable-metadata-perf"
|
||||
|
||||
if test "x$PAR4" != x1 ; then
|
||||
FLAGS="$FLAGS --disable-parallel4"
|
||||
|
25
configure.ac
25
configure.ac
@ -742,20 +742,6 @@ AC_CHECK_FUNCS([strlcat snprintf \
|
||||
mkstemp mktemp random \
|
||||
getrlimit gettimeofday fsync MPI_Comm_f2c])
|
||||
|
||||
# Does the user want to use NC_DISKLESS?
|
||||
AC_MSG_CHECKING([whether in-memory files are enabled])
|
||||
AC_ARG_ENABLE([diskless],
|
||||
[AS_HELP_STRING([--disable-diskless],
|
||||
[disable support for in-memory (NC_DISKLESS) files])])
|
||||
test "x$enable_diskless" = xno || enable_diskless=yes
|
||||
AC_MSG_RESULT($enable_diskless)
|
||||
|
||||
# If DAP enabled and diskless not enabled, then warn of consequences
|
||||
if test "x$enable_dap" = "xyes" -a "x$enable_diskless" = xno ; then
|
||||
AC_MSG_NOTICE([Warning: DAP support is enabled but diskless support is disabled.])
|
||||
AC_MSG_NOTICE([=> temporary files will be created + reclaimed when using DAP.])
|
||||
fi
|
||||
|
||||
# disable dap4 if netcdf-4 is disabled
|
||||
if test "x$enable_netcdf_4" = "xno" ; then
|
||||
AC_MSG_WARN([netcdf-4 not enabled; disabling DAP4])
|
||||
@ -785,12 +771,8 @@ if test "x$ac_cv_func_mmap_fixed_mapped" != xyes -o "x$ac_cv_func_mremap" != xye
|
||||
enable_mmap=no
|
||||
fi
|
||||
|
||||
# Setup the diskless and mmap conditionals
|
||||
if test "x$enable_diskless" = xyes ; then
|
||||
AC_DEFINE([USE_DISKLESS], [1], [if true, include NC_DISKLESS and NC_INMEMORY code])
|
||||
if test "x$enable_mmap" = xyes; then
|
||||
if test "x$enable_mmap" = xyes; then
|
||||
AC_DEFINE([USE_MMAP], [1], [if true, use mmap for in-memory files])
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_FUNC_ALLOCA
|
||||
@ -1211,7 +1193,6 @@ AM_CONDITIONAL(USE_RENAMEV3, [test x$enable_netcdf_4 = xyes -o x$enable_dap = xy
|
||||
AM_CONDITIONAL(BUILD_FORTRAN, [test x$enable_remote_fortran_bootstrap = xyes])
|
||||
AM_CONDITIONAL(USE_PNETCDF, [test x$enable_pnetcdf = xyes])
|
||||
AM_CONDITIONAL(USE_DISPATCH, [test x$enable_dispatch = xyes])
|
||||
AM_CONDITIONAL(BUILD_DISKLESS, [test x$enable_diskless = xyes])
|
||||
AM_CONDITIONAL(BUILD_MMAP, [test x$enable_mmap = xyes])
|
||||
AM_CONDITIONAL(BUILD_DOCS, [test x$enable_doxygen = xyes])
|
||||
AM_CONDITIONAL(SHOW_DOXYGEN_TAG_LIST, [test x$enable_doxygen_tasks = xyes])
|
||||
@ -1345,7 +1326,7 @@ AC_SUBST(HAS_LOGGING, [$enable_logging])
|
||||
AC_SUBST(HAS_SZLIB,[$enable_szlib])
|
||||
AC_SUBST(HAS_PARALLEL,[$enable_parallel])
|
||||
AC_SUBST(HAS_PARALLEL4,[$enable_parallel4])
|
||||
AC_SUBST(HAS_DISKLESS,[$enable_diskless])
|
||||
AC_SUBST(HAS_DISKLESS,[yes])
|
||||
AC_SUBST(HAS_MMAP,[$enable_mmap])
|
||||
AC_SUBST(HAS_JNA,[$enable_jna])
|
||||
AC_SUBST(RELAX_COORD_BOUND,[$enable_relax_coord_bound])
|
||||
@ -1409,7 +1390,7 @@ AX_SET_META([NC_HAS_HDF5],[$enable_netcdf_4],[yes])
|
||||
AX_SET_META([NC_HAS_SZIP],[$ac_cv_func_H5Z_SZIP],[yes])
|
||||
AX_SET_META([NC_HAS_DAP2],[$enable_dap],[yes])
|
||||
AX_SET_META([NC_HAS_DAP4],[$enable_dap4],[yes])
|
||||
AX_SET_META([NC_HAS_DISKLESS],[$enable_diskless],[yes])
|
||||
AX_SET_META([NC_HAS_DISKLESS],[yes],[yes])
|
||||
AX_SET_META([NC_HAS_MMAP],[$enable_mmap],[yes])
|
||||
AX_SET_META([NC_HAS_JNA],[$enable_jna],[yes])
|
||||
AX_SET_META([NC_HAS_PNETCDF],[$enable_pnetcdf],[yes])
|
||||
|
@ -12,9 +12,7 @@ if BUILD_PARALLEL
|
||||
include_HEADERS += netcdf_par.h
|
||||
endif
|
||||
|
||||
if BUILD_DISKLESS
|
||||
include_HEADERS += netcdf_mem.h
|
||||
endif
|
||||
|
||||
noinst_HEADERS = nc_logging.h nc_tests.h fbits.h nc.h nclist.h \
|
||||
ncuri.h ncutf8.h ncdispatch.h ncdimscale.h netcdf_f.h err_macros.h \
|
||||
|
@ -368,16 +368,13 @@ NCD2_open(const char* path, int mode,
|
||||
/* Now, use the file to create the hidden, in-memory netcdf file.
|
||||
We want this hidden file to always be NC_CLASSIC, so we need to
|
||||
force default format temporarily in case user changed it.
|
||||
If diskless is enabled, then create file in-memory, else
|
||||
create an actual temporary file in the file system.
|
||||
Since diskless is enabled, create file in-memory.
|
||||
*/
|
||||
{
|
||||
int new = 0; /* format netcdf-3 */
|
||||
int old = 0;
|
||||
int ncflags = NC_CLOBBER|NC_CLASSIC_MODEL;
|
||||
#ifdef USE_DISKLESS
|
||||
ncflags |= NC_DISKLESS;
|
||||
#endif
|
||||
nc_set_default_format(new,&old); /* save and change */
|
||||
ncstat = nc_create(tmpname,ncflags,&nc3id);
|
||||
nc_set_default_format(old,&new); /* restore */
|
||||
|
@ -101,17 +101,14 @@ NCD4_open(const char * path, int mode,
|
||||
/* Now, use the file to create the hidden substrate netcdf file.
|
||||
We want this hidden file to always be NC_NETCDF4, so we need to
|
||||
force default format temporarily in case user changed it.
|
||||
If diskless is enabled, then create file in-memory, else
|
||||
create an actual temporary file in the file system.
|
||||
Since diskless is enabled, create file in-memory.
|
||||
*/
|
||||
{
|
||||
int new = NC_NETCDF4;
|
||||
int old = 0;
|
||||
int ncid = 0;
|
||||
int ncflags = NC_NETCDF4|NC_CLOBBER;
|
||||
#ifdef USE_DISKLESS
|
||||
ncflags |= NC_DISKLESS;
|
||||
#endif
|
||||
if(FLAGSET(d4info->controls.debugflags,NCF_DEBUG_COPY)) {
|
||||
/* Cause data to be dumped to real file */
|
||||
ncflags |= NC_WRITE;
|
||||
|
@ -573,14 +573,10 @@ named foo.nc. The initial size is set to 4096.
|
||||
int
|
||||
nc_create_mem(const char* path, int mode, size_t initialsize, int* ncidp)
|
||||
{
|
||||
#ifdef USE_DISKLESS
|
||||
if(mode & (NC_MPIIO|NC_MPIPOSIX|NC_MMAP))
|
||||
return NC_EINVAL;
|
||||
mode |= (NC_INMEMORY|NC_NOCLOBBER); /* Specifically, do not set NC_DISKLESS */
|
||||
return NC_create(path, mode, initialsize, 0, NULL, 0, NULL, ncidp);
|
||||
#else
|
||||
return NC_EDISKLESS;
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
@ -838,7 +834,6 @@ if (status != NC_NOERR) handle_error(status);
|
||||
int
|
||||
nc_open_mem(const char* path, int mode, size_t size, void* memory, int* ncidp)
|
||||
{
|
||||
#ifdef USE_DISKLESS
|
||||
NC_memio meminfo;
|
||||
|
||||
/* Sanity checks */
|
||||
@ -851,9 +846,6 @@ nc_open_mem(const char* path, int mode, size_t size, void* memory, int* ncidp)
|
||||
meminfo.memory = memory;
|
||||
meminfo.flags = NC_MEMIO_LOCKED;
|
||||
return NC_open(path, mode, 0, NULL, 0, &meminfo, ncidp);
|
||||
#else
|
||||
return NC_EDISKLESS;
|
||||
#endif
|
||||
}
|
||||
|
||||
/** \ingroup datasets
|
||||
@ -907,7 +899,6 @@ if (status != NC_NOERR) handle_error(status);
|
||||
int
|
||||
nc_open_memio(const char* path, int mode, NC_memio* params, int* ncidp)
|
||||
{
|
||||
#ifdef USE_DISKLESS
|
||||
/* Sanity checks */
|
||||
if(path == NULL || params == NULL)
|
||||
return NC_EINVAL;
|
||||
@ -917,9 +908,6 @@ nc_open_memio(const char* path, int mode, NC_memio* params, int* ncidp)
|
||||
return NC_EINVAL;
|
||||
mode |= (NC_INMEMORY);
|
||||
return NC_open(path, mode, 0, NULL, 0, params, ncidp);
|
||||
#else
|
||||
return NC_EINMEMORY;
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1441,7 +1429,6 @@ and release its netCDF ID:
|
||||
int
|
||||
nc_close_memio(int ncid, NC_memio* memio)
|
||||
{
|
||||
#ifdef USE_DISKLESS
|
||||
NC* ncp;
|
||||
int stat = NC_check_id(ncid, &ncp);
|
||||
if(stat != NC_NOERR) return stat;
|
||||
@ -1460,9 +1447,6 @@ nc_close_memio(int ncid, NC_memio* memio)
|
||||
}
|
||||
}
|
||||
return stat;
|
||||
#else
|
||||
return NC_EINMEMORY;
|
||||
#endif
|
||||
}
|
||||
|
||||
/** \ingroup datasets
|
||||
@ -1879,14 +1863,6 @@ check_create_mode(int mode)
|
||||
(mode & NC_MPIPOSIX && mode & NC_DISKLESS))
|
||||
return NC_EINVAL;
|
||||
|
||||
#ifndef USE_DISKLESS
|
||||
/* If diskless is requested, but not built, return error. */
|
||||
if (mode & NC_DISKLESS)
|
||||
return NC_ENOTBUILT;
|
||||
if (mode & NC_INMEMORY)
|
||||
return NC_ENOTBUILT;
|
||||
#endif
|
||||
|
||||
#ifndef USE_NETCDF4
|
||||
/* If the user asks for a netCDF-4 file, and the library was built
|
||||
* without netCDF-4, then return an error.*/
|
||||
@ -1963,10 +1939,6 @@ NC_create(const char *path0, int cmode, size_t initialsz,
|
||||
return stat;
|
||||
}
|
||||
|
||||
#ifndef USE_DISKLESS
|
||||
cmode &= (~ (NC_DISKLESS|NC_INMEMORY)); /* Force off */
|
||||
#endif
|
||||
|
||||
#ifdef WINPATH
|
||||
/* Need to do path conversion */
|
||||
path = NCpathcvt(path0);
|
||||
@ -2152,11 +2124,6 @@ NC_open(const char *path0, int cmode, int basepe, size_t *chunksizehintp,
|
||||
repeated in protocol code: libdap2 and libdap4
|
||||
*/
|
||||
|
||||
#ifndef USE_DISKLESS
|
||||
/* Clean up cmode */
|
||||
cmode &= (~ (NC_DISKLESS|NC_INMEMORY));
|
||||
#endif
|
||||
|
||||
inmemory = ((cmode & NC_INMEMORY) == NC_INMEMORY);
|
||||
diskless = ((cmode & NC_DISKLESS) == NC_DISKLESS);
|
||||
|
||||
|
@ -640,16 +640,16 @@ close_netcdf4_file(NC_HDF5_FILE_INFO_T *h5, int abort, int extractmem)
|
||||
|
||||
if(h5->fileinfo) free(h5->fileinfo);
|
||||
|
||||
/* Check to see if this is an in-memory file and we want to get its
|
||||
final content
|
||||
*/
|
||||
if(extractmem) {
|
||||
/* File must be read/write */
|
||||
if(!h5->no_write) {
|
||||
retval = NC4_extract_file_image(h5);
|
||||
}
|
||||
/* Check to see if this is an in-memory file and we want to get its
|
||||
final content
|
||||
*/
|
||||
if(extractmem) {
|
||||
/* File must be read/write */
|
||||
if(!h5->no_write) {
|
||||
retval = NC4_extract_file_image(h5);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (H5Fclose(h5->hdfid) < 0)
|
||||
{
|
||||
dumpopenobjects(h5);
|
||||
@ -964,7 +964,7 @@ nc4_create_file(const char *path, int cmode, size_t initialsz, void* parameters,
|
||||
/* ok */
|
||||
} else if ((cmode & NC_NOCLOBBER) && (fp = fopen(path, "r"))) {
|
||||
fclose(fp);
|
||||
return NC_EEXIST;
|
||||
BAIL(NC_EEXIST);
|
||||
}
|
||||
|
||||
/* Need this access plist to control how HDF5 handles open objects
|
||||
@ -3018,48 +3018,6 @@ NC4_close(int ncid, void* params)
|
||||
return NC_NOERR;
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal Close an in-memory netcdf file, writing any changes first.
|
||||
*
|
||||
* @param ncid File and group ID.
|
||||
* @param sizep ptr into which the final size is stored
|
||||
* @param memp ptr into which the final memory is stored
|
||||
*
|
||||
* @return ::NC_NOERR No error.
|
||||
* @author Ed Hartnett
|
||||
*/
|
||||
int
|
||||
NC4_close_mem(int ncid, size_t* sizep, void** memp)
|
||||
{
|
||||
NC_GRP_INFO_T *grp;
|
||||
NC *nc;
|
||||
NC_HDF5_FILE_INFO_T *h5;
|
||||
int retval;
|
||||
|
||||
LOG((1, "%s: ncid 0x%x", __func__, ncid));
|
||||
|
||||
/* Find our metadata for this file. */
|
||||
if ((retval = nc4_find_nc_grp_h5(ncid, &nc, &grp, &h5)))
|
||||
return retval;
|
||||
|
||||
assert(nc && h5 && grp);
|
||||
|
||||
/* This must be the root group. */
|
||||
if (grp->parent)
|
||||
return NC_EBADGRPID;
|
||||
|
||||
/* If the file is not an in-memory file, then treat like normal close */
|
||||
if((h5->cmode & NC_INMEMORY) == 0)
|
||||
return NC4_close(ncid,NULL);
|
||||
|
||||
/* Call the nc4 close and extract memory */
|
||||
if ((retval = close_netcdf4_file(grp->nc4_info, 0, 1)))
|
||||
return retval;
|
||||
|
||||
|
||||
return NC_NOERR;
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal Learn number of dimensions, variables, global attributes,
|
||||
* and the ID of the first unlimited dimension (if any).
|
||||
|
@ -14,13 +14,11 @@ SET(libsrc_SOURCES v1hpg.c putget.c attr.c nc3dispatch.c
|
||||
|
||||
SET(libsrc_SOURCES ${libsrc_SOURCES} pstdint.h ncio.h ncx.h)
|
||||
|
||||
IF (BUILD_DISKLESS)
|
||||
SET(libsrc_SOURCES ${libsrc_SOURCES} memio.c)
|
||||
SET(libsrc_SOURCES ${libsrc_SOURCES} memio.c)
|
||||
|
||||
IF (BUILD_MMAP)
|
||||
SET(libsrc_SOURCES ${libsrc_SOURCES} mmapio.c)
|
||||
ENDIF( BUILD_MMAP)
|
||||
ENDIF (BUILD_DISKLESS)
|
||||
IF (BUILD_MMAP)
|
||||
SET(libsrc_SOURCES ${libsrc_SOURCES} mmapio.c)
|
||||
ENDIF( BUILD_MMAP)
|
||||
|
||||
IF (USE_FFIO)
|
||||
SET(libsrc_SOURCES ${libsrc_SOURCES} ffio.c)
|
||||
|
@ -11,14 +11,11 @@ libnetcdf3_la_CPPFLAGS = ${AM_CPPFLAGS}
|
||||
# These files comprise the netCDF-3 classic library code.
|
||||
libnetcdf3_la_SOURCES = v1hpg.c \
|
||||
putget.c attr.c nc3dispatch.c nc3internal.c var.c dim.c ncx.c \
|
||||
ncx.h lookup3.c pstdint.h ncio.c ncio.h
|
||||
ncx.h lookup3.c pstdint.h ncio.c ncio.h memio.c
|
||||
|
||||
if BUILD_DISKLESS
|
||||
libnetcdf3_la_SOURCES += memio.c
|
||||
if BUILD_MMAP
|
||||
libnetcdf3_la_SOURCES += mmapio.c
|
||||
endif BUILD_MMAP
|
||||
endif BUILD_DISKLESS
|
||||
|
||||
# Does the user want to use ffio, a replacement for posixio for Cray
|
||||
# computers?
|
||||
|
@ -30,14 +30,12 @@ extern int ffio_create(const char*,int,size_t,off_t,size_t,size_t*,void*,ncio**,
|
||||
extern int ffio_open(const char*,int,off_t,size_t,size_t*,void*,ncio**,void** const);
|
||||
#endif
|
||||
|
||||
#ifdef USE_DISKLESS
|
||||
# ifdef USE_MMAP
|
||||
extern int mmapio_create(const char*,int,size_t,off_t,size_t,size_t*,void*,ncio**,void** const);
|
||||
extern int mmapio_open(const char*,int,off_t,size_t,size_t*,void*,ncio**,void** const);
|
||||
# endif
|
||||
extern int memio_create(const char*,int,size_t,off_t,size_t,size_t*,void*,ncio**,void** const);
|
||||
extern int memio_open(const char*,int,off_t,size_t,size_t*,void*,ncio**,void** const);
|
||||
#endif
|
||||
|
||||
int
|
||||
ncio_create(const char *path, int ioflags, size_t initialsz,
|
||||
@ -45,7 +43,6 @@ ncio_create(const char *path, int ioflags, size_t initialsz,
|
||||
void* parameters,
|
||||
ncio** iopp, void** const mempp)
|
||||
{
|
||||
#ifdef USE_DISKLESS
|
||||
if(fIsSet(ioflags,NC_INMEMORY)) {
|
||||
# ifdef USE_MMAP
|
||||
if(fIsSet(ioflags,NC_MMAP) && fIsSet(ioflags, NC_DISKLESS))
|
||||
@ -54,7 +51,6 @@ ncio_create(const char *path, int ioflags, size_t initialsz,
|
||||
# endif /*USE_MMAP*/
|
||||
return memio_create(path,ioflags,initialsz,igeto,igetsz,sizehintp,parameters,iopp,mempp);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef USE_STDIO
|
||||
return stdio_create(path,ioflags,initialsz,igeto,igetsz,sizehintp,parameters,iopp,mempp);
|
||||
@ -74,7 +70,6 @@ ncio_open(const char *path, int ioflags,
|
||||
/* Diskless open has the following constraints:
|
||||
1. file must be classic version 1 or 2 or 5
|
||||
*/
|
||||
#ifdef USE_DISKLESS
|
||||
if(fIsSet(ioflags,NC_INMEMORY)) {
|
||||
# ifdef USE_MMAP
|
||||
if(fIsSet(ioflags,NC_MMAP) && fIsSet(ioflags, NC_DISKLESS))
|
||||
@ -83,7 +78,6 @@ ncio_open(const char *path, int ioflags,
|
||||
# endif /*USE_MMAP*/
|
||||
return memio_open(path,ioflags,igeto,igetsz,sizehintp,parameters,iopp,mempp);
|
||||
}
|
||||
#endif
|
||||
#ifdef USE_STDIO
|
||||
return stdio_open(path,ioflags,igeto,igetsz,sizehintp,parameters,iopp,mempp);
|
||||
#elif defined(USE_FFIO)
|
||||
|
@ -52,9 +52,7 @@ ncstdio_uid(ncstdio* ncstdiop,int*);
|
||||
extern int ncFile_create(const char *path, int ioflags, ncstdio** filepp);
|
||||
extern int ncFile_open(const char *path, int ioflags, ncstdio** filepp);
|
||||
|
||||
#ifdef USE_DISKLESS
|
||||
extern int ncMemory_create(const char *path, int ioflags, ncstdio** filepp);
|
||||
extern int ncMemory_open(const char *path, int ioflags, ncstdio** filepp);
|
||||
#endif
|
||||
|
||||
#endif /* _NCSTDIO_H_* /
|
||||
|
@ -52,11 +52,9 @@ IF(LARGE_FILE_TESTS)
|
||||
|
||||
ENDIF()
|
||||
|
||||
IF(BUILD_DISKLESS)
|
||||
SET(TESTFILES ${TESTFILES} tst_diskless tst_diskless3 tst_diskless4 tst_diskless5 tst_inmemory)
|
||||
IF(USE_NETCDF4)
|
||||
SET(TESTFILES ${TESTFILES} tst_diskless2)
|
||||
ENDIF()
|
||||
SET(TESTFILES ${TESTFILES} tst_diskless tst_diskless3 tst_diskless4 tst_diskless5 tst_inmemory)
|
||||
IF(USE_NETCDF4)
|
||||
SET(TESTFILES ${TESTFILES} tst_diskless2)
|
||||
ENDIF()
|
||||
|
||||
# Build executables required for the shell scripts.
|
||||
@ -73,7 +71,6 @@ ADD_TEST(nc_test ${EXECUTABLE_OUTPUT_PATH}/nc_test)
|
||||
|
||||
IF(BUILD_UTILITIES)
|
||||
|
||||
IF(BUILD_DISKLESS)
|
||||
add_sh_test(nc_test run_diskless)
|
||||
IF(BUILD_MMAP)
|
||||
add_sh_test(nc_test run_mmap)
|
||||
@ -85,7 +82,6 @@ IF(BUILD_UTILITIES)
|
||||
add_sh_test(nc_test run_diskless5)
|
||||
add_sh_test(nc_test run_inmemory)
|
||||
|
||||
ENDIF(BUILD_DISKLESS)
|
||||
ENDIF(BUILD_UTILITIES)
|
||||
|
||||
# Copy some test files from current source dir to out-of-tree build dir.
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Test c output
|
||||
T=tst_inmemory
|
||||
T=tst_diskless
|
||||
|
||||
#ARGS=t
|
||||
|
||||
|
@ -53,17 +53,14 @@ endif
|
||||
check_PROGRAMS = $(TESTPROGRAMS)
|
||||
|
||||
# Build Diskless test helpers
|
||||
if BUILD_DISKLESS
|
||||
check_PROGRAMS += tst_diskless tst_diskless3 tst_diskless4 tst_diskless5 tst_inmemory
|
||||
if USE_NETCDF4
|
||||
check_PROGRAMS += tst_diskless2
|
||||
endif
|
||||
endif
|
||||
|
||||
TESTS = $(TESTPROGRAMS)
|
||||
|
||||
if BUILD_UTILITIES
|
||||
if BUILD_DISKLESS
|
||||
TESTS += run_diskless.sh run_diskless5.sh run_inmemory.sh
|
||||
if BUILD_MMAP
|
||||
TESTS += run_mmap.sh
|
||||
@ -73,7 +70,6 @@ if LARGE_FILE_TESTS
|
||||
TESTS += run_diskless2.sh
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
if USE_PNETCDF
|
||||
TESTS += run_pnetcdf_test.sh
|
||||
|
@ -20,9 +20,8 @@ redistribution conditions.
|
||||
#include "nc_tests.h"
|
||||
#include "err_macros.h"
|
||||
|
||||
#include <hdf5.h>
|
||||
|
||||
#ifdef USE_NETCDF4
|
||||
#include <hdf5.h>
|
||||
extern int H5Eprint1(FILE * stream);
|
||||
#endif
|
||||
|
||||
@ -98,13 +97,10 @@ fail(int line) {
|
||||
#define ERR fail(__LINE__)
|
||||
#endif
|
||||
|
||||
/* Store any error message */
|
||||
static char errmsg[4096];
|
||||
|
||||
static int
|
||||
check(int stat, const char* file, int line, int xfail)
|
||||
{
|
||||
int pass = ((!xfail && stat == NC_NOERR) || (xfail && stat != NC_NOERR));
|
||||
/* int pass = ((!xfail && stat == NC_NOERR) || (xfail && stat != NC_NOERR)); */
|
||||
fflush(stdout);
|
||||
if(!xfail) {
|
||||
if(stat != NC_NOERR) {
|
||||
@ -196,7 +192,6 @@ writefile(const char* path, NC_memio* memio)
|
||||
int status = NC_NOERR;
|
||||
FILE* f = NULL;
|
||||
size_t count = 0;
|
||||
char* memory = NULL;
|
||||
char* p = NULL;
|
||||
|
||||
/* Open the file for writing */
|
||||
@ -363,7 +358,6 @@ verify_file(int ncid, int modified)
|
||||
float float_data_in;
|
||||
int milesdata_in[MAXDIMLEN];
|
||||
int dimprod = UNLIM_LEN * DIM1_LEN;
|
||||
int modcount = (modified?1:0);
|
||||
|
||||
CHECK(nc_inq(ncid, &ndims_in, &nvars_in, &natts_in, &unlimdimid_in));
|
||||
if (ndims_in != 2 || nvars_in != NVARS+modified || natts_in != 1 || unlimdimid_in != 0)
|
||||
@ -608,8 +602,6 @@ int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
int stat = NC_NOERR;
|
||||
int i;
|
||||
void* filedata = NULL;
|
||||
NC_memio filedata3;
|
||||
NC_memio filedata4;
|
||||
|
||||
|
@ -71,16 +71,6 @@ main(int argc, char **argv)
|
||||
}
|
||||
SUMMARIZE_ERR;
|
||||
#endif /* USE_NETCDF4 undefined */
|
||||
#ifndef USE_DISKLESS
|
||||
printf("*** Trying to create diskless file without diskless...");
|
||||
{
|
||||
int ncid;
|
||||
|
||||
if (nc_create(FILE_NAME, NC_DISKLESS, &ncid) != NC_ENOTBUILT)
|
||||
ERR;
|
||||
}
|
||||
SUMMARIZE_ERR;
|
||||
#endif /* USE_DISKLESS undefined */
|
||||
|
||||
#ifdef TEST_PNETCDF
|
||||
MPI_Finalize();
|
||||
|
@ -140,12 +140,10 @@ ENDIF(MSVC)
|
||||
ENDIF(ENABLE_LARGE_FILE_TESTS)
|
||||
ENDIF(CMAKE_COMPILER_IS_GNUCC OR APPLE)
|
||||
|
||||
IF(BUILD_DISKLESS)
|
||||
add_sh_test(ncdump tst_inmemory_nc3)
|
||||
IF(USE_NETCDF4)
|
||||
add_sh_test(ncdump tst_inmemory_nc3)
|
||||
IF(USE_NETCDF4)
|
||||
add_sh_test(ncdump tst_inmemory_nc4)
|
||||
ENDIF(USE_NETCDF4)
|
||||
ENDIF(BUILD_DISKLESS)
|
||||
ENDIF(USE_NETCDF4)
|
||||
|
||||
IF(USE_NETCDF4)
|
||||
build_bin_test_no_prefix(tst_create_files)
|
||||
|
@ -90,13 +90,10 @@ tst_nccopy4.log: run_ncgen_tests.log tst_output.log tst_ncgen4.log \
|
||||
tst_fillbug.log tst_netcdf4_4.log tst_h_scalar.log
|
||||
endif #!USE_NETCDF4
|
||||
|
||||
# Add diskless checks if needed.
|
||||
if BUILD_DISKLESS
|
||||
TESTS += tst_inmemory_nc3.sh
|
||||
if USE_NETCDF4
|
||||
TESTS += tst_inmemory_nc4.sh
|
||||
endif
|
||||
endif
|
||||
|
||||
endif BUILD_TESTSETS
|
||||
|
||||
|
@ -315,7 +315,6 @@ kind_string_extended(int kind, int mode)
|
||||
return text;
|
||||
}
|
||||
|
||||
#ifdef USE_DISKLESS
|
||||
static int
|
||||
fileopen(const char* path, void** memp, size_t* sizep)
|
||||
{
|
||||
@ -388,7 +387,6 @@ done:
|
||||
|
||||
return status;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Emit initial line of output for NcML
|
||||
@ -2311,7 +2309,6 @@ main(int argc, char *argv[])
|
||||
/* else fall thru and treat like a file path */
|
||||
}
|
||||
#endif /*USE_DAP*/
|
||||
#ifdef USE_DISKLESS
|
||||
if(formatting_specs.xopt_inmemory) {
|
||||
size_t size = 0;
|
||||
void* mem = NULL;
|
||||
@ -2319,7 +2316,6 @@ main(int argc, char *argv[])
|
||||
if(nc_status == NC_NOERR)
|
||||
nc_status = nc_open_mem(path,NC_DISKLESS|NC_INMEMORY,size,mem,&ncid);
|
||||
} else
|
||||
#endif
|
||||
nc_status = nc_open(path, NC_NOWRITE, &ncid);
|
||||
if (nc_status != NC_NOERR) {
|
||||
error("%s: %s", path, nc_strerror(nc_status));
|
||||
|
Loading…
Reference in New Issue
Block a user