summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@lbl.gov>2016-11-28 01:00:12 (GMT)
committerQuincey Koziol <koziol@lbl.gov>2016-11-28 01:00:12 (GMT)
commit460b573a73e1cfa73ad16dc7fff286fd561ff735 (patch)
tree71fab2b5a5779b54b5fdac00963c44458ba00f6b
parent61e0a035bcc96b4fa38e443332bcbb6041e56b5d (diff)
downloadhdf5-460b573a73e1cfa73ad16dc7fff286fd561ff735.zip
hdf5-460b573a73e1cfa73ad16dc7fff286fd561ff735.tar.gz
hdf5-460b573a73e1cfa73ad16dc7fff286fd561ff735.tar.bz2
Eliminate unnecessary data structure for parallel collective metadata cache I/O
-rw-r--r--src/H5C.c17
-rw-r--r--src/H5Cmpio.c55
-rw-r--r--src/H5Cpkg.h9
-rw-r--r--testpar/t_cache.c1
4 files changed, 11 insertions, 71 deletions
diff --git a/src/H5C.c b/src/H5C.c
index 31f887d..af2440c 100644
--- a/src/H5C.c
+++ b/src/H5C.c
@@ -216,9 +216,6 @@ H5FL_DEFINE_STATIC(H5C_t);
/* Declare a free list to manage flush dependency arrays */
H5FL_BLK_DEFINE_STATIC(parent);
-/* Declare extern free list to manage the H5C_collective_write_t struct */
-H5FL_EXTERN(H5C_collective_write_t);
-
/*-------------------------------------------------------------------------
@@ -5859,20 +5856,8 @@ H5C__flush_single_entry(const H5F_t *f, hid_t dxpl_id, H5C_cache_entry_t *entry_
if(((entry_ptr->type->flags) & H5C__CLASS_SKIP_WRITES) == 0) {
#ifdef H5_HAVE_PARALLEL
if(collective_write_list) {
- H5C_collective_write_t *item;
-
- if(NULL == (item = (H5C_collective_write_t *)H5FL_MALLOC(H5C_collective_write_t)))
- HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "unable to allocate skip list item")
-
- item->length = entry_ptr->size;
- item->free_buf = FALSE;
- item->buf = entry_ptr->image_ptr;
- item->offset = entry_ptr->addr;
-
- if(H5SL_insert(collective_write_list, item, &item->offset) < 0) {
- H5MM_free(item);
+ if(H5SL_insert(collective_write_list, entry_ptr, &entry_ptr->addr) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_CANTINSERT, FAIL, "unable to insert skip list item")
- } /* end if */
} /* end if */
else
#endif /* H5_HAVE_PARALLEL */
diff --git a/src/H5Cmpio.c b/src/H5Cmpio.c
index 72de4d0..0d666de 100644
--- a/src/H5Cmpio.c
+++ b/src/H5Cmpio.c
@@ -66,7 +66,6 @@
/********************/
static herr_t H5C__collective_write(H5F_t *f, hid_t dxpl_id,
H5SL_t *collective_write_list);
-static herr_t H5C__collective_write_free(void *_item, void *key, void *op_data);
/*********************/
@@ -83,9 +82,6 @@ static herr_t H5C__collective_write_free(void *_item, void *key, void *op_data);
/* Local Variables */
/*******************/
-/* Declare a free list to manage the H5C_collective_write_t struct */
-H5FL_DEFINE(H5C_collective_write_t);
-
/*-------------------------------------------------------------------------
@@ -783,7 +779,7 @@ done:
candidate_assignment_table = (int *)H5MM_xfree((void *)candidate_assignment_table);
if(collective_write_list)
- if(H5SL_destroy(collective_write_list, H5C__collective_write_free, NULL) < 0)
+ if(H5SL_close(collective_write_list) < 0)
HDONE_ERROR(H5E_CACHE, H5E_CANTFREE, FAIL, "failed to destroy skip list")
FUNC_LEAVE_NOAPI(ret_value)
@@ -1382,7 +1378,7 @@ H5C__collective_write(H5F_t *f, hid_t dxpl_id, H5SL_t *collective_write_list)
if(count > 0) {
H5FD_mpio_xfer_t xfer_mode = H5FD_MPIO_COLLECTIVE;
H5SL_node_t *node;
- H5C_collective_write_t *item;
+ H5C_cache_entry_t *entry_ptr;
void *base_buf;
int i;
@@ -1400,25 +1396,25 @@ H5C__collective_write(H5F_t *f, hid_t dxpl_id, H5SL_t *collective_write_list)
/* Fill arrays */
node = H5SL_first(collective_write_list);
HDassert(node);
- if(NULL == (item = (H5C_collective_write_t *)H5SL_item(node)))
+ if(NULL == (entry_ptr = (H5C_cache_entry_t *)H5SL_item(node)))
HGOTO_ERROR(H5E_CACHE, H5E_NOTFOUND, FAIL, "can't retrieve skip list item")
/* Set up initial array position & buffer base address */
- length_array[0] = (int)item->length;
- base_buf = item->buf;
+ length_array[0] = (int)entry_ptr->size;
+ base_buf = entry_ptr->image_ptr;
buf_array[0] = (MPI_Aint)0;
- offset_array[0] = (MPI_Aint)item->offset;
+ offset_array[0] = (MPI_Aint)entry_ptr->addr;
node = H5SL_next(node);
i = 1;
while(node) {
- if(NULL == (item = (H5C_collective_write_t *)H5SL_item(node)))
+ if(NULL == (entry_ptr = (H5C_cache_entry_t *)H5SL_item(node)))
HGOTO_ERROR(H5E_CACHE, H5E_NOTFOUND, FAIL, "can't retrieve skip list item")
/* Set up array position */
- length_array[i] = (int)item->length;
- buf_array[i] = (MPI_Aint)item->buf - (MPI_Aint)base_buf;
- offset_array[i] = (MPI_Aint)item->offset;
+ length_array[i] = (int)entry_ptr->size;
+ buf_array[i] = (MPI_Aint)entry_ptr->image_ptr - (MPI_Aint)base_buf;
+ offset_array[i] = (MPI_Aint)entry_ptr->addr;
/* Advance to next node & array location */
node = H5SL_next(node);
@@ -1491,36 +1487,5 @@ done:
FUNC_LEAVE_NOAPI(ret_value);
} /* end H5C__collective_write() */
-
-
-/*-------------------------------------------------------------------------
- *
- * Function: H5C__collective_write_free
- *
- * Purpose: Release node on collective write skiplist
- *
- * Return: FAIL if error is detected, SUCCEED otherwise.
- *
- * Programmer: Mohamad Chaarawi
- * February, 2016
- *
- *-------------------------------------------------------------------------
- */
-static herr_t
-H5C__collective_write_free(void *_item, void H5_ATTR_UNUSED *key, void H5_ATTR_UNUSED *op_data)
-{
- H5C_collective_write_t *item = (H5C_collective_write_t *)_item;
-
- FUNC_ENTER_STATIC_NOERR
-
- /* Sanity check */
- HDassert(item);
-
- if(item->free_buf)
- item->buf = H5MM_xfree(item->buf);
- H5FL_FREE(H5C_collective_write_t, item);
-
- FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5C__collective_write_free() */
#endif /* H5_HAVE_PARALLEL */
diff --git a/src/H5Cpkg.h b/src/H5Cpkg.h
index 78ae930..63c2c8b 100644
--- a/src/H5Cpkg.h
+++ b/src/H5Cpkg.h
@@ -4310,15 +4310,6 @@ struct H5C_t {
char prefix[H5C__PREFIX_LEN];
};
-#ifdef H5_HAVE_PARALLEL
-typedef struct H5C_collective_write_t {
- size_t length;
- hbool_t free_buf;
- void *buf;
- haddr_t offset;
-} H5C_collective_write_t;
-#endif /* H5_HAVE_PARALLEL */
-
/* Define typedef for tagged cache entry iteration callbacks */
typedef int (*H5C_tag_iter_cb_t)(H5C_cache_entry_t *entry, void *ctx);
diff --git a/testpar/t_cache.c b/testpar/t_cache.c
index 0fa0096..ef89c8d 100644
--- a/testpar/t_cache.c
+++ b/testpar/t_cache.c
@@ -2522,7 +2522,6 @@ datum_serialize(const H5F_t *f,
HDassert( aux_ptr );
HDassert( aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC );
-// HDassert( entry_ptr->aux_ptr == NULL );
entry_ptr->aux_ptr = aux_ptr;