summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMohamad Chaarawi <chaarawi@hdfgroup.org>2013-12-30 20:52:17 (GMT)
committerMohamad Chaarawi <chaarawi@hdfgroup.org>2013-12-30 20:52:17 (GMT)
commitb3a2bd81a1c2d27ea9e34e833149401e340bdc92 (patch)
tree12152e8a6602b94d9ccd382bf8b7cf6ff7c8e8f0
parent582b9a6d3c3a099b576ded57e1caa94a830b692e (diff)
downloadhdf5-b3a2bd81a1c2d27ea9e34e833149401e340bdc92.zip
hdf5-b3a2bd81a1c2d27ea9e34e833149401e340bdc92.tar.gz
hdf5-b3a2bd81a1c2d27ea9e34e833149401e340bdc92.tar.bz2
[svn-r24599] Merged /trunk:r24598
allocate and use the H5AC_aux_t struct even if num_procs == 1. This was a bug exposed by running a single process with a program that generates lots of dirty metadata that needs to be flushed. --This line, and those below, will be ignored-- _M . M src/H5AC.c
-rw-r--r--src/H5AC.c90
1 files changed, 42 insertions, 48 deletions
diff --git a/src/H5AC.c b/src/H5AC.c
index fce477d..e0891dd 100644
--- a/src/H5AC.c
+++ b/src/H5AC.c
@@ -498,58 +498,52 @@ H5AC_create(const H5F_t *f,
if((mpi_size = H5F_mpi_get_size(f)) < 0)
HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "can't get mpi size")
- /* There is no point in setting up the auxilary structure if size
- * is less than or equal to 1, as there will never be any processes
- * to broadcast the clean lists to.
- */
- if(mpi_size > 1) {
- if(NULL == (aux_ptr = H5FL_CALLOC(H5AC_aux_t)))
- HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "Can't allocate H5AC auxilary structure.")
-
- aux_ptr->magic = H5AC__H5AC_AUX_T_MAGIC;
- aux_ptr->mpi_comm = mpi_comm;
- aux_ptr->mpi_rank = mpi_rank;
- aux_ptr->mpi_size = mpi_size;
- aux_ptr->write_permitted = FALSE;
- aux_ptr->dirty_bytes_threshold = H5AC__DEFAULT_DIRTY_BYTES_THRESHOLD;
- aux_ptr->dirty_bytes = 0;
- aux_ptr->metadata_write_strategy = H5AC__DEFAULT_METADATA_WRITE_STRATEGY;
+ if(NULL == (aux_ptr = H5FL_CALLOC(H5AC_aux_t)))
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "Can't allocate H5AC auxilary structure.")
+
+ aux_ptr->magic = H5AC__H5AC_AUX_T_MAGIC;
+ aux_ptr->mpi_comm = mpi_comm;
+ aux_ptr->mpi_rank = mpi_rank;
+ aux_ptr->mpi_size = mpi_size;
+ aux_ptr->write_permitted = FALSE;
+ aux_ptr->dirty_bytes_threshold = H5AC__DEFAULT_DIRTY_BYTES_THRESHOLD;
+ aux_ptr->dirty_bytes = 0;
+ aux_ptr->metadata_write_strategy = H5AC__DEFAULT_METADATA_WRITE_STRATEGY;
#if H5AC_DEBUG_DIRTY_BYTES_CREATION
- aux_ptr->dirty_bytes_propagations = 0;
- aux_ptr->unprotect_dirty_bytes = 0;
- aux_ptr->unprotect_dirty_bytes_updates = 0;
- aux_ptr->insert_dirty_bytes = 0;
- aux_ptr->insert_dirty_bytes_updates = 0;
- aux_ptr->move_dirty_bytes = 0;
- aux_ptr->move_dirty_bytes_updates = 0;
+ aux_ptr->dirty_bytes_propagations = 0;
+ aux_ptr->unprotect_dirty_bytes = 0;
+ aux_ptr->unprotect_dirty_bytes_updates = 0;
+ aux_ptr->insert_dirty_bytes = 0;
+ aux_ptr->insert_dirty_bytes_updates = 0;
+ aux_ptr->move_dirty_bytes = 0;
+ aux_ptr->move_dirty_bytes_updates = 0;
#endif /* H5AC_DEBUG_DIRTY_BYTES_CREATION */
- aux_ptr->d_slist_ptr = NULL;
- aux_ptr->d_slist_len = 0;
- aux_ptr->c_slist_ptr = NULL;
- aux_ptr->c_slist_len = 0;
- aux_ptr->candidate_slist_ptr = NULL;
- aux_ptr->candidate_slist_len = 0;
- aux_ptr->write_done = NULL;
- aux_ptr->sync_point_done = NULL;
-
- sprintf(prefix, "%d:", mpi_rank);
-
- if(mpi_rank == 0) {
- if(NULL == (aux_ptr->d_slist_ptr = H5SL_create(H5SL_TYPE_HADDR, NULL)))
- HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, FAIL, "can't create dirtied entry list.")
-
- if(NULL == (aux_ptr->c_slist_ptr = H5SL_create(H5SL_TYPE_HADDR, NULL)))
- HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, FAIL, "can't create cleaned entry list.")
- } /* end if */
-
- /* construct the candidate slist for all processes.
- * when the distributed strategy is selected as all processes
- * will use it in the case of a flush.
- */
- if(NULL == (aux_ptr->candidate_slist_ptr = H5SL_create(H5SL_TYPE_HADDR, NULL)))
- HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, FAIL, "can't create candidate entry list.")
+ aux_ptr->d_slist_ptr = NULL;
+ aux_ptr->d_slist_len = 0;
+ aux_ptr->c_slist_ptr = NULL;
+ aux_ptr->c_slist_len = 0;
+ aux_ptr->candidate_slist_ptr = NULL;
+ aux_ptr->candidate_slist_len = 0;
+ aux_ptr->write_done = NULL;
+ aux_ptr->sync_point_done = NULL;
+
+ sprintf(prefix, "%d:", mpi_rank);
+
+ if(mpi_rank == 0) {
+ if(NULL == (aux_ptr->d_slist_ptr = H5SL_create(H5SL_TYPE_HADDR, NULL)))
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, FAIL, "can't create dirtied entry list.")
+
+ if(NULL == (aux_ptr->c_slist_ptr = H5SL_create(H5SL_TYPE_HADDR, NULL)))
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, FAIL, "can't create cleaned entry list.")
} /* end if */
+ /* construct the candidate slist for all processes.
+ * when the distributed strategy is selected as all processes
+ * will use it in the case of a flush.
+ */
+ if(NULL == (aux_ptr->candidate_slist_ptr = H5SL_create(H5SL_TYPE_HADDR, NULL)))
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, FAIL, "can't create candidate entry list.")
+
if(aux_ptr != NULL) {
if(aux_ptr->mpi_rank == 0) {
f->shared->cache = H5C_create(H5AC__DEFAULT_MAX_CACHE_SIZE,