Skip to content

Commit

Permalink
Merge pull request ESMCI#1696 from NCAR/ejh_fix_test_leak
Browse files Browse the repository at this point in the history
fixed memory leaks in tests/ncint/tst_ncint_async_perf.c and tests/ncint/tst_ncint_perf.c
  • Loading branch information
edwardhartnett authored Aug 5, 2020
2 parents 64a117c + 4438bf5 commit eedc46c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ before_script:
- export CPPFLAGS='-I/usr/include'
- wget https://parallel-netcdf.github.io/Release/pnetcdf-1.12.1.tar.gz
- tar -xzvf pnetcdf-1.12.1.tar.gz
- ls -l
- pushd pnetcdf-1.12.1
- ./configure --prefix=/usr --enable-shared
- ./configure --prefix=/usr --enable-shared --disable-cxx
- make
- sudo make install
- popd
Expand All @@ -54,4 +53,4 @@ script:
- cmake -DPIO_HDF5_LOGGING=On -DPIO_USE_MALLOC=On -DPIO_ENABLE_LOGGING=On -DPIO_ENABLE_TIMING=Off ..
- make VERBOSE=1
- make tests VERBOSE=1
- ctest -VV
- ctest -VV
5 changes: 3 additions & 2 deletions tests/ncint/tst_ncint_async_perf.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,11 @@ main(int argc, char **argv)
printf("%s,\t%d,\t%d,\t%d,\t%8.3f,\t%8.1f,\t%8.3f\n", mode_name[m],
ntasks, num_io_procs, 1, delta_in_sec, num_megabytes,
mb_per_sec);

free(my_data);
if (nc_free_decomp(ioid)) PERR;
} /* next mode flag */

free(my_data);
if (nc_free_decomp(ioid)) PERR;
if (nc_free_iosystem(iosysid)) PERR;
}
}
Expand Down
7 changes: 4 additions & 3 deletions tests/ncint/tst_ncint_perf.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,11 @@ main(int argc, char **argv)
printf("%s,\t%d,\t%d,\t%d,\t%8.3f,\t%8.1f,\t%8.3f\n", mode_name[m],
ntasks, num_io_procs, 1, delta_in_sec, num_megabytes,
mb_per_sec);
} /* next mode flag */

free(my_data);
if (nc_free_decomp(ioid)) PERR;

free(my_data);
if (nc_free_decomp(ioid)) PERR;
} /* next mode flag */
}
if (nc_free_iosystem(iosysid)) PERR;

Expand Down
4 changes: 2 additions & 2 deletions tests/unit/basic_tests.F90
Original file line number Diff line number Diff line change
Expand Up @@ -285,15 +285,15 @@ Subroutine test_open(test_id, err_msg)
call mpi_abort(MPI_COMM_WORLD, 0, ret_val2)
end if

ret_val = PIO_set_log_level(3)
!ret_val = PIO_set_log_level(3)
ret_val = PIO_inq_unlimdim(pio_file, unlimdimid)
if(unlimdimid /= -1) then
err_msg = "Error in inq_unlimdim"
call PIO_closefile(pio_file)
print *,__FILE__,__LINE__,iotype, trim(err_msg)
call mpi_abort(MPI_COMM_WORLD, 0, ret_val2)
end if
ret_val = PIO_set_log_level(0)
!ret_val = PIO_set_log_level(0)

! Close file
call PIO_closefile(pio_file)
Expand Down

0 comments on commit eedc46c

Please sign in to comment.