diff options
author | jhendersonHDF <jhenderson@hdfgroup.org> | 2021-11-25 03:14:45 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-25 03:14:45 (GMT) |
commit | ed92286131a6c1ae02a6f0d748110db841825903 (patch) | |
tree | 5c0f40055ddf16bbed8043232a864d0ca4246d96 | |
parent | b3262c75d56dca8dac5bbe46c5531d9b9c6c9f21 (diff) | |
download | hdf5-ed92286131a6c1ae02a6f0d748110db841825903.zip hdf5-ed92286131a6c1ae02a6f0d748110db841825903.tar.gz hdf5-ed92286131a6c1ae02a6f0d748110db841825903.tar.bz2 |
Only check HDF5_DRIVER in MPI I/O VFD if VFD isn't initialized (#1213)
-rw-r--r-- | src/H5FDmpio.c | 27 | ||||
-rw-r--r-- | src/H5FDsec2.c | 1 | ||||
-rw-r--r-- | src/H5FDsplitter.c | 1 |
3 files changed, 14 insertions, 15 deletions
diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c index 67b01f1..c72578d 100644 --- a/src/H5FDmpio.c +++ b/src/H5FDmpio.c @@ -214,21 +214,22 @@ H5FD_mpio_init(void) FUNC_ENTER_NOAPI(H5I_INVALID_HID) /* Register the MPI-IO VFD, if it isn't already */ - if (H5I_VFL != H5I_get_type(H5FD_MPIO_g)) + if (H5I_VFL != H5I_get_type(H5FD_MPIO_g)) { H5FD_MPIO_g = H5FD_register((const H5FD_class_t *)&H5FD_mpio_g, sizeof(H5FD_class_t), FALSE); - /* Check if MPI driver has been loaded dynamically */ - env = HDgetenv(HDF5_DRIVER); - if (env && !HDstrcmp(env, "mpio")) { - int mpi_initialized = 0; - - /* Initialize MPI if not already initialized */ - if (MPI_SUCCESS != MPI_Initialized(&mpi_initialized)) - HGOTO_ERROR(H5E_VFL, H5E_UNINITIALIZED, H5I_INVALID_HID, "can't check if MPI is initialized") - if (!mpi_initialized) { - if (MPI_SUCCESS != MPI_Init(NULL, NULL)) - HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, H5I_INVALID_HID, "can't initialize MPI") - H5FD_mpi_self_initialized = TRUE; + /* Check if MPI driver has been loaded dynamically */ + env = HDgetenv(HDF5_DRIVER); + if (env && !HDstrcmp(env, "mpio")) { + int mpi_initialized = 0; + + /* Initialize MPI if not already initialized */ + if (MPI_SUCCESS != MPI_Initialized(&mpi_initialized)) + HGOTO_ERROR(H5E_VFL, H5E_UNINITIALIZED, H5I_INVALID_HID, "can't check if MPI is initialized") + if (!mpi_initialized) { + if (MPI_SUCCESS != MPI_Init(NULL, NULL)) + HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, H5I_INVALID_HID, "can't initialize MPI") + H5FD_mpi_self_initialized = TRUE; + } } } diff --git a/src/H5FDsec2.c b/src/H5FDsec2.c index 77cc58e..46f5fd4 100644 --- a/src/H5FDsec2.c +++ b/src/H5FDsec2.c @@ -1080,7 +1080,6 @@ H5FD__sec2_ctl(H5FD_t *_file, uint64_t op_code, uint64_t flags, const void H5_AT /* Sanity checks */ HDassert(file); - HDassert(H5FD_SEC2 == file->pub.driver_id); switch (op_code) { /* Unknown op code */ diff --git a/src/H5FDsplitter.c b/src/H5FDsplitter.c index b64a2b5..31438cd 100644 --- a/src/H5FDsplitter.c +++ b/src/H5FDsplitter.c @@ -1316,7 +1316,6 @@ H5FD__splitter_ctl(H5FD_t *_file, uint64_t op_code, uint64_t flags, const void * /* Sanity checks */ HDassert(file); - HDassert(H5FD_SPLITTER == file->pub.driver_id); switch (op_code) { /* Unknown op code */ |