-
-
Notifications
You must be signed in to change notification settings - Fork 265
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Preserve MPI-I/O file hints when fapl is closed #3755
Changes from 8 commits
8f93a2c
3dec7d5
84fd36f
aa6ccbe
833c6b8
2806b3f
2fa841d
7964b98
6bf3647
e5fa4eb
38db446
99da0e6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1119,3 +1119,63 @@ test_evict_on_close_parallel_unsupp(void) | |
ret = H5Pclose(fapl_id); | ||
VRFY((SUCCEED == ret), "H5Pclose"); | ||
} | ||
|
||
/* | ||
* Verify that MPI I/O hints are preserved after closing the file access property list | ||
* as described in issue #3025 | ||
* This is a test program from the user. | ||
*/ | ||
void | ||
test_fapl_preserve_hints(void) | ||
{ | ||
hid_t fid = H5I_INVALID_HID; /* HDF5 file ID */ | ||
hid_t fapl_id = H5I_INVALID_HID; /* File access plist */ | ||
const char *filename; | ||
MPI_Info info = MPI_INFO_NULL; | ||
MPI_Info info_used = MPI_INFO_NULL; | ||
herr_t ret; /* Generic return value */ | ||
int mpi_ret; /* MPI return value */ | ||
|
||
filename = (const char *)GetTestParameters(); | ||
|
||
/* set up MPI parameters */ | ||
mpi_ret = MPI_Info_create(&info); | ||
VRFY((mpi_ret >= 0), "MPI_Info_create succeeded"); | ||
|
||
mpi_ret = MPI_Info_set(info, "hdf_info_fapl", "true"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would you be able to test MPI_Info_get() after retrieving the info to make sure it still has the same value? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Other than that, looks good to me. I'm fine with merging it to get it into 1.14 and adding this line to the test after if needed. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed on checking to make sure that the hint is still the same after retrieving the prop list |
||
VRFY((mpi_ret == MPI_SUCCESS), "MPI_Info_set succeeded"); | ||
|
||
fapl_id = H5Pcreate(H5P_FILE_ACCESS); | ||
VRFY((fapl_id != H5I_INVALID_HID), "H5Pcreate"); | ||
|
||
ret = H5Pset_fapl_mpio(fapl_id, MPI_COMM_WORLD, info); | ||
VRFY((ret >= 0), "H5Pset_fapl_mpio"); | ||
|
||
fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id); | ||
VRFY((fid != H5I_INVALID_HID), "H5Fcreate succeeded"); | ||
|
||
ret = H5Pclose(fapl_id); | ||
VRFY((ret >= 0), "H5Pclose succeeded"); | ||
|
||
fapl_id = H5Fget_access_plist(fid); | ||
VRFY((fapl_id != H5I_INVALID_HID), "H5Fget_access_plist succeeded"); | ||
|
||
ret = H5Pget_fapl_mpio(fapl_id, NULL, &info_used); | ||
VRFY((ret >= 0), "H5Pget_fapl_mpio succeeded"); | ||
|
||
VRFY((info_used != MPI_INFO_NULL), "H5Pget_fapl_mpio"); | ||
|
||
ret = H5Pclose(fapl_id); | ||
VRFY((ret >= 0), "H5Pclose succeeded"); | ||
|
||
ret = H5Fclose(fid); | ||
VRFY((ret >= 0), "H5Fclose succeeded"); | ||
|
||
/* Free the MPI info object */ | ||
mpi_ret = MPI_Info_free(&info); | ||
VRFY((mpi_ret >= 0), "MPI_Info_free succeeded"); | ||
|
||
mpi_ret = MPI_Info_free(&info_used); | ||
VRFY((mpi_ret >= 0), "MPI_Info_free succeeded"); | ||
|
||
} /* end test_fapl_preserve_hints() */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the library calls
H5_mpi_info_dup
when getting MPI info from a FAPL, I believe this means the library will need to close theMPI_Info
struct withH5_mpi_info_free
when closing anH5F_shared_t
structure now.