summaryrefslogtreecommitdiffstats
path: root/tools/src/h5perf/sio_engine.c
diff options
context:
space:
mode:
authorDana Robinson <43805+derobins@users.noreply.github.com>2023-03-21 04:31:41 (GMT)
committerGitHub <noreply@github.com>2023-03-21 04:31:41 (GMT)
commit7ed1deb00f6fdc49aa48632096a8596f55cdf57f (patch)
tree1c89ae08b77ef78660ce87690e617fe3999f608f /tools/src/h5perf/sio_engine.c
parentf1e7081cc28b3af0077af71605df7320aa1b9312 (diff)
downloadhdf5-7ed1deb00f6fdc49aa48632096a8596f55cdf57f.zip
hdf5-7ed1deb00f6fdc49aa48632096a8596f55cdf57f.tar.gz
hdf5-7ed1deb00f6fdc49aa48632096a8596f55cdf57f.tar.bz2
Remove perf tool and standalone h5perf builds (#2619)
The small perf tool conflicts with the standard perf tool and is being removed from all HDF5 releases. Building h5perf in "standalone" mode (i.e., independently of the library) has been broken for some time, so the build code for that has also been removed.
Diffstat (limited to 'tools/src/h5perf/sio_engine.c')
-rw-r--r--tools/src/h5perf/sio_engine.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/tools/src/h5perf/sio_engine.c b/tools/src/h5perf/sio_engine.c
index 4b39545..a1b52b9 100644
--- a/tools/src/h5perf/sio_engine.c
+++ b/tools/src/h5perf/sio_engine.c
@@ -16,12 +16,10 @@
#include "hdf5.h"
-#ifdef H5_STDC_HEADERS
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
-#endif
#ifdef H5_HAVE_UNISTD_H
#include <sys/types.h>
@@ -52,7 +50,7 @@
/* verify: if val is false (0), print mesg. */
#define VRFY(val, mesg) \
do { \
- if (!val) { \
+ if (!(val)) { \
ERRMSG(mesg); \
GOTOERROR(FAIL); \
} \
@@ -181,7 +179,7 @@ do_sio(parameters param, results *res)
if ((param.dset_size[i] % param.buf_size[i]) != 0) {
HDfprintf(stderr,
- "Dataset size[%d] (%" H5_PRINTF_LL_WIDTH "d) must be a multiple of the "
+ "Dataset size[%d] (%lld) must be a multiple of the "
"transfer buffer size[%d] (%zu)\n",
param.rank, (long long)param.dset_size[i], param.rank, param.buf_size[i]);
GOTOERROR(FAIL);
@@ -205,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), &param);
+ sio_create_filename(iot, base_name, fname, FILENAME_MAX, &param);
if (sio_debug_level > 0)
HDfprintf(output, "data filename=%s\n", fname);
@@ -331,7 +329,7 @@ sio_create_filename(iotype iot, const char *base_name, char *fullname, size_t si
/* If the prefix specifies the HDF5_PREFIX directory, then
* default to using the "/tmp/$USER" or "/tmp/$LOGIN"
* directory instead. */
- register char *user, *login, *subdir;
+ char *user, *login, *subdir;
user = HDgetenv("USER");
login = HDgetenv("LOGIN");
@@ -524,7 +522,7 @@ do_write(results *res, file_descr *fd, parameters *parms, void *buffer)
} /* end if */
} /* end if */
- HDsprintf(dname, "Dataset_%ld", (unsigned long)parms->num_bytes);
+ HDsnprintf(dname, sizeof(dname), "Dataset_%ld", (unsigned long)parms->num_bytes);
h5ds_id =
H5Dcreate2(fd->h5fd, dname, ELMT_H5_TYPE, h5dset_space_id, H5P_DEFAULT, h5dcpl, H5P_DEFAULT);
@@ -853,7 +851,7 @@ do_read(results *res, file_descr *fd, parameters *parms, void *buffer)
break;
case HDF5:
- HDsprintf(dname, "Dataset_%ld", (long)parms->num_bytes);
+ HDsnprintf(dname, sizeof(dname), "Dataset_%ld", (long)parms->num_bytes);
h5ds_id = H5Dopen2(fd->h5fd, dname, H5P_DEFAULT);
if (h5ds_id < 0) {
HDfprintf(stderr, "HDF5 Dataset open failed\n");
@@ -1183,7 +1181,7 @@ set_vfd(parameters *param)
return -1;
for (mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt++) {
memb_fapl[mt] = H5P_DEFAULT;
- HDsprintf(sv->arr[mt], "%%s-%c.h5", multi_letters[mt]);
+ HDsnprintf(sv->arr[mt], 1024, "%%s-%c.h5", multi_letters[mt]);
memb_name[mt] = sv->arr[mt];
memb_addr[mt] = (haddr_t)MAX(mt - 1, 0) * (HADDR_MAX / 10);
}
@@ -1281,7 +1279,7 @@ do_cleanupfile(iotype iot, char *filename)
int j;
hid_t driver;
- temp_sz = (2048) * sizeof(char);
+ temp_sz = (4096 + sizeof("-?.h5")) * sizeof(char);
if (NULL == (temp = HDcalloc(1, temp_sz)))
goto done;
@@ -1300,7 +1298,9 @@ do_cleanupfile(iotype iot, char *filename)
if (driver == H5FD_FAMILY) {
for (j = 0; /*void*/; j++) {
+ H5_GCC_CLANG_DIAG_OFF("format-nonliteral")
HDsnprintf(temp, temp_sz, filename, j);
+ H5_GCC_CLANG_DIAG_ON("format-nonliteral")
if (HDaccess(temp, F_OK) < 0)
break;