diff options
Diffstat (limited to 'test/swmr_sparse_reader.c')
-rw-r--r-- | test/swmr_sparse_reader.c | 75 |
1 files changed, 37 insertions, 38 deletions
diff --git a/test/swmr_sparse_reader.c b/test/swmr_sparse_reader.c index ff55a5b..b26ee4a 100644 --- a/test/swmr_sparse_reader.c +++ b/test/swmr_sparse_reader.c @@ -112,8 +112,8 @@ check_dataset(hid_t fid, unsigned verbose, const symbol_info_t *symbol, symbol_t /* Emit informational message */ if (verbose) - HDfprintf(stderr, "Symbol = '%s', location = %" PRIuMAX ",%" PRIuMAX "\n", symbol->name, - (uintmax_t)start[0], (uintmax_t)start[1]); + fprintf(stderr, "Symbol = '%s', location = %" PRIuMAX ",%" PRIuMAX "\n", symbol->name, + (uintmax_t)start[0], (uintmax_t)start[1]); /* Read record from dataset */ record->rec_id = UINT64_MAX; @@ -122,11 +122,10 @@ check_dataset(hid_t fid, unsigned verbose, const symbol_info_t *symbol, symbol_t /* Verify record value */ if (record->rec_id != start[1]) { - HDfprintf(stderr, "*** ERROR ***\n"); - HDfprintf(stderr, "Incorrect record value!\n"); - HDfprintf(stderr, - "Symbol = '%s', location = %" PRIuMAX ",%" PRIuMAX ", record->rec_id = %" PRIu64 "\n", - symbol->name, (uintmax_t)start[0], (uintmax_t)start[1], record->rec_id); + fprintf(stderr, "*** ERROR ***\n"); + fprintf(stderr, "Incorrect record value!\n"); + fprintf(stderr, "Symbol = '%s', location = %" PRIuMAX ",%" PRIuMAX ", record->rec_id = %" PRIu64 "\n", + symbol->name, (uintmax_t)start[0], (uintmax_t)start[1], record->rec_id); return -1; } /* end if */ @@ -193,7 +192,7 @@ read_records(const char *filename, unsigned verbose, unsigned long nrecords, uns /* Emit informational message */ if (verbose) - HDfprintf(stderr, "Opening file: %s\n", filename); + fprintf(stderr, "Opening file: %s\n", filename); /* Open the file */ if ((fid = H5Fopen(filename, H5F_ACC_RDONLY | H5F_ACC_SWMR_READ, fapl)) < 0) @@ -218,7 +217,7 @@ read_records(const char *filename, unsigned verbose, unsigned long nrecords, uns /* Emit informational message */ if (verbose) - HDfprintf(stderr, "Reading records\n"); + fprintf(stderr, "Reading records\n"); /* Get the starting time */ start_time = HDtime(NULL); @@ -259,7 +258,7 @@ read_records(const char *filename, unsigned verbose, unsigned long nrecords, uns /* Check for timeout */ if (HDtime(NULL) >= (time_t)(start_time + (time_t)TIMEOUT)) { - HDfprintf(stderr, "Reader timed out\n"); + fprintf(stderr, "Reader timed out\n"); return -1; } /* end if */ @@ -268,7 +267,7 @@ read_records(const char *filename, unsigned verbose, unsigned long nrecords, uns /* Retrieve and print the collection of metadata read retries */ if (print_metadata_retries_info(fid) < 0) - HDfprintf(stderr, "Warning: could not obtain metadata retries info\n"); + fprintf(stderr, "Warning: could not obtain metadata retries info\n"); /* Reopen the file */ if (H5Fclose(fid) < 0) @@ -280,7 +279,7 @@ read_records(const char *filename, unsigned verbose, unsigned long nrecords, uns /* Emit informational message */ if (verbose) - HDfprintf(stderr, "Checking dataset %lu\n", u); + fprintf(stderr, "Checking dataset %lu\n", u); /* Check dataset */ if (check_dataset(fid, verbose, symbol, &record, mem_sid) < 0) @@ -292,11 +291,11 @@ read_records(const char *filename, unsigned verbose, unsigned long nrecords, uns if (iter_to_reopen == 0) { /* Emit informational message */ if (verbose) - HDfprintf(stderr, "Reopening file: %s\n", filename); + fprintf(stderr, "Reopening file: %s\n", filename); /* Retrieve and print the collection of metadata read retries */ if (print_metadata_retries_info(fid) < 0) - HDfprintf(stderr, "Warning: could not obtain metadata retries info\n"); + fprintf(stderr, "Warning: could not obtain metadata retries info\n"); /* Reopen the file */ if (H5Fclose(fid) < 0) @@ -309,7 +308,7 @@ read_records(const char *filename, unsigned verbose, unsigned long nrecords, uns /* Retrieve and print the collection of metadata read retries */ if (print_metadata_retries_info(fid) < 0) - HDfprintf(stderr, "Warning: could not obtain metadata retries info\n"); + fprintf(stderr, "Warning: could not obtain metadata retries info\n"); /* Close file */ if (H5Fclose(fid) < 0) @@ -325,18 +324,18 @@ read_records(const char *filename, unsigned verbose, unsigned long nrecords, uns static void usage(void) { - HDprintf("\n"); - HDprintf("Usage error!\n"); - HDprintf("\n"); - HDprintf("Usage: swmr_sparse_reader [-q] [-s <# of seconds to wait for writer>]\n"); - HDprintf(" [-n <# of reads between reopens>] <# of records>\n"); - HDprintf("\n"); - HDprintf("Defaults to verbose (no '-q' given), 1 second wait ('-s 1') and 1 read\n"); - HDprintf("between reopens ('-r 1')\n"); - HDprintf("\n"); - HDprintf("Note that the # of records *must* be the same as that supplied to\n"); - HDprintf("swmr_sparse_writer\n"); - HDprintf("\n"); + printf("\n"); + printf("Usage error!\n"); + printf("\n"); + printf("Usage: swmr_sparse_reader [-q] [-s <# of seconds to wait for writer>]\n"); + printf(" [-n <# of reads between reopens>] <# of records>\n"); + printf("\n"); + printf("Defaults to verbose (no '-q' given), 1 second wait ('-s 1') and 1 read\n"); + printf("between reopens ('-r 1')\n"); + printf("\n"); + printf("Note that the # of records *must* be the same as that supplied to\n"); + printf("swmr_sparse_writer\n"); + printf("\n"); HDexit(EXIT_FAILURE); } /* end usage() */ @@ -397,19 +396,19 @@ main(int argc, char *argv[]) /* Emit informational message */ if (verbose) { - HDfprintf(stderr, "Parameters:\n"); - HDfprintf(stderr, "\t# of seconds between polling = %d\n", poll_time); - HDfprintf(stderr, "\t# of reads between reopens = %d\n", reopen_count); - HDfprintf(stderr, "\t# of records to read = %ld\n", nrecords); + fprintf(stderr, "Parameters:\n"); + fprintf(stderr, "\t# of seconds between polling = %d\n", poll_time); + fprintf(stderr, "\t# of reads between reopens = %d\n", reopen_count); + fprintf(stderr, "\t# of records to read = %ld\n", nrecords); } /* end if */ /* Emit informational message */ if (verbose) - HDfprintf(stderr, "Generating symbol names\n"); + fprintf(stderr, "Generating symbol names\n"); /* Generate dataset names */ if (generate_symbols() < 0) { - HDfprintf(stderr, "Error generating symbol names!\n"); + fprintf(stderr, "Error generating symbol names!\n"); HDexit(EXIT_FAILURE); } /* end if */ @@ -420,27 +419,27 @@ main(int argc, char *argv[]) /* Reading records from datasets */ if (read_records(FILENAME, verbose, (unsigned long)nrecords, (unsigned)poll_time, (unsigned)reopen_count) < 0) { - HDfprintf(stderr, "Error reading records from datasets!\n"); + fprintf(stderr, "Error reading records from datasets!\n"); HDexit(EXIT_FAILURE); } /* end if */ /* Emit informational message */ if (verbose) - HDfprintf(stderr, "Releasing symbols\n"); + fprintf(stderr, "Releasing symbols\n"); /* Clean up the symbols */ if (shutdown_symbols() < 0) { - HDfprintf(stderr, "Error releasing symbols!\n"); + fprintf(stderr, "Error releasing symbols!\n"); HDexit(EXIT_FAILURE); } /* end if */ /* Emit informational message */ if (verbose) - HDfprintf(stderr, "Closing objects\n"); + fprintf(stderr, "Closing objects\n"); /* Close objects created */ if (H5Tclose(symbol_tid) < 0) { - HDfprintf(stderr, "Error closing symbol datatype!\n"); + fprintf(stderr, "Error closing symbol datatype!\n"); HDexit(EXIT_FAILURE); } /* end if */ |