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

re-implement the nc_def_var_szip() function, including for parallel I/O #1589

Merged
merged 28 commits into from
Jan 22, 2020
Merged
Show file tree
Hide file tree
Changes from 38 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
808a0e2
merged ejh_parallel_zlib
edwardhartnett Jan 2, 2020
e703a76
first stab at re-adding nc_def_var_szip()
edwardhartnett Jan 3, 2020
c47b404
added test for when szip is missing from HDF5
edwardhartnett Jan 6, 2020
6af1b0b
changed error code in nc_def_var_szip() to NC_EFILTER
edwardhartnett Jan 6, 2020
1c3edc5
now checking for proper error from nc_def_var_szip() when szip is not…
edwardhartnett Jan 6, 2020
8a34137
clean up
edwardhartnett Jan 6, 2020
65e5897
whitespace clean up
edwardhartnett Jan 6, 2020
9c8719b
more szip tests
edwardhartnett Jan 6, 2020
7e33269
more szip testing
edwardhartnett Jan 6, 2020
3e3b83b
whitespace cleanup
edwardhartnett Jan 6, 2020
184507b
now using members in NC_VAR_INFO_T to hold szip info
edwardhartnett Jan 6, 2020
bb7ffe6
starting to add parallel tests
edwardhartnett Jan 6, 2020
a0396a8
parallel szip test
edwardhartnett Jan 6, 2020
a8a523f
parallel szip test
edwardhartnett Jan 6, 2020
c813572
parallel szip test
edwardhartnett Jan 6, 2020
58abb5a
parallel szip test
edwardhartnett Jan 6, 2020
86a9835
checking sziped data in parallel I/O test
edwardhartnett Jan 6, 2020
fe7132b
fixed deflate_level comment
edwardhartnett Jan 6, 2020
98748ea
added SZIP to libnetcdf.settings.in
edwardhartnett Jan 6, 2020
9406f69
moved nc_def_var_szip prototype to netcdf_filter.h
edwardhartnett Jan 6, 2020
e94615a
Merge branch 'master' into ejh_szip
edwardhartnett Jan 16, 2020
0a02827
added to libnetcdf.settings and netcdf_meta.h
edwardhartnett Jan 16, 2020
fb51e44
adding NC_HAS_SZIP_WRITE and NC_HAS_PAR_FILTERS to cmake build
edwardhartnett Jan 17, 2020
3da6304
fixing running of parallel filter tests only when parallel filters ar…
edwardhartnett Jan 17, 2020
b9823d2
fixed shell test for par filters
edwardhartnett Jan 17, 2020
21a204c
start using par filters in HDF5-1.10.3
edwardhartnett Jan 17, 2020
a15126e
move AM_CONDITIONAL outside if-statement body
edwardhartnett Jan 17, 2020
0735a45
switch cmake build to check for func H5Dread_chunk to detect 1.10.3 o…
edwardhartnett Jan 21, 2020
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
12 changes: 6 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -912,12 +912,6 @@ IF(ENABLE_TESTS)
SET(SITE "${NC_CTEST_SITE}" CACHE STRING "")
ENDIF()

# Create a CTestConfig file from the template.
CONFIGURE_FILE("${netCDF_SOURCE_DIR}/CTestConfig.cmake.in"
"${netCDF_BINARY_DIR}/CTestConfig.cmake"
@ONLY
)

###
# This option dictates whether or not to turn on
# tests which are known to fail. This is not the
Expand Down Expand Up @@ -1993,6 +1987,7 @@ SET(TOPSRCDIR "${CMAKE_CURRENT_SOURCE_DIR}")
SET(TOPBUILDDIR "${CMAKE_CURRENT_BINARY_DIR}")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/test_common.in ${CMAKE_CURRENT_BINARY_DIR}/test_common.sh @ONLY NEWLINE_STYLE LF)


#####
# Build nc_test4/findplugin.sh
#####
Expand All @@ -2009,6 +2004,11 @@ ENDIF()
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/ncdap_test/findtestserver.c.in ${CMAKE_CURRENT_SOURCE_DIR}/ncdap_test/findtestserver.c @ONLY NEWLINE_STYLE LF)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/ncdap_test/findtestserver.c.in ${CMAKE_CURRENT_SOURCE_DIR}/dap4_test/findtestserver4.c @ONLY NEWLINE_STYLE LF)

