From 938680d0c7a37742f736403731e6e6db2ec46b9c Mon Sep 17 00:00:00 2001 From: Ed Hartnett Date: Sat, 23 Mar 2019 09:34:19 -0600 Subject: [PATCH 1/5] fixed warning in test_perf2.c --- tests/cunit/test_perf2.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/cunit/test_perf2.c b/tests/cunit/test_perf2.c index 36668776108..66f2b259a1b 100644 --- a/tests/cunit/test_perf2.c +++ b/tests/cunit/test_perf2.c @@ -219,9 +219,8 @@ int test_darray(int iosysid, int ioid, int num_flavors, int *flavor, int my_rank startt = (1000000 * starttime.tv_sec) + starttime.tv_usec; endt = (1000000 * endtime.tv_sec) + endtime.tv_usec; delta = (endt - startt)/NUM_TIMESTEPS; - /* if (!my_rank) */ - /* printf("%d\t%d\t%d\t%d\t%lld\n", rearranger, fmt, pio_type, test_multi, */ - /* delta); */ + if (!my_rank) + printf("%d\t%lld\n", fmt, delta); /* Reopen the file. */ if ((ret = PIOc_openfile(iosysid, &ncid2, &flavor[fmt], filename, PIO_NOWRITE))) From f7ac2b09ccf0dac73e49c8da279335f5501ce35f Mon Sep 17 00:00:00 2001 From: Ed Hartnett Date: Sat, 23 Mar 2019 09:36:36 -0600 Subject: [PATCH 2/5] fixed warning in test_darray_multi.c --- tests/cunit/test_darray_multi.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/tests/cunit/test_darray_multi.c b/tests/cunit/test_darray_multi.c index 5827c6760c2..5f8f93c5163 100644 --- a/tests/cunit/test_darray_multi.c +++ b/tests/cunit/test_darray_multi.c @@ -84,7 +84,6 @@ int test_darray(int iosysid, int ioid, int num_flavors, int *flavor, int my_rank int ncid2; /* The ncid of the re-opened netCDF file. */ int varid[NVAR]; /* The IDs of the netCDF varables. */ int other_varid; /* The IDs of a var of different type. */ - int wrong_varid[NVAR]; /* These will not work. */ PIO_Offset arraylen = 4; /* Amount of data from each task. */ void *fillvalue; /* Pointer to fill value. */ void *test_data; /* Pointer to test data we will write. */ @@ -279,14 +278,6 @@ int test_darray(int iosysid, int ioid, int num_flavors, int *flavor, int my_rank int frame[NVAR] = {0, 0, 0}; int flushtodisk = test_multi; - /* This will not work, because we mix var types. */ - wrong_varid[0] = varid[0]; - wrong_varid[1] = varid[1]; - wrong_varid[0] = other_varid; -// if (PIOc_write_darray_multi(ncid, wrong_varid, ioid, NVAR, arraylen, test_data, frame, -// fillvalue, flushtodisk) != PIO_EINVAL) -// ERR(ERR_WRONG); - /* Write the data with the _multi function. */ if ((ret = PIOc_write_darray_multi(ncid, varid, ioid, NVAR, arraylen, test_data, frame, fillvalue, flushtodisk))) From 75da52815651c0ad5835a92f3870dee6e96d2eba Mon Sep 17 00:00:00 2001 From: Ed Hartnett Date: Sat, 23 Mar 2019 09:41:30 -0600 Subject: [PATCH 3/5] fixed warning in test_darray_multivar3.c --- tests/cunit/test_darray_multivar3.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/cunit/test_darray_multivar3.c b/tests/cunit/test_darray_multivar3.c index 35c932f6afd..dc12b9e0c20 100644 --- a/tests/cunit/test_darray_multivar3.c +++ b/tests/cunit/test_darray_multivar3.c @@ -133,11 +133,11 @@ int test_multivar_darray(int iosysid, int ioid, int num_flavors, int *flavor, ERR(ret); int *fvp_int = NULL; - float *fvp_float = NULL; + /* float *fvp_float = NULL; */ if (use_fv) { fvp_int = &custom_fillvalue_int; - fvp_float = &custom_fillvalue_float; + /* fvp_float = &custom_fillvalue_float; */ } /* Write the data. */ @@ -148,13 +148,16 @@ int test_multivar_darray(int iosysid, int ioid, int num_flavors, int *flavor, fvp_int))) ERR(ret); - /* This should not work since we cannot mix record and not record vars */ + /* This should not work since we cannot mix record and not + * record vars. */ int frame[NUM_VAR] = {0, 0, 0}; if (PIOc_write_darray_multi(ncid, varid, ioid, NUM_VAR, arraylen * NUM_VAR, test_data_float, frame, NULL, 0) != PIO_EVARDIMMISMATCH) ERR(ERR_WRONG); - /* This should work since int and float are the same size and both are record vars */ + + /* This should work since int and float are the same size + * and both are record vars. */ if ((ret = PIOc_write_darray_multi(ncid, varid+1, ioid, NUM_VAR-1, arraylen * (NUM_VAR-1), test_data_float, frame, NULL, 0))) ERR(ret); From e55de319c842c077d0c2979f99d20ed1f31df0f1 Mon Sep 17 00:00:00 2001 From: Ed Hartnett Date: Sun, 24 Mar 2019 06:03:53 -0600 Subject: [PATCH 4/5] fixed memory problem in logging statement --- src/clib/pio_darray_int.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/clib/pio_darray_int.c b/src/clib/pio_darray_int.c index 24b45302078..cf43617eedf 100644 --- a/src/clib/pio_darray_int.c +++ b/src/clib/pio_darray_int.c @@ -640,8 +640,6 @@ int write_darray_multi_par(file_desc_t *file, int nvars, int fndims, const int * /* Write, in non-blocking fashion, a list of subarrays. */ LOG((3, "about to call ncmpi_iput_varn() varids[%d] = %d rrcnt = %d, llen = %d", nv, varids[nv], rrcnt, llen)); - for (int i=0; i< rrcnt; i++) - LOG((3, "i %d start %ld count %ld start %ld count %ld\n",i,startlist[i][0], countlist[i][0],startlist[i][1], countlist[i][1])); ierr = ncmpi_iput_varn(file->fh, varids[nv], rrcnt, startlist, countlist, bufptr, llen, iodesc->mpitype, &vdesc->request[vdesc->nreqs]); From f70ce394f152328facd2d5d73328715469436dae Mon Sep 17 00:00:00 2001 From: Ed Hartnett Date: Sun, 24 Mar 2019 06:40:17 -0600 Subject: [PATCH 5/5] fixed remap memory leak --- src/clib/pioc.c | 3 ++- src/clib/pioc_support.c | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/clib/pioc.c b/src/clib/pioc.c index 3575a33a64a..50b119375d1 100644 --- a/src/clib/pioc.c +++ b/src/clib/pioc.c @@ -526,7 +526,8 @@ int PIOc_InitDecomp(int iosysid, int pio_type, int ndims, const int *gdimlen, in break; } } - if (iodesc->needssort){ + if (iodesc->needssort) + { struct sort_map *tmpsort; if (!(tmpsort = malloc(sizeof(struct sort_map) * maplen))) diff --git a/src/clib/pioc_support.c b/src/clib/pioc_support.c index 646f3867dc2..9c8372f682d 100644 --- a/src/clib/pioc_support.c +++ b/src/clib/pioc_support.c @@ -789,6 +789,9 @@ int PIOc_freedecomp(int iosysid, int ioid) /* Free the dimlens. */ free(iodesc->dimlen); + if (iodesc->remap) + free(iodesc->remap); + LOG((3, "freeing rfrom, rtype")); if (iodesc->rfrom) free(iodesc->rfrom);