[svn-r716] Added barrier to H5F_istore_allocate to preclude racing with data writes.

This commit is contained in:
Robert Kim Yates 1998-09-23 12:24:50 -05:00
parent 5fcf0dc22e
commit 0db7facffe
2 changed files with 34 additions and 0 deletions

View File

@ -1998,6 +1998,9 @@ H5F_istore_get_addr (H5F_t *f, const H5O_layout_t *layout,
*
* Modifications:
*
* rky 980923
* Added barrier to preclude racing with data writes.
*
*-------------------------------------------------------------------------
*/
herr_t
@ -2092,6 +2095,20 @@ H5F_istore_allocate (H5F_t *f, const H5O_layout_t *layout,
if (carry) break;
}
/*
* rky 980923
* The following barrier is a temporary fix to prevent overwriting
* real data caused by a race between one proc's call of H5F_istore_allocate
* (from H5D_allocate, ultimately from H5Dcreate and H5Dextend)
* and another proc's call of H5Dwrite.
* Eventually, this barrier should be removed,
* when H5D_allocate is changed to call H5MF_alloc directly
* to allocate space, instead of calling H5F_istore_unlock.
*/
if (MPI_Barrier( f->shared->access_parms->u.mpio.comm )) {
HRETURN_ERROR(H5E_INTERNAL, H5E_MPI, FAIL, "MPI_Barrier failed");
}
FUNC_LEAVE(SUCCEED);
}
#endif

View File

@ -1998,6 +1998,9 @@ H5F_istore_get_addr (H5F_t *f, const H5O_layout_t *layout,
*
* Modifications:
*
* rky 980923
* Added barrier to preclude racing with data writes.
*
*-------------------------------------------------------------------------
*/
herr_t
@ -2092,6 +2095,20 @@ H5F_istore_allocate (H5F_t *f, const H5O_layout_t *layout,
if (carry) break;
}
/*
* rky 980923
* The following barrier is a temporary fix to prevent overwriting
* real data caused by a race between one proc's call of H5F_istore_allocate
* (from H5D_allocate, ultimately from H5Dcreate and H5Dextend)
* and another proc's call of H5Dwrite.
* Eventually, this barrier should be removed,
* when H5D_allocate is changed to call H5MF_alloc directly
* to allocate space, instead of calling H5F_istore_unlock.
*/
if (MPI_Barrier( f->shared->access_parms->u.mpio.comm )) {
HRETURN_ERROR(H5E_INTERNAL, H5E_MPI, FAIL, "MPI_Barrier failed");
}
FUNC_LEAVE(SUCCEED);
}
#endif