summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2009-03-02 20:57:18 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2009-03-02 20:57:18 (GMT)
commit92b11988c8b96297febc54db6d7956217f223037 (patch)
treeb995324484b2ecae6cd4346eec69cd65bd0d21ec
parent11746c435240a888510f907d013eec8826e24a88 (diff)
downloadhdf5-92b11988c8b96297febc54db6d7956217f223037.zip
hdf5-92b11988c8b96297febc54db6d7956217f223037.tar.gz
hdf5-92b11988c8b96297febc54db6d7956217f223037.tar.bz2
[svn-r16532] Description:
Pass the chunk "user data" to H5D_chunk_unlock(), so that chunks with an address already aren't reallocated. Tested on: FreeBSD/32 6.3 (duty) in debug mode FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
-rw-r--r--src/H5Dchunk.c13
-rw-r--r--src/H5Dmpio.c4
-rw-r--r--src/H5Dpkg.h3
3 files changed, 11 insertions, 9 deletions
diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c
index bbe57a0..2f35609 100644
--- a/src/H5Dchunk.c
+++ b/src/H5Dchunk.c
@@ -1580,7 +1580,7 @@ H5D_chunk_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info,
HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "chunked read failed")
/* Release the cache lock on the chunk. */
- if(chunk && H5D_chunk_unlock(io_info, FALSE, idx_hint, chunk, src_accessed_bytes) < 0)
+ if(chunk && H5D_chunk_unlock(io_info, &udata, FALSE, idx_hint, chunk, src_accessed_bytes) < 0)
HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to unlock raw data chunk")
} /* end if */
@@ -1734,7 +1734,7 @@ H5D_chunk_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info,
HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "chunked write failed")
/* Release the cache lock on the chunk. */
- if(chunk && H5D_chunk_unlock(io_info, TRUE, idx_hint, chunk, dst_accessed_bytes) < 0)
+ if(chunk && H5D_chunk_unlock(io_info, &udata, TRUE, idx_hint, chunk, dst_accessed_bytes) < 0)
HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to unlock raw data chunk")
/* Advance to next chunk in list */
@@ -2736,8 +2736,8 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5D_chunk_unlock(const H5D_io_info_t *io_info, hbool_t dirty, unsigned idx_hint,
- void *chunk, uint32_t naccessed)
+H5D_chunk_unlock(const H5D_io_info_t *io_info, const H5D_chunk_ud_t *udata,
+ hbool_t dirty, unsigned idx_hint, void *chunk, uint32_t naccessed)
{
const H5O_layout_t *layout = &(io_info->dset->shared->layout); /* Dataset layout */
const H5D_rdcc_t *rdcc = &(io_info->dset->shared->cache.chunk);
@@ -2747,6 +2747,7 @@ H5D_chunk_unlock(const H5D_io_info_t *io_info, hbool_t dirty, unsigned idx_hint,
FUNC_ENTER_NOAPI_NOINIT(H5D_chunk_unlock)
HDassert(io_info);
+ HDassert(udata);
if(UINT_MAX == idx_hint) {
/*
@@ -2762,7 +2763,7 @@ H5D_chunk_unlock(const H5D_io_info_t *io_info, hbool_t dirty, unsigned idx_hint,
x.dirty = TRUE;
HDmemcpy(x.offset, io_info->store->chunk.offset, layout->u.chunk.ndims * sizeof(x.offset[0]));
HDassert(layout->u.chunk.size > 0);
- x.chunk_addr = HADDR_UNDEF;
+ x.chunk_addr = udata->addr;
x.chunk_size = layout->u.chunk.size;
H5_ASSIGN_OVERFLOW(x.alloc_size, x.chunk_size, uint32_t, size_t);
x.chunk = (uint8_t *)chunk;
@@ -3324,7 +3325,7 @@ H5D_chunk_prune_fill(const H5D_chunk_rec_t *chunk_rec, H5D_chunk_it_ud1_t *udata
bytes_accessed = (uint32_t)sel_nelmts * layout->u.chunk.dim[rank];
/* Release lock on chunk */
- if(H5D_chunk_unlock(io_info, TRUE, idx_hint, chunk, bytes_accessed) < 0)
+ if(H5D_chunk_unlock(io_info, &chk_udata, TRUE, idx_hint, chunk, bytes_accessed) < 0)
HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "unable to unlock raw data chunk")
done:
diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c
index 8757ba7..e4dd8b5 100644
--- a/src/H5Dmpio.c
+++ b/src/H5Dmpio.c
@@ -1272,7 +1272,7 @@ if(H5DEBUG(D))
} /* end else */
/* Release the cache lock on the chunk. */
- if(chunk && H5D_chunk_unlock(io_info, (io_info->op_type == H5D_IO_OP_WRITE), idx_hint, chunk, accessed_bytes) < 0)
+ if(chunk && H5D_chunk_unlock(io_info, &udata, (io_info->op_type == H5D_IO_OP_WRITE), idx_hint, chunk, accessed_bytes) < 0)
HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to unlock raw data chunk")
} /* end if */
#else /* !defined(H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS) || !defined(H5_MPI_SPECIAL_COLLECTIVE_IO_WORKS) */
@@ -1502,7 +1502,7 @@ if(H5DEBUG(D)) {
/* Release the cache lock on the chunk. */
if(chunk)
- if(H5D_chunk_unlock(io_info, (io_info->op_type == H5D_IO_OP_WRITE), idx_hint, chunk, accessed_bytes) < 0)
+ if(H5D_chunk_unlock(io_info, &udata, (io_info->op_type == H5D_IO_OP_WRITE), idx_hint, chunk, accessed_bytes) < 0)
HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to unlock raw data chunk")
} /* end if */
else { /*collective I/O */
diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h
index 7c94906..791e223 100644
--- a/src/H5Dpkg.h
+++ b/src/H5Dpkg.h
@@ -583,7 +583,8 @@ H5_DLL herr_t H5D_chunk_get_info(const H5D_t *dset, hid_t dxpl_id,
H5_DLL void *H5D_chunk_lock(const H5D_io_info_t *io_info,
H5D_chunk_ud_t *udata, hbool_t relax, unsigned *idx_hint/*in,out*/);
H5_DLL herr_t H5D_chunk_unlock(const H5D_io_info_t *io_info,
- hbool_t dirty, unsigned idx_hint, void *chunk, uint32_t naccessed);
+ const H5D_chunk_ud_t *udata, hbool_t dirty, unsigned idx_hint, void *chunk,
+ uint32_t naccessed);
H5_DLL herr_t H5D_chunk_flush(H5D_t *dset, hid_t dxpl_id, unsigned flags);
H5_DLL herr_t H5D_chunk_allocated(H5D_t *dset, hid_t dxpl_id, hsize_t *nbytes);
H5_DLL herr_t H5D_chunk_allocate(H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite);