summaryrefslogtreecommitdiffstats
path: root/src/H5FDcore.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2003-02-10 17:26:09 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2003-02-10 17:26:09 (GMT)
commit24d8506dd564c5cc0fdebb5ebdfaec7bda5a7435 (patch)
tree6b2eb3bb1e782c40718204882428e6471b6281ac /src/H5FDcore.c
parent738661ab9f409b8d961ba1402d6c4dd5f99ecb43 (diff)
downloadhdf5-24d8506dd564c5cc0fdebb5ebdfaec7bda5a7435.zip
hdf5-24d8506dd564c5cc0fdebb5ebdfaec7bda5a7435.tar.gz
hdf5-24d8506dd564c5cc0fdebb5ebdfaec7bda5a7435.tar.bz2
[svn-r6387] Purpose:
Bug Fix Description: Metadata cache in parallel I/O can cause hangs in applications which perform independent I/O on chunked datasets, because the metadata cache can attempt to flush out dirty metadata from only a single process, instead of collectively from all processes. Solution: Pass a dataset transfer property list down from every API function which could possibly trigger metadata I/O. Then, split the metadata cache into two sets of entries to allow dirty metadata to be set aside when a hash table collision occurs during independent I/O. Platforms tested: Tested h5committest {arabica (fortran), eirene (fortran, C++) modi4 (parallel, fortran)} FreeBSD 4.7 (sleipnir) serial & parallel Misc. update: Updated release_docs/RELEASE
Diffstat (limited to 'src/H5FDcore.c')
-rw-r--r--src/H5FDcore.c113
1 files changed, 55 insertions, 58 deletions
diff --git a/src/H5FDcore.c b/src/H5FDcore.c
index fc56096..9ea8ada 100644
--- a/src/H5FDcore.c
+++ b/src/H5FDcore.c
@@ -78,7 +78,6 @@ typedef struct H5FD_core_fapl_t {
static void *H5FD_core_fapl_get(H5FD_t *_file);
static H5FD_t *H5FD_core_open(const char *name, unsigned flags, hid_t fapl_id,
haddr_t maxaddr);
-static herr_t H5FD_core_flush(H5FD_t *_file, unsigned closing);
static herr_t H5FD_core_close(H5FD_t *_file);
static int H5FD_core_cmp(const H5FD_t *_f1, const H5FD_t *_f2);
static haddr_t H5FD_core_get_eoa(H5FD_t *_file);
@@ -89,6 +88,7 @@ static herr_t H5FD_core_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, hadd
size_t size, void *buf);
static herr_t H5FD_core_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr,
size_t size, const void *buf);
+static herr_t H5FD_core_flush(H5FD_t *_file, hid_t dxpl_id, unsigned closing);
static const H5FD_class_t H5FD_core_g = {
"core", /*name */
@@ -370,59 +370,6 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5FD_core_flush
- *
- * Purpose: Flushes the file to backing store if there is any and if the
- * dirty flag is set.
- *
- * Return: Success: 0
- *
- * Failure: -1
- *
- * Programmer: Robb Matzke
- * Friday, October 15, 1999
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-static herr_t
-H5FD_core_flush(H5FD_t *_file, unsigned UNUSED closing)
-{
- H5FD_core_t *file = (H5FD_core_t*)_file;
- herr_t ret_value=SUCCEED; /* Return value */
-
- FUNC_ENTER_NOAPI(H5FD_core_flush, FAIL);
-
- /* Write to backing store */
- if (file->dirty && file->fd>=0) {
- haddr_t size = file->eof;
- unsigned char *ptr = file->mem;
-
- if (0!=HDlseek(file->fd, (off_t)0, SEEK_SET))
- HGOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "error seeking in backing store");
-
- while (size) {
- ssize_t n;
-
- H5_CHECK_OVERFLOW(size,hsize_t,size_t);
- n = HDwrite(file->fd, ptr, (size_t)size);
- if (n<0 && EINTR==errno)
- continue;
- if (n<0)
- HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "error writing backing store");
- ptr += (size_t)n;
- size -= (size_t)n;
- }
- file->dirty = FALSE;
- }
-
-done:
- FUNC_LEAVE_NOAPI(ret_value);
-}
-
-
-/*-------------------------------------------------------------------------
* Function: H5FD_core_close
*
* Purpose: Closes the file.
@@ -448,10 +395,6 @@ H5FD_core_close(H5FD_t *_file)
FUNC_ENTER_NOAPI(H5FD_core_close, FAIL);
- /* Flush */
- if (H5FD_core_flush(_file,TRUE)<0)
- HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush file");
-
/* Release resources */
if (file->fd>=0)
HDclose(file->fd);
@@ -790,3 +733,57 @@ H5FD_core_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, had
done:
FUNC_LEAVE_NOAPI(ret_value);
}
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5FD_core_flush
+ *
+ * Purpose: Flushes the file to backing store if there is any and if the
+ * dirty flag is set.
+ *
+ * Return: Success: 0
+ *
+ * Failure: -1
+ *
+ * Programmer: Robb Matzke
+ * Friday, October 15, 1999
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5FD_core_flush(H5FD_t *_file, hid_t dxpl_id, unsigned UNUSED closing)
+{
+ H5FD_core_t *file = (H5FD_core_t*)_file;
+ herr_t ret_value=SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI(H5FD_core_flush, FAIL);
+
+ /* Write to backing store */
+ if (file->dirty && file->fd>=0) {
+ haddr_t size = file->eof;
+ unsigned char *ptr = file->mem;
+
+ if (0!=HDlseek(file->fd, (off_t)0, SEEK_SET))
+ HGOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "error seeking in backing store");
+
+ while (size) {
+ ssize_t n;
+
+ H5_CHECK_OVERFLOW(size,hsize_t,size_t);
+ n = HDwrite(file->fd, ptr, (size_t)size);
+ if (n<0 && EINTR==errno)
+ continue;
+ if (n<0)
+ HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "error writing backing store");
+ ptr += (size_t)n;
+ size -= (size_t)n;
+ }
+ file->dirty = FALSE;
+ }
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value);
+}
+