Merge pull request #2311 in HDFFV/hdf5 from ~KMU/hdf5:misc to develop

* commit '406330addf45529ecdd088f4d22e9aab9a03661d':
  rename macro
  change condition
  pick up from Dave's fix
  leave Wswitch-default for later fix
  fix Wredundant-decls, Wswitch-default, Wdeclaration-after-statement, Wsign-compare, Wmisleading-indentation, Wshadow
This commit is contained in:
Kimmy Mu 2020-01-28 13:28:26 -06:00 committed by kmu
parent 68c54e69a4
commit d4dedac70f
18 changed files with 416 additions and 380 deletions

View File

@ -1616,7 +1616,7 @@ extern char *strdup(const char *s);
srctype _tmp_src = (srctype)(src); \
dsttype _tmp_dst = (dsttype)(_tmp_src); \
HDassert(_tmp_src >= 0); \
HDassert(_tmp_src == _tmp_dst); \
HDassert(_tmp_src == (srctype)_tmp_dst); \
(dst) = _tmp_dst; \
}

View File

@ -343,44 +343,45 @@ int write_uc_file(hbool_t tosend, hid_t fid)
count[1]=dims[1];
count[2]=dims[2];
for (i=0; i<UC_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++)
*bufptr++ = (UC_CTYPE)i;
/* fill buffer with value i+1 */
bufptr = buffer;
for (j=0; j<dims[1]; j++)
for (k=0; k<dims[2]; k++)
*bufptr++ = (UC_CTYPE)i;
/* Cork the dataset's metadata in the cache, if SWMR is enabled */
if(UC_opts.use_swmr)
if(UC_opts.use_swmr) {
if(H5Odisable_mdc_flushes(dsid) < 0) {
HDfprintf(stderr, "H5Odisable_mdc_flushes failed\n");
return -1;
}
}
/* extend the dataset by one for new plane */
dims[0]=i+1;
/* extend the dataset by one for new plane */
dims[0]=i+1;
if(H5Dset_extent(dsid, dims) < 0){
HDfprintf(stderr, "H5Dset_extent failed\n");
return -1;
}
}
/* Get the dataset's dataspace */
if((f_sid = H5Dget_space(dsid)) < 0){
HDfprintf(stderr, "H5Dset_extent failed\n");
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");
return -1;
}
}
/* Write plane to the dataset */
if(H5Dwrite(dsid, UC_DATATYPE, m_sid, f_sid, H5P_DEFAULT, buffer) < 0){
HDfprintf(stderr, "Failed H5Dwrite\n");
return -1;
}
}
/* Uncork the dataset's metadata from the cache, if SWMR is enabled */
if(UC_opts.use_swmr)
@ -389,12 +390,11 @@ int write_uc_file(hbool_t tosend, hid_t fid)
return -1;
}
/* flush file to make the just written plane available. */
if(H5Dflush(dsid) < 0)
{
HDfprintf(stderr, "Failed to H5Fflush file\n");
return -1;
}
/* flush file to make the just written plane available. */
if(H5Dflush(dsid) < 0) {
HDfprintf(stderr, "Failed to H5Fflush file\n");
return -1;
}
}
/* Done writing. Free/Close all resources including data file */

View File

@ -2125,7 +2125,7 @@ extend_writeInd2(void)
{
const char *filename;
hid_t fid; /* HDF5 file ID */
hid_t fapl; /* File access templates */
hid_t fapl_id; /* File access templates */
hid_t fs; /* File dataspace ID */
hid_t ms; /* Memory dataspace ID */
hid_t dataset; /* Dataset ID */
@ -2153,15 +2153,15 @@ extend_writeInd2(void)
* START AN HDF5 FILE
* -------------------*/
/* setup file access template */
fapl = create_faccess_plist(test_comm, MPI_INFO_NULL, facc_type);
VRFY((fapl >= 0), "create_faccess_plist succeeded");
fapl_id = create_faccess_plist(test_comm, MPI_INFO_NULL, facc_type);
VRFY((fapl_id >= 0), "create_faccess_plist succeeded");
/* create the file collectively */
fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id);
VRFY((fid >= 0), "H5Fcreate succeeded");
/* Release file-access template */
ret = H5Pclose(fapl);
ret = H5Pclose(fapl_id);
VRFY((ret >= 0), "H5Pclose succeeded");
@ -3379,7 +3379,7 @@ test_actual_io_mode(int selection_mode) {
hid_t sid = -1;
hid_t dataset = -1;
hid_t data_type = H5T_NATIVE_INT;
hid_t fapl = -1;
hid_t fapl_id = -1;
hid_t mem_space = -1;
hid_t file_space = -1;
hid_t dcpl = -1;
@ -3430,11 +3430,11 @@ test_actual_io_mode(int selection_mode) {
HDassert(filename != NULL);
/* Setup the file access template */
fapl = create_faccess_plist(mpi_comm, mpi_info, facc_type);
VRFY((fapl >= 0), "create_faccess_plist() succeeded");
fapl_id = create_faccess_plist(mpi_comm, mpi_info, facc_type);
VRFY((fapl_id >= 0), "create_faccess_plist() succeeded");
/* Create the file */
fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id);
VRFY((fid >= 0), "H5Fcreate succeeded");
/* Create the basic Space */
@ -3766,7 +3766,7 @@ test_actual_io_mode(int selection_mode) {
/* Release some resources */
ret = H5Sclose(sid);
ret = H5Pclose(fapl);
ret = H5Pclose(fapl_id);
ret = H5Pclose(dcpl);
ret = H5Pclose(dxpl_write);
ret = H5Pclose(dxpl_read);
@ -3895,7 +3895,7 @@ test_no_collective_cause_mode(int selection_mode)
hid_t sid = -1;
hid_t dataset = -1;
hid_t data_type = H5T_NATIVE_INT;
hid_t fapl = -1;
hid_t fapl_id = -1;
hid_t dcpl = -1;
hid_t dxpl_write = -1;
hid_t dxpl_read = -1;
@ -3976,11 +3976,11 @@ test_no_collective_cause_mode(int selection_mode)
HDassert(filename != NULL);
/* Setup the file access template */
fapl = create_faccess_plist(mpi_comm, mpi_info, l_facc_type);
VRFY((fapl >= 0), "create_faccess_plist() succeeded");
fapl_id = create_faccess_plist(mpi_comm, mpi_info, l_facc_type);
VRFY((fapl_id >= 0), "create_faccess_plist() succeeded");
/* Create the file */
fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id);
VRFY((fid >= 0), "H5Fcreate succeeded");
@ -4147,8 +4147,8 @@ test_no_collective_cause_mode(int selection_mode)
/* Release some resources */
if (sid)
H5Sclose(sid);
if (fapl)
H5Pclose(fapl);
if (fapl_id)
H5Pclose(fapl_id);
if (dcpl)
H5Pclose(dcpl);
if (dxpl_write)

File diff suppressed because it is too large Load Diff

View File

@ -385,18 +385,18 @@ verify_data(const char *filename, int chunk_factor, write_type write_pattern, in
/* set expected value according the write pattern */
switch (write_pattern) {
case all:
value = i%mpi_size + 1;
break;
case none:
value = 0;
break;
case sec_last:
if (i==nchunks-2)
value = 100;
else
case all:
value = i%mpi_size + 1;
break;
case none:
value = 0;
break;
case sec_last:
if (i==nchunks-2)
value = 100;
else
value = 0;
break;
default:
HDassert(0);
}

View File

@ -235,6 +235,9 @@ void compact_dataset(void)
char dname[]="dataset";
herr_t ret;
const char *filename;
#ifdef H5_HAVE_INSTRUMENTED_LIBRARY
hbool_t prop_value;
#endif
size = get_size();
@ -314,7 +317,6 @@ void compact_dataset(void)
VRFY((dataset >= 0), "H5Dopen2 succeeded");
#ifdef H5_HAVE_INSTRUMENTED_LIBRARY
hbool_t prop_value;
prop_value = H5D_XFER_COLL_RANK0_BCAST_DEF;
ret = H5Pinsert2(dxpl, H5D_XFER_COLL_RANK0_BCAST_NAME, H5D_XFER_COLL_RANK0_BCAST_SIZE, &prop_value,
NULL, NULL, NULL, NULL, NULL, NULL);
@ -620,6 +622,9 @@ void dataset_fillvalue(void)
int acc, i, ii, j, k, l; /* Local index variables */
herr_t ret; /* Generic return value */
const char *filename;
#ifdef H5_HAVE_INSTRUMENTED_LIBRARY
hbool_t prop_value;
#endif
MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
MPI_Comm_size(MPI_COMM_WORLD, &mpi_size);
@ -664,7 +669,6 @@ void dataset_fillvalue(void)
VRFY((dxpl >= 0), "H5Pcreate succeeded");
#ifdef H5_HAVE_INSTRUMENTED_LIBRARY
hbool_t prop_value;
prop_value = H5D_XFER_COLL_RANK0_BCAST_DEF;
ret = H5Pinsert2(dxpl, H5D_XFER_COLL_RANK0_BCAST_NAME, H5D_XFER_COLL_RANK0_BCAST_SIZE, &prop_value,
NULL, NULL, NULL, NULL, NULL, NULL);

View File

@ -34,8 +34,8 @@ main (int argc, char **argv)
hid_t file_id, dset_id, grp_id;
hid_t fapl, sid, mem_dataspace;
herr_t ret;
char filename[1024];
int mpi_size, mpi_rank, ndims, i, j;
char filename[1024];
int mpi_size, mpi_rank, ndims;
MPI_Comm comm = MPI_COMM_WORLD;
MPI_Info info = MPI_INFO_NULL;
hsize_t dims[RANK];
@ -43,6 +43,7 @@ main (int argc, char **argv)
hsize_t count[RANK];
hsize_t stride[RANK];
hsize_t block[RANK];
hsize_t i, j;
DATATYPE *data_array = NULL, *dataptr; /* data buffer */
MPI_Init(&argc, &argv);
@ -73,8 +74,8 @@ main (int argc, char **argv)
ndims = H5Sget_simple_extent_dims(sid, dims, NULL);
VRFY((ndims == 2), "H5Sget_simple_extent_dims succeeded");
VRFY(dims[0] == ROW_FACTOR*mpi_size, "Wrong dataset dimensions");
VRFY(dims[1] == COL_FACTOR*mpi_size, "Wrong dataset dimensions");
VRFY(dims[0] == (hsize_t)(ROW_FACTOR*mpi_size), "Wrong dataset dimensions");
VRFY(dims[1] == (hsize_t)(COL_FACTOR*mpi_size), "Wrong dataset dimensions");
/* allocate memory for data buffer */
data_array = (DATATYPE *)HDmalloc(dims[0]*dims[1]*sizeof(DATATYPE));

View File

@ -397,14 +397,9 @@ hs_dr_pio_test__setup(const int test_num,
*
* JRM -- 9/16/10
*/
if ( express_test == 0 ) {
tv_ptr->chunk_dims[0] = 1;
tv_ptr->chunk_dims[0] = 1;
} else {
tv_ptr->chunk_dims[0] = 1;
}
tv_ptr->chunk_dims[1] = tv_ptr->chunk_dims[2] =
tv_ptr->chunk_dims[3] =
tv_ptr->chunk_dims[4] = (hsize_t)(tv_ptr->chunk_edge_size);

View File

@ -223,7 +223,7 @@ void coll_write_test(int chunk_factor)
hsize_t chunk_dims[2];
herr_t ret;
unsigned i;
int i;
int fillvalue = 0; /* Fill value for the dataset */
int *matrix_out = NULL;
@ -682,7 +682,7 @@ coll_read_test(void)
hsize_t block[2]; /* Block sizes */
herr_t ret;
unsigned i;
int i;
int *matrix_out;
int *matrix_out1; /* Buffer to read from the dataset */

View File

@ -44,12 +44,12 @@
* This will allow program to continue and can be used for debugging.
* (The "do {...} while(0)" is to group all the statements as one unit.)
*/
#define VRFY(val, mesg) do { \
#define VRFY_IMPL(val, mesg, rankvar) do { \
if (val) { \
MESG(mesg); \
} \
else { \
HDprintf("Proc %d: ", mpi_rank); \
HDprintf("Proc %d: ", rankvar); \
HDprintf("*** Parallel ERROR ***\n"); \
HDprintf(" VRFY (%s) failed at line %4d in %s\n", \
mesg, (int)__LINE__, __FILE__); \
@ -62,6 +62,9 @@
} \
} while(0)
#define VRFY_G(val, mesg) VRFY_IMPL(val, mesg, mpi_rank_g)
#define VRFY(val, mesg) VRFY_IMPL(val, mesg, mpi_rank)
/*
* Checking for information purpose.
* If val is false, print mesg; else nothing.

View File

@ -1345,7 +1345,7 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1,
} /* end else */
} /* end while */
for(i = 1; i < g_nTasks; i++)
for(i = 1; (int)i < g_nTasks; i++)
MPI_Send(NULL, 0, MPI_BYTE, (int)i, MPI_TAG_END, MPI_COMM_WORLD);
/* Print any final data waiting in our queue */

View File

@ -166,7 +166,7 @@ ph5diff_worker(int nID)
{
struct diff_mpi_args args;
struct diffs_found diffs;
int i;
unsigned i;
/* Make certain we've received the filenames and opened the files already */
if(file1_id < 0 || file2_id < 0)

View File

@ -1302,7 +1302,7 @@ dump_reference(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx
hid_t new_obj_sid = H5I_INVALID_HID;
hsize_t elmt_counter = 0; /*counts the # elements printed. */
size_t ncols = 80; /* available output width */
size_t i;
int i;
hsize_t curr_pos = 0; /* total data element position */
h5tools_str_t buffer; /* string into which to render */
h5tools_context_t datactx; /* print context */
@ -1312,7 +1312,7 @@ dump_reference(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx
datactx = *ctx; /* print context */
/* Assume entire data space to be printed */
if (datactx.ndims > 0)
for (i = 0; i < (size_t)datactx.ndims; i++)
for (i = 0; (unsigned)i < datactx.ndims; i++)
datactx.p_min_idx[i] = 0;
datactx.need_prefix = TRUE;
@ -1447,13 +1447,13 @@ dump_reference(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx
/* Print point information */
H5TOOLS_DEBUG("H5S_SEL_POINTS H5R_DATASET_REGION2");
h5tools_dump_region_data_points(new_obj_sid, new_obj_id, stream, info, &datactx,
&buffer, &curr_pos, ncols, i, elmt_counter);
&buffer, &curr_pos, ncols, (hsize_t)i, elmt_counter);
}
else if(region_type == H5S_SEL_HYPERSLABS) {
/* Print block information */
H5TOOLS_DEBUG("H5S_SEL_HYPERSLABS H5R_DATASET_REGION2");
h5tools_dump_region_data_blocks(new_obj_sid, new_obj_id, stream, info, &datactx,
&buffer, &curr_pos, ncols, i, elmt_counter);
&buffer, &curr_pos, ncols, (hsize_t)i, elmt_counter);
}
else
H5TOOLS_INFO("invalid region type");

View File

@ -744,9 +744,9 @@ static void Test_Obj_Copy(void)
/* Set the FAPL for the type of format */
/* Create source file */
if(new_format)
fid = H5Fcreate(HDF_FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_new);
else
fid = H5Fcreate(HDF_FILE1_NEW, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
fid = H5Fcreate(HDF_FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_new);
else
fid = H5Fcreate(HDF_FILE1_NEW, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
if(fid < 0) {
HDfprintf(stderr, "Error: H5Fcreate failed.\n");
goto out;
@ -756,7 +756,7 @@ static void Test_Obj_Copy(void)
gent_empty_group(fid);
gent_nested_datasets(fid);
gent_nested_group(fid);
gent_att_compound_vlstr(fid);
gent_att_compound_vlstr(fid);
H5Fclose(fid);
fid = (-1);

View File

@ -231,9 +231,9 @@ generate_int32le_3d(hbool_t external) {
/* generate values, alternating positive and negative
*/
for (i = 0, n = 0; i < dims[0]; i++) {
for (j = 0; j < dims[1]; j++) {
for (k = 0; k < dims[2]; k++, n++) {
for (i = 0, n = 0; (hsize_t)i < dims[0]; i++) {
for (j = 0; (hsize_t)j < dims[1]; j++) {
for (k = 0; (hsize_t)k < dims[2]; k++, n++) {
wdata[n] = (k + j * 512 + i * 4096) * ((n & 1) ? (-1) : (1));
}
}
@ -263,9 +263,9 @@ generate_uint8be(hbool_t external) {
/* Generate values, ping-pong from ends of range
*/
for (i = 0, n = 0; i < dims[0]; i++) {
for (j = 0; j < dims[1]; j++) {
for (k = 0; k < dims[2]; k++, n++) {
for (i = 0, n = 0; (hsize_t)i < dims[0]; i++) {
for (j = 0; (hsize_t)j < dims[1]; j++) {
for (k = 0; (hsize_t)k < dims[2]; k++, n++) {
wdata[n] = (uint8_t)((n & 1) ? -n : n);
}
}
@ -294,8 +294,8 @@ generate_f32le(hbool_t external) {
int ret_value = 0;
/* Generate values */
for (i = 0, k = 0, n = 0; i < dims[0]; i++) {
for (j = 0; j < dims[1]; j++, k++, n++) {
for (i = 0, k = 0, n = 0; (hsize_t)i < dims[0]; i++) {
for (j = 0; (hsize_t)j < dims[1]; j++, k++, n++) {
wdata[k] = n * 801.1f * ((k % 5 == 1) ? (-1) : (1));
}
}

View File

@ -110,8 +110,10 @@ const char *FILENAME[] = {
/* function prototypes */
static int parse_args(int argc, char **argv);
#ifndef H5_HAVE_UNISTD_H
/* globals needed for getopt */
extern char *optarg;
#endif
int main(int argc, char **argv)
{

View File

@ -362,15 +362,17 @@ done:
switch (iot) {
case POSIXIO:
if (fd.posixfd != -1)
hrc = do_fclose(iot, &fd);
hrc = do_fclose(iot, &fd);
break;
case MPIO:
if (fd.mpifd != MPI_FILE_NULL)
hrc = do_fclose(iot, &fd);
hrc = do_fclose(iot, &fd);
break;
case PHDF5:
if (fd.h5fd != -1)
hrc = do_fclose(iot, &fd);
hrc = do_fclose(iot, &fd);
break;
default:
break;
}
@ -413,6 +415,8 @@ pio_create_filename(iotype iot, const char *base_name, char *fullname, size_t si
case PHDF5:
suffix = ".h5";
break;
default:
break;
}
/* First use the environment variable and then try the constant */
@ -857,6 +861,9 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
} /* end if */
} /* end if */
break;
default:
break;
} /* end switch */
for (ndset = 1; ndset <= ndsets; ++ndset) {
@ -920,6 +927,9 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
GOTOERROR(FAIL);
}
break;
default:
break;
}
/* The task is to transfer bytes_count bytes, starting at
@ -1376,6 +1386,9 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
} /* end else */
break;
default:
break;
} /* switch (parms->io_type) */
} /* end while */
@ -1815,19 +1828,22 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
/* Create the dataset transfer property list */
h5dxpl = H5Pcreate(H5P_DATASET_XFER);
if (h5dxpl < 0) {
HDfprintf(stderr, "HDF5 Property List Create failed\n");
GOTOERROR(FAIL);
HDfprintf(stderr, "HDF5 Property List Create failed\n");
GOTOERROR(FAIL);
}
/* Change to collective I/O, if asked */
if(parms->collective) {
hrc = H5Pset_dxpl_mpio(h5dxpl, H5FD_MPIO_COLLECTIVE);
if (hrc < 0) {
HDfprintf(stderr, "HDF5 Property List Set failed\n");
GOTOERROR(FAIL);
} /* end if */
hrc = H5Pset_dxpl_mpio(h5dxpl, H5FD_MPIO_COLLECTIVE);
if (hrc < 0) {
HDfprintf(stderr, "HDF5 Property List Set failed\n");
GOTOERROR(FAIL);
} /* end if */
} /* end if */
break;
default:
break;
} /* end switch */
for (ndset = 1; ndset <= ndsets; ++ndset) {
@ -1838,19 +1854,21 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
switch (parms->io_type) {
case POSIXIO:
case MPIO:
/* both posix and mpi io just need dataset offset in file*/
dset_offset = (ndset - 1) * nbytes;
break;
/* both posix and mpi io just need dataset offset in file*/
dset_offset = (ndset - 1) * nbytes;
break;
case PHDF5:
HDsprintf(dname, "Dataset_%ld", ndset);
h5ds_id = H5DOPEN(fd->h5fd, dname);
if (h5ds_id < 0) {
HDfprintf(stderr, "HDF5 Dataset open failed\n");
GOTOERROR(FAIL);
}
h5ds_id = H5DOPEN(fd->h5fd, dname);
if (h5ds_id < 0) {
HDfprintf(stderr, "HDF5 Dataset open failed\n");
GOTOERROR(FAIL);
}
break;
break;
default:
break;
}
/* The task is to transfer bytes_count bytes, starting at
@ -2303,6 +2321,9 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
} /* end else */
break;
default:
break;
} /* switch (parms->io_type) */
/* Verify raw data, if asked */
@ -2532,6 +2553,9 @@ do_fopen(parameters *param, char *fname, file_descr *fd /*out*/, int flags)
}
break;
default:
break;
}
done:
@ -2552,38 +2576,41 @@ do_fclose(iotype iot, file_descr *fd /*out*/)
int mrc = 0, rc = 0;
switch (iot) {
case POSIXIO:
rc = POSIXCLOSE(fd->posixfd);
case POSIXIO:
rc = POSIXCLOSE(fd->posixfd);
if (rc != 0){
HDfprintf(stderr, "POSIX File Close failed\n");
GOTOERROR(FAIL);
}
if (rc != 0){
HDfprintf(stderr, "POSIX File Close failed\n");
GOTOERROR(FAIL);
}
fd->posixfd = -1;
break;
fd->posixfd = -1;
break;
case MPIO:
mrc = MPI_File_close(&fd->mpifd);
case MPIO:
mrc = MPI_File_close(&fd->mpifd);
if (mrc != MPI_SUCCESS){
HDfprintf(stderr, "MPI File close failed\n");
GOTOERROR(FAIL);
}
if (mrc != MPI_SUCCESS){
HDfprintf(stderr, "MPI File close failed\n");
GOTOERROR(FAIL);
}
fd->mpifd = MPI_FILE_NULL;
break;
fd->mpifd = MPI_FILE_NULL;
break;
case PHDF5:
hrc = H5Fclose(fd->h5fd);
case PHDF5:
hrc = H5Fclose(fd->h5fd);
if (hrc < 0) {
HDfprintf(stderr, "HDF5 File Close failed\n");
GOTOERROR(FAIL);
}
if (hrc < 0) {
HDfprintf(stderr, "HDF5 File Close failed\n");
GOTOERROR(FAIL);
}
fd->h5fd = -1;
break;
fd->h5fd = -1;
break;
default:
break;
}
done:
@ -2610,15 +2637,17 @@ do_cleanupfile(iotype iot, char *fname)
clean_file_g = (getenv("HDF5_NOCLEANUP")==NULL) ? 1 : 0;
if (clean_file_g){
switch (iot){
case POSIXIO:
HDremove(fname);
break;
case MPIO:
case PHDF5:
MPI_File_delete(fname, h5_io_info_g);
break;
}
switch (iot){
case POSIXIO:
HDremove(fname);
break;
case MPIO:
case PHDF5:
MPI_File_delete(fname, h5_io_info_g);
break;
default:
break;
}
}
}

View File

@ -80,11 +80,12 @@
#define PIO_MPI 0x2
#define PIO_HDF5 0x4
#ifdef STANDALONE
#define DBL_EPSILON 2.2204460492503131e-16
#define H5_DBL_ABS_EQUAL(X,Y) (fabs((X)-(Y)) < DBL_EPSILON)
#endif
/* report 0.0 in case t is zero too */
#define MB_PER_SEC(bytes,t) (((t)==0.0) ? 0.0 : ((((double)bytes) / ONE_MB) / (t)))
#define MB_PER_SEC(bytes,t) (H5_DBL_ABS_EQUAL((t), 0.0) ? 0.0 : ((((double)bytes) / ONE_MB) / (t)))
#ifndef TRUE
@ -569,6 +570,8 @@ run_test(iotype iot, parameters parms, struct options *opts)
case PHDF5:
output_report("PHDF5 (w/MPI-IO driver)\n");
break;
default:
break;
}
MPI_Comm_size(pio_comm_g, &comm_size);