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

Add support for multiple filters per variable. #1639

Merged
merged 7 commits into from
Feb 28, 2020

Conversation

DennisHeimbigner
Copy link
Collaborator

@DennisHeimbigner DennisHeimbigner commented Feb 16, 2020

Support has been added for multiple filters per variable. This
affects a number of components in netcdf. The new APIs are
documented in NUG/filters.md.

The primary changes are:

  • A set of new functions are provided (see include/netcdf_filter.h).
    • Obtain a list of the filters associated with a variable
    • Obtain the parameters for a specific filter.
  • The existing nc_inq_var_filter function now returns info
    about the first defined filter.
  • The utilities (ncgen, ncdump, and nccopy) now support
    an extended format for specifying a sequence of filters.
    The general form is __<filter>|<filter>..._.
  • The ncdump _Filter attribute now dumps a list of all the
    filters associated with a variable using the above new format.
  • Filter specifications can now use a filter name instead of number
    for filters known to the netcdf library, which in turn is taken
    from the HDF5 filter registration page.
  • New errors are defined: NC_EFILTER and NC_ENOFILTER. The latter
    is returned if an attempt is made to access an unknown filter.
  • Internally, the dispatch table has been extended to add a function
    to handle all of the filter functions.
  • New, filter-related, tests were added to nc_test4.
  • A new plugin was added to the plugins directory to help with testing.

Notes:

  1. The shuffle and fletcher32 filters are not part of the multifilter system.

Misc. changes:

  1. A debug module was added to libhdf5 to help catch error locations.

re: Unidata#1584

Support has been added for multiple filters per variable.  This
affects a number of components in netcdf. The new APIs are
documented in NUG/filters.md.

The primary changes are:
* A set of new functions are provided (see __include/netcdf_filter.h__).
    - Obtain a list of the filters associated with a variable
    - Obtain the parameters for a specific filter.
* The existing __nc_inq_var_filter__ function now returns info
  about the first defined filter.
* The utilities (ncgen, ncdump, and nccopy) now support
  an extended format for specifying a sequence of filters.
  The general form is __<filter>|<filter>..._.
* The ncdump **_Filter** attribute now dumps a list of all the
  filters associated with a variable using the above new format.
* Filter specifications can now use a filter name instead of number
  for filters known to the netcdf library, which in turn is taken
  from the HDF5 filter registration page.
* New errors are defined: NC_EFILTER and NC_ENOFILTER. The latter
  is returned if an attempt is made to access an unknown filter.
* Internally, the dispatch table has been extended to add a function
  to handle all of the filter functions.
* New, filter-related, tests were added to nc_test4.
* A new plugin was added to the plugins directory to help with testing.

Notes:
1. The shuffle and fletcher32 filters are not part of the multifilter system.

Misc. changes:
1. A debug module was added to libhdf5 to help catch error locations.
@WardF
Copy link
Member

WardF commented Feb 17, 2020

Thanks @DennisHeimbigner, reviewing now! Looks good so far!

@WardF WardF self-assigned this Feb 17, 2020
@WardF WardF added this to the 4.7.4 milestone Feb 17, 2020
@edwardhartnett
Copy link
Contributor

@WardF it would be good to merge this. Then I can adjust #1635, which should be merged before the next release, if possible.

@edwardhartnett
Copy link
Contributor

These conflicts are probably the result of a recent merge of my dispatch version work. Possibly it would have been better to merge Dennis' PR first. I would try to fix these, but I have no write permissions on this branch. ;-(

@edwardhartnett
Copy link
Contributor

Also, nc_test4/tst_filterparser.c fails address sanitizer checks due to a memory leak in the test. It's fixed by inserting this as line 251 of tst_filterparser.c:

free(pfs);

I have fixed this on my branch and am running it through my CI system now, but I'll wait to put up any PR...

@DennisHeimbigner
Copy link
Collaborator Author

ok, thanks for the fix.

@DennisHeimbigner
Copy link
Collaborator Author

Wait, we seem to be out of synch. There is no variable named pfs
in tst_filterparser.c. Please send me the file you are using so I can resolve this.

