summaryrefslogtreecommitdiffstats
path: root/src/H5F.c
diff options
context:
space:
mode:
authorJohn Mainzer <mainzer@hdfgroup.org>2004-04-19 17:42:34 (GMT)
committerJohn Mainzer <mainzer@hdfgroup.org>2004-04-19 17:42:34 (GMT)
commit4a85877fdc3b6b4a4e87dad27149148c7ac6ebf5 (patch)
tree40d5a2ea5107c34e5163495cd59acdfa6fb029f2 /src/H5F.c
parent55a64a7359e61dc1d67c4bce9d50fc5166735b10 (diff)
downloadhdf5-4a85877fdc3b6b4a4e87dad27149148c7ac6ebf5.zip
hdf5-4a85877fdc3b6b4a4e87dad27149148c7ac6ebf5.tar.gz
hdf5-4a85877fdc3b6b4a4e87dad27149148c7ac6ebf5.tar.bz2
[svn-r8391] Purpose:
Checkpoint checkin of FP bug fixes. FP is still quite buggy, but I must go deal with other matters. Description: Fixed two major bugs: 1) H5FPserver.c was clobbering meta data in its care. 2) H5FPserver.c was allocating the same space multiple times, causing both data and meta data corruption. Also made minor fixes, added debugging code, and familiarized myself with the FP code. All development work with FP enabled was done on Eirene. On this platform, FP now passes its test reliably with up to 9 processes. At 10 processes it seg faults every time. I haven't looked into this issue. There are also several known locking bugs which have to be fixed. However, they are of sufficiently low probability that I didn't bother with them on this pass. FP has not been tested with deletions -- this should be done. Also, need to test FP chunked I/O. Solution: 1) Modified cache in H5FPserver.c to merge changes correctly. Found and fixed a bug in H5TB.c in passing. 2) Multiple space allocation was caused by a race condition with set eoa requests. Most of these eoa requests appeared to be superfluous, so I deleted them. Those issued during the superblock read seemed necessary, so I inserted a barrier at the end of the superblock read, to prevent races with allocations. Platforms tested: h5committested
Diffstat (limited to 'src/H5F.c')
-rw-r--r--src/H5F.c30
1 files changed, 29 insertions, 1 deletions
diff --git a/src/H5F.c b/src/H5F.c
index 007b2bf..63ebdde 100644
--- a/src/H5F.c
+++ b/src/H5F.c
@@ -1957,16 +1957,32 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, hid_t d
if (H5F_read_superblock(file, dxpl_id, &root_ent, super_info.addr,
buf, (size_t)super_info.size) < 0)
HGOTO_ERROR(H5E_FILE, H5E_READERROR, NULL, "unable to read superblock")
+ }
+
+ /* The following barrier ensures that all set eoa operations
+ * associated with creating the superblock are complete before
+ * we attempt any allocations.
+ * JRM - 4/13/04
+ */
+ if ( (mrc = MPI_Barrier(H5FP_SAP_BARRIER_COMM)) != MPI_SUCCESS )
+ {
+ HMPI_GOTO_ERROR(NULL, "MPI_Barrier failed", mrc)
+ }
+ if (!H5FD_fphdf5_is_captain(lf)) {
if (H5G_mkroot(file, dxpl_id, &root_ent) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "unable to create/open root group")
- } /* end if */
+ }
/* All clients free the buffer used for broadcasting the superblock */
buf = H5MM_xfree (buf);
} /* end if */
#endif /* H5_HAVE_FPHDF5 */
} else if (1 == shared->nrefs) {
+#ifdef H5_HAVE_FPHDF5
+ int mrc; /*MPI return code */
+#endif /* H5_HAVE_FPHDF5 */
+
/* Read the superblock if it hasn't been read before. */
if (HADDR_UNDEF == (shared->super_addr = H5F_locate_signature(lf,dxpl_id)))
HGOTO_ERROR(H5E_FILE, H5E_NOTHDF5, NULL, "unable to find file signature")
@@ -1974,6 +1990,18 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, hid_t d
if (H5F_read_superblock(file, dxpl_id, &root_ent, shared->super_addr, NULL, 0) < 0)
HGOTO_ERROR(H5E_FILE, H5E_READERROR, NULL, "unable to read superblock")
+#ifdef H5_HAVE_FPHDF5
+ if (H5FD_is_fphdf5_driver(lf)) {
+ /* reading the superblock generates lots of set_eoa calls. To avoid
+ * race conditions with allocations, make sure that everyone is done
+ * reading the superblock before we proceed.
+ */
+ if ( (mrc = MPI_Barrier(H5FP_SAP_BARRIER_COMM)) != MPI_SUCCESS ) {
+ HMPI_GOTO_ERROR(NULL, "MPI_Barrier failed", mrc)
+ }
+ }
+#endif /* H5_HAVE_FPHDF5 */
+
/* Make sure we can open the root group */
if (H5G_mkroot(file, dxpl_id, &root_ent) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to read root group")