diff options
author | Robert Kim Yates <rkyates@llnl.gov> | 1998-09-23 17:24:50 (GMT) |
---|---|---|
committer | Robert Kim Yates <rkyates@llnl.gov> | 1998-09-23 17:24:50 (GMT) |
commit | 0db7facffee0e07e096ad96f323608d752d3790a (patch) | |
tree | 73e5fb87b6b86f97c9bc55a2da1acccba22b5d44 /src | |
parent | 5fcf0dc22ece3dcbfd139936e3ae4f70024d7678 (diff) | |
download | hdf5-0db7facffee0e07e096ad96f323608d752d3790a.zip hdf5-0db7facffee0e07e096ad96f323608d752d3790a.tar.gz hdf5-0db7facffee0e07e096ad96f323608d752d3790a.tar.bz2 |
[svn-r716] Added barrier to H5F_istore_allocate to preclude racing with data writes.
Diffstat (limited to 'src')
-rw-r--r-- | src/H5Distore.c | 17 | ||||
-rw-r--r-- | src/H5Fistore.c | 17 |
2 files changed, 34 insertions, 0 deletions
diff --git a/src/H5Distore.c b/src/H5Distore.c index 3a54612..dcd1d35 100644 --- a/src/H5Distore.c +++ b/src/H5Distore.c @@ -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 diff --git a/src/H5Fistore.c b/src/H5Fistore.c index 3a54612..dcd1d35 100644 --- a/src/H5Fistore.c +++ b/src/H5Fistore.c @@ -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 |