diff options
author | Dana Robinson <43805+derobins@users.noreply.github.com> | 2022-07-05 23:55:18 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-05 23:55:18 (GMT) |
commit | 5ceaf920eccbf5176065b0deeb27b124b821db76 (patch) | |
tree | 2bca04a4fd6fd27065c3e33335092970ef30b940 /tools | |
parent | ac7bddf2af317d4bc34854f5565396da51ff12aa (diff) | |
download | hdf5-feature/vfd_swmr.zip hdf5-feature/vfd_swmr.tar.gz hdf5-feature/vfd_swmr.tar.bz2 |
VFD SWMR: Warning fixes and minor cleanup (#1847)feature/vfd_swmr
* Normalization with develop
* Moves remaining datatype code changes over from develop
* Cleanup in examples files
* Warning cleanup in VFD SWMR code
* Committing clang-format changes
* Warning cleanup
* Warning reduction
* More warning fixes
* Committing clang-format changes
* Even more warning reduction in the VFD SWMR tests
* More warning fixes in the VFD SWMR tests
* Even more VFD SWMR test warning fixes
* Last warning fixes in VFD SWMR
* Committing clang-format changes
* Minor things missed from develop
* Warning fixes from GitHub build failures
* Committing clang-format changes
* Fix for warning due to weird bit shift type promotion
* Yet another attempt at fixing the integral promotion warning
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/src/h5perf/perf.c | 13 | ||||
-rw-r--r-- | tools/src/h5perf/pio_engine.c | 11 | ||||
-rw-r--r-- | tools/src/h5perf/sio_engine.c | 2 |
3 files changed, 13 insertions, 13 deletions
diff --git a/tools/src/h5perf/perf.c b/tools/src/h5perf/perf.c index 84be7e8..270af57 100644 --- a/tools/src/h5perf/perf.c +++ b/tools/src/h5perf/perf.c @@ -457,7 +457,7 @@ parse_args(int argc, char **argv) } } - return (0); + return 0; } /*------------------------------------------------------------------------- * Function: getenv_all @@ -478,14 +478,9 @@ parse_args(int argc, char **argv) * Programmer: Leon Arber * 4/4/05 * - * Modifications: - * Use original getenv if MPI is not initialized. This happens - * one uses the PHDF5 library to build a serial nature code. - * Albert 2006/04/07 - * *------------------------------------------------------------------------- */ -char * +static char * getenv_all(MPI_Comm comm, int root, const char *name) { int mpi_size, mpi_rank, mpi_initialized, mpi_finalized; @@ -539,7 +534,9 @@ getenv_all(MPI_Comm comm, int root, const char *name) #endif } else { - /* use original getenv */ + /* Use the original getenv if MPI is not initialized. This happens + * if you use the parallel HDF5 library to build a serial program. + */ if (env) HDfree(env); env = HDgetenv(name); diff --git a/tools/src/h5perf/pio_engine.c b/tools/src/h5perf/pio_engine.c index 9d08938..b546c43 100644 --- a/tools/src/h5perf/pio_engine.c +++ b/tools/src/h5perf/pio_engine.c @@ -146,7 +146,7 @@ do_pio(parameters param) file_descr fd; iotype iot; - char fname[FILENAME_MAX]; + char *fname = NULL; long nf; long ndsets; off_t nbytes; /*number of bytes per dataset */ @@ -168,6 +168,9 @@ do_pio(parameters param) /* IO type */ iot = param.io_type; + if (NULL == (fname = HDcalloc(FILENAME_MAX, sizeof(char)))) + GOTOERROR(FAIL); + switch (iot) { case MPIO: fd.mpifd = MPI_FILE_NULL; @@ -283,7 +286,7 @@ do_pio(parameters param) char base_name[256]; HDsnprintf(base_name, sizeof(base_name), "#pio_tmp_%lu", nf); - pio_create_filename(iot, base_name, fname, sizeof(fname)); + pio_create_filename(iot, base_name, fname, FILENAME_MAX); if (pio_debug_level > 0) HDfprintf(output, "rank %d: data filename=%s\n", pio_mpi_rank_g, fname); @@ -365,8 +368,8 @@ done: } /* release generic resources */ - if (buffer) - HDfree(buffer); + HDfree(buffer); + HDfree(fname); res.ret_code = ret_code; return res; } diff --git a/tools/src/h5perf/sio_engine.c b/tools/src/h5perf/sio_engine.c index e113e82..7781f80 100644 --- a/tools/src/h5perf/sio_engine.c +++ b/tools/src/h5perf/sio_engine.c @@ -203,7 +203,7 @@ do_sio(parameters param, results *res) /* Open file for write */ HDstrcpy(base_name, "#sio_tmp"); - sio_create_filename(iot, base_name, fname, sizeof(fname), ¶m); + sio_create_filename(iot, base_name, fname, FILENAME_MAX, ¶m); if (sio_debug_level > 0) HDfprintf(output, "data filename=%s\n", fname); |