#####
# Build dap4_test/pingurl4.c
#####
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/ncdap_test/pingurl.c ${CMAKE_CURRENT_SOURCE_DIR}/dap4_test/pingurl4.c @ONLY NEWLINE_STYLE LF)

####
# Export files
####
Expand Down
1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1507,6 +1507,7 @@ AC_CONFIG_FILES(nc_test4/findplugin.sh:nc_test4/findplugin.in)
AC_CONFIG_FILES(examples/C/findplugin.sh:nc_test4/findplugin.in)
AC_CONFIG_FILES(ncdap_test/findtestserver.c:ncdap_test/findtestserver.c.in)
AC_CONFIG_FILES(dap4_test/findtestserver4.c:ncdap_test/findtestserver.c.in)
AC_CONFIG_FILES(dap4_test/pingurl4.c:ncdap_test/pingurl.c)
AC_CONFIG_FILES([nc_test4/run_par_test.sh], [chmod ugo+x nc_test4/run_par_test.sh])
AC_CONFIG_FILES([nc_perf/run_par_bm_test.sh], [chmod ugo+x nc_perf/run_par_bm_test.sh])
AC_CONFIG_FILES([examples/C/run_par_test.sh], [chmod ugo+x examples/C/run_par_test.sh])
Expand Down
3 changes: 3 additions & 0 deletions ctest_scripts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# CTest Script Directory

