summaryrefslogtreecommitdiffstats
path: root/test/use_common.c
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2020-09-30 14:27:10 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2020-09-30 14:27:10 (GMT)
commitb2d661b508a7fc7a2592c13bc6bdc175551f075d (patch)
tree13baeb0d83a7c2a4c6299993c182b1227c2f6114 /test/use_common.c
parent29ab58b58dce556639ea3154e262895773a8a8df (diff)
downloadhdf5-b2d661b508a7fc7a2592c13bc6bdc175551f075d.zip
hdf5-b2d661b508a7fc7a2592c13bc6bdc175551f075d.tar.gz
hdf5-b2d661b508a7fc7a2592c13bc6bdc175551f075d.tar.bz2
Clang-format of source files
Diffstat (limited to 'test/use_common.c')
-rw-r--r--test/use_common.c306
1 files changed, 151 insertions, 155 deletions
diff --git a/test/use_common.c b/test/use_common.c
index 7e19167..ccebd0b 100644
--- a/test/use_common.c
+++ b/test/use_common.c
@@ -33,7 +33,8 @@ usage(const char *prog)
HDfprintf(stderr, " OPTIONS\n");
HDfprintf(stderr, " -h, --help Print a usage message and exit\n");
HDfprintf(stderr, " -f FN Test file name [default: %s.h5]\n", prog);
- HDfprintf(stderr, " -i N, --iteration=N Number of iterations to repeat the whole thing. [default: 1]\n");
+ HDfprintf(stderr,
+ " -i N, --iteration=N Number of iterations to repeat the whole thing. [default: 1]\n");
HDfprintf(stderr, " -l w|r launch writer or reader only. [default: launch both]\n");
HDfprintf(stderr, " -n N, --nplanes=N Number of planes to write/read. [default: 1000]\n");
HDfprintf(stderr, " -s N, --swmr=N Use SWMR mode (0: no, non-0: yes) default is yes\n");
@@ -48,11 +49,11 @@ usage(const char *prog)
* ----------------------------------------------------------------------------
*/
int
-parse_option(int argc, char * const argv[], options_t * opts)
+parse_option(int argc, char *const argv[], options_t *opts)
{
- int ret_value=0;
+ int ret_value = 0;
int c;
- int use_swmr; /* Need an int to detect errors */
+ int use_swmr; /* Need an int to detect errors */
/* command line options: See function usage for a description */
const char *nagg_options = "f:hi:l:n:s:y:z:";
@@ -65,79 +66,80 @@ parse_option(int argc, char * const argv[], options_t * opts)
if (-1 == c)
break;
switch (c) {
- case 'h':
- usage(opts->progname);
- exit(EXIT_SUCCESS);
- break;
- case 'f': /* usecase data file name */
- opts->filename = HDstrdup(optarg);
- break;
- case 'i': /* iterations */
- if ((opts->iterations = HDatoi(optarg)) <= 0) {
- HDfprintf(stderr, "bad iterations number %s, must be a positive integer\n", optarg);
+ case 'h':
usage(opts->progname);
- Hgoto_error(-1);
- }
- break;
- case 'l': /* launch reader or writer only */
- switch (*optarg) {
- case 'r': /* reader only */
- opts->launch = UC_READER;
+ exit(EXIT_SUCCESS);
break;
- case 'w': /* writer only */
- opts->launch = UC_WRITER;
+ case 'f': /* usecase data file name */
+ opts->filename = HDstrdup(optarg);
break;
- default:
- HDfprintf(stderr, "launch value(%c) should be w or r only.\n", *optarg);
- usage(opts->progname);
- Hgoto_error(-1);
+ case 'i': /* iterations */
+ if ((opts->iterations = HDatoi(optarg)) <= 0) {
+ HDfprintf(stderr, "bad iterations number %s, must be a positive integer\n", optarg);
+ usage(opts->progname);
+ Hgoto_error(-1);
+ }
break;
- } /* end switch (reader/writer-only mode toggle) */
- break;
- case 'n': /* number of planes to write/read */
- if ((opts->nplanes = HDstrtoul(optarg, NULL, 0)) <= 0) {
- HDfprintf(stderr, "bad number of planes %s, must be a positive integer\n", optarg);
- usage(opts->progname);
- Hgoto_error(-1);
- }
- break;
- case 's': /* use swmr file open mode */
- use_swmr = HDatoi(optarg);
- if (use_swmr != 0 && use_swmr != 1) {
- HDfprintf(stderr, "swmr value should be 0(no) or 1(yes)\n");
- usage(opts->progname);
- Hgoto_error(-1);
- }
- opts->use_swmr = (hbool_t)use_swmr;
- break;
- case 'y': /* Number of planes per chunk */
- if ((opts->chunkplanes = HDstrtoul(optarg, NULL, 0)) <= 0) {
- HDfprintf(stderr, "bad number of planes per chunk %s, must be a positive integer\n", optarg);
- usage(opts->progname);
+ case 'l': /* launch reader or writer only */
+ switch (*optarg) {
+ case 'r': /* reader only */
+ opts->launch = UC_READER;
+ break;
+ case 'w': /* writer only */
+ opts->launch = UC_WRITER;
+ break;
+ default:
+ HDfprintf(stderr, "launch value(%c) should be w or r only.\n", *optarg);
+ usage(opts->progname);
+ Hgoto_error(-1);
+ break;
+ } /* end switch (reader/writer-only mode toggle) */
+ break;
+ case 'n': /* number of planes to write/read */
+ if ((opts->nplanes = HDstrtoul(optarg, NULL, 0)) <= 0) {
+ HDfprintf(stderr, "bad number of planes %s, must be a positive integer\n", optarg);
+ usage(opts->progname);
+ Hgoto_error(-1);
+ }
+ break;
+ case 's': /* use swmr file open mode */
+ use_swmr = HDatoi(optarg);
+ if (use_swmr != 0 && use_swmr != 1) {
+ HDfprintf(stderr, "swmr value should be 0(no) or 1(yes)\n");
+ usage(opts->progname);
+ Hgoto_error(-1);
+ }
+ opts->use_swmr = (hbool_t)use_swmr;
+ break;
+ case 'y': /* Number of planes per chunk */
+ if ((opts->chunkplanes = HDstrtoul(optarg, NULL, 0)) <= 0) {
+ HDfprintf(stderr, "bad number of planes per chunk %s, must be a positive integer\n",
+ optarg);
+ usage(opts->progname);
+ Hgoto_error(-1);
+ }
+ break;
+ case 'z': /* size of chunk=(z,z) */
+ if ((opts->chunksize = HDstrtoull(optarg, NULL, 0)) <= 0) {
+ HDfprintf(stderr, "bad chunksize %s, must be a positive integer\n", optarg);
+ usage(opts->progname);
+ Hgoto_error(-1);
+ }
+ break;
+ case '?':
+ HDfprintf(stderr, "getopt returned '%c'.\n", c);
Hgoto_error(-1);
- }
- break;
- case 'z': /* size of chunk=(z,z) */
- if ((opts->chunksize = HDstrtoull(optarg, NULL, 0)) <= 0) {
- HDfprintf(stderr, "bad chunksize %s, must be a positive integer\n", optarg);
- usage(opts->progname);
+ default:
+ HDfprintf(stderr, "getopt returned unexpected value.\n");
+ HDfprintf(stderr, "Unexpected value is %d\n", c);
Hgoto_error(-1);
- }
- break;
- case '?':
- HDfprintf(stderr, "getopt returned '%c'.\n", c);
- Hgoto_error(-1);
- default:
- HDfprintf(stderr, "getopt returned unexpected value.\n");
- HDfprintf(stderr, "Unexpected value is %d\n", c);
- Hgoto_error(-1);
} /* end switch (argument symbol) */
- } /* end while (there are still arguments) */
+ } /* end while (there are still arguments) */
/* set test file name if not given */
if (!opts->filename) {
/* default data file name is <progname>.h5 */
- if ((opts->filename=(char*)HDmalloc(HDstrlen(opts->progname)+4))==NULL) {
+ if ((opts->filename = (char *)HDmalloc(HDstrlen(opts->progname) + 4)) == NULL) {
HDfprintf(stderr, "malloc: failed\n");
Hgoto_error(-1);
}
@@ -146,7 +148,7 @@ parse_option(int argc, char * const argv[], options_t * opts)
}
done:
- return(ret_value);
+ return (ret_value);
} /* end parse_option() */
/* ----------------------------------------------------------------------------
@@ -154,18 +156,18 @@ done:
* ----------------------------------------------------------------------------
*/
void
-show_parameters(options_t * opts)
+show_parameters(options_t *opts)
{
HDprintf("===Parameters used:===\n");
HDprintf("chunk dims=(%llu, %llu, %llu)\n", (unsigned long long)opts->chunkdims[0],
- (unsigned long long)opts->chunkdims[1], (unsigned long long)opts->chunkdims[2]);
+ (unsigned long long)opts->chunkdims[1], (unsigned long long)opts->chunkdims[2]);
HDprintf("dataset max dims=(%llu, %llu, %llu)\n", (unsigned long long)opts->max_dims[0],
- (unsigned long long)opts->max_dims[1], (unsigned long long)opts->max_dims[2]);
+ (unsigned long long)opts->max_dims[1], (unsigned long long)opts->max_dims[2]);
HDprintf("number of planes to write=%llu\n", (unsigned long long)opts->nplanes);
HDprintf("using SWMR mode=%s\n", opts->use_swmr ? "yes(1)" : "no(0)");
HDprintf("data filename=%s\n", opts->filename);
HDprintf("launch part=");
- switch (opts->launch) {
+ switch (opts->launch) {
case UC_READWRITE:
HDprintf("Reader/Writer\n");
break;
@@ -178,7 +180,7 @@ show_parameters(options_t * opts)
default:
/* should not happen */
HDprintf("Illegal part(%d)\n", opts->launch);
- }
+ }
HDprintf("number of iterations=%d (not used yet)\n", opts->iterations);
HDprintf("===Parameters shown===\n");
} /* end show_parameters() */
@@ -194,13 +196,13 @@ show_parameters(options_t * opts)
* ----------------------------------------------------------------------------
*/
int
-create_uc_file(options_t * opts)
+create_uc_file(options_t *opts)
{
- hsize_t dims[3]; /* Dataset starting dimensions */
- hid_t fid; /* File ID for new HDF5 file */
- hid_t dcpl; /* Dataset creation property list */
- hid_t sid; /* Dataspace ID */
- hid_t dsid; /* Dataset ID */
+ hsize_t dims[3]; /* Dataset starting dimensions */
+ hid_t fid; /* File ID for new HDF5 file */
+ hid_t dcpl; /* Dataset creation property list */
+ hid_t sid; /* Dataspace ID */
+ hid_t dsid; /* Dataset ID */
H5D_chunk_index_t idx_type; /* Chunk index type */
if ((fid = H5Fcreate(opts->filename, H5F_ACC_TRUNC, H5P_DEFAULT, opts->fapl_id)) < 0)
@@ -258,19 +260,19 @@ create_uc_file(options_t * opts)
* ----------------------------------------------------------------------------
*/
int
-write_uc_file(hbool_t tosend, hid_t file_id, options_t * opts)
+write_uc_file(hbool_t tosend, hid_t file_id, options_t *opts)
{
- hid_t dsid; /* dataset ID */
- hid_t dcpl; /* Dataset creation property list */
- UC_CTYPE *buffer, *bufptr; /* data buffer */
- hsize_t cz=opts->chunksize; /* Chunk size */
- hid_t f_sid; /* dataset file space id */
- hid_t m_sid; /* memory space id */
- int rank; /* rank */
- hsize_t chunk_dims[3]; /* Chunk dimensions */
- hsize_t dims[3]; /* Dataspace dimensions */
- hsize_t memdims[3]; /* Memory space dimensions */
- hsize_t start[3] = {0,0,0}, count[3]; /* Hyperslab selection values */
+ hid_t dsid; /* dataset ID */
+ hid_t dcpl; /* Dataset creation property list */
+ UC_CTYPE *buffer, *bufptr; /* data buffer */
+ hsize_t cz = opts->chunksize; /* Chunk size */
+ hid_t f_sid; /* dataset file space id */
+ hid_t m_sid; /* memory space id */
+ int rank; /* rank */
+ hsize_t chunk_dims[3]; /* Chunk dimensions */
+ hsize_t dims[3]; /* Dataspace dimensions */
+ hsize_t memdims[3]; /* Memory space dimensions */
+ hsize_t start[3] = {0, 0, 0}, count[3]; /* Hyperslab selection values */
hsize_t i, j, k;
if (TRUE == tosend) {
@@ -299,18 +301,18 @@ write_uc_file(hbool_t tosend, hid_t file_id, options_t * opts)
}
/* verify chunk_dims against set paramenters */
- if (chunk_dims[0]!=opts->chunkdims[0] || chunk_dims[1] != cz || chunk_dims[2] != cz) {
+ if (chunk_dims[0] != opts->chunkdims[0] || chunk_dims[1] != cz || chunk_dims[2] != cz) {
HDfprintf(stderr, "chunk size is not as expected. Got dims=(%llu,%llu,%llu)\n",
- (unsigned long long)chunk_dims[0], (unsigned long long)chunk_dims[1],
- (unsigned long long)chunk_dims[2]);
+ (unsigned long long)chunk_dims[0], (unsigned long long)chunk_dims[1],
+ (unsigned long long)chunk_dims[2]);
return -1;
}
/* allocate space for data buffer 1 X dims[1] X dims[2] of UC_CTYPE */
- memdims[0]=1;
+ memdims[0] = 1;
memdims[1] = opts->dims[1];
memdims[2] = opts->dims[2];
- if ((buffer=(UC_CTYPE*)HDmalloc((size_t)memdims[1]*(size_t)memdims[2]*sizeof(UC_CTYPE)))==NULL) {
+ if ((buffer = (UC_CTYPE *)HDmalloc((size_t)memdims[1] * (size_t)memdims[2] * sizeof(UC_CTYPE))) == NULL) {
HDfprintf(stderr, "malloc: failed\n");
return -1;
}
@@ -318,7 +320,7 @@ write_uc_file(hbool_t tosend, hid_t file_id, options_t * opts)
/*
* Get dataset rank and dimension.
*/
- f_sid = H5Dget_space(dsid); /* Get filespace handle first. */
+ f_sid = H5Dget_space(dsid); /* Get filespace handle first. */
rank = H5Sget_simple_extent_ndims(f_sid);
if (rank != UC_RANK) {
HDfprintf(stderr, "rank(%d) of dataset does not match\n", rank);
@@ -328,32 +330,30 @@ write_uc_file(hbool_t tosend, hid_t file_id, options_t * opts)
HDfprintf(stderr, "H5Sget_simple_extent_dims got error\n");
return -1;
}
- HDprintf("dataset rank %d, dimensions %llu x %llu x %llu\n",
- rank, (unsigned long long)(dims[0]), (unsigned long long)(dims[1]),
- (unsigned long long)(dims[2]));
+ HDprintf("dataset rank %d, dimensions %llu x %llu x %llu\n", rank, (unsigned long long)(dims[0]),
+ (unsigned long long)(dims[1]), (unsigned long long)(dims[2]));
/* verify that file space dims are as expected and are consistent with memory space dims */
if (dims[0] != 0 || dims[1] != memdims[1] || dims[2] != memdims[2]) {
- HDfprintf(stderr, "dataset is not empty. Got dims=(%llu,%llu,%llu)\n",
- (unsigned long long)dims[0], (unsigned long long)dims[1],
- (unsigned long long)dims[2]);
+ HDfprintf(stderr, "dataset is not empty. Got dims=(%llu,%llu,%llu)\n", (unsigned long long)dims[0],
+ (unsigned long long)dims[1], (unsigned long long)dims[2]);
return -1;
}
/* setup mem-space for buffer */
- if ((m_sid=H5Screate_simple(rank, memdims, NULL))<0) {
+ if ((m_sid = H5Screate_simple(rank, memdims, NULL)) < 0) {
HDfprintf(stderr, "H5Screate_simple for memory failed\n");
return -1;
}
/* write planes */
- count[0]=1;
- count[1]=dims[1];
- count[2]=dims[2];
- for (i=0; i < opts->nplanes; i++) {
+ count[0] = 1;
+ count[1] = dims[1];
+ count[2] = dims[2];
+ for (i = 0; i < opts->nplanes; i++) {
/* fill buffer with value i+1 */
bufptr = buffer;
- for (j=0; j < dims[1]; j++) {
- for (k=0; k < dims[2]; k++) {
+ for (j = 0; j < dims[1]; j++) {
+ for (k = 0; k < dims[2]; k++) {
*bufptr++ = (UC_CTYPE)i;
}
}
@@ -367,7 +367,7 @@ write_uc_file(hbool_t tosend, hid_t file_id, options_t * opts)
}
/* extend the dataset by one for new plane */
- dims[0]=i+1;
+ dims[0] = i + 1;
if (H5Dset_extent(dsid, dims) < 0) {
HDfprintf(stderr, "H5Dset_extent failed\n");
return -1;
@@ -379,7 +379,7 @@ write_uc_file(hbool_t tosend, hid_t file_id, options_t * opts)
return -1;
}
- start[0]=i;
+ start[0] = i;
/* Choose the next plane to write */
if (H5Sselect_hyperslab(f_sid, H5S_SELECT_SET, start, NULL, count, NULL) < 0) {
HDfprintf(stderr, "Failed H5Sselect_hyperslab\n");
@@ -438,20 +438,20 @@ write_uc_file(hbool_t tosend, hid_t file_id, options_t * opts)
* ----------------------------------------------------------------------------
*/
int
-read_uc_file(hbool_t towait, options_t * opts)
+read_uc_file(hbool_t towait, options_t *opts)
{
- hid_t fid; /* File ID for new HDF5 file */
- hid_t dsid; /* dataset ID */
- UC_CTYPE *buffer, *bufptr; /* read data buffer */
- hid_t f_sid; /* dataset file space id */
- hid_t m_sid; /* memory space id */
- int rank; /* rank */
- hsize_t dims[3]; /* Dataspace dimensions */
- hsize_t memdims[3]; /* Memory space dimensions */
- hsize_t nplane=0, nplanes_seen=0; /* nth plane, last nth plane */
- hsize_t start[3] = {0,0,0}, count[3]; /* Hyperslab selection values */
+ hid_t fid; /* File ID for new HDF5 file */
+ hid_t dsid; /* dataset ID */
+ UC_CTYPE *buffer, *bufptr; /* read data buffer */
+ hid_t f_sid; /* dataset file space id */
+ hid_t m_sid; /* memory space id */
+ int rank; /* rank */
+ hsize_t dims[3]; /* Dataspace dimensions */
+ hsize_t memdims[3]; /* Memory space dimensions */
+ hsize_t nplane = 0, nplanes_seen = 0; /* nth plane, last nth plane */
+ hsize_t start[3] = {0, 0, 0}, count[3]; /* Hyperslab selection values */
hsize_t j, k;
- int nreadererr=0;
+ int nreadererr = 0;
int nerrs;
int loops_waiting_for_plane;
@@ -462,7 +462,8 @@ read_uc_file(hbool_t towait, options_t * opts)
}
HDfprintf(stderr, "Opening to read %s\n", opts->filename);
- if ((fid = H5Fopen(opts->filename, H5F_ACC_RDONLY | (opts->use_swmr ? H5F_ACC_SWMR_READ : 0), opts->fapl_id)) < 0) {
+ if ((fid = H5Fopen(opts->filename, H5F_ACC_RDONLY | (opts->use_swmr ? H5F_ACC_SWMR_READ : 0),
+ opts->fapl_id)) < 0) {
HDfprintf(stderr, "H5Fopen failed\n");
return -1;
}
@@ -476,7 +477,7 @@ read_uc_file(hbool_t towait, options_t * opts)
memdims[0] = 1;
memdims[1] = opts->dims[1];
memdims[2] = opts->dims[2];
- if ((buffer=(UC_CTYPE*)HDmalloc((size_t)memdims[1]*(size_t)memdims[2]*sizeof(UC_CTYPE)))==NULL) {
+ if ((buffer = (UC_CTYPE *)HDmalloc((size_t)memdims[1] * (size_t)memdims[2] * sizeof(UC_CTYPE))) == NULL) {
HDfprintf(stderr, "malloc: failed\n");
return -1;
}
@@ -485,7 +486,7 @@ read_uc_file(hbool_t towait, options_t * opts)
* Get dataset rank and dimension.
* Verify dimension is as expected (unlimited,2*chunksize,2*chunksize).
*/
- f_sid = H5Dget_space(dsid); /* Get filespace handle first. */
+ f_sid = H5Dget_space(dsid); /* Get filespace handle first. */
rank = H5Sget_simple_extent_ndims(f_sid);
if (rank != UC_RANK) {
HDfprintf(stderr, "rank(%d) of dataset does not match\n", rank);
@@ -495,22 +496,19 @@ read_uc_file(hbool_t towait, options_t * opts)
HDfprintf(stderr, "H5Sget_simple_extent_dims got error\n");
return -1;
}
- HDprintf("dataset rank %d, dimensions %llu x %llu x %llu\n",
- rank, (unsigned long long)(dims[0]), (unsigned long long)(dims[1]),
- (unsigned long long)(dims[2]));
+ HDprintf("dataset rank %d, dimensions %llu x %llu x %llu\n", rank, (unsigned long long)(dims[0]),
+ (unsigned long long)(dims[1]), (unsigned long long)(dims[2]));
/* verify that file space dims are as expected and are consistent with memory space dims */
if (dims[1] != memdims[1] || dims[2] != memdims[2]) {
HDfprintf(stderr, "dataset dimension is not as expected. Got dims=(%llu,%llu,%llu)\n",
- (unsigned long long)dims[0], (unsigned long long)dims[1],
- (unsigned long long)dims[2]);
- HDfprintf(stderr, "But memdims=(%llu,%llu,%llu)\n",
- (unsigned long long)memdims[0], (unsigned long long)memdims[1],
- (unsigned long long)memdims[2]);
+ (unsigned long long)dims[0], (unsigned long long)dims[1], (unsigned long long)dims[2]);
+ HDfprintf(stderr, "But memdims=(%llu,%llu,%llu)\n", (unsigned long long)memdims[0],
+ (unsigned long long)memdims[1], (unsigned long long)memdims[2]);
return -1;
}
/* Setup mem-space for buffer */
- if ((m_sid=H5Screate_simple(rank, memdims, NULL)) < 0) {
+ if ((m_sid = H5Screate_simple(rank, memdims, NULL)) < 0) {
HDfprintf(stderr, "H5Screate_simple for memory failed\n");
return -1;
}
@@ -520,22 +518,22 @@ read_uc_file(hbool_t towait, options_t * opts)
count[1] = dims[1];
count[2] = dims[2];
/* quit when all nplanes have been read */
- loops_waiting_for_plane=0;
+ loops_waiting_for_plane = 0;
while (nplanes_seen < opts->nplanes) {
/* print progress message according to if new planes are availalbe */
if (nplanes_seen < dims[0]) {
if (loops_waiting_for_plane) {
/* end the previous message */
HDprintf("\n");
- loops_waiting_for_plane=0;
+ loops_waiting_for_plane = 0;
}
HDprintf("reading planes %llu to %llu\n", (unsigned long long)nplanes_seen,
- (unsigned long long)dims[0]);
+ (unsigned long long)dims[0]);
}
else {
if (loops_waiting_for_plane) {
HDprintf(".");
- if (loops_waiting_for_plane>=30) {
+ if (loops_waiting_for_plane >= 30) {
HDfprintf(stderr, "waited too long for new plane, quit.\n");
return -1;
}
@@ -549,7 +547,7 @@ read_uc_file(hbool_t towait, options_t * opts)
HDsleep(1);
}
- for (nplane=nplanes_seen; nplane < dims[0]; nplane++) {
+ for (nplane = nplanes_seen; nplane < dims[0]; nplane++) {
/* read planes between last old nplanes and current extent */
/* Get the dataset's dataspace */
if ((f_sid = H5Dget_space(dsid)) < 0) {
@@ -557,7 +555,7 @@ read_uc_file(hbool_t towait, options_t * opts)
return -1;
}
- start[0]=nplane;
+ start[0] = nplane;
/* Choose the next plane to read */
if (H5Sselect_hyperslab(f_sid, H5S_SELECT_SET, start, NULL, count, NULL) < 0) {
HDfprintf(stderr, "H5Sselect_hyperslab failed\n");
@@ -572,31 +570,30 @@ read_uc_file(hbool_t towait, options_t * opts)
/* compare read data with expected data value which is nplane */
bufptr = buffer;
- nerrs=0;
- for (j=0; j < dims[1]; j++) {
- for (k=0; k < dims[2]; k++) {
+ nerrs = 0;
+ for (j = 0; j < dims[1]; j++) {
+ for (k = 0; k < dims[2]; k++) {
if ((hsize_t)*bufptr++ != nplane) {
if (++nerrs < ErrorReportMax) {
- HDfprintf(stderr,
- "found error %llu plane(%llu,%llu), expected %llu, got %d\n",
- (unsigned long long)nplane, (unsigned long long)j,
- (unsigned long long)k, (unsigned long long)nplane, (int)*(bufptr-1));
+ HDfprintf(stderr, "found error %llu plane(%llu,%llu), expected %llu, got %d\n",
+ (unsigned long long)nplane, (unsigned long long)j,
+ (unsigned long long)k, (unsigned long long)nplane, (int)*(bufptr - 1));
} /* end if should print error */
- } /* end if value mismatch */
- } /* end for plane second dimension */
- } /* end for plane first dimension */
+ } /* end if value mismatch */
+ } /* end for plane second dimension */
+ } /* end for plane first dimension */
if (nerrs) {
nreadererr++;
HDfprintf(stderr, "found %d unexpected values in plane %llu\n", nerrs,
- (unsigned long long)nplane);
+ (unsigned long long)nplane);
}
} /* end for each plane added since last read */
- nplanes_seen=dims[0];
+ nplanes_seen = dims[0];
/* check if dataset has grown since last time (update dims) */
H5Drefresh(dsid);
- f_sid = H5Dget_space(dsid); /* Get filespace handle first. */
+ f_sid = H5Dget_space(dsid); /* Get filespace handle first. */
if (H5Sget_simple_extent_dims(f_sid, dims, NULL) < 0) {
HDfprintf(stderr, "H5Sget_simple_extent_dims got error\n");
return -1;
@@ -615,4 +612,3 @@ read_uc_file(hbool_t towait, options_t * opts)
} /* end read_uc_file() */
#endif /* H5_HAVE_FORK */
-