summaryrefslogtreecommitdiffstats
path: root/src/H5FD.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/H5FD.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/H5FD.c')
-rw-r--r--src/H5FD.c55
1 files changed, 12 insertions, 43 deletions
diff --git a/src/H5FD.c b/src/H5FD.c
index 2ab1666..d7ac465 100644
--- a/src/H5FD.c
+++ b/src/H5FD.c
@@ -1518,6 +1518,10 @@ done:
* Bill Wendling, 2003/02/19
* Added support for FPHDF5.
*
+ * John Mainzer, 2004/04/13
+ * Moved much of the FPHDF5 specific code into H5FP_client_alloc(),
+ * and re-worked it to get rid of a race condition on the eoa.
+ *
*-------------------------------------------------------------------------
*/
haddr_t
@@ -1540,51 +1544,16 @@ H5FD_alloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size)
* is the SAP executing this code, then skip the send to the SAP and
* try to do the actual allocations.
*/
- if (H5FD_is_fphdf5_driver(file) && !H5FD_fphdf5_is_sap(file)) {
- unsigned req_id = 0;
- unsigned capt_only = 0;
- H5FP_status_t status = H5FP_STATUS_OK;
- H5P_genplist_t *plist;
- H5FP_alloc_t fp_alloc;
-
- /* Get the data xfer property list */
- if ((plist = H5I_object(dxpl_id)) == NULL)
- HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, HADDR_UNDEF, "not a dataset transfer list")
-
- if (H5P_exist_plist(plist, H5FD_FPHDF5_CAPTN_ALLOC_ONLY) > 0)
- if (H5P_get(plist, H5FD_FPHDF5_CAPTN_ALLOC_ONLY, &capt_only) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, HADDR_UNDEF, "can't retrieve FPHDF5 property")
+ if ( H5FD_is_fphdf5_driver(file) && !H5FD_fphdf5_is_sap(file) ) {
+ haddr_t addr;
- HDmemset(&fp_alloc, 0, sizeof(fp_alloc));
-
- /*
- * If the captain is the only one who should allocate resources,
- * then do just that...
- */
- if (!capt_only || H5FD_fphdf5_is_captain(file)) {
- /* Send the request to the SAP */
- if (H5FP_request_allocate(file, type, size, &fp_alloc.addr,
- &fp_alloc.eoa, &req_id, &status) != SUCCEED)
- /* FIXME: Should we check the "status" variable here? */
- HGOTO_ERROR(H5E_FPHDF5, H5E_CANTALLOC, HADDR_UNDEF,
- "server couldn't allocate from file")
- }
-
- if (capt_only) {
- int mrc;
-
- if ((mrc = MPI_Bcast(&fp_alloc, 1, H5FP_alloc,
- (int)H5FP_capt_barrier_rank,
- H5FP_SAP_BARRIER_COMM)) != MPI_SUCCESS)
- HMPI_GOTO_ERROR(HADDR_UNDEF, "MPI_Bcast failed", mrc);
+ if ( (addr = H5FP_client_alloc(file, type, dxpl_id, size))
+ == HADDR_UNDEF) {
+ HGOTO_ERROR(H5E_FPHDF5, H5E_CANTALLOC, HADDR_UNDEF,
+ "allocation failed.")
+ } else {
+ HGOTO_DONE(addr)
}
-
-
- /* Set the EOA for all processes. This doesn't fail. */
- file->cls->set_eoa(file, fp_alloc.eoa);
-
- /* We've succeeded -- return the value */
- HGOTO_DONE(fp_alloc.addr)
}
#endif /* H5_HAVE_FPHDF5 */