diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2002-07-19 19:27:09 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2002-07-19 19:27:09 (GMT) |
commit | 99eee6dff9a38a1bab3d74b4b77dd8169e57409c (patch) | |
tree | 5db3dd6e5ed35a694c655337750dc741e30181fb /src/H5HL.c | |
parent | 814ea8b962fec329f6a440d1f52f6b682de47524 (diff) | |
download | hdf5-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/H5HL.c')
-rw-r--r-- | src/H5HL.c | 31 |
1 files changed, 19 insertions, 12 deletions
@@ -52,17 +52,17 @@ typedef struct H5HL_t { } H5HL_t; /* PRIVATE PROTOTYPES */ -static H5HL_t *H5HL_load(H5F_t *f, haddr_t addr, const void *udata1, +static H5HL_t *H5HL_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *udata1, void *udata2); -static herr_t H5HL_flush(H5F_t *f, hbool_t dest, haddr_t addr, H5HL_t *heap); +static herr_t H5HL_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, haddr_t addr, H5HL_t *heap); /* * H5HL inherits cache-like properties from H5AC */ static const H5AC_class_t H5AC_LHEAP[1] = {{ H5AC_LHEAP_ID, - (void *(*)(H5F_t*, haddr_t, const void*, void*))H5HL_load, - (herr_t (*)(H5F_t*, hbool_t, haddr_t, void*))H5HL_flush, + (H5AC_load_func_t)H5HL_load, + (H5AC_flush_func_t)H5HL_flush, }}; /* Interface initialization */ @@ -195,10 +195,14 @@ H5HL_create(H5F_t *f, size_t size_hint, haddr_t *addr_p/*out*/) * Modifications: * 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 H5HL_t * -H5HL_load(H5F_t *f, haddr_t addr, const void * UNUSED udata1, +H5HL_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void * UNUSED udata1, void * UNUSED udata2) { uint8_t hdr[52]; @@ -217,7 +221,7 @@ H5HL_load(H5F_t *f, haddr_t addr, const void * UNUSED udata1, assert(!udata1); assert(!udata2); - if (H5F_block_read(f, H5FD_MEM_LHEAP, addr, H5HL_SIZEOF_HDR(f), H5P_DATASET_XFER_DEFAULT, + if (H5F_block_read(f, H5FD_MEM_LHEAP, addr, H5HL_SIZEOF_HDR(f), dxpl_id, hdr) < 0) { HRETURN_ERROR(H5E_HEAP, H5E_READERROR, NULL, "unable to read heap header"); @@ -258,7 +262,7 @@ H5HL_load(H5F_t *f, haddr_t addr, const void * UNUSED udata1, } if (heap->disk_alloc && H5F_block_read(f, H5FD_MEM_LHEAP, heap->addr, heap->disk_alloc, - H5P_DATASET_XFER_DEFAULT, heap->chunk + H5HL_SIZEOF_HDR(f)) < 0) { + dxpl_id, heap->chunk + H5HL_SIZEOF_HDR(f)) < 0) { HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, NULL, "unable to read heap data"); } @@ -323,10 +327,14 @@ H5HL_load(H5F_t *f, haddr_t addr, const void * UNUSED udata1, * * 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 -H5HL_flush(H5F_t *f, hbool_t destroy, haddr_t addr, H5HL_t *heap) +H5HL_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5HL_t *heap) { uint8_t *p = heap->chunk; H5HL_free_t *fl = heap->freelist; @@ -394,19 +402,18 @@ H5HL_flush(H5F_t *f, hbool_t destroy, haddr_t addr, H5HL_t *heap) /* The header and data are contiguous */ if (H5F_block_write(f, H5FD_MEM_LHEAP, addr, (H5HL_SIZEOF_HDR(f)+heap->disk_alloc), - H5P_DATASET_XFER_DEFAULT, heap->chunk) < 0) { + dxpl_id, heap->chunk) < 0) { HRETURN_ERROR(H5E_HEAP, H5E_WRITEERROR, FAIL, "unable to write heap header and data to file"); } } else { if (H5F_block_write(f, H5FD_MEM_LHEAP, addr, H5HL_SIZEOF_HDR(f), - H5P_DATASET_XFER_DEFAULT, heap->chunk)<0) { + dxpl_id, heap->chunk)<0) { HRETURN_ERROR(H5E_HEAP, H5E_WRITEERROR, FAIL, "unable to write heap header to file"); } if (H5F_block_write(f, H5FD_MEM_LHEAP, heap->addr, heap->disk_alloc, - H5P_DATASET_XFER_DEFAULT, - heap->chunk + H5HL_SIZEOF_HDR(f)) < 0) { + dxpl_id, heap->chunk + H5HL_SIZEOF_HDR(f)) < 0) { HRETURN_ERROR(H5E_HEAP, H5E_WRITEERROR, FAIL, "unable to write heap data to file"); } |