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

YAA (Yet Another Aggregation) #1264

Merged
merged 30 commits into from
Jan 2, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
30d63bb
Fix failings of nc_test/run_inmemory.sh
DennisHeimbigner Dec 5, 2018
3054002
Eliminate nested comments
gsjaardema Dec 7, 2018
da58a31
merged ejh_next_23
edhartnett Dec 11, 2018
3c9a141
moved function detect_preserve_dimids and made it static
edhartnett Dec 11, 2018
ef5a39e
cleaned up hdf5internal.c
edhartnett Dec 11, 2018
7d168f7
cleaned up nc4internal.c
edhartnett Dec 11, 2018
89b2c48
added benchmark program tst_wrf_reads.c
edhartnett Dec 11, 2018
f724fe6
uncommented test in tst_interops.c
edhartnett Dec 11, 2018
53bdb74
fixed error handling of write_netcdf4_dimid()
edhartnett Dec 11, 2018
d7b657a
cleaned up comments, changed loop to use ncindexlookup() instead of l…
edhartnett Dec 11, 2018
39a0f82
changed loop to use ncindexlookup() instead of looping through the names
edhartnett Dec 11, 2018
7b72d0b
fixed error handling in attach_dimscales()
edhartnett Dec 11, 2018
26239a0
cleaned up loop reattaching dimscales
edhartnett Dec 11, 2018
1a0cfb7
fixed error handling in write_var()
edhartnett Dec 11, 2018
8e1d781
fixed error handling in write_dim(), also converted dimscale creation…
edhartnett Dec 11, 2018
28aa22f
cleanup and some comments for rec_write_metadata()
edhartnett Dec 11, 2018
dc1115a
moved rec_match_dimscales() to hdf5open.c, made it faster by skipping…
edhartnett Dec 11, 2018
aaa5a50
cleanup of hdf5open.c, now check for COORDINATES hidden att and use i…
edhartnett Dec 11, 2018
8ca5a1a
Merge branch 'master' into ejh_fast_var_prep
edhartnett Dec 12, 2018
3697f43
whitespace fixes in header file, fixed enable-benchmarks doc string i…
edhartnett Dec 17, 2018
77b3a81
starting to deal with var metadata separately
edhartnett Dec 17, 2018
e9bd948
split out some var meta reading, fixed setting of var->container
edhartnett Dec 17, 2018
aa16d29
fixed comment
edhartnett Dec 17, 2018
dc982ef
moved tst_attsperf to be with rest of benchmarks
edhartnett Dec 17, 2018
b2fbc71
added test, uncommented some test code
edhartnett Dec 17, 2018
6b2156b
Merge branch 'master' into patch-30
WardF Dec 31, 2018
718537a
A bit of cleanup.
WardF Dec 31, 2018
c62d7eb
Merge remote-tracking branch 'origin/gh1233.dmh' into pr-aggregation.wif
WardF Dec 31, 2018
e6f768b
Merge branch 'ejh_fast_var_prep' of https://github.com/NetCDF-World-D…
WardF Dec 31, 2018
9e94e32
Merge branch 'ejh_fast_var_prep_2' of https://github.com/NetCDF-World…
WardF Dec 31, 2018
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
9 changes: 4 additions & 5 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -550,13 +550,12 @@ if test "x$enable_large_file_tests" = xyes; then
fi

# Does the user want to run benchmarks?
AC_MSG_CHECKING([whether benchmarks should be run (experimental)])
AC_MSG_CHECKING([whether benchmarks should be run])
AC_ARG_ENABLE([benchmarks],
[AS_HELP_STRING([--enable-benchmarks],
[Run benchmarks. This is an experimental feature. You must fetch
sample data files from the Unidata ftp site to use these benchmarks.
The benchmarks are a bunch of extra tests, which are timed. We use these
tests to check netCDF performance.])])
[Run benchmarks. This will cause sample data files from the Unidata ftp
site to be fetched. The benchmarks are a bunch of extra tests, which
are timed. We use these tests to check netCDF performance.])])
test "x$enable_benchmarks" = xyes || enable_benchmarks=no
AC_MSG_RESULT($enable_benchmarks)
AM_CONDITIONAL(BUILD_BENCHMARKS, [test x$enable_benchmarks = xyes])
Expand Down
1 change: 1 addition & 0 deletions debug/README.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
This directory contains various scripts for debugging by Dennis
Heimbigner @ Unidata.
DO NOT DELETE.
USE AT YOUR OWN PERIL.


2 changes: 1 addition & 1 deletion debug/cf.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ NCLIB="${NCLIB}/build/liblib"
#G="-GUnix Makefiles"
#T="--trace-expand"
cmake "${G}" $FLAGS ..
if test "x$NOBUILD" == x ; then
if test "x$NOBUILD" = x ; then
make all
make test
fi
Expand Down
2 changes: 0 additions & 2 deletions include/hdf5internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ int hdf5_set_log_level();
int rec_detach_scales(NC_GRP_INFO_T *grp, int dimid, hid_t dimscaleid);
int rec_reattach_scales(NC_GRP_INFO_T *grp, int dimid, hid_t dimscaleid);
int delete_existing_dimscale_dataset(NC_GRP_INFO_T *grp, int dimid, NC_DIM_INFO_T *dim);
int nc4_rec_match_dimscales(NC_GRP_INFO_T *grp);

/* Write metadata. */
int nc4_rec_write_metadata(NC_GRP_INFO_T *grp, nc_bool_t bad_coord_order);
Expand Down Expand Up @@ -137,7 +136,6 @@ extern hid_t NC4_image_init(NC_FILE_INFO_T* h5);
extern void NC4_image_finalize(void*);

