netcdf-c/ncdump/chunkspec.h
Dennis Heimbigner b02703aa24 This PR primarily addresses Issue https://github.com/Unidata/netcdf-c/issues/725.
After a long discussion, I implemented the rules at the end of that issue.
They are documented in nccopy.1.

Additionally, I added a new, per-variable, -c flag that allows
for the direct setting of the chunking parameters for a variable.
The form is
    -c var:c1,c2,...ck
where var is the name of the variable (possibly a fully qualified name)
and the ci are the chunksizes for that variable. It must be the case
that the rank of the variable is k. If the new form is used as well
as the old form, then the new form overrides the old form for the
specified variable. Note that multiple occurrences of the new form
-c flag may be specified.

Misc. Other fixes
1. Added -M <size> option to nccopy to specify the minimum
   allowable chunksize.
2. Removed the unused variables from bigmeta.c
   (Issue https://github.com/Unidata/netcdf-c/issues/1079)
3. Fixed failure of nc_test4/tst_filter.sh by using the new -M
   flag (#1) to allow filter test on a small chunk size.
2018-07-26 20:16:02 -06:00

43 lines
1.3 KiB
C

/*********************************************************************
* Copyright 2010, UCAR/Unidata
* See netcdf/COPYRIGHT file for copying and redistribution conditions.
* $Id $
*********************************************************************/
#ifndef _CHUNKSPEC_H_
#define _CHUNKSPEC_H_
/* Parse chunkspec string and convert into internal data structure,
* associating dimids from open file or group specified by ncid with
* corresponding chunk sizes */
extern int
chunkspec_parse(int ncid, const char *spec);
/* Return chunk size in chunkspec string specified for dimension
* corresponding to dimid, 0 if not found */
extern size_t
dimchunkspec_size(int dimid);
/* Return number of dimensions for which chunking was specified in
* chunkspec string on command line, 0 if no chunkspec string was
* specified. */
extern int
dimchunkspec_ndims(void);
/* Return whether chunking should be omitted, due to explicit
* command-line specification. */
extern bool_t
dimchunkspec_omit(void);
extern bool_t varchunkspec_omit(int grpid, int varid);
extern size_t* varchunkspec_chunksizes(int grpid, int varid);
extern size_t varchunkspec_ndims(int grpid, int varid);
extern bool_t varchunkspec_exists(int grpid, int varid);
extern void chunkspecinit(void);
#endif /* _CHUNKSPEC_H_ */