summaryrefslogtreecommitdiffstats
path: root/src/H5O.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2002-07-19 19:27:09 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2002-07-19 19:27:09 (GMT)
commit99eee6dff9a38a1bab3d74b4b77dd8169e57409c (patch)
tree5db3dd6e5ed35a694c655337750dc741e30181fb /src/H5O.c
parent814ea8b962fec329f6a440d1f52f6b682de47524 (diff)
downloadhdf5-99eee6dff9a38a1bab3d74b4b77dd8169e57409c.zip
hdf5-99eee6dff9a38a1bab3d74b4b77dd8169e57409c.tar.gz
hdf5-99eee6dff9a38a1bab3d74b4b77dd8169e57409c.tar.bz2
[svn-r5814] Purpose:
Bug Fix Description: It was possible to create corrupted metadata information (either in memory or in the file or both) with a parallel I/O program because of the way metadata writes were being handled for writes out of the metadata cache. Solution: Added a dataset transfer property called "block before metadata write" which is used by the MPI-I/O and MPI-posix drivers to sync up all the processes before attempting a metadata write. This property is currently only for metadata writes from the metadata cache. Platforms tested: IRIX64 6.5 (modi4) w/parallel
Diffstat (limited to 'src/H5O.c')
-rw-r--r--src/H5O.c30
1 files changed, 19 insertions, 11 deletions
diff --git a/src/H5O.c b/src/H5O.c
index 7081048..827fdad 100644
--- a/src/H5O.c
+++ b/src/H5O.c
@@ -30,8 +30,8 @@
#define PABLO_MASK H5O_mask
/* PRIVATE PROTOTYPES */
-static herr_t H5O_flush(H5F_t *f, hbool_t destroy, haddr_t addr, H5O_t *oh);
-static H5O_t *H5O_load(H5F_t *f, haddr_t addr, const void *_udata1,
+static herr_t H5O_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5O_t *oh);
+static H5O_t *H5O_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *_udata1,
void *_udata2);
static unsigned H5O_find_in_ohdr(H5F_t *f, haddr_t addr,
const H5O_class_t **type_p, int sequence);
@@ -44,8 +44,8 @@ static herr_t H5O_touch_oh(H5F_t *f, H5O_t *oh, hbool_t force);
/* H5O inherits cache-like properties from H5AC */
static const H5AC_class_t H5AC_OHDR[1] = {{
H5AC_OHDR_ID,
- (void *(*)(H5F_t *, haddr_t, const void *, void *)) H5O_load,
- (herr_t (*)(H5F_t *, hbool_t, haddr_t, void *)) H5O_flush,
+ (H5AC_load_func_t)H5O_load,
+ (H5AC_flush_func_t)H5O_flush,
}};
/* Interface initialization */
@@ -339,10 +339,14 @@ H5O_close(H5G_entry_t *obj_ent)
*
* Robb Matzke, 1999-07-28
* The ADDR argument is passed by value.
+ *
+ * Quincey Koziol, 2002-7-180
+ * Added dxpl parameter to allow more control over I/O from metadata
+ * cache.
*-------------------------------------------------------------------------
*/
static H5O_t *
-H5O_load(H5F_t *f, haddr_t addr, const void * UNUSED _udata1,
+H5O_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void * UNUSED _udata1,
void * UNUSED _udata2)
{
H5O_t *oh = NULL;
@@ -376,7 +380,7 @@ H5O_load(H5F_t *f, haddr_t addr, const void * UNUSED _udata1,
/* read fixed-lenth part of object header */
hdr_size = H5O_SIZEOF_HDR(f);
assert(hdr_size<=sizeof(buf));
- if (H5F_block_read(f, H5FD_MEM_OHDR, addr, hdr_size, H5P_DATASET_XFER_DEFAULT, buf) < 0) {
+ if (H5F_block_read(f, H5FD_MEM_OHDR, addr, hdr_size, dxpl_id, buf) < 0) {
HGOTO_ERROR(H5E_OHDR, H5E_READERROR, NULL,
"unable to read object header");
}
@@ -434,7 +438,7 @@ H5O_load(H5F_t *f, haddr_t addr, const void * UNUSED _udata1,
HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL,
"memory allocation failed");
}
- if (H5F_block_read(f, H5FD_MEM_OHDR, chunk_addr, chunk_size, H5P_DATASET_XFER_DEFAULT,
+ if (H5F_block_read(f, H5FD_MEM_OHDR, chunk_addr, chunk_size, dxpl_id,
oh->chunk[chunkno].image) < 0) {
HGOTO_ERROR(H5E_OHDR, H5E_READERROR, NULL,
"unable to read object header data");
@@ -537,10 +541,14 @@ done:
*
* Robb Matzke, 1999-07-28
* The ADDR argument is passed by value.
+ *
+ * Quincey Koziol, 2002-7-180
+ * Added dxpl parameter to allow more control over I/O from metadata
+ * cache.
*-------------------------------------------------------------------------
*/
static herr_t
-H5O_flush(H5F_t *f, hbool_t destroy, haddr_t addr, H5O_t *oh)
+H5O_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5O_t *oh)
{
uint8_t buf[16], *p;
int id;
@@ -586,7 +594,7 @@ H5O_flush(H5F_t *f, hbool_t destroy, haddr_t addr, H5O_t *oh)
} /* end if */
else {
if (H5F_block_write(f, H5FD_MEM_OHDR, addr, H5O_SIZEOF_HDR(f),
- H5P_DATASET_XFER_DEFAULT, buf) < 0) {
+ dxpl_id, buf) < 0) {
HRETURN_ERROR(H5E_OHDR, H5E_WRITEERROR, FAIL,
"unable to write object header hdr to disk");
}
@@ -669,7 +677,7 @@ H5O_flush(H5F_t *f, hbool_t destroy, haddr_t addr, H5O_t *oh)
/* Write the combined prefix/chunk out */
if (H5F_block_write(f, H5FD_MEM_OHDR, addr,
(H5O_SIZEOF_HDR(f)+oh->chunk[u].size),
- H5P_DATASET_XFER_DEFAULT, p) < 0) {
+ dxpl_id, p) < 0) {
HRETURN_ERROR(H5E_OHDR, H5E_WRITEERROR, FAIL,
"unable to write object header data to disk");
} /* end if */
@@ -680,7 +688,7 @@ H5O_flush(H5F_t *f, hbool_t destroy, haddr_t addr, H5O_t *oh)
else {
if (H5F_block_write(f, H5FD_MEM_OHDR, oh->chunk[u].addr,
(oh->chunk[u].size),
- H5P_DATASET_XFER_DEFAULT, oh->chunk[u].image) < 0) {
+ dxpl_id, oh->chunk[u].image) < 0) {
HRETURN_ERROR(H5E_OHDR, H5E_WRITEERROR, FAIL,
"unable to write object header data to disk");
} /* end if */