clean up hints in HDF5 error cases

master
Rob Latham 2016-11-17 14:34:49 -06:00
parent c9bb4bb7d2
commit 982f266a73
1 changed files with 6 additions and 0 deletions

View File

@ -260,6 +260,8 @@ static void *HDF5_Open(char *testFileName, IOR_param_t * param)
HDF5_CHECK(H5Fget_vfd_handle
(*fd, apl, (void **)&fd_mpiio),
"cannot get MPIIO file handle");
if (mpiHintsCheck != MPI_INFO_NULL)
MPI_Info_free(&mpiHintsCheck);
MPI_CHECK(MPI_File_get_info
(*fd_mpiio, &mpiHintsCheck),
"cannot get info object through MPIIO");
@ -267,6 +269,8 @@ static void *HDF5_Open(char *testFileName, IOR_param_t * param)
"\nhints returned from opened file (MPIIO) {\n");
ShowHints(&mpiHintsCheck);
fprintf(stdout, "}\n");
if (mpiHintsCheck != MPI_INFO_NULL)
MPI_Info_free(&mpiHintsCheck);
}
}
MPI_CHECK(MPI_Barrier(testComm), "barrier error");
@ -328,6 +332,8 @@ static void *HDF5_Open(char *testFileName, IOR_param_t * param)
and shape of data set, and open it for access */
dataSpace = H5Screate_simple(NUM_DIMS, dataSetDims, NULL);
HDF5_CHECK(dataSpace, "cannot create simple data space");
if (mpiHints != MPI_INFO_NULL)
MPI_Info_free(&mpiHints);
return (fd);
}