summaryrefslogtreecommitdiffstats
path: root/src/H5Distore.c
diff options
context:
space:
mode:
authorRobert Kim Yates <rkyates@llnl.gov>1998-12-07 23:13:05 (GMT)
committerRobert Kim Yates <rkyates@llnl.gov>1998-12-07 23:13:05 (GMT)
commitbf250c6bb28b13f3a4f986a6eab52c5c70ee84b6 (patch)
treef0ca8e2b051e7655bab30c06a9398e742b212858 /src/H5Distore.c
parentb58e9a6253c5b0a5beff9bd444f68cf64c2533e9 (diff)
downloadhdf5-bf250c6bb28b13f3a4f986a6eab52c5c70ee84b6.zip
hdf5-bf250c6bb28b13f3a4f986a6eab52c5c70ee84b6.tar.gz
hdf5-bf250c6bb28b13f3a4f986a6eab52c5c70ee84b6.tar.bz2
[svn-r960] Added interprocess coordination in H5F_istore_allocate around calls to
H5F_istore_lock and H5F_istore_inlock to prevent race between reading and writing data chunks that caused "holes" (i.e., sequences of 0s) in chunked datasets.
Diffstat (limited to 'src/H5Distore.c')
-rw-r--r--src/H5Distore.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/H5Distore.c b/src/H5Distore.c
index 89d087c..4d2d0dd 100644
--- a/src/H5Distore.c
+++ b/src/H5Distore.c
@@ -2054,6 +2054,10 @@ H5F_istore_get_addr (H5F_t *f, const H5O_layout_t *layout,
* rky 980923
* Added barrier to preclude racing with data writes.
*
+ * rky 19981207
+ * Added Wait-Signal wrapper around unlock-lock critical region
+ * to prevent race condition (unlock reads, lock writes the chunk).
+ *
*-------------------------------------------------------------------------
*/
herr_t
@@ -2118,6 +2122,14 @@ H5F_istore_allocate (H5F_t *f, const H5O_layout_t *layout,
* Lock the chunk, copy from application to chunk, then unlock the
* chunk.
*/
+
+ /* rky 981207 Serialize access to this critical region. */
+ if (SUCCEED!=
+ H5PC_Wait_for_left_neighbor(f->shared->access_parms->u.mpio.comm))
+ {
+ HRETURN_ERROR (H5E_IO, H5E_WRITEERROR, FAIL,
+ "unable to lock the data chunk");
+ }
if (NULL==(chunk=H5F_istore_lock (f, layout, split_ratios, pline,
fill, chunk_offset, FALSE,
&idx_hint))) {
@@ -2130,6 +2142,12 @@ H5F_istore_allocate (H5F_t *f, const H5O_layout_t *layout,
HRETURN_ERROR (H5E_IO, H5E_WRITEERROR, FAIL,
"uanble to unlock raw data chunk");
}
+ if (SUCCEED!=
+ H5PC_Signal_right_neighbor(f->shared->access_parms->u.mpio.comm))
+ {
+ HRETURN_ERROR (H5E_IO, H5E_WRITEERROR, FAIL,
+ "unable to unlock the data chunk");
+ }
#ifdef NO
} else {
#ifdef AKC