summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorDana Robinson <43805+derobins@users.noreply.github.com>2022-06-29 20:02:38 (GMT)
committerGitHub <noreply@github.com>2022-06-29 20:02:38 (GMT)
commit03ed7a3d790c2add2dccc15300005c1aec0f4f6f (patch)
treede1cc9a0c22eed50f696204e573a004c457aa3fb /tools
parentcb424b2c456c85bcb7c338cc96923dfa43b038be (diff)
downloadhdf5-03ed7a3d790c2add2dccc15300005c1aec0f4f6f.zip
hdf5-03ed7a3d790c2add2dccc15300005c1aec0f4f6f.tar.gz
hdf5-03ed7a3d790c2add2dccc15300005c1aec0f4f6f.tar.bz2
Fixes a few minor parallel warnings (#1832)
Diffstat (limited to 'tools')
-rw-r--r--tools/src/h5perf/perf.c13
-rw-r--r--tools/src/h5perf/pio_engine.c9
2 files changed, 11 insertions, 11 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..d50e783 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;
@@ -365,8 +368,8 @@ done:
}
/* release generic resources */
- if (buffer)
- HDfree(buffer);
+ HDfree(buffer);
+ HDfree(fname);
res.ret_code = ret_code;
return res;
}