Skip to content

Commit

Permalink
Merge pull request #1725 from NCAR/ejh_next_9
Browse files Browse the repository at this point in the history
adding netCDF interation to build summary and pio_meta.h
  • Loading branch information
edwardhartnett authored Aug 20, 2020
2 parents 23c5c50 + 41b62fb commit 0043527
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 15 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/cmake_ncint.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# This is the GitHub workflow file to build and test the PIO library with CMake, and netCDF integration.

# Ed Hartnett 8/19/20

name: cmake_ncint

on:
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/strict_autotools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ jobs:
- name: autoreconf
run: autoreconf -i
- name: configure
run: |
export CFLAGS="-std=c99 -fsanitize=address -fno-omit-frame-pointer -Werror"
export FFLAGS="-fsanitize=address -fno-omit-frame-pointer -Werror"
export FCFLAGS="-fsanitize=address -fno-omit-frame-pointer -Werror"
./configure
- name: make -j distcheck
- name: build
run: |
set -x
export CFLAGS="-std=c99 -Wall"
export FFLAGS="-Wall"
export FCFLAGS="-Wall"
export DISTCHECK_CONFIGURE_FLAGS="--enable-fortran"
./configure
make -j distcheck
10 changes: 10 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,15 @@ CHECK_C_SOURCE_COMPILES("
#endif
int main() {return 0;}" HAVE_DISPATCH2)

if (NETCDF_INTEGRATION)
if (NOT HAVE_DISPATCH2)
message (FATAL_ERROR "Need newer version of netcdf-c for netcdf integration feature, please upgrade your netCDF library")
endif ()
set(HAVE_NETCDF_INTEGRATION 1)
else ()
set(HAVE_NETCDF_INTEGRATION 0)
endif ()

#####
# Configure and print the libpio.settings file.
#####
Expand Down Expand Up @@ -400,6 +409,7 @@ is_enabled(HAVE_H5Z_SZIP HAS_SZLIB)
is_enabled(HDF5_HAS_PAR_FILTERS HAS_PAR_FILTERS)
is_enabled(HAVE_NETCDF4 HAS_NETCDF4)
is_enabled(HAVE_NETCDF_PAR HAS_NETCDF4_PAR)
is_enabled(HAVE_NETCDF_INTEGRATION HAS_NETCDF_INTEGRATION)

# Generate file from template.
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/libpio.settings.in"
Expand Down
2 changes: 2 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,7 @@ AX_SET_META([PIO_HAS_PNETCDF],[$enable_pnetcdf],[yes])
AX_SET_META([PIO_HAS_PAR_FILTERS], [$have_par_filters],[yes])
AX_SET_META([PIO_HAS_NETCDF4], [$have_netcdf4],[yes])
AX_SET_META([PIO_HAS_NETCDF4_PAR], [$have_netcdf_par],[yes])
AX_SET_META([PIO_HAS_NETCDF_INTEGRATION], [$enable_netcdf_integration],[yes])

# Create output variables from various shell variables, for use in
# generating libpio.settings.
Expand All @@ -430,6 +431,7 @@ AC_SUBST(HAS_SZIP_WRITE, [$have_szip_write])
AC_SUBST([HAS_PAR_FILTERS], [$have_par_filters])
AC_SUBST([HAS_NETCDF4], [$have_netcdf4])
AC_SUBST([HAS_NETCDF4_PAR], [$have_netcdf_par])
AC_SUBST([HAS_NETCDF_INTEGRATION], [$enable_netcdf_integration])

# Create the build summary file.
AC_CONFIG_FILES([libpio.settings
Expand Down
1 change: 1 addition & 0 deletions libpio.settings.in
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,5 @@ SZIP Write Support: @HAS_SZIP_WRITE@
Parallel Filters: @HAS_PAR_FILTERS@
NetCDF/HDF5 Support: @HAS_NETCDF4@
NetCDF/HDF5 Par I/O: @HAS_NETCDF4_PAR@
NetCDF Integration: @HAS_NETCDF_INTEGRATION@

1 change: 1 addition & 0 deletions src/clib/pio_meta.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,6 @@
#define PIO_HAS_PAR_FILTERS @PIO_HAS_PAR_FILTERS@ /*!< NetCDF supports parallel I/O with filters. */
#define PIO_HAS_NETCDF4 @PIO_HAS_NETCDF4@ /*!< NetCDF-4 supported. */
#define PIO_HAS_NETCDF4_PAR @PIO_HAS_NETCDF4_PAR@ /*!< NetCDF-4 parallel I/O supported. */
#define PIO_HAS_NETCDF_INTEGRATION @PIO_HAS_NETCDF_INTEGRATION@ /*!< NetCDF integration supported. */

#endif
4 changes: 0 additions & 4 deletions tests/cunit/test_darray_append.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ int test_darray_append(int iosysid, int ioid, int num_flavors, int *flavor, int
int varid; /* The ID of the netCDF varable. */
int varid2; /* The ID of a netCDF varable of different type. */
int varid3; /* the ID of a variable with no unlimited dimension. */
int wrong_varid = TEST_VAL_42; /* A wrong ID. */
int ret; /* Return code. */
MPI_Datatype mpi_type;
int type_size; /* size of a variable of type pio_type */
Expand Down Expand Up @@ -188,9 +187,6 @@ int test_darray_append(int iosysid, int ioid, int num_flavors, int *flavor, int
if (other_type && (ret = PIOc_setframe(ncid, varid2, 0)))
ERR(ret);

int frame = 0;
int flushtodisk = 0;

/* These should not work. */
if (PIOc_write_darray(ncid + TEST_VAL_42, varid, ioid, arraylen, test_data, fillvalue) != PIO_EBADID)
ERR(ERR_WRONG);
Expand Down

0 comments on commit 0043527

Please sign in to comment.