@edwardhartnett
Copy link
Contributor

OK, why don't you get these changes in and then I can rerun my CI to see if there is anything to fix...

@edwardhartnett
Copy link
Contributor

If it's easier to roll back the last two of my PRs that were merged, then this PR could be merged, probably without conflict, and I can reapply my changes. I'm happy to do this if it will help...

@DennisHeimbigner
Copy link
Collaborator Author

I fixed the conflicts. Why is it not rebuilding?

@edwardhartnett
Copy link
Contributor

When you fixed the conflicts, did you do a git add for the conflicted files?

Alternatively, you can use the github gui to resolve the conflicts.

@DennisHeimbigner
Copy link
Collaborator Author

Ok, I think this PR is ready to go.

@edwardhartnett
Copy link
Contributor

edwardhartnett commented Feb 28, 2020

In order to compile this branch for parallel builds, I had to change line 449 of libsrc4/nc4var.c from:

if ((var->deflate || var->shuffle || var->fletcher32) &&
to

if ((nclistlength(var->filters) || var->shuffle || var->fletcher32) &&

However, this then failed the szip parallel write test in nc_test4/tst_parallel5.c. I will append output of the logging. (However, I later found the fix - see next message.)

In order to run this test you must build HDF5 for parallel with szip, then you must build netcdf-c with that HDF5. (Recall that for the HDF5 configure you must use --enable-parallel, and for the netcdf-c configure you must use --enable-parallel-tests.)

This also failed on your branch before merging in recent changes, so this is not a result of the recent merge actions.

I don't know what is going on with this error, I'm still trying to figure it out...

make tst_parallel5 && mpiexec -n 4 ./tst_parallel5
depbase=`echo tst_parallel5.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
mpicc -DHAVE_CONFIG_H -I. -I..  -I../include -I../oc2 -I/usr/local/hdf5-1.10.6_mpich_szip/include  -g -Wall -MT tst_parallel5.o -MD -MP -MF $depbase.Tpo -c -o tst_parallel5.o tst_parallel5.c &&\
mv -f $depbase.Tpo $depbase.Po
/bin/bash ../libtool  --tag=CC   --mode=link mpicc  -g -Wall  -L/usr/local/hdf5-1.10.6_mpich_szip/lib -o tst_parallel5 tst_parallel5.o ../liblib/libnetcdf.la -lhdf5_hl -lhdf5 -lm -ldl -lz -lcurl 
libtool: link: mpicc -g -Wall -o .libs/tst_parallel5 tst_parallel5.o  -L/usr/local/hdf5-1.10.6_mpich_szip/lib ../liblib/.libs/libnetcdf.so /usr/local/hdf5-1.10.6_mpich_szip/lib/libhdf5_hl.so /usr/local/hdf5-1.10.6_mpich_szip/lib/libhdf5.so -lm -ldl -lz /usr/lib/x86_64-linux-gnu/libcurl-nss.so -pthread -Wl,-rpath -Wl,/usr/local/hdf5-1.10.6_mpich_szip/lib

*** Testing parallel I/O.
*** testing whether we can write 0 elements from some tasks...ok.
*** testing enum type and parallel I/O...ok.
*** testing compound type and parallel I/O...ok.
*** testing string type and parallel I/O...ok.
*** testing NC_BYTE type and parallel I/O...ok.
*** testing szip compression with parallel I/O...		NC4_create: path tst_parallel5.nc cmode 0x1000 parameters 0x7fff0b3f8d70
	NC4_create: path tst_parallel5.nc cmode 0x1000 parameters 0x7ffe2c131720
	HDF5 error messages turned on.
			nc4_create_file: path tst_parallel5.nc mode 0x1000NC4_create: path tst_parallel5.nc cmode 0x1000 parameters 0x7ffe6d4123d0
	HDF5 error messages turned on.
			nc4_create_file: path tst_parallel5.nc mode 0x1000
			HDF5 error messages turned on.
			nc4_create_file: path tst_parallel5.nc mode 0x1000
			nc4_grp_list_add: name / 

			nc4_grp_list_add: name / 
	nc4_grp_list_add: name / 
	NC4_create: path tst_parallel5.nc cmode 0x1000 parameters 0x7ffd14d3b740
	HDF5 error messages turned on.
			nc4_create_file: path tst_parallel5.nc mode 0x1000
			nc4_grp_list_add: name / 
		NC4_def_dim: ncid 0x10000 name Barrels len 256
		NC4_def_dim: ncid 0x10000 name Barrels len 256
		NC4_def_var: name Best_Sligo_Rags type 5 ndims 1
		NC4_def_var: name Best_Sligo_Rags type 5 ndims 1
						find_default: chunksizes for var Best_Sligo_Ragssizes=256
find_default: chunksizes for var Best_Sligo_Ragssizes=256
		NC4_filter_actions: ncid 0x10000 varid 0 op=1
		NC4_filter_actions: ncid 0x10000 varid 0 op=1
		NC4_enddef: ncid 0x10000
			nc4_enddef_netcdf4_file
					NC4_def_dim: ncid 0x10000 name Barrels len 256
NC4_enddef: ncid 0x10000
			nc4_enddef_netcdf4_file
			sync_netcdf4_file
	sync_netcdf4_file
		*** NetCDF-4 Internal Metadata: int_ncid 0x0 ext_ncid 0x10000
		FILE - path: tst_parallel5.nc cmode: 0x1009 parallel: 1 redef: 0 fill_mode: 0 no_write: 0 next_nc_grpid: 1
		 GROUP - / nc_grpid: 0 nvars: 1 natts: 0
		NC4_def_var: name Best_Sligo_Rags type 5 ndims 1
	*** NetCDF-4 Internal Metadata: int_ncid 0x0 ext_ncid 0x10000
		FILE - path: tst_parallel5.nc cmode: 0x1009 parallel: 1 redef: 0 fill_mode: 0 no_write: 0 next_nc_grpid: 1
		 GROUP - / nc_grpid: 0 nvars: 1 natts: 0
				 DIMENSION - dimid: 0 name: Barrels len: 256 unlimited: 0
		 VARIABLE - varid: 0 name: Best_Sligo_Rags ndims: 1 dimscale: 0 dimids: 0 storage: chunked
			nc4_rec_write_groups_types: grp->hdr.name /
 DIMENSION - dimid: 0 name: Barrels len: 256 unlimited: 0
		 VARIABLE - varid: 0 name: Best_Sligo_Rags ndims: 1 dimscale: 0 dimids: 0 storage: chunked					nc4_rec_write_metadata: grp->hdr.name /, bad_coord_order 0

			nc4_rec_write_groups_types: grp->hdr.name /
			nc4_rec_write_metadata: grp->hdr.name /, bad_coord_order 0
NC4_def_dim: ncid 0x10000 name Barrels len 256
			find_default: chunksizes for var Best_Sligo_Ragssizes=256
				NC4_def_var: name Best_Sligo_Rags type 5 ndims 1
NC4_filter_actions: ncid 0x10000 varid 0 op=1
	NC4_enddef: ncid 0x10000
			nc4_enddef_netcdf4_file
			sync_netcdf4_file
		*** NetCDF-4 Internal Metadata: int_ncid 0x0 ext_ncid 0x10000
				find_default: chunksizes for var Best_Sligo_Ragssizes=256
	FILE - path: tst_parallel5.nc cmode: 0x1009 parallel: 1 redef: 0 fill_mode: 0 no_write: 0 next_nc_grpid: 1
		 GROUP - / nc_grpid: 0 nvars: 1 natts: 0
		NC4_filter_actions: ncid 0x10000 varid 0 op=1
			 DIMENSION - dimid: 0 name: Barrels len: 256 unlimited: 0
		 VARIABLE - varid: 0 name: Best_Sligo_Rags ndims: 1 dimscale: 0 dimids: 0 storage: chunkedNC4_enddef: ncid 0x10000
			nc4_enddef_netcdf4_file
	
			nc4_rec_write_groups_types: grp->hdr.name /
					sync_netcdf4_file
		*** NetCDF-4 Internal Metadata: int_ncid 0x0 ext_ncid 0x10000
nc4_rec_write_metadata: grp->hdr.name /, bad_coord_order 0
		FILE - path: tst_parallel5.nc cmode: 0x1009 parallel: 1 redef: 0 fill_mode: 0 no_write: 0 next_nc_grpid: 1
		 GROUP - / nc_grpid: 0 nvars: 1 natts: 0
		 DIMENSION - dimid: 0 name: Barrels len: 256 unlimited: 0			var_create_dataset:: name Best_Sligo_Rags

		 VARIABLE - varid: 0 name: Best_Sligo_Rags ndims: 1 dimscale: 0 dimids: 0 storage: chunked
			var_create_dataset:: name Best_Sligo_Rags
			nc4_rec_write_groups_types: grp->hdr.name /
			nc4_rec_write_metadata: grp->hdr.name /, bad_coord_order 0
			var_create_dataset:: name Best_Sligo_Rags
			var_create_dataset:: name Best_Sligo_Rags
		attach_dimscales: attaching scale for dimid 0 to var Best_Sligo_Rags
		attach_dimscales: attaching scale for dimid 0 to var Best_Sligo_Rags
		attach_dimscales: attaching scale for dimid 0 to var Best_Sligo_Rags
		attach_dimscales: attaching scale for dimid 0 to var Best_Sligo_Rags
			NC4_put_vars: var->hdr.name Best_Sligo_Rags mem_nc_type 5
			NC4_put_vars: var->hdr.name Best_Sligo_Rags mem_nc_type 5
			NC4_put_vars: var->hdr.name Best_Sligo_Rags mem_nc_type 5
			NC4_put_vars: var->hdr.name Best_Sligo_Rags mem_nc_type 5
HDF5-DHDF5-DIAG: Error dIAG: Error dHDF5-DIAG: Error etected in HDF5 (1.10.6) etected in HDF5detected in HDF5MPI-process 3:
 (1.10.6) MPI-pro (1.10.6) MPI-proce  #000: H5Dio.c line 336cess 0:
  #HDF5-DIAG: Error ss 2:
  #000: H5Dio.c in H5Dwrite(): can't write data
    major: Dataset000: H5Dio.c line 336 in detected in HDF5  line 336 in H5Dwrite(): 
    minor: Write failed
  #001: H5Dio.cH5Dwrite(): can't write data
    major: Dataset
(1.10.6) MPI-procescan't write data
    major: Dataset
    min line 815 in H5D__write(): unable to adjust I/O info for parallel I/O
    ma    minor: Write failed
  #001: s 1:
  #000: or: Write failed
  #001: H5Dio.c lijor: Dataset
    minor: Unable to initialize object
  #H5Dio.c line 815 in H5D__write(): H5Dio.c line 336 in H5Dwritene 815 in H5D__write(): unable to adjust I/O info for parallel I/O
    002: H5Dio.c line 1228 in H5D__ioinfo_adjust(): unable to adjust I/O info for parallel I/O
    major: Dataset
    minor(): can't write data
    major: major: Dataset
    minor: Can't perform independent write with filters in pipeline.
    The following caused a break from collective I/O:
        Local causes: independent I/O was requested
        Global causes: independent I/O was requested
    major: Low-level I/O
    minor: Can't perform independent IO: Unable to initialize object
  #002: H5Dio.c line Dataset
    minor: Write failed
  Unable to initialize object
  #002: H5Dio.c line 1228 
ERROR: file hdf5var.c, line 1742.
NetCDF: HDF error
HDF5-DIAG: Error1228 in H5D__ioinfo_adjust(): Can't perform independent write with filters in pipeline.
    The following caused a break from collective I/O:
        Local causes: independent I/O was requested
        Global causes: independent I/O was requested
    majo#001: H5Dio.c line 815in H5D__ioinfo_adjust(): Can't perform independent write with filters in pipeline.
    The following caused a break from collective I/O:
        Local causes: independent I/O was requested
        Global causes: independent I/O was requested
    majo detected in HDF5 (1.10.6) MPr: Low-level I/O
    minor: Can't perform independent IO
 in H5D__write(): unable to adjust I/O info for parallel I/O
    mr: Low-level I/O
    minor: Can't perform independent IO
I-process 3:
  #000: H5Dio.cERROR: file hdf5var.c, line 1742.
NetCDF: HDF error
HDF5-DIAG: Errajor: Dataset
    minoERROR: file hdf5var.c, line 1742.
NetCDF: HDF error
HDF5-DIAG: Er line 336 in H5Dwrite(): can't write data
    mor detected in HDF5 (1.10.6)r: Unable to initialize object
  #002: H5Dio.c ror detected in HDF5 (ajor: Dataset
    minor: Write failed
  # MPI-process 0:
  #line 1228 in H5D__ioinfo_adjust()1.10.6) MPI-process 2:
001: H5Dio.c line 815 in H5D__write(): unable to adjust I/O info for parallel I/O000: H5Dio.c line 336 in H5Dwrite(): Can't perform independent write with filters in pipeline.
    The following caused a break from collective I/O:
        Local causes: independent I/O was requested
        Global causes: independent I/O was requested
    major: Low-level I/O  #000: H5Dio.c line 336 in 
    major: Dataset
    minor: Unable to initialize object
  : can't write data
    major: Dataset
    minor
    minor: Can't perform independent IO
ERROR: file hdf5var.c, line 1742.
NetCDF: HDF errorH5Dwrite(): can't write data
    major: Dataset
#002: H5Dio.c line 1228 in H5D__ioinfo_adjust(): Write failed
  #001: H5Dio.c line
HDF5-DIAG: Erro    minor: Write failed
  #001:: Can't perform independent write with filters in pipeline.
    The following caused a break from collective I/O:
        Local causes: independent I/O was requested
        Global causes: independent I/O was requested
    major: Low-level I/O
    minor:  815 in H5D__write(): unable to adjust I/O info for parallel I/O
    r detected in HDF5 H5Dio.c line 815 in H5D__write(): Can't perform independent IO
	NC4_close: ncid 0x10000
			nc4_close_hdf5_file: h5->path tst_parallel5.nc abort 0major: Dataset
    minor:  (1.10.6) MPI-procesunable to adjust I/O info for parallel I/O
    major: Dataset
    mino
			sync_netcdf4_file
		*** NetCDF-4 Internal Metadata: int_ncid 0x0 ext_ncid 0x10000
		FILE - path: tst_parallel5.nc cmode: 0x1009 parallel: 1 redef: 0 fill_mode: 0 no_write: 0 next_nc_grpid: 1
		 GROUP - / nc_grpid: 0 nvars: 1 natts: 0
		 DIMENSION - dimid: 0 name: Barrels len: 256 unlimited: 0Unable to initialize object
  #002: H5Dio.c line 1228 in H5D__ioinfo_adjust(): s 1:
  #000: H5Dio.c lr: Unable to initialize object
  #002: H5Dio.c li
		 VARIABLE - varid: 0 name: Best_Sligo_Rags ndims: 1 dimscale: 0 dimids: 0 storage: chunked
			nc4_rec_write_groups_types: grp->hdr.name /
			nc4_rec_write_metadata: grp->hdr.name /, bad_coord_order 0
Can't perform independent write with filters in pipeline.
    The following caused a break from collective I/O:
        Local causes: independent I/O was requested
        Global causes: independent I/O was requested
    major: Low-level I/O
    minor: Can't perform independent IO
ine 336 in H5Dwrite(): ne 1228 in H5D__ioinfo_adjust(): Can't perform independent write with filters in pipeline.
    The following caused a break from collective I/O:
        Local causes: independent I/O was requested
        Global causes: independent I/O was requested
	NC4_close: ncid 0x10000
			can't write data
    major:     major: Low-level I/O
    mi			nc4_rec_grp_HDF5_del: grp->name /
			closing HDF5 dataset 360287970189639701
nc4_close_hdf5_file: h5->path tst_parallel5.nc abort 0
			sync_netcdf4_file
		*** NetCDF-4 Internal Metadata: int_ncid 0x0 ext_ncid 0x10000
		FILE - path: tst_parallel5.nc cmode: 0x1009 parallel: 1 redef: 0 fill_mode: 0 no_write: 0 next_nc_grpid: 1
		 GROUP - / nc_grpid: 0 nvars: 1 natts: 0
		Dataset
    minor: Write failed
nor: Can't perform independent IO
 DIMENSION - dimid: 0 name: Barrels len: 256 unlimited: 0
		 VARIABLE - varid: 0 name: Best_Sligo_Rags ndims: 1 dimscale: 0 dimids: 0 storage: chunked
			nc4_rec_write_groups_types: grp->hdr.name /
			nc4_rec_write_metadata: grp->hdr.name /, bad_coord_order 0
  #001: H5Dio.c line 	NC4_close: ncid 0x10000
			nc4_close_hdf5_file: h5->path tst_parallel5.nc abort 0
			sync_netcdf4_file
			nc4_close_netcdf4_file: h5->path tst_parallel5.nc abort 0
			nc4_rec_grp_HDF5_del: grp->name /
			closing HDF5 dataset 360287970189639705
815 in H5D__write(): unable to adjust I/O info for parallel I/O
		*** NetCDF-4 Internal Metadata: int_ncid 0x0 ext_ncid 0x10000
		FILE - path: tst_parallel5.nc cmode: 0x1009 parallel: 1 redef: 0 fill_mode: 0 no_write: 0 next_nc_grpid: 1
		 GROUP - / nc_grpid: 0 nvars: 1 natts: 0
		    major:  DIMENSION - dimid: 0 name: Barrels len: 256 unlimited: 0
		 VARIABLE - varid: 0 name: Best_Sligo_Rags ndims: 1 dimscale: 0 dimids: 0 storage: chunked
					nc4_close_netcdf4_file: h5->path tst_parallel5.nc abort 0
Dataset
    minor: 	nc4_rec_write_groups_types: grp->hdr.name /
			nc4_rec_write_metadata: grp->hdr.name /, bad_coord_order 0
Unable to initialize object
  #002: H5Dio.c li			nc4_rec_grp_HDF5_del: grp->name /
		ne 1228 in H5D__ioinfo_adjust	closing HDF5 dataset 360287970189639701
(): Can't perform independent write with filters in pipeline.
    The following caused a break from collective I/O:
        Local causes: independent I/O was requested
        Global causes: independent I/O was requested
    major: Low-level I/O
    minor: Can't perform independent IO
			nc4_close_netcdf4_file: h5->path tst_parallel5.nc abort 0
	NC4_close: ncid 0x10000
			nc4_close_hdf5_file: h5->path tst_parallel5.nc abort 0
			sync_netcdf4_file
		*** NetCDF-4 Internal Metadata: int_ncid 0x0 ext_ncid 0x10000
		FILE - path: tst_parallel5.nc cmode: 0x1009 parallel: 1 redef: 0 fill_mode: 0 no_write: 0 next_nc_grpid: 1
		 GROUP - / nc_grpid: 0 nvars: 1 natts: 0
		 DIMENSION - dimid: 0 name: Barrels len: 256 unlimited: 0
		 VARIABLE - varid: 0 name: Best_Sligo_Rags ndims: 1 dimscale: 0 dimids: 0 storage: chunked
			nc4_rec_write_groups_types: grp->hdr.name /
			nc4_rec_write_metadata: grp->hdr.name /, bad_coord_order 0
			nc4_rec_grp_HDF5_del: grp->name /
			closing HDF5 dataset 360287970189639701
			nc4_close_netcdf4_file: h5->path tst_parallel5.nc abort 0
			nc4_rec_grp_del: grp->name /
			nc4_rec_grp_del: grp->name /
			nc4_rec_grp_del: grp->name /
			nc4_rec_grp_del: grp->name /
	NC4_open: path tst_parallel5.nc mode 4096 params 2c131720
	HDF5 error messages turned on.
			nc4_open_file: path tst_parallel5.nc mode 4096
			nc4_grp_list_add: name / 
	NC4_open: path tst_parallel5.nc mode 4096 params 6d4123d0
	HDF5 error messages turned on.
	NC4_open: path tst_parallel5.nc mode 4096 params b3f8d70
	HDF5 error messages turned on.
			nc4_open_file: path tst_parallel5.nc mode 4096
			nc4_grp_list_add: name / 
			nc4_open_file: path tst_parallel5.nc mode 4096
			nc4_grp_list_add: name / 	NC4_open: path tst_parallel5.nc mode 4096 params 14d3b740
	HDF5 error messages turned on.
			nc4_open_file: path tst_parallel5.nc mode 4096
	
		nc4_grp_list_add: name / 
			rec_read_metadata: grp->hdr.name /
			rec_read_metadata: grp->hdr.name /
			rec_read_metadata: grp->hdr.name /
			rec_read_metadata: grp->hdr.name /
			found dataset Barrels
			found dataset Barrels
			found dataset Barrels			found dataset Barrels

			found dataset Best_Sligo_Rags			found dataset Best_Sligo_Rags

				read_coord_dimids: var->hdr.name Best_Sligo_Rags
		read_coord_dimids: var->hdr.name Best_Sligo_Rags
			found dataset Best_Sligo_Rags
			found dataset Best_Sligo_Rags
			read_coord_dimids: var->hdr.name Best_Sligo_Rags
			read_coord_dimids: var->hdr.name Best_Sligo_Rags
		*** NetCDF-4 Internal Metadata: int_ncid 0x0 ext_ncid 0x10000
				*** NetCDF-4 Internal Metadata: int_ncid 0x0 ext_ncid 0x10000
		FILE - path: tst_parallel5.nc cmode: 0x1008 parallel: 1 redef: 0 fill_mode: 0 no_write: 1 next_nc_grpid: 1
FILE - path: tst_parallel5.nc cmode: 0x1008 parallel: 1 redef: 0 fill_mode: 0 no_write: 1 next_nc_grpid: 1
		 GROUP - / nc_grpid: 0 nvars: 1 natts: 0
		 DIMENSION - dimid: 0 name: Barrels len: 256 unlimited: 0
		 VARIABLE - varid: 0 name: Best_Sligo_Rags ndims: 1 dimscale: 0 dimids: 0 storage: unknown
		 GROUP - / nc_grpid: 0 nvars: 1 natts: 0
		 DIMENSION - dimid: 0 name: Barrels len: 256 unlimited: 0
		 VARIABLE - varid: 0 name: Best_Sligo_Rags ndims: 1 dimscale: 0 dimids: 0 storage: unknown
			nc4_get_var_meta: var Best_Sligo_Rags
			nc4_get_var_meta: var Best_Sligo_Rags		*** NetCDF-4 Internal Metadata: int_ncid 0x0 ext_ncid 0x10000
	
	FILE - path: tst_parallel5.nc cmode: 0x1008 parallel: 1 redef: 0 fill_mode: 0 no_write: 1 next_nc_grpid: 1
		 GROUP - / nc_grpid: 0 nvars: 1 natts: 0
		 DIMENSION - dimid: 0 name: Barrels len: 256 unlimited: 0
				*** NetCDF-4 Internal Metadata: int_ncid 0x0 ext_ncid 0x10000
		FILE - path: tst_parallel5.nc cmode: 0x1008 parallel: 1 redef: 0 fill_mode: 0 no_write: 1 next_nc_grpid: 1
					NC4_get_vars: var->hdr.name Best_Sligo_Rags mem_nc_type 5
 VARIABLE - varid: 0 name: Best_Sligo_Rags ndims: 1 dimscale: 0 dimids: 0 storage: unknown
 GROUP - / nc_grpid: 0 nvars: 1 natts: 0
		 DIMENSION - dimid: 0 name: Barrels len: 256 unlimited: 0
		 VARIABLE - varid: 0 name: Best_Sligo_Rags ndims: 1 dimscale: 0 dimids: 0 storage: unknown
			nc4_get_var_meta: var Best_Sligo_Rags
						NC4_get_vars: var->hdr.name Best_Sligo_Rags mem_nc_type 5
nc4_get_var_meta: var Best_Sligo_Rags
	NC4_close: ncid 0x10000
			nc4_close_hdf5_file: h5->path tst_parallel5.nc abort 0
			nc4_rec_grp_HDF5_del: grp->name /
						NC4_get_vars: var->hdr.name Best_Sligo_Rags mem_nc_type 5
closing HDF5 dataset 360287970189639703
			NC4_get_vars: var->hdr.name Best_Sligo_Rags mem_nc_type 5
	NC4_close: ncid 0x10000
			nc4_close_netcdf4_file: h5->path tst_parallel5.nc abort 0
			nc4_close_hdf5_file: h5->path tst_parallel5.nc abort 0
			nc4_rec_grp_HDF5_del: grp->name /
			closing HDF5 dataset 360287970189639707
	NC4_close: ncid 0x10000
			nc4_close_netcdf4_file: h5->path tst_parallel5.nc abort 0
			nc4_close_hdf5_file: h5->path tst_parallel5.nc abort 0
			nc4_rec_grp_HDF5_del: grp->name /
			closing HDF5 dataset 360287970189639703
	NC4_close: ncid 0x10000
			nc4_close_hdf5_file: h5->path tst_parallel5.nc abort 0
			nc4_rec_grp_HDF5_del: grp->name /
			closing HDF5 dataset 360287970189639703
			nc4_close_netcdf4_file: h5->path tst_parallel5.nc abort 0
			nc4_close_netcdf4_file: h5->path tst_parallel5.nc abort 0
			nc4_rec_grp_del: grp->name /
			nc4_rec_grp_del: grp->name /
			nc4_rec_grp_del: grp->name /
			nc4_rec_grp_del: grp->name /
Sorry! Unexpected result, tst_parallel5.c, line: 355
Sorry! Unexpected result, tst_parallel5.c, line: 355
Sorry! Unexpected result, tst_parallel5.c, line: 355
Sorry! Unexpected result, tst_parallel5.c, line: 355
ed@mikado:~/noaa/netcdf-c/nc_test4$ 

@edwardhartnett
Copy link
Contributor

OK I found the problem. In hdf5filter.c I had to change the code around line 307 from:

#ifndef HDF5_SUPPORTS_PAR_FILTERS
/* Switch to collective access. HDF5 requires collevtive access
         * for filter use with parallel I/O. */
        if (h5->parallel)
            var->parallel_access = NC_COLLECTIVE;
#endif /* HDF5_SUPPORTS_PAR_FILTERS */

to:

#ifndef HDF5_SUPPORTS_PAR_FILTERS
        if (h5->parallel)
            return NC_EINVAL;
#else
        /* Switch to collective access. HDF5 requires collevtive access
         * for filter use with parallel I/O. */
        if (h5->parallel)
            var->parallel_access = NC_COLLECTIVE;
#endif /* HDF5_SUPPORTS_PAR_FILTERS */

@DennisHeimbigner
Copy link
Collaborator Author

Ok, I pushed Ed's fix for the parallel filters problem.

@WardF
Copy link
Member

WardF commented Feb 28, 2020

Testing now, thanks Dennis!

@WardF WardF merged commit 0014db9 into Unidata:master Feb 28, 2020
@edwardhartnett
Copy link
Contributor

Unfortunately the fix for nc4var.c above was not applied, so parallel builds on master are now broken. ;-)

I will have a PR up shortly with a PR.

@WardF I suggest you add a parallel build to travis to catch this in future. We do build PIO with MPICH on travis, so it can be done...

@DennisHeimbigner
Copy link
Collaborator Author

Whar nc4var fix are you referring to?

@DennisHeimbigner
Copy link
Collaborator Author

Oh, you mean the hdf5filter fix. There is a commit for it:
10d227f
I reversed the ifndef to be ifdef, but otherwise it looks the same to me.
Wonder what is going on?

@edwardhartnett
Copy link
Contributor

No, there were two fixes, one in hdf5filter.c and one in nc4var.c. I have a PR up now with the nc4var.c change - it's just one line of code.

I don't yet know what is happening with my cmake tests, I'll take a look...

@DennisHeimbigner DennisHeimbigner deleted the multifilter.dmh branch March 29, 2020 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can more than one filter be applied to a variable?
3 participants