summaryrefslogtreecommitdiffstats
path: root/src/H5AC.c
diff options
context:
space:
mode:
authorMohamad Chaarawi <chaarawi@hdfgroup.org>2016-02-10 20:48:34 (GMT)
committerMohamad Chaarawi <chaarawi@hdfgroup.org>2016-02-10 20:48:34 (GMT)
commit63c90e5c67445de5deaaf45b70273fef1286ae60 (patch)
tree97f30fd46663aa809ac03bb4feac32bed9b12ee5 /src/H5AC.c
parent4da0790886dd7f52d9bd01ef5d9191f7ff729b3e (diff)
parent557a3972ac65f4d0d40f73b5add3195b739ea5cc (diff)
downloadhdf5-63c90e5c67445de5deaaf45b70273fef1286ae60.zip
hdf5-63c90e5c67445de5deaaf45b70273fef1286ae60.tar.gz
hdf5-63c90e5c67445de5deaaf45b70273fef1286ae60.tar.bz2
[svn-r29081] - merge in the phdf5_metadata_opt/ branch with the collective metadata optimizations.
- rename H5AC_dxpl_id to H5AC_ind_read_dxpl_id and update all usage in the library tested on bb-8 with parallel and serial.
Diffstat (limited to 'src/H5AC.c')
-rw-r--r--src/H5AC.c91
1 files changed, 74 insertions, 17 deletions
diff --git a/src/H5AC.c b/src/H5AC.c
index a58a211..958cc61 100644
--- a/src/H5AC.c
+++ b/src/H5AC.c
@@ -80,8 +80,12 @@ hbool_t H5_PKG_INIT_VAR = FALSE;
/* Library Private Variables */
/*****************************/
-/* Default dataset transfer property list for metadata I/O calls */
-hid_t H5AC_dxpl_id = (-1);
+/* Default dataset transfer property list for metadata I/O calls (coll write, ind read) */
+hid_t H5AC_ind_read_dxpl_id = (-1);
+#ifdef H5_HAVE_PARALLEL
+/* collective metadata read property */
+hid_t H5AC_coll_read_dxpl_id = (-1);
+#endif /* H5_HAVE_PARALLEL */
/* DXPL to be used in operations that will not result in I/O calls */
hid_t H5AC_noio_dxpl_id = (-1);
@@ -174,8 +178,11 @@ done:
herr_t
H5AC__init_package(void)
{
-#ifdef H5_DEBUG_BUILD
H5P_genplist_t *xfer_plist; /* Dataset transfer property list object */
+#ifdef H5_HAVE_PARALLEL
+ H5P_coll_md_read_flag_t coll_meta_read;
+#endif /* H5_HAVE_PARALLEL */
+#ifdef H5_DEBUG_BUILD
H5FD_dxpl_type_t dxpl_type; /* Property indicating the type of the internal dxpl */
#endif /* H5_DEBUG_BUILD */
herr_t ret_value = SUCCEED; /* Return value */
@@ -195,12 +202,16 @@ H5AC__init_package(void)
}
#endif /* H5_HAVE_PARALLEL */
-#ifdef H5_DEBUG_BUILD
- /* Get an ID for the metadata (H5AC) dxpl */
- if((H5AC_dxpl_id = H5P_create_id(H5P_CLS_DATASET_XFER_g, FALSE)) < 0)
+#if defined(H5_HAVE_PARALLEL) || defined(H5_DEBUG_BUILD)
+ /* Get an ID for the internal independent metadata dxpl */
+ if((H5AC_ind_read_dxpl_id = H5P_create_id(H5P_CLS_DATASET_XFER_g, FALSE)) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, FAIL, "unable to register property list")
+
+ /* if this is a debug build, set the dxpl type flag on the
+ independent metadata dxpl and create the noio and raw data internal dxpls */
+#ifdef H5_DEBUG_BUILD
/* Get the property list object */
- if (NULL == (xfer_plist = (H5P_genplist_t *)H5I_object(H5AC_dxpl_id)))
+ if (NULL == (xfer_plist = (H5P_genplist_t *)H5I_object(H5AC_ind_read_dxpl_id)))
HGOTO_ERROR(H5E_CACHE, H5E_BADATOM, FAIL, "can't get new property list object")
/* Insert the dxpl type property */
dxpl_type = H5FD_METADATA_DXPL;
@@ -228,11 +239,37 @@ H5AC__init_package(void)
dxpl_type = H5FD_RAWDATA_DXPL;
if(H5P_set(xfer_plist, H5FD_DXPL_TYPE_NAME, &dxpl_type) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_CANTSET, FAIL, "can't set dxpl type property")
-#else /* H5_DEBUG_BUILD */
- H5AC_dxpl_id = H5P_DATASET_XFER_DEFAULT;
+#endif /* H5_DEBUG_BUILD */
+
+ /* if this is a parallel build, create an internal dxpl for
+ collective metadata reads */
+#ifdef H5_HAVE_PARALLEL
+ /* Get an ID for H5AC_coll_read_dxpl_id */
+ if((H5AC_coll_read_dxpl_id = H5P_create_id(H5P_CLS_DATASET_XFER_g, FALSE)) < 0)
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, FAIL, "unable to register property list")
+ /* Get the property list object */
+ if (NULL == (xfer_plist = (H5P_genplist_t *)H5I_object(H5AC_coll_read_dxpl_id)))
+ HGOTO_ERROR(H5E_CACHE, H5E_BADATOM, FAIL, "can't get new property list object")
+ /* set 'collective metadata read' property */
+ coll_meta_read = H5P_USER_TRUE;
+ if(H5P_set(xfer_plist, H5_COLL_MD_READ_FLAG_NAME, &coll_meta_read) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set collective metadata read flag")
+
+ /* if we have a debug build, set the dxpl type to metadata on the
+ collective metadata dxpl */
+#ifdef H5_DEBUG_BUILD
+ /* set metadata dxpl type */
+ dxpl_type = H5FD_METADATA_DXPL;
+ if(H5P_set(xfer_plist, H5FD_DXPL_TYPE_NAME, &dxpl_type) < 0)
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTSET, FAIL, "can't set dxpl type property")
+#endif /* H5_DEBUG_BUILD */
+#endif /* H5_HAVE_PARALLEL */
+
+#else /* defined(H5_HAVE_PARALLEL) || defined(H5_DEBUG_BUILD) */
+ H5AC_ind_read_dxpl_id = H5P_DATASET_XFER_DEFAULT;
H5AC_noio_dxpl_id = H5P_DATASET_XFER_DEFAULT;
H5AC_rawdata_dxpl_id = H5P_DATASET_XFER_DEFAULT;
-#endif /* H5_DEBUG_BUILD */
+#endif /* defined(H5_HAVE_PARALLEL) || defined(H5_DEBUG_BUILD) */
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -261,21 +298,33 @@ H5AC_term_package(void)
FUNC_ENTER_NOAPI_NOINIT_NOERR
if(H5_PKG_INIT_VAR) {
- if(H5AC_dxpl_id > 0 || H5AC_noio_dxpl_id > 0 || H5AC_rawdata_dxpl_id > 0) {
-#ifdef H5_DEBUG_BUILD
+ if(H5AC_ind_read_dxpl_id > 0 || H5AC_noio_dxpl_id > 0 || H5AC_rawdata_dxpl_id > 0
+#ifdef H5_HAVE_PARALLEL
+ || H5AC_coll_read_dxpl_id > 0
+#endif /* H5_HAVE_PARALLEL */
+ ) {
+#if defined(H5_HAVE_PARALLEL) || defined(H5_DEBUG_BUILD)
/* Indicate more work to do */
n = 1; /* H5I */
- /* Close H5AC dxpl */
- if(H5I_dec_ref(H5AC_dxpl_id) < 0 ||
+ /* Close H5AC dxpls */
+ if(H5I_dec_ref(H5AC_ind_read_dxpl_id) < 0 ||
H5I_dec_ref(H5AC_noio_dxpl_id) < 0 ||
- H5I_dec_ref(H5AC_rawdata_dxpl_id) < 0)
+ H5I_dec_ref(H5AC_rawdata_dxpl_id) < 0
+#ifdef H5_HAVE_PARALLEL
+ || H5I_dec_ref(H5AC_coll_read_dxpl_id) < 0
+#endif /* H5_HAVE_PARALLEL */
+ )
H5E_clear_stack(NULL); /*ignore error*/
-#endif /* H5_DEBUG_BUILD */
+#endif /* defined(H5_HAVE_PARALLEL) || defined(H5_DEBUG_BUILD) */
+
/* Reset static IDs */
- H5AC_dxpl_id = (-1);
+ H5AC_ind_read_dxpl_id = (-1);
H5AC_noio_dxpl_id = (-1);
H5AC_rawdata_dxpl_id = (-1);
+#ifdef H5_HAVE_PARALLEL
+ H5AC_coll_read_dxpl_id = (-1);
+#endif /* H5_HAVE_PARALLEL */
} /* end if */
/* Reset interface initialization flag */
@@ -491,6 +540,10 @@ H5AC_dest(H5F_t *f, hid_t dxpl_id)
#endif /* H5AC__TRACE_FILE_ENABLED */
#ifdef H5_HAVE_PARALLEL
+ /* destroying the cache, so clear all collective entries */
+ if(H5C_clear_coll_entries(f->shared->cache, 0) < 0)
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "H5C_clear_coll_entries() failed.")
+
aux_ptr = (H5AC_aux_t *)H5C_get_aux_ptr(f->shared->cache);
if(aux_ptr)
/* Sanity check */
@@ -629,6 +682,10 @@ H5AC_flush(H5F_t *f, hid_t dxpl_id)
#endif /* H5AC__TRACE_FILE_ENABLED */
#ifdef H5_HAVE_PARALLEL
+ /* flushing the cache, so clear all collective entries */
+ if(H5C_clear_coll_entries(f->shared->cache, 0) < 0)
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "H5C_clear_coll_entries() failed.")
+
/* Attempt to flush all entries from rank 0 & Bcast clean list to other ranks */
if(H5AC__flush_entries(f, dxpl_id) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush.")