This directory contains ctest scripts which upload the results to the [NetCDF CDash Dashboard](https://cdash.unidata.ucar.edu). These scripts require an environmental variable, `CDASH_TOKEN`, to submit results. This is primarily a Unidata tool, but for users who want to submit results, a token can be requested by emailing support-netcdf@unidata.ucar.edu.
49 changes: 49 additions & 0 deletions ctest_scripts/ctest_mpicc.ctest
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
###
# Standard CTest Script for testing netCDF.
# Requires a CDash Token.
#
# Set the CDASH_TOKEN environmental variable.
#
###

SET(CTEST_SOURCE_DIRECTORY "..")
SET(CTEST_BINARY_DIRECTORY ".")

set(CDASH_TOKEN $ENV{CDASH_TOKEN})
MESSAGE("Using cdash token: ${CDASH_TOKEN}")


SITE_NAME(local_site_name)
set(CTEST_SITE ${local_site_name})

set(CTEST_BUILD_CONFIGURATION "Profiling")
set(CTEST_CMAKE_GENERATOR "Unix Makefiles")
set(CTEST_BUILD_NAME "default")
set(CTEST_BUILD_CONFIGURATION "Profiling")
set(CTEST_DROP_METHOD "https")
set(CTEST_DROP_SITE_CDASH TRUE)
set(CTEST_PROJECT_NAME netcdf-c)
set(CTEST_COMPILER mpicc)

find_program(CMAKE_COMMAND cmake)
find_program(CTEST_GIT_COMMAND NAMES git)
find_program(CTEST_COVERAGE_COMMAND NAMES gcov)
find_program(CTEST_MEMORYCHECK_COMMAND NAMES valgrind)

set(CTEST_BUILD_OPTIONS "-DENABLE_COVERAGE_TESTS=TRUE -DENABLE_ERANGE_FILL=TRUE -DENABLE_LOGGING=TRUE -DENABLE_BYTERANGE=TRUE -DENABLE_LARGE_FILE_TESTS=FALSE -DCMAKE_C_COMPILER=${CTEST_COMPILER}")


set(CTEST_DROP_METHOD https)
set(CTEST_DROP_SITE "cdash.unidata.ucar.edu:443")
set(CTEST_DROP_LOCATION "/submit.php?project=netcdf-c")

set(CTEST_CONFIGURE_COMMAND "${CMAKE_COMMAND} -DCMAKE_BUILD_TYPE:STRING=${CTEST_BUILD_CONFIGURATION} ${CTEST_BUILD_OPTIONS} ${CTEST_SOURCE_DIRECTORY}")

ctest_start("Experimental")
ctest_configure()
ctest_build()
ctest_test()
ctest_coverage()
if (NOT "${CDASH_TOKEN}" STREQUAL "")
ctest_submit(HTTPHEADER "Authorization: Bearer ${CDASH_TOKEN}")
endif()
48 changes: 48 additions & 0 deletions ctest_scripts/ctest_serial.ctest
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
###
# Standard CTest Script for testing netCDF.
# Requires a CDash Token.
#
# Set the CDASH_TOKEN environmental variable.
#
###

SET(CTEST_SOURCE_DIRECTORY "..")
SET(CTEST_BINARY_DIRECTORY ".")

set(CDASH_TOKEN $ENV{CDASH_TOKEN})
MESSAGE("Using cdash token: ${CDASH_TOKEN}")


SITE_NAME(local_site_name)
set(CTEST_SITE ${local_site_name})

set(CTEST_BUILD_CONFIGURATION "Profiling")
set(CTEST_CMAKE_GENERATOR "Unix Makefiles")
set(CTEST_BUILD_NAME "default")
set(CTEST_BUILD_CONFIGURATION "Profiling")
set(CTEST_DROP_METHOD "https")
set(CTEST_DROP_SITE_CDASH TRUE)
set(CTEST_PROJECT_NAME netcdf-c)

find_program(CMAKE_COMMAND cmake)
find_program(CTEST_GIT_COMMAND NAMES git)
find_program(CTEST_COVERAGE_COMMAND NAMES gcov)
find_program(CTEST_MEMORYCHECK_COMMAND NAMES valgrind)

set(CTEST_BUILD_OPTIONS "-DENABLE_COVERAGE_TESTS=TRUE -DENABLE_ERANGE_FILL=TRUE -DENABLE_LOGGING=TRUE -DENABLE_BYTERANGE=TRUE -DENABLE_LARGE_FILE_TESTS=FALSE")


set(CTEST_DROP_METHOD https)
set(CTEST_DROP_SITE "cdash.unidata.ucar.edu:443")
set(CTEST_DROP_LOCATION "/submit.php?project=netcdf-c")

set(CTEST_CONFIGURE_COMMAND "${CMAKE_COMMAND} -DCMAKE_BUILD_TYPE:STRING=${CTEST_BUILD_CONFIGURATION} ${CTEST_BUILD_OPTIONS} ${CTEST_SOURCE_DIRECTORY}")

ctest_start("Experimental")
ctest_configure()
ctest_build()
ctest_test()
ctest_coverage()
if (NOT "${CDASH_TOKEN}" STREQUAL "")
ctest_submit(HTTPHEADER "Authorization: Bearer ${CDASH_TOKEN}")
endif()
1 change: 1 addition & 0 deletions dap4_test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ IF(ENABLE_DAP_REMOTE_TESTS)
# Change name (add '4') to avoid cmake
# complaint about duplicate targets.
BUILD_BIN_TEST(findtestserver4)
BUILD_BIN_TEST(pingurl4)
ENDIF()

IF(ENABLE_TESTS)
Expand Down
3 changes: 2 additions & 1 deletion dap4_test/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ test_data.log: test_meta.log
if ENABLE_DAP_REMOTE_TESTS
# Note: This program name was changed to findtestserver4
# to avoid cmake complaint about duplicate targets.
noinst_PROGRAMS = findtestserver4
noinst_PROGRAMS = findtestserver4 pingurl4
findtestserver4_SOURCES = findtestserver4.c
pingurl4_SOURCES = pingurl4.c
endif

if ENABLE_DAP_REMOTE_TESTS
Expand Down
5 changes: 4 additions & 1 deletion include/nc4internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,12 @@ typedef struct NC_VAR_INFO
nc_bool_t dimscale; /**< True if var is a dimscale */
nc_bool_t *dimscale_attached; /**< Array of flags that are true if dimscale is attached for that dim index */
nc_bool_t deflate; /**< True if var has deflate filter applied */
int deflate_level;
int deflate_level; /**< If deflate is true, this is the deflate level, between 1 and 9. */
edwardhartnett marked this conversation as resolved.
Show resolved Hide resolved
nc_bool_t shuffle; /**< True if var has shuffle filter applied */
nc_bool_t fletcher32; /**< True if var has fletcher32 filter applied */
nc_bool_t szip; /**< True if szip filter is in use. */
int options_mask; /**< Setting for szip filter, NC_SZIP_EC or NC_SZIP_NN. */
int pixels_per_block; /**< Setting for szip filter, even and <= 32. */
size_t chunk_cache_size, chunk_cache_nelems;
float chunk_cache_preemption;
void *format_var_info; /**< Pointer to any binary format info. */
Expand Down
20 changes: 17 additions & 3 deletions include/nctestserver.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ See \ref copyright file for more info.

*/

#ifndef NCTESTSERVER_H
#define NCTESTSERVER_H 1

#include "config.h"
#include <stdio.h>
#include <stdlib.h>
Expand All @@ -18,6 +21,8 @@ See \ref copyright file for more info.

#undef FINDTESTSERVER_DEBUG

enum KIND {NOKIND, DAP2KIND, DAP4KIND, THREDDSKIND};

#define MAXSERVERURL 4096
#define TIMEOUT 10 /*seconds*/
#define BUFSIZE 8192 /*bytes*/
Expand All @@ -28,6 +33,7 @@ See \ref copyright file for more info.
#endif

static int ping(const char* url);
static int timedping(const char* url, long timeout);

static char**
parseServers(const char* remotetestservers)
Expand Down Expand Up @@ -73,8 +79,8 @@ This indicates that the server is up and running.
Return the complete url for the server plus the path.
*/

static char*
nc_findtestserver(const char* path, int isdap4, const char* serverlist)
char*
nc_findtestserver(const char* path, const char* serverlist)
{
char** svclist;
char** svc;
Expand Down Expand Up @@ -153,8 +159,15 @@ WriteMemoryCallback(void *ptr, size_t size, size_t nmemb, void *data)
See if a server is responding.
Return NC_ECURL if the ping fails, NC_NOERR otherwise
*/

static int
ping(const char* url)
{
return timedping(url,TIMEOUT);
}

static int
timedping(const char* url, long timeout)
{
int stat = NC_NOERR;
CURLcode cstat = CURLE_OK;
Expand All @@ -172,7 +185,7 @@ ping(const char* url)
CERR((curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L)));

/* use a very short timeout: 10 seconds */
CERR((curl_easy_setopt(curl, CURLOPT_TIMEOUT, (long)TIMEOUT)));
CERR((curl_easy_setopt(curl, CURLOPT_TIMEOUT, (long)timeout)));

/* fail on HTTP 400 code errors */
CERR((curl_easy_setopt(curl, CURLOPT_FAILONERROR, (long)1)));
Expand Down Expand Up @@ -210,3 +223,4 @@ ping(const char* url)
curl_easy_cleanup(curl);
return stat;
}
#endif /*NCTESTSERVER_H*/
7 changes: 7 additions & 0 deletions include/netcdf.h
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,9 @@ there. */
#define NC_MIN_DEFLATE_LEVEL 0 /**< Minimum deflate level. */
#define NC_MAX_DEFLATE_LEVEL 9 /**< Maximum deflate level. */

#define NC_SZIP_EC 4 /**< Selects entropy coding method for szip. */
#define NC_SZIP_NN 32 /**< Selects nearest neighbor coding method for szip. */

/** The netcdf version 3 functions all return integer error status.
* These are the possible values, in addition to certain values from
* the system errno.h.
Expand Down Expand Up @@ -850,6 +853,10 @@ EXTERNL int
nc_inq_var_deflate(int ncid, int varid, int *shufflep,
int *deflatep, int *deflate_levelp);

/* Set szip compression for a variable. */
EXTERNL int
nc_def_var_szip(int ncid, int varid, int options_mask, int pixels_per_block);

/* Find out szip settings of a var. */
EXTERNL int
nc_inq_var_szip(int ncid, int varid, int *options_maskp, int *pixels_per_blockp);
Expand Down
9 changes: 7 additions & 2 deletions libdispatch/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,13 @@ IF(ENABLE_BYTERANGE)
ENDIF(ENABLE_BYTERANGE)

add_library(dispatch OBJECT ${libdispatch_SOURCES})
target_include_directories(dispatch PUBLIC ${MPI_C_INCLUDE_PATH})
target_link_libraries(dispatch PUBLIC ${MPI_C_LIBRARIES})
IF(MPI_C_INCLUDE_PATH)
target_include_directories(dispatch PUBLIC ${MPI_C_INCLUDE_PATH})
ENDIF(MPI_C_INCLUDE_PATH)

IF(MPI_C_LIBRARIES)
target_link_libraries(dispatch PUBLIC ${MPI_C_LIBRARIES})
ENDIF(MPI_C_LIBRARIES)

FILE(GLOB CUR_EXTRA_DIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.h ${CMAKE_CURRENT_SOURCE_DIR}/*.c)
SET(CUR_EXTRA_DIST ${CUR_EXTRA_DIST} CMakeLists.txt Makefile.am)
Expand Down
Loading