/* These functions are internal to the libhdf5 directory. */
int nc4_detect_preserve_dimids(NC_GRP_INFO_T *grp, nc_bool_t *bad_coord_orderp);
int nc4_get_fill_value(NC_FILE_INFO_T *h5, NC_VAR_INFO_T *var, void **fillp);


Expand Down
8 changes: 4 additions & 4 deletions include/nc4internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,10 @@ typedef struct NC_VAR_INFO
{
NC_OBJ hdr;
char *hdf5_name; /* used if different from name */
struct NC_GRP_INFO* container; /* containing group */
struct NC_GRP_INFO *container; /* containing group */
size_t ndims;
int *dimids;
NC_DIM_INFO_T** dim;
NC_DIM_INFO_T **dim;
nc_bool_t is_new_var; /* True if variable is newly created */
nc_bool_t was_coord_var; /* True if variable was a coordinate var, but either the dim or var has been renamed */
nc_bool_t became_coord_var; /* True if variable _became_ a coordinate var, because either the dim or var has been renamed */
Expand All @@ -154,7 +154,7 @@ typedef struct NC_VAR_INFO
nc_bool_t written_to; /* True if variable has data written to it */
struct NC_TYPE_INFO *type_info;
int atts_not_read; /* If true, the atts have not yet been read. */
NCindex* att; /* NCindex<NC_ATT_INFO_T*> */
NCindex *att; /* NCindex<NC_ATT_INFO_T*> */
nc_bool_t no_fill; /* True if no fill value is defined for var */
void *fill_value;
size_t *chunksizes;
Expand All @@ -172,7 +172,7 @@ typedef struct NC_VAR_INFO
/* Stuff for arbitrary filters */
unsigned int filterid;
size_t nparams;
unsigned int* params;
unsigned int *params;
} NC_VAR_INFO_T;

typedef struct NC_FIELD_INFO
Expand Down
2 changes: 0 additions & 2 deletions include/nc_provenance.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
* info and/or displaying provenance info.
*
* @author Dennis Heimbigner, Ward Fisher
*/
/**

It has come to pass that we can't guarantee that this information is
contained only within netcdf4 files. As a result, we need
Expand Down
80 changes: 79 additions & 1 deletion libhdf5/hdf5file.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,84 @@ NC_findreserved(const char* name)
return NULL;
}

/**
* @internal Recursively determine if there is a mismatch between
* order of coordinate creation and associated dimensions in this
* group or any subgroups, to find out if we have to handle that
* situation. Also check if there are any multidimensional coordinate
* variables defined, which require the same treatment to fix a
* potential bug when such variables occur in subgroups.
*
* @param grp Pointer to group info struct.
* @param bad_coord_orderp Pointer that gets 1 if there is a bad
* coordinate order.
*
* @returns NC_NOERR No error.
* @returns NC_EHDFERR HDF5 returned an error.
* @author Ed Hartnett
*/
static int
detect_preserve_dimids(NC_GRP_INFO_T *grp, nc_bool_t *bad_coord_orderp)
{
NC_VAR_INFO_T *var;
NC_GRP_INFO_T *child_grp;
int last_dimid = -1;
int retval;
int i;

/* Iterate over variables in this group */
for (i=0; i < ncindexsize(grp->vars); i++)
{
var = (NC_VAR_INFO_T*)ncindexith(grp->vars,i);
if (var == NULL) continue;
/* Only matters for dimension scale variables, with non-scalar dimensionality */
if (var->dimscale && var->ndims)
{
/* If the user writes coord vars in a different order then he
* defined their dimensions, then, when the file is reopened, the
* order of the dimids will change to match the order of the coord
* vars. Detect if this is about to happen. */
if (var->dimids[0] < last_dimid)
{
LOG((5, "%s: %s is out of order coord var", __func__, var->hdr.name));
*bad_coord_orderp = NC_TRUE;
return NC_NOERR;
}
last_dimid = var->dimids[0];

/* If there are multidimensional coordinate variables defined, then
* it's also necessary to preserve dimension IDs when the file is
* reopened ... */
if (var->ndims > 1)
{
LOG((5, "%s: %s is multidimensional coord var", __func__, var->hdr.name));
*bad_coord_orderp = NC_TRUE;
return NC_NOERR;
}

/* Did the user define a dimension, end define mode, reenter define
* mode, and then define a coordinate variable for that dimension?
* If so, dimensions will be out of order. */
if (var->is_new_var || var->became_coord_var)
{
LOG((5, "%s: coord var defined after enddef/redef", __func__));
*bad_coord_orderp = NC_TRUE;
return NC_NOERR;
}
}
}

/* If there are any child groups, check them also for this condition. */
for (i = 0; i < ncindexsize(grp->children); i++)
{
if (!(child_grp = (NC_GRP_INFO_T *)ncindexith(grp->children, i)))
continue;
if ((retval = detect_preserve_dimids(child_grp, bad_coord_orderp)))
return retval;
}
return NC_NOERR;
}

/**
* @internal This function will write all changed metadata and flush
* HDF5 file to disk.
Expand Down Expand Up @@ -127,7 +205,7 @@ sync_netcdf4_file(NC_FILE_INFO_T *h5)
/* Check to see if the coordinate order is messed up. If
* detected, propagate to all groups to consistently store
* dimids. */
if ((retval = nc4_detect_preserve_dimids(h5->root_grp, &bad_coord_order)))
if ((retval = detect_preserve_dimids(h5->root_grp, &bad_coord_order)))
return retval;

/* Write all the metadata. */
Expand Down
Loading