Commit 14339366 authored by Bas Couwenberg's avatar Bas Couwenberg

New upstream version 1.5.0

parent 846a7822
......@@ -44,7 +44,24 @@ matrix:
- MPI=1
- CC=mpicc.mpich
- DEPENDS="numpy>=1.9.0 cython>=0.21 setuptools>=18.0 mpi4py>=1.3.1 cftime"
- NETCDF_VERSION=4.6.2
- NETCDF_VERSION=4.6.3
- NETCDF_DIR=$HOME
- PATH=${NETCDF_DIR}/bin:${PATH} # pick up nc-config here
addons:
apt:
packages:
- mpich
- libmpich-dev
- libhdf5-mpich-dev
# test MPI with latest released version
- python: 3.7
dist: xenial
env:
- MPI=1
- CC=mpicc.mpich
- DEPENDS="numpy>=1.9.0 cython>=0.21 setuptools>=18.0 mpi4py>=1.3.1 cftime"
- NETCDF_VERSION=4.6.3
- PNETCDF_VERSION=1.11.0
- NETCDF_DIR=$HOME
- PATH=${NETCDF_DIR}/bin:${PATH} # pick up nc-config here
addons:
......@@ -86,6 +103,8 @@ script:
- cd test
- python run_all.py
- |
echo "MPI = ${MPI}"
echo "PNETCDF_VERSION = ${PNETCDF_VERSION}"
if [ $MPI -eq 1 ] ; then
cd ../examples
mpirun.mpich -np 4 python mpi_example.py
......@@ -94,6 +113,14 @@ script:
exit 1
else
echo "mpi test passed!"
exit 0
fi
if [ -n "${PNETCDF_VERSION}" ] ; then
mpirun.mpich -np 4 python mpi_example.py NETCDF3_64BIT_DATA
if [ $? -ne 0 ] ; then
echo "PnetCDF mpi test failed!"
exit 1
else
echo "PnetCDF mpi test passed!"
fi
fi
fi
version 1.4.3.2 (tag v1.4.3.2rel)
==================================
version 1.5.0 (tag v1.5.0rel)
===============================
* added support for parallel IO in the classic netcdf-3 formats through the
pnetcdf library (pull request #897).
version 1.4.3.2 (tag v1.4.3.2)
===============================
* include missing membuf.pyx file in release source tarball.
version 1.4.3.1 (tag v1.4.3.1)
===================================
===============================
* fix bug in implementation of NETCDF4_CLASSIC support for parallel IO
in v1.4.3 release.
......
Metadata-Version: 1.1
Name: netCDF4
Version: 1.4.3.1
Version: 1.5.0
Author: Jeff Whitaker
Author-email: jeffrey s whitaker at noaa gov
Home-page: https://github.com/Unidata/netcdf4-python
......
......@@ -5,12 +5,17 @@
[![Windows Build Status](https://ci.appveyor.com/api/projects/status/fl9taa9je4e6wi7n/branch/master?svg=true)](https://ci.appveyor.com/project/jswhit/netcdf4-python/branch/master)
[![PyPI package](https://badge.fury.io/py/netCDF4.svg)](http://python.org/pypi/netCDF4)
[![Anaconda-Server Badge](https://anaconda.org/conda-forge/netCDF4/badges/version.svg)](https://anaconda.org/conda-forge/netCDF4)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.2592291.svg)](https://doi.org/10.5281/zenodo.2592291)
## News
For details on the latest updates, see the [Changelog](https://github.com/Unidata/netcdf4-python/blob/master/Changelog).
03/24/2019: Version [1.5.0](https://pypi.python.org/pypi/netCDF4/1.5.0) released. Parallel IO support for classic
file formats added using the pnetcdf library (contribution from Lars Pastewka, [pull request #897](https://github.com/Unidata/netcdf4-python/pull/897)).
03/08/2019: Version [1.4.3.2](https://pypi.python.org/pypi/netCDF4/1.4.3.2) released.
Include missing membuf.pyx file in source tarball.
Include missing membuf.pyx file in source tarball. No need to update if you installed
1.4.3.1 from a binary wheel.
03/07/2019: Version [1.4.3.1](https://pypi.python.org/pypi/netCDF4/1.4.3.1) released.
Fixes bug in implementation of NETCDF4_CLASSIC parallel IO support in 1.4.3.
......
......@@ -2,8 +2,19 @@
set -e
echo "Using downloaded netCDF version ${NETCDF_VERSION} with parallel capabilities enabled"
pushd /tmp
if [ -n "${PNETCDF_VERSION}" ]; then
echo "Using downloaded PnetCDF version ${PNETCDF_VERSION}"
wget https://parallel-netcdf.github.io/Release/pnetcdf-${PNETCDF_VERSION}.tar.gz
tar -xzf pnetcdf-${PNETCDF_VERSION}.tar.gz
pushd pnetcdf-${PNETCDF_VERSION}
./configure --prefix $NETCDF_DIR --enable-shared --disable-fortran --disable-cxx
NETCDF_EXTRA_CONFIG="--enable-pnetcdf"
make -j 2
make install
popd
fi
echo "Using downloaded netCDF version ${NETCDF_VERSION} with parallel capabilities enabled"
if [ ${NETCDF_VERSION} == "GITMASTER" ]; then
git clone http://github.com/Unidata/netcdf-c netcdf-c
pushd netcdf-c
......@@ -14,9 +25,10 @@ else
pushd netcdf-c-${NETCDF_VERSION}
fi
# for Ubuntu xenial
export CPPFLAGS="-I/usr/include/hdf5/mpich"
export CPPFLAGS="-I/usr/include/hdf5/mpich -I${NETCDF_DIR}/include"
export LDFLAGS="-L${NETCDF_DIR}/lib"
export LIBS="-lhdf5_mpich_hl -lhdf5_mpich -lm -lz"
./configure --prefix $NETCDF_DIR --enable-netcdf-4 --enable-shared --disable-dap --enable-parallel
./configure --prefix $NETCDF_DIR --enable-netcdf-4 --enable-shared --disable-dap --enable-parallel4 $NETCDF_EXTRA_CONFIG
make -j 2
make install
popd
<meta http-equiv="refresh" content="0; url=./netCDF4/index.html" />
This diff is collapsed.
# to run: mpirun -np 4 python mpi_example.py
import sys
from mpi4py import MPI
import numpy as np
from netCDF4 import Dataset
if len(sys.argv) == 2:
format = sys.argv[1]
else:
format = 'NETCDF4_CLASSIC'
rank = MPI.COMM_WORLD.rank # The process ID (integer 0-3 for 4-process run)
if rank == 0:
print('Creating file with format {}'.format(format))
nc = Dataset('parallel_test.nc', 'w', parallel=True, comm=MPI.COMM_WORLD,
info=MPI.Info(),format='NETCDF4_CLASSIC')
info=MPI.Info(),format=format)
# below should work also - MPI_COMM_WORLD and MPI_INFO_NULL will be used.
#nc = Dataset('parallel_test.nc', 'w', parallel=True)
d = nc.createDimension('dim',4)
......
......@@ -51,6 +51,7 @@ cdef extern from "netcdf.h":
NC_CLOBBER
NC_NOCLOBBER # Don't destroy existing file on create
NC_64BIT_OFFSET # Use large (64-bit) file offsets
NC_64BIT_DATA # Use cdf-5 format
NC_NETCDF4 # Use netCDF-4/HDF5 format
NC_CLASSIC_MODEL # Enforce strict netcdf-3 rules.
# Use these 'mode' flags for both nc_create and nc_open.
......@@ -703,7 +704,7 @@ IF HAS_NC_CREATE_MEM:
int flags
int nc_close_memio(int ncid, NC_memio* info);
IF HAS_NC_PAR:
IF HAS_PARALLEL4_SUPPORT or HAS_PNETCDF_SUPPORT:
cdef extern from "mpi-compat.h": pass
cdef extern from "netcdf_par.h":
ctypedef int MPI_Comm
......
......@@ -6,6 +6,7 @@ from ._netCDF4 import __doc__, __pdoc__
from ._netCDF4 import (__version__, __netcdf4libversion__, __hdf5libversion__,
__has_rename_grp__, __has_nc_inq_path__,
__has_nc_inq_format_extended__, __has_nc_open_mem__,
__has_nc_create_mem__,__has_cdf5_format__,__has_nc_par__)
__has_nc_create_mem__, __has_cdf5_format__,
__has_parallel4_support__, __has_pnetcdf_support__)
__all__ =\
['Dataset','Variable','Dimension','Group','MFDataset','MFTime','CompoundType','VLType','date2num','num2date','date2index','stringtochar','chartostring','stringtoarr','getlibversion','EnumType']
This diff is collapsed.
......@@ -56,7 +56,8 @@ def check_api(inc_dirs):
has_cdf5_format = False
has_nc_open_mem = False
has_nc_create_mem = False
has_nc_par = False
has_parallel4_support = False
has_pnetcdf_support = False
for d in inc_dirs:
try:
......@@ -65,7 +66,6 @@ def check_api(inc_dirs):
continue
has_nc_open_mem = os.path.exists(os.path.join(d, 'netcdf_mem.h'))
has_nc_par = os.path.exists(os.path.join(d, 'netcdf_par.h'))
for line in f:
if line.startswith('nc_rename_grp'):
......@@ -91,10 +91,15 @@ def check_api(inc_dirs):
for line in open(ncmetapath):
if line.startswith('#define NC_HAS_CDF5'):
has_cdf5_format = bool(int(line.split()[2]))
elif line.startswith('#define NC_HAS_PARALLEL4'):
has_parallel4_support = bool(int(line.split()[2]))
elif line.startswith('#define NC_HAS_PNETCDF'):
has_pnetcdf_support = bool(int(line.split()[2]))
break
return has_rename_grp, has_nc_inq_path, has_nc_inq_format_extended, \
has_cdf5_format, has_nc_open_mem, has_nc_create_mem, has_nc_par
has_cdf5_format, has_nc_open_mem, has_nc_create_mem, \
has_parallel4_support, has_pnetcdf_support
def getnetcdfvers(libdirs):
......@@ -488,7 +493,8 @@ if 'sdist' not in sys.argv[1:] and 'clean' not in sys.argv[1:]:
os.remove(netcdf4_src_c)
# this determines whether renameGroup and filepath methods will work.
has_rename_grp, has_nc_inq_path, has_nc_inq_format_extended, \
has_cdf5_format, has_nc_open_mem, has_nc_create_mem, has_nc_par = check_api(inc_dirs)
has_cdf5_format, has_nc_open_mem, has_nc_create_mem, \
has_parallel4_support, has_pnetcdf_support = check_api(inc_dirs)
# for netcdf 4.4.x CDF5 format is always enabled.
if netcdf_lib_version is not None and\
(netcdf_lib_version > "4.4" and netcdf_lib_version < "4.5"):
......@@ -498,7 +504,8 @@ if 'sdist' not in sys.argv[1:] and 'clean' not in sys.argv[1:]:
try:
import mpi4py
except ImportError:
has_nc_par = False
has_parallel4_support = False
has_pnetcdf_support = False
f = open(osp.join('include', 'constants.pyx'), 'w')
if has_rename_grp:
......@@ -544,16 +551,23 @@ if 'sdist' not in sys.argv[1:] and 'clean' not in sys.argv[1:]:
sys.stdout.write('netcdf lib does not have cdf-5 format capability\n')
f.write('DEF HAS_CDF5_FORMAT = 0\n')
if has_nc_par:
if has_parallel4_support:
sys.stdout.write('netcdf lib has netcdf4 parallel functions\n')
f.write('DEF HAS_NC_PAR = 1\n')
f.write('DEF HAS_PARALLEL4_SUPPORT = 1\n')
else:
sys.stdout.write('netcdf lib does not have netcdf4 parallel functions\n')
f.write('DEF HAS_NC_PAR = 0\n')
f.write('DEF HAS_PARALLEL4_SUPPORT = 0\n')
if has_pnetcdf_support:
sys.stdout.write('netcdf lib has pnetcdf parallel functions\n')
f.write('DEF HAS_PNETCDF_SUPPORT = 1\n')
else:
sys.stdout.write('netcdf lib does not have pnetcdf parallel functions\n')
f.write('DEF HAS_PNETCDF_SUPPORT = 0\n')
f.close()
if has_nc_par:
if has_parallel4_support or has_pnetcdf_support:
inc_dirs.append(mpi4py.get_include())
# mpi_incdir should not be needed if using nc-config
# (should be included in nc-config --cflags)
......@@ -570,7 +584,7 @@ else:
setup(name="netCDF4",
cmdclass=cmdclass,
version="1.4.3.2",
version="1.5.0",
long_description="netCDF version 4 has many features not found in earlier versions of the library, such as hierarchical groups, zlib compression, multiple unlimited dimensions, and new data types. It is implemented on top of HDF5. This module implements most of the new features, and can read and write netCDF files compatible with older versions of the library. The API is modelled after Scientific.IO.NetCDF, and should be familiar to users of that module.\n\nThis project is hosted on a `GitHub repository <https://github.com/Unidata/netcdf4-python>`_ where you may access the most up-to-date source.",
author="Jeff Whitaker",
author_email="jeffrey.s.whitaker@noaa.gov",
......
import glob, os, sys, unittest, struct
from netCDF4 import getlibversion,__hdf5libversion__,__netcdf4libversion__,__version__
from netCDF4 import __has_cdf5_format__, __has_nc_inq_path__, __has_nc_par__,\
__has_nc_create_mem__
from netCDF4 import __has_cdf5_format__, __has_nc_inq_path__, __has_nc_create_mem__, \
__has_parallel4_support__, __has_pnetcdf_support__
# can also just run
# python -m unittest discover . 'tst*py'
......@@ -16,7 +16,7 @@ if python3:
else:
test_files.remove('tst_unicode3.py')
sys.stdout.write('not running tst_unicode3.py ...\n')
if __netcdf4libversion__ < '4.2.1' or __has_nc_par__:
if __netcdf4libversion__ < '4.2.1' or __has_parallel4_support__ or __has_pnetcdf_support__:
test_files.remove('tst_diskless.py')
sys.stdout.write('not running tst_diskless.py ...\n')
if not __has_nc_inq_path__:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment