summaryrefslogtreecommitdiffstats
path: root/src/H5FDsubfile_int.c
diff options
context:
space:
mode:
authorRichard Warren <Richard.Warren@hdfgroup.org>2021-09-24 12:53:37 (GMT)
committerRichard Warren <Richard.Warren@hdfgroup.org>2021-09-24 12:53:37 (GMT)
commita92965fc69386df6b05c0263e52aa9f6edd50b71 (patch)
treef0686583e15b2038257b8f25185874ef6dfaeeed /src/H5FDsubfile_int.c
parent5c2b9be483040a860ebaebda07b99c79cc6ae115 (diff)
downloadhdf5-a92965fc69386df6b05c0263e52aa9f6edd50b71.zip
hdf5-a92965fc69386df6b05c0263e52aa9f6edd50b71.tar.gz
hdf5-a92965fc69386df6b05c0263e52aa9f6edd50b71.tar.bz2
attempting to make a more reliable subfile file open which doesn't return errors. For some unknown reason, the regular posix open will occasionally fail to create a subfile. Some better error handling for file close has been added.
Diffstat (limited to 'src/H5FDsubfile_int.c')
-rw-r--r--src/H5FDsubfile_int.c25
1 files changed, 7 insertions, 18 deletions
diff --git a/src/H5FDsubfile_int.c b/src/H5FDsubfile_int.c
index 9fa0dfa..8abda5e 100644
--- a/src/H5FDsubfile_int.c
+++ b/src/H5FDsubfile_int.c
@@ -454,7 +454,6 @@ close__subfiles( subfiling_context_t *sf_context, uint64_t fid)
double t_main_exit = 0.0, t_finalize_threads = 0.0;
HDassert((sf_context != NULL));
-
t0 = MPI_Wtime();
/* We make the subfile close operation collective.
@@ -471,26 +470,10 @@ close__subfiles( subfiling_context_t *sf_context, uint64_t fid)
* extremely busy servicing IO requests from all
* HDF5 application ranks.
*/
-#if MPI_VERSION >= 3 && MPI_SUBVERSION >= 1
- MPI_Request b_req = MPI_REQUEST_NULL;
- int mpi_status = MPI_Ibarrier(MPI_COMM_WORLD, &b_req);
- if (mpi_status == MPI_SUCCESS) {
- int completed = 0;
- while (!completed) {
- useconds_t t_delay = 5;
- usleep(t_delay);
- mpi_status = MPI_Test(&b_req, &completed, MPI_STATUS_IGNORE);
- if (mpi_status != MPI_SUCCESS) completed = 1;
- }
- }
-#else
- MPI_Barrier(MPI_COMM_WORLD);
-#endif
/* The map from fid to context can now be cleared */
clear_fid_map_entry(fid);
if (sf_context->topology->rank_is_ioc) {
-
file_open_count = atomic_load(&sf_file_open_count);
atomic_fetch_sub(&sf_file_open_count, 1);
@@ -518,7 +501,9 @@ close__subfiles( subfiling_context_t *sf_context, uint64_t fid)
if ((subfile_fid = sf_context->sf_fid) > 0) {
if (HDclose(subfile_fid) < 0)
errors++;
- sf_context->sf_fid = -1;
+ else {
+ sf_context->sf_fid = -1;
+ }
}
#ifndef NDEBUG
@@ -557,6 +542,8 @@ close__subfiles( subfiling_context_t *sf_context, uint64_t fid)
#endif
}
+ MPI_Allreduce(&errors, &global_errors, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD);
+
#ifndef NDEBUG
if (sf_verbose_flag) {
if (client_log != NULL) {
@@ -565,6 +552,8 @@ close__subfiles( subfiling_context_t *sf_context, uint64_t fid)
}
}
#endif
+
+
return global_errors;
} /* end close__subfiles() */