diff options
author | Dana Robinson <43805+derobins@users.noreply.github.com> | 2023-04-28 20:37:04 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-28 20:37:04 (GMT) |
commit | a150e5fc2567b9b0f2a6dafec1fd3f330fca2e55 (patch) | |
tree | e300ebb600a0f29f83f27c12d2ecbb911fbbe350 /src/H5FDsubfiling/H5FDioc.c | |
parent | f82f056d7b4804f9f29abf0c3cac36fdd9e9d7a3 (diff) | |
download | hdf5-a150e5fc2567b9b0f2a6dafec1fd3f330fca2e55.zip hdf5-a150e5fc2567b9b0f2a6dafec1fd3f330fca2e55.tar.gz hdf5-a150e5fc2567b9b0f2a6dafec1fd3f330fca2e55.tar.bz2 |
Sync with develop (#2849)
Cherry pick of
ea7dfcd (Change Powershell to PowerShell in docs)
to
4497feb (Update H5Dget_space_status bug note to reference 1.14.0)
Diffstat (limited to 'src/H5FDsubfiling/H5FDioc.c')
-rw-r--r-- | src/H5FDsubfiling/H5FDioc.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/H5FDsubfiling/H5FDioc.c b/src/H5FDsubfiling/H5FDioc.c index 2fd8b64..7d20021 100644 --- a/src/H5FDsubfiling/H5FDioc.c +++ b/src/H5FDsubfiling/H5FDioc.c @@ -887,16 +887,20 @@ done: static herr_t H5FD__ioc_close_int(H5FD_ioc_t *file_ptr) { + int mpi_finalized; + int mpi_code; herr_t ret_value = SUCCEED; HDassert(file_ptr); + if (MPI_SUCCESS != (mpi_code = MPI_Finalized(&mpi_finalized))) + H5_SUBFILING_MPI_GOTO_ERROR(FAIL, "MPI_Finalized failed", mpi_code); + if (file_ptr->context_id >= 0) { subfiling_context_t *sf_context = H5_get_subfiling_object(file_ptr->context_id); - int mpi_code; /* Don't allow IOC threads to be finalized until everyone gets here */ - if (file_ptr->mpi_size > 1) + if (!mpi_finalized && (file_ptr->mpi_size > 1)) if (MPI_SUCCESS != (mpi_code = MPI_Barrier(file_ptr->comm))) H5_SUBFILING_MPI_GOTO_ERROR(FAIL, "MPI_Barrier failed", mpi_code); @@ -911,10 +915,12 @@ H5FD__ioc_close_int(H5FD_ioc_t *file_ptr) file_ptr->context_id = -1; } - if (H5_mpi_comm_free(&file_ptr->comm) < 0) - H5_SUBFILING_GOTO_ERROR(H5E_VFL, H5E_CANTFREE, FAIL, "unable to free MPI Communicator"); - if (H5_mpi_info_free(&file_ptr->info) < 0) - H5_SUBFILING_GOTO_ERROR(H5E_VFL, H5E_CANTFREE, FAIL, "unable to free MPI Info object"); + if (!mpi_finalized) { + if (H5_mpi_comm_free(&file_ptr->comm) < 0) + H5_SUBFILING_GOTO_ERROR(H5E_VFL, H5E_CANTFREE, FAIL, "unable to free MPI Communicator"); + if (H5_mpi_info_free(&file_ptr->info) < 0) + H5_SUBFILING_GOTO_ERROR(H5E_VFL, H5E_CANTFREE, FAIL, "unable to free MPI Info object"); + } done: HDfree(file_ptr->file_path); |