Skip to content

Commit

Permalink
Merge branch 'master' into testp2.dmh
Browse files Browse the repository at this point in the history
  • Loading branch information
DennisHeimbigner authored Oct 27, 2017
2 parents d9b60fe + 7255a11 commit 682ad6a
Show file tree
Hide file tree
Showing 22 changed files with 112 additions and 122 deletions.
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1169,7 +1169,7 @@ if test "x$enable_pnetcdf" = xyes; then
erange_fill_pnetcdf=no
else
erange_fill_pnetcdf=`echo ${erange_fill_pnetcdf} | cut -d' ' -f3`
if test "x$coord_bound_pnetcdf" = x0; then
if test "x$erange_fill_pnetcdf" = x0; then
enable_erange_fill_pnetcdf=no
else
enable_erange_fill_pnetcdf=yes
Expand Down
1 change: 0 additions & 1 deletion h5_test/tst_h_files.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ main()
int obj_class;
char obj_name[STR_LEN + 1];
H5T_class_t class;
size_t type_size;
int j, k;
hid_t tmp1;

Expand Down
8 changes: 6 additions & 2 deletions libdispatch/dfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -1926,8 +1926,12 @@ NC_open(const char *path0, int cmode,
cmode |= NC_64BIT_DATA;
}

if((cmode & NC_MPIIO && cmode & NC_MPIPOSIX))
return NC_EINVAL;
/* Invalid to use both NC_MPIIO and NC_MPIPOSIX. Make up your damn
* mind! */
if((cmode & NC_MPIIO && cmode & NC_MPIPOSIX)) {
nullfree(path);
return NC_EINVAL;
}

/* override any other table choice */
if(dispatcher != NULL) goto havetable;
Expand Down
10 changes: 7 additions & 3 deletions libsrc4/nc4hdf.c
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,9 @@ nc4_put_vara(NC *nc, int ncid, int varid, const size_t *startp,
hsize_t start[NC_MAX_VAR_DIMS], count[NC_MAX_VAR_DIMS];
char *name_to_use;
int need_to_extend = 0;
#ifdef USE_PARALLEL4
int extend_possible = 0;
#endif
int retval = NC_NOERR, range_error = 0, i, d2;
void *bufr = NULL;
#ifndef HDF5_CONVERT
Expand Down Expand Up @@ -743,7 +745,9 @@ nc4_put_vara(NC *nc, int ncid, int varid, const size_t *startp,
assert(dim && dim->dimid == var->dimids[d2]);
if (dim->unlimited)
{
extend_possible = 1;
#ifdef USE_PARALLEL4
extend_possible = 1;
#endif
if (start[d2] + count[d2] > fdims[d2])
{
xtend_size[d2] = (long long unsigned)(start[d2] + count[d2]);
Expand Down Expand Up @@ -3984,7 +3988,7 @@ reportobject(int log, hid_t id, unsigned int type)
LOG((0,"Type = %s(%8u) name='%s'",typename,id,name));
#endif
} else {
fprintf(stderr,"Type = %s(%8u) name='%s'",typename,id,name);
fprintf(stderr,"Type = %s(%8u) name='%s'",typename,(unsigned int)id,name);
}
}

Expand All @@ -4003,7 +4007,7 @@ reportopenobjectsT(int log, hid_t fid, int ntypes, unsigned int* otypes)
LOG((0,"\nReport: open objects on %d\n",fid));
#endif
} else {
fprintf(stdout,"\nReport: open objects on %d\n",fid);
fprintf(stdout,"\nReport: open objects on %d\n",(int)fid);
}
maxobjs = H5Fget_obj_count(fid,H5F_OBJ_ALL);
if(idlist != NULL) free(idlist);
Expand Down
6 changes: 0 additions & 6 deletions libsrc4/nc4info.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,13 @@ NC4_get_propattr(NC_HDF5_FILE_INFO_T* h5)
hid_t aspace = -1;
hid_t atype = -1;
hid_t ntype = -1;
herr_t herr = 0;
char* text = NULL;

/* Get root group */
grp = h5->root_grp->hdf_grpid; /* get root group */
/* Try to extract the NCPROPS attribute */
if(H5Aexists(grp,NCPROPS) > 0) { /* Does exist */
attid = H5Aopen_name(grp, NCPROPS);
herr = -1;
aspace = H5Aget_space(attid); /* dimensions of attribute data */
atype = H5Aget_type(attid);
/* Verify that atype and size */
Expand All @@ -129,7 +127,6 @@ NC4_get_propattr(NC_HDF5_FILE_INFO_T* h5)
text[size] = '\0';
/* Try to parse text */
ncstat = NC4_properties_parse(&h5->fileinfo->propattr,text);
herr = 0;
}
done:
if(attid >= 0) HCHECK((H5Aclose(attid)));
Expand All @@ -148,7 +145,6 @@ NC4_put_propattr(NC_HDF5_FILE_INFO_T* h5)
hid_t attid = -1;
hid_t aspace = -1;
hid_t atype = -1;
herr_t herr = 0;
char* text = NULL;

/* Get root group */
Expand All @@ -159,15 +155,13 @@ NC4_put_propattr(NC_HDF5_FILE_INFO_T* h5)
if(text == NULL || ncstat != NC_NOERR) {
goto done;
}
herr = -1;
/* Create a datatype to refer to. */
HCHECK((atype = H5Tcopy(H5T_C_S1)));
HCHECK((H5Tset_cset(atype, H5T_CSET_ASCII)));
HCHECK((H5Tset_size(atype, strlen(text)+1))); /*keep nul term */
HCHECK((aspace = H5Screate(H5S_SCALAR)));
HCHECK((attid = H5Acreate(grp, NCPROPS, atype, aspace, H5P_DEFAULT)));
HCHECK((H5Awrite(attid, atype, text)));
herr = 0;
}
done:
if(text != NULL) {
Expand Down
14 changes: 0 additions & 14 deletions libsrc4/nc4var.c
Original file line number Diff line number Diff line change
Expand Up @@ -1434,17 +1434,3 @@ NC4_get_vara(int ncid, int varid, const size_t *startp,
{
return nc4_get_vara_tc(ncid, varid, memtype, 0, startp, countp, ip);
}

void
nc4verify(int ncid, char* name)
{
NC_GRP_INFO_T *grp;
NC_HDF5_FILE_INFO_T *h5;
int retval;

/* Find info for this file and group, and set pointer to each. */
retval = nc4_find_grp_h5(ncid, &grp, &h5);
assert(grp && h5);
retval = nc4_check_dup_name(grp, name);
return;
}
8 changes: 0 additions & 8 deletions nc_test/tst_atts3.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,14 +140,6 @@ main(int argc, char **argv)
float float_in[ATT_LEN], float_out[ATT_LEN] = {-0.5, 0.25, 0.125};
double double_in[ATT_LEN], double_out[ATT_LEN] = {-0.25, .5, 0.125};
long long longlong_in[ATT_LEN] = {-1LL, -1LL, -1LL};
#ifdef USE_NETCDF4
long long_in[ATT_LEN];
unsigned short ushort_in[ATT_LEN], ushort_out[ATT_LEN] = {0, 128, NC_MAX_USHORT};
unsigned int uint_in[ATT_LEN], uint_out[ATT_LEN] = {0, 128, NC_MAX_UINT};
long long longlong_out[ATT_LEN] = {-3123456789LL, 128LL, 3123456789LL};
unsigned long long ulonglong_in[ATT_LEN] = {NC_MAX_UINT64, NC_MAX_UINT64, NC_MAX_UINT64};
unsigned long long ulonglong_out[ATT_LEN] = {0LL, 128LL, 3123456789LL};
#endif

#ifdef TEST_PNETCDF
MPI_Init(&argc, &argv);
Expand Down
3 changes: 1 addition & 2 deletions nc_test/tst_elatefill.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

#include "config.h"
#include <nc_tests.h>
#include "err_macros.h"
#include <stdio.h>
#include <netcdf.h>

Expand All @@ -26,7 +25,7 @@ int
main(int argc, char **argv)
{
int ncid, dimid, varid, err;
int no_fill, fillv, buf[10];
int fillv;

err = nc_create(FILE_NAME, NC_NETCDF4, &ncid); ERR_CHK;
err = nc_def_dim(ncid, "dim", 10, &dimid); ERR_CHK;
Expand Down
5 changes: 1 addition & 4 deletions nc_test/tst_utf8_phrases.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include <config.h>
#include <stdlib.h>
#include <nc_tests.h>
#include "err_macros.h"
#include <netcdf.h>
#include <string.h>

Expand Down Expand Up @@ -280,7 +279,7 @@ static int
test(const struct Test* tests, const char* title)
{
int status = NC_NOERR;
int i,failures = 0;
int failures = 0;
const struct Test* p;

fprintf(stderr,"Testing %s...\n",title);
Expand Down Expand Up @@ -328,9 +327,7 @@ test(const struct Test* tests, const char* title)
int
main(int argc, char** argv)
{
int i, status;
int failures = 0;
int tstcnt = 0;

printf("\n Testing UTF-8 sequences.\n");
failures += test(utf8currency,"Currencies");
Expand Down
Binary file modified nc_test/tst_utf8_validate.c
Binary file not shown.
2 changes: 1 addition & 1 deletion nc_test4/renamegroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ check(int status)
int
main(int argc, char **argv)
{
int i,stat;
int stat;
int ncid, grpid;
char* filename;
char* oldname;
Expand Down
8 changes: 4 additions & 4 deletions nc_test4/tst_dims3.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ nc_set_log_level(0);
printf("*** testing defining dimensions and coord variables in different orders in root group...");
{
int ncid, grpid, grp2id;
int time_dimid, lev_dimid, vrt_dimid, g2lev_dimid, g2vrt_dimid;
int time_dimid_in, lev_dimid_in, vrt_dimid_in, g2lev_dimid_in, g2vrt_dimid_in;
int time_dimid, lev_dimid, g2lev_dimid, g2vrt_dimid;
int time_dimid_in, lev_dimid_in, g2lev_dimid_in, g2vrt_dimid_in;
int time_varid, lev_varid, gvar2_varid, g2lev_varid, g2vrt_varid;
int var2_dims[VAR2_RANK];
/* Create test for fix of bug that resulted in two dimensions
Expand Down Expand Up @@ -156,8 +156,8 @@ nc_set_log_level(0);
printf("*** testing defining dimensions and coord variables in different orders in subgroup...");
{
int ncid, grpid, grp2id;
int time_dimid, lev_dimid, vrt_dimid, g2lev_dimid, g2vrt_dimid;
int time_dimid_in, lev_dimid_in, vrt_dimid_in, g2lev_dimid_in, g2vrt_dimid_in;
int time_dimid, lev_dimid, g2lev_dimid, g2vrt_dimid;
int time_dimid_in, lev_dimid_in, g2lev_dimid_in, g2vrt_dimid_in;
int time_varid, lev_varid, gvar2_varid, g2lev_varid, g2vrt_varid;
int var2_dims[VAR2_RANK];
/* Create test for fix of bug inside a subgroup that results in two dimensions
Expand Down
30 changes: 14 additions & 16 deletions nc_test4/tst_empty_vlen_unlim.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ int main() {

printf("\t* Puting data in secondary variable:\tnc_put_vara().\n");
if (nc_put_vara(ncid,varid2,startp2,countp2,data2)) ERR;
free(data2);

/***********/
/* Actually unnecessary to recreate the issue. */
Expand Down Expand Up @@ -112,18 +113,17 @@ int main() {
data[2].p = dat2;
data[2].len = VLEN2;

//printf("\t* Puting data in VLEN variable:\tnc_put_vara().\n");
//stat = nc_put_vara(ncid,varid,&startp,&countp,data);
//stat = nc_put_var(ncid,varid,&data);
//if(stat) ERR;


printf("\t* Puting data in VLEN variable:\tnc_put_vara().\n");
stat = nc_put_vara(ncid,varid,startp,countp,data);
if(stat) ERR;

/* Close File. */
printf("\t* Closing file:\tnc_close().\n");
if ((stat = nc_close(ncid))) ERR;


free(dat0);
free(dat1);
free(dat2);
}

printf("Testing access to unset entries in VLEN variable, unlimit dimension\n");
Expand Down Expand Up @@ -174,6 +174,7 @@ int main() {

printf("\t* Puting data in secondary variable:\tnc_put_vara().\n");
if (nc_put_vara(ncid,varid2,startp2,countp2,data2)) ERR;
free(data2);

/***********/
/* Actually unnecessary to recreate the issue. */
Expand Down Expand Up @@ -204,21 +205,18 @@ int main() {
data[2].p = dat2;
data[2].len = VLEN2;

//printf("\t* Puting data in VLEN variable:\tnc_put_vara().\n");
//stat = nc_put_vara(ncid,varid,&startp,&countp,data);
//stat = nc_put_var(ncid,varid,&data);
//if(stat) ERR;


printf("\t* Puting data in VLEN variable:\tnc_put_vara().\n");
stat = nc_put_vara(ncid,varid,startp,countp,data);
if(stat) ERR;

/* Close File. */
printf("\t* Closing file:\tnc_close().\n");
if ((stat = nc_close(ncid))) ERR;


free(dat0);
free(dat1);
free(dat2);
}


SUMMARIZE_ERR;
FINAL_RESULTS;

Expand Down
9 changes: 0 additions & 9 deletions nc_test4/tst_fill_attr_vanish.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,11 @@
int main()
{
int ncid, dimids[RANK_P], time_id, p_id, test_id, status;
int ndims, dimids_in[RANK_P];

int test_data[1] = {1};
size_t test_start[1] = {0}, test_count[1] = {1};
int test_fill_val[] = {5};


double data[1] = {3.14159};
size_t start[1] = {0}, count[1] = {1};
float ddata[1][4][3];
static float P_data[LEN];
size_t cor[RANK_P] = {0, 1, 0};
size_t edg[RANK_P] = {1, 1, LEN};
float pfills[] = {3};

printf("\n*** Testing for a netCDF-4 fill-value bug.\n");
printf("*** Creating a file with no _FillValue defined. ***\n");
Expand Down
Loading

0 comments on commit 682ad6a

Please sign in to comment.