diff options
author | H. Joe Lee <hyoklee@hdfgroup.org> | 2024-01-09 16:38:35 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-09 16:38:35 (GMT) |
commit | 6a5dd86315c07f2c371a4d3e4a1e296739f789f1 (patch) | |
tree | 222700a495f9582cf5e7fdd1960cbece0f2eeae7 /tools | |
parent | d001379f68ffe5955200c7ce38d7258240e3418d (diff) | |
download | hdf5-6a5dd86315c07f2c371a4d3e4a1e296739f789f1.zip hdf5-6a5dd86315c07f2c371a4d3e4a1e296739f789f1.tar.gz hdf5-6a5dd86315c07f2c371a4d3e4a1e296739f789f1.tar.bz2 |
Remove check for MPI initialization in tools library when using parallel VFDs
The tools library no longer checks for whether MPI is initialized when attempting to use a parallel VFD, such as the MPI I/O VFD or Subfiling VFD. This requires that parallel VFDs check for this situation and initialize MPI on their own if need be, but also allows parallel VFDs to be used with non-parallel HDF5 tools, such as h5dump.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/lib/h5tools.c | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c index 36e304d..ca6bba2 100644 --- a/tools/lib/h5tools.c +++ b/tools/lib/h5tools.c @@ -587,16 +587,8 @@ h5tools_set_fapl_vfd(hid_t fapl_id, h5tools_vfd_info_t *vfd_info) } else if (!strcmp(vfd_info->u.name, drivernames[SUBFILING_VFD_IDX])) { #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"); - } + 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 @@ -626,9 +618,20 @@ h5tools_set_fapl_vfd(hid_t fapl_id, h5tools_vfd_info_t *vfd_info) * * Currently, driver configuration strings are unsupported. */ - if (H5Pset_driver_by_value(fapl_id, vfd_info->u.value, (const char *)vfd_info->info) < 0) - H5TOOLS_GOTO_ERROR(FAIL, "can't load VFD plugin by driver value '%ld'", - (long int)vfd_info->u.value); + + if (vfd_info->u.value == H5_VFD_SUBFILING) { +#if defined(H5_HAVE_PARALLEL) && defined(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"); +#else + H5TOOLS_GOTO_ERROR(FAIL, "The Subfiling VFD is not enabled"); +#endif + } + else { + if (H5Pset_driver_by_value(fapl_id, vfd_info->u.value, (const char *)vfd_info->info) < 0) + H5TOOLS_GOTO_ERROR(FAIL, "can't load VFD plugin by driver value '%ld'", + (long int)vfd_info->u.value); + } break; default: |