summaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorDana Robinson <43805+derobins@users.noreply.github.com>2023-07-27 20:43:30 (GMT)
committerGitHub <noreply@github.com>2023-07-27 20:43:30 (GMT)
commit1e91d96fa02466ffe451319bdac1005f84dc7993 (patch)
tree4de04ef502c313dfd766497b20235188761146c0 /utils
parent95e5349089b95dfb95f0f8ce2d6db1bc04ba6c82 (diff)
downloadhdf5-1e91d96fa02466ffe451319bdac1005f84dc7993.zip
hdf5-1e91d96fa02466ffe451319bdac1005f84dc7993.tar.gz
hdf5-1e91d96fa02466ffe451319bdac1005f84dc7993.tar.bz2
Brings over most of the HD prefix removal (#3293)
Diffstat (limited to 'utils')
-rw-r--r--utils/tools/h5dwalk/h5dwalk.c76
1 files changed, 38 insertions, 38 deletions
diff --git a/utils/tools/h5dwalk/h5dwalk.c b/utils/tools/h5dwalk/h5dwalk.c
index acb1724..9dcb4a8 100644
--- a/utils/tools/h5dwalk/h5dwalk.c
+++ b/utils/tools/h5dwalk/h5dwalk.c
@@ -120,7 +120,7 @@ create_default_separators(struct distribute_option *option, mfu_flist *flist, ui
double max_size_tmp;
const char *max_size_units;
mfu_format_bytes(*global_max_file_size, &max_size_tmp, &max_size_units);
- HDprintf("Max File Size: %.3lf %s\n", max_size_tmp, max_size_units);
+ printf("Max File Size: %.3lf %s\n", max_size_tmp, max_size_units);
/* round next_pow_2 to next multiple of 10 */
uint64_t max_magnitude_bin = (uint64_t)((ceil(log2((double)(*global_max_file_size)) / 10)) * 10);
@@ -213,15 +213,15 @@ print_flist_distribution(int file_histogram, struct distribute_option *option, m
uint64_t number;
double size_tmp;
const char *size_units;
- HDprintf("%-27s %s\n", "Range", "Number");
+ printf("%-27s %s\n", "Range", "Number");
for (size_t i = 0; i <= separators; i++) {
- HDprintf("%s", "[ ");
+ printf("%s", "[ ");
if (i == 0) {
- HDprintf("%7.3lf %3s", 0.000, "B");
+ printf("%7.3lf %3s", 0.000, "B");
}
else {
mfu_format_bytes((uint64_t)option->separators[i - 1], &size_tmp, &size_units);
- HDprintf("%7.3lf %3s", size_tmp, size_units);
+ printf("%7.3lf %3s", size_tmp, size_units);
}
printf("%s", " - ");
@@ -230,17 +230,17 @@ print_flist_distribution(int file_histogram, struct distribute_option *option, m
mfu_format_bytes((uint64_t)option->separators[i], &size_tmp, &size_units);
number = disttotal[i];
mfu_format_bytes((uint64_t)option->separators[i], &size_tmp, &size_units);
- HDprintf("%7.3lf %3s ) %" PRIu64 "\n", size_tmp, size_units, number);
+ printf("%7.3lf %3s ) %" PRIu64 "\n", size_tmp, size_units, number);
}
else {
if (i == separators) {
number = disttotal[i];
- HDprintf("%10s ) %" PRIu64 "\n", "MAX", number);
+ printf("%10s ) %" PRIu64 "\n", "MAX", number);
}
else {
number = disttotal[i];
mfu_format_bytes((uint64_t)option->separators[i], &size_tmp, &size_units);
- HDprintf("%7.3lf %3s ) %" PRIu64 "\n", size_tmp, size_units, number);
+ printf("%7.3lf %3s ) %" PRIu64 "\n", size_tmp, size_units, number);
}
}
}
@@ -268,7 +268,7 @@ distribute_separator_add(struct distribute_option *option, uint64_t separator)
count = option->separator_number;
option->separator_number++;
if (option->separator_number > MAX_DISTRIBUTE_SEPARATORS) {
- HDprintf("Too many separators");
+ printf("Too many separators");
return -1;
}
@@ -340,13 +340,13 @@ distribution_parse(struct distribute_option *option, const char *string)
}
if (mfu_abtoull(ptr, &separator) != MFU_SUCCESS) {
- HDprintf("Invalid separator \"%s\"\n", ptr);
+ printf("Invalid separator \"%s\"\n", ptr);
status = -1;
goto out;
}
if (distribute_separator_add(option, separator)) {
- HDprintf("Duplicated separator \"%llu\"\n", separator);
+ printf("Duplicated separator \"%llu\"\n", separator);
status = -1;
goto out;
}
@@ -450,8 +450,8 @@ print_file(mfu_flist flist, uint64_t idx)
const char *size_units;
mfu_format_bytes(size, &size_tmp, &size_units);
- HDprintf("%s %s %s %7.3f %3s %s %s\n", mode_format, username, groupname, size_tmp, size_units,
- modify_s, file);
+ printf("%s %s %s %7.3f %3s %s %s\n", mode_format, username, groupname, size_tmp, size_units, modify_s,
+ file);
}
else {
/* get type */
@@ -467,7 +467,7 @@ print_file(mfu_flist flist, uint64_t idx)
type_str = type_str_link;
}
- HDprintf("Type=%s File=%s\n", type_str, file);
+ printf("Type=%s File=%s\n", type_str, file);
}
}
@@ -521,8 +521,8 @@ print_file_text(mfu_flist flist, uint64_t idx, char *buffer, size_t bufsize)
const char *size_units;
mfu_format_bytes(size, &size_tmp, &size_units);
- numbytes = (size_t)snHDprintf(buffer, bufsize, "%s %s %s %7.3f %3s %s %s\n", mode_format, username,
- groupname, size_tmp, size_units, modify_s, file);
+ numbytes = (size_t)snprintf(buffer, bufsize, "%s %s %s %7.3f %3s %s %s\n", mode_format, username,
+ groupname, size_tmp, size_units, modify_s, file);
}
else {
/* get type */
@@ -538,7 +538,7 @@ print_file_text(mfu_flist flist, uint64_t idx, char *buffer, size_t bufsize)
type_str = type_str_link;
}
- numbytes = (size_t)snHDprintf(buffer, bufsize, "Type=%s File=%s\n", type_str, file);
+ numbytes = (size_t)snprintf(buffer, bufsize, "Type=%s File=%s\n", type_str, file);
}
return numbytes;
@@ -606,7 +606,7 @@ dh5tool_flist_write_text(const char *name, mfu_flist bflist)
/* change number of ranks to string to pass to MPI_Info */
char str_buf[12];
- HDprintf(str_buf, "%d", ranks);
+ printf(str_buf, "%d", ranks);
/* no. of I/O devices for lustre striping is number of ranks */
MPI_Info_set(info, "striping_factor", str_buf);
@@ -758,7 +758,7 @@ fill_file_list(mfu_flist new_flist, const char *config_filename, int myrank, int
char linebuf[PATH_MAX] = {
'\0',
};
- FILE *config = HDfopen(config_filename, "r");
+ FILE *config = fopen(config_filename, "r");
if (config == NULL)
return -1;
while (HDfgets(linebuf, sizeof(linebuf), config) != NULL) {
@@ -924,7 +924,7 @@ run_command(int argc __attribute__((unused)), char **argv, char *cmdline, const
int use_stdout = 0;
#ifdef H5_HAVE_WINDOWS
- HDprintf("ERROR: %s %s: Unable to support fork/exec on WINDOWS\n", PROGRAMNAME, __func__);
+ printf("ERROR: %s %s: Unable to support fork/exec on WINDOWS\n", PROGRAMNAME, __func__);
h5dwalk_exit(EXIT_FAILURE);
#else
@@ -943,7 +943,7 @@ run_command(int argc __attribute__((unused)), char **argv, char *cmdline, const
buf_cache = bufs;
#ifdef VERBOSE
if (buft_count == 0) {
- HDprintf("[%d] Initial buf_cache allocation: buft_count=%d\n", sg_mpi_rank, buft_count);
+ printf("[%d] Initial buf_cache allocation: buft_count=%d\n", sg_mpi_rank, buft_count);
}
#endif
bufs[buft_count++] = thisbuft = (buf_t *)MFU_CALLOC(1, sizeof(buf_t));
@@ -1006,7 +1006,7 @@ run_command(int argc __attribute__((unused)), char **argv, char *cmdline, const
/* Create a new read buffer */
#ifdef VERBOSE
- HDprintf("[%d] Allocate-1 a new read buffer:: buft_count=%d\n", sg_mpi_rank, buft_count);
+ printf("[%d] Allocate-1 a new read buffer:: buft_count=%d\n", sg_mpi_rank, buft_count);
#endif
bufs[buft_count++] = thisbuft = (buf_t *)MFU_CALLOC(1, sizeof(buf_t));
assert(thisbuft != NULL);
@@ -1033,8 +1033,8 @@ run_command(int argc __attribute__((unused)), char **argv, char *cmdline, const
thisbuft->count = 0;
thisbuft->chars += read_bytes;
#ifdef VERBOSE
- HDprintf("[%d] Allocate-2 a new read buffer:: buft_count=%d\n", sg_mpi_rank,
- buft_count);
+ printf("[%d] Allocate-2 a new read buffer:: buft_count=%d\n", sg_mpi_rank,
+ buft_count);
#endif
bufs[buft_count++] = thisbuft = (buf_t *)MFU_CALLOC(1, sizeof(buf_t));
assert(thisbuft != NULL);
@@ -1109,7 +1109,7 @@ run_command(int argc __attribute__((unused)), char **argv, char *cmdline, const
HDstrcpy(&logErrors[log_len - 3], "err");
}
if (mfu_debug_level == MFU_LOG_VERBOSE) {
- HDprintf("\tCreating logfile: %s\n", logpath);
+ printf("\tCreating logfile: %s\n", logpath);
fflush(stdout);
}
pid = fork();
@@ -1175,7 +1175,7 @@ MFU_PRED_EXEC(mfu_flist flist, uint64_t idx, void *arg)
argv[k++] = HDstrdup(toolname);
- HDmemset(cmdline, 0, sizeof(cmdline));
+ memset(cmdline, 0, sizeof(cmdline));
buf += HDstrlen(toolname) + 1;
/* Reconstruct the command line that the user provided for the h5tool */
for (k = 1; k < count; k++) {
@@ -1184,15 +1184,15 @@ MFU_PRED_EXEC(mfu_flist flist, uint64_t idx, void *arg)
mfu_flist flist_arg;
void *check_ptr[2] = {NULL, NULL};
- HDmemcpy(check_ptr, &buf[1], sizeof(void *));
+ memcpy(check_ptr, &buf[1], sizeof(void *));
flist_arg = (mfu_flist)check_ptr[0];
/* +2 (see below) accounts for the '&' and the trailing zero pad */
buf += sizeof(mfu_flist *) + 2;
fname_arg = mfu_flist_file_get_name(flist_arg, idx);
if (fname_arg == NULL) {
- HDprintf("[%d] Warning: Unable to resolve file_substitution %d (idx=%ld)\n", sg_mpi_rank,
- file_substituted, idx);
+ printf("[%d] Warning: Unable to resolve file_substitution %d (idx=%ld)\n", sg_mpi_rank,
+ file_substituted, idx);
argv[k] = HDstrdup(fname);
}
else {
@@ -1224,7 +1224,7 @@ int
MFU_PRED_PRINT(mfu_flist flist, uint64_t idx, void *arg __attribute__((unused)))
{
const char *name = mfu_flist_file_get_name(flist, idx);
- HDprintf("%s\n", name);
+ printf("%s\n", name);
return 1;
}
@@ -1257,7 +1257,7 @@ process_input_file(char *inputname, int myrank, int size)
char linebuf[PATH_MAX] = {
'\0',
};
- FILE *config = HDfopen(inputname, "r");
+ FILE *config = fopen(inputname, "r");
mfu_flist flist1 = NULL;
if (config == NULL)
@@ -1311,7 +1311,7 @@ process_input_file(char *inputname, int myrank, int size)
index++;
}
linebuf[0] = 0;
- HDfree(cmdline);
+ free(cmdline);
}
if (output_log_file) {
@@ -1352,7 +1352,7 @@ main(int argc, char *argv[])
#if 0
env_var = HDgetenv("HDF5_H5DWALK_PRINT_CMDLINE");
if (env_var) {
- int enable = HDatoi(env_var);
+ int enable = atoi(env_var);
if (enable) {
}
@@ -1517,7 +1517,7 @@ main(int argc, char *argv[])
}
}
if (count1 != count2) {
- HDprintf("config files have different file counts: (1) %d and (2) %d\n", count1, count2);
+ printf("config files have different file counts: (1) %d and (2) %d\n", count1, count2);
}
}
else if (numpaths > 0) {
@@ -1568,7 +1568,7 @@ main(int argc, char *argv[])
if (tool_selected && (args_byte_length > 0)) {
pred_head = mfu_pred_new();
- args_buf = (char *)HDmalloc((size_t)(args_byte_length + pathlen_total));
+ args_buf = (char *)malloc((size_t)(args_byte_length + pathlen_total));
}
/* filter files to only include hdf5 files */
@@ -1607,10 +1607,10 @@ main(int argc, char *argv[])
*ptr++ = '&';
/* Select which argument list should be used */
if (k == 0) {
- HDmemcpy(ptr, &flist1, sizeof(void *));
+ memcpy(ptr, &flist1, sizeof(void *));
}
if (k == 1) {
- HDmemcpy(ptr, &flist2, sizeof(void *));
+ memcpy(ptr, &flist2, sizeof(void *));
}
ptr += sizeof(mfu_flist *);
k++;
@@ -1708,5 +1708,5 @@ h5dwalk_exit(int status)
if (require_finalize)
MPI_Finalize();
- HDexit(status);
+ exit(status);
}