mirror of
https://github.com/HDFGroup/hdf5.git
synced 2026-09-25 04:09:44 +03:00
Only use Subfiling VFD in tools if MPI was initialized previously (#1998)
This commit is contained in:
+11
-3
@@ -584,9 +584,17 @@ h5tools_set_fapl_vfd(hid_t fapl_id, h5tools_vfd_info_t *vfd_info)
|
||||
#endif
|
||||
}
|
||||
else if (!HDstrcmp(vfd_info->u.name, drivernames[SUBFILING_VFD_IDX])) {
|
||||
#ifdef H5_HAVE_SUBFILING_VFD
|
||||
if (H5Pset_fapl_subfiling(fapl_id, (const H5FD_subfiling_config_t *)vfd_info->info) < 0)
|
||||
H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_subfiling() failed");
|
||||
#if defined(H5_HAVE_PARALLEL) && defined(H5_HAVE_SUBFILING_VFD)
|
||||
int mpi_initialized, mpi_finalized;
|
||||
|
||||
/* check if MPI is available. */
|
||||
MPI_Initialized(&mpi_initialized);
|
||||
MPI_Finalized(&mpi_finalized);
|
||||
|
||||
if (mpi_initialized && !mpi_finalized) {
|
||||
if (H5Pset_fapl_subfiling(fapl_id, (const H5FD_subfiling_config_t *)vfd_info->info) < 0)
|
||||
H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_subfiling() failed");
|
||||
}
|
||||
#else
|
||||
H5TOOLS_GOTO_ERROR(FAIL, "The Subfiling VFD is not enabled");
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user