Skip to content

Commit

Permalink
Merge pull request ESMCI#1363 from NCAR/ejh_minor
Browse files Browse the repository at this point in the history
Some fixes identified by codacy
  • Loading branch information
edhartnett authored Mar 21, 2019
2 parents 1a541d8 + 0869129 commit 3289961
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 15 deletions.
3 changes: 2 additions & 1 deletion examples/c/run_tests.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#!/bin/sh
# This is a test script for PIO examples.
# Ed Hartnett 5/7/18

# Stop execution of script if error is returned.
set -e

# Stop loop if ctrl-c is pressed.
trap exit SIGINT SIGTERM
trap exit INT TERM

printf 'running PIO examples...\n'

Expand Down
6 changes: 6 additions & 0 deletions src/clib/pio_getput_int.c
Original file line number Diff line number Diff line change
Expand Up @@ -866,8 +866,14 @@ int PIOc_get_var_tc(int ncid, int varid, nc_type xtype, void *buf)

/* Find the dimension lengths. */
for (int d = 0; d < ndims; d++)
{
if ((ierr = PIOc_inq_dimlen(ncid, dimids[d], &countp[d])))
{
free(startp);
free(countp);
return pio_err(ios, file, ierr, __FILE__, __LINE__);
}
}

/* Set up start array. */
for (int d = 0; d < ndims; d++)
Expand Down
18 changes: 9 additions & 9 deletions src/clib/pio_msg.c
Original file line number Diff line number Diff line change
Expand Up @@ -1225,9 +1225,9 @@ int inq_var_deflate_handler(iosystem_desc_t *ios)
char shuffle_present;
char deflate_present;
char deflate_level_present;
int shuffle, *shufflep;
int deflate, *deflatep;
int deflate_level, *deflate_levelp;
int shuffle, *shufflep = NULL;
int deflate, *deflatep = NULL;
int deflate_level, *deflate_levelp = NULL;
int mpierr;

assert(ios);
Expand Down Expand Up @@ -2331,9 +2331,9 @@ int get_chunk_cache_handler(iosystem_desc_t *ios)
int iosysid;
int iotype;
char size_present, nelems_present, preemption_present;
PIO_Offset size, *sizep;
PIO_Offset nelems, *nelemsp;
float preemption, *preemptionp;
PIO_Offset size, *sizep = NULL;
PIO_Offset nelems, *nelemsp = NULL;
float preemption, *preemptionp = NULL;
int mpierr = MPI_SUCCESS; /* Return code from MPI function codes. */

LOG((1, "get_chunk_cache_handler called"));
Expand Down Expand Up @@ -2384,9 +2384,9 @@ int get_var_chunk_cache_handler(iosystem_desc_t *ios)
int ncid;
int varid;
char size_present, nelems_present, preemption_present;
PIO_Offset size, *sizep;
PIO_Offset nelems, *nelemsp;
float preemption, *preemptionp;
PIO_Offset size, *sizep = NULL;
PIO_Offset nelems, *nelemsp = NULL;
float preemption, *preemptionp = NULL;
int mpierr = MPI_SUCCESS; /* Return code from MPI function codes. */

LOG((1, "get_var_chunk_cache_handler called"));
Expand Down
1 change: 0 additions & 1 deletion src/clib/pio_rearrange.c
Original file line number Diff line number Diff line change
Expand Up @@ -2076,7 +2076,6 @@ void performance_tune_rearranger(iosystem_desc_t *ios, io_desc_t *iodesc)
if (!(wall = bget(2 * 4 * log2 * sizeof(double))))
return pio_err(ios, file, PIO_ENOMEM, __FILE__, __LINE__);
double mintime;
int k = 0;

if ((mpierr = MPI_Barrier(mycomm)))
return check_mpi(NULL, mpierr, __FILE__, __LINE__);
Expand Down
3 changes: 2 additions & 1 deletion tests/cunit/run_tests.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#!/bin/sh
# This is a test script for PIO.
# Ed Hartnett

# Stop execution of script if error is returned.
set -e

# Stop loop if ctrl-c is pressed.
trap exit SIGINT SIGTERM
trap exit INT TERM

printf 'running PIO tests...\n'

Expand Down
3 changes: 0 additions & 3 deletions tests/general/test_memleak.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,6 @@ main(int argc, char **argv)
* example. */
int ioproc_stride = 1;

/** Number of the aggregator? Always 0 in this example. */
int numAggregator = 0;

/** Zero based rank of first processor to be used for I/O. */
int ioproc_start = 0;

Expand Down

0 comments on commit 3289961

Please sign in to comment.