From 9e8899c3b47a2041242dc4539ca8b1c5e151a371 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Tue, 9 Jun 2020 15:48:14 -0500 Subject: Remove redundant metadata cache tagging from some low-level internal chunk functions. The metadata cache tagging has already been done by routines further up the call stack. --- src/H5Dchunk.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index 90516c6..5fda3c0 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -3351,7 +3351,7 @@ H5D__chunk_flush_entry(const H5D_t *dset, H5D_rdcc_ent_t *ent, hbool_t reset) H5O_storage_chunk_t *sc = &(dset->shared->layout.storage.u.chunk); herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_STATIC_TAG(dset->oloc.addr) + FUNC_ENTER_STATIC HDassert(dset); HDassert(dset->shared); @@ -3515,7 +3515,7 @@ done: ((ent->edge_chunk_state & H5D_RDCC_DISABLE_FILTERS) ? NULL : &(dset->shared->dcpl_cache.pline))); - FUNC_LEAVE_NOAPI_TAG(ret_value) + FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__chunk_flush_entry() */ @@ -4350,7 +4350,7 @@ H5D__chunk_allocate(const H5D_io_info_t *io_info, hbool_t full_overwrite, hsize_ const H5O_storage_chunk_t *sc = &(layout->storage.u.chunk); herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_PACKAGE_TAG(dset->oloc.addr) + FUNC_ENTER_PACKAGE /* Check args */ HDassert(dset && H5D_CHUNKED == layout->type); @@ -4754,7 +4754,7 @@ done: H5MM_free(chunk_info.addr); #endif - FUNC_LEAVE_NOAPI_TAG(ret_value) + FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__chunk_allocate() */ -- cgit v0.12 From a8a4e9f27b67ae2e22970e42859225adcc2e5cbb Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Tue, 9 Jun 2020 16:24:48 -0500 Subject: Eliminate allocating file & memory offset & length arrays when performing I/O on a single element. --- src/H5Dselect.c | 59 +++++++++++++++++++++++++++++++-------------------------- 1 file changed, 32 insertions(+), 27 deletions(-) diff --git a/src/H5Dselect.c b/src/H5Dselect.c index a843d93..c5469c2 100644 --- a/src/H5Dselect.c +++ b/src/H5Dselect.c @@ -113,51 +113,38 @@ H5D__select_io(const H5D_io_info_t *io_info, size_t elmt_size, HDassert(io_info->store); HDassert(io_info->u.rbuf); - /* Get info from API context */ - if(H5CX_get_vec_size(&dxpl_vec_size) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't retrieve I/O vector size") - - /* Allocate the vector I/O arrays */ - if(dxpl_vec_size > H5D_IO_VECTOR_SIZE) - vec_size = dxpl_vec_size; - else - vec_size = H5D_IO_VECTOR_SIZE; - if(NULL == (mem_len = H5FL_SEQ_MALLOC(size_t, vec_size))) - HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "can't allocate I/O length vector array") - if(NULL == (mem_off = H5FL_SEQ_MALLOC(hsize_t, vec_size))) - HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "can't allocate I/O offset vector array") - if(NULL == (file_len = H5FL_SEQ_MALLOC(size_t, vec_size))) - HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "can't allocate I/O length vector array") - if(NULL == (file_off = H5FL_SEQ_MALLOC(hsize_t, vec_size))) - HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "can't allocate I/O offset vector array") - /* Check for only one element in selection */ if(nelmts == 1) { + hsize_t single_mem_off; /* Offset in memory */ + hsize_t single_file_off; /* Offset in the file */ + size_t single_mem_len; /* Length in memory */ + size_t single_file_len; /* Length in the file */ + /* Get offset of first element in selections */ - if(H5S_SELECT_OFFSET(file_space, file_off) < 0) + if(H5S_SELECT_OFFSET(file_space, &single_file_off) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_UNSUPPORTED, FAIL, "can't retrieve file selection offset") - if(H5S_SELECT_OFFSET(mem_space, mem_off) < 0) + if(H5S_SELECT_OFFSET(mem_space, &single_mem_off) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_UNSUPPORTED, FAIL, "can't retrieve memory selection offset") /* Set up necessary information for I/O operation */ file_nseq = mem_nseq = 1; curr_mem_seq = curr_file_seq = 0; - *file_off *= elmt_size; - *mem_off *= elmt_size; - *file_len = *mem_len = elmt_size; + single_file_off *= elmt_size; + single_mem_off *= elmt_size; + single_file_len = single_mem_len = elmt_size; /* Perform I/O on memory and file sequences */ if(io_info->op_type == H5D_IO_OP_READ) { if((tmp_file_len = (*io_info->layout_ops.readvv)(io_info, - file_nseq, &curr_file_seq, file_len, file_off, - mem_nseq, &curr_mem_seq, mem_len, mem_off)) < 0) + file_nseq, &curr_file_seq, &single_file_len, &single_file_off, + mem_nseq, &curr_mem_seq, &single_mem_len, &single_mem_off)) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_READERROR, FAIL, "read error") } /* end if */ else { HDassert(io_info->op_type == H5D_IO_OP_WRITE); if((tmp_file_len = (*io_info->layout_ops.writevv)(io_info, - file_nseq, &curr_file_seq, file_len, file_off, - mem_nseq, &curr_mem_seq, mem_len, mem_off)) < 0) + file_nseq, &curr_file_seq, &single_file_len, &single_file_off, + mem_nseq, &curr_mem_seq, &single_mem_len, &single_mem_off)) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_WRITEERROR, FAIL, "write error") } /* end else */ @@ -168,6 +155,24 @@ H5D__select_io(const H5D_io_info_t *io_info, size_t elmt_size, size_t mem_nelem; /* Number of elements used in memory sequences */ size_t file_nelem; /* Number of elements used in file sequences */ + /* Get info from API context */ + if(H5CX_get_vec_size(&dxpl_vec_size) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't retrieve I/O vector size") + + /* Allocate the vector I/O arrays */ + if(dxpl_vec_size > H5D_IO_VECTOR_SIZE) + vec_size = dxpl_vec_size; + else + vec_size = H5D_IO_VECTOR_SIZE; + if(NULL == (mem_len = H5FL_SEQ_MALLOC(size_t, vec_size))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "can't allocate I/O length vector array") + if(NULL == (mem_off = H5FL_SEQ_MALLOC(hsize_t, vec_size))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "can't allocate I/O offset vector array") + if(NULL == (file_len = H5FL_SEQ_MALLOC(size_t, vec_size))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "can't allocate I/O length vector array") + if(NULL == (file_off = H5FL_SEQ_MALLOC(hsize_t, vec_size))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "can't allocate I/O offset vector array") + /* Allocate the iterators */ if(NULL == (mem_iter = H5FL_MALLOC(H5S_sel_iter_t))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "can't allocate memory iterator") -- cgit v0.12 From 0ef32f07fb9e8fb6063f3318425506047454d6f4 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Tue, 9 Jun 2020 18:38:04 -0500 Subject: Remember the info for the last ID looked up for a given ID type. --- src/H5I.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/src/H5I.c b/src/H5I.c index 2ef3601..1752e5e 100644 --- a/src/H5I.c +++ b/src/H5I.c @@ -67,6 +67,7 @@ typedef struct { unsigned init_count; /* # of times this type has been initialized*/ uint64_t id_count; /* Current number of IDs held */ uint64_t nextid; /* ID to use for the next atom */ + H5I_id_info_t *last_info; /* Info for most recent ID looked up */ H5SL_t *ids; /* Pointer to skip list that stores IDs */ } H5I_id_type_t; @@ -318,6 +319,7 @@ H5I_register_type(const H5I_class_t *cls) type_ptr->cls = cls; type_ptr->id_count = 0; type_ptr->nextid = cls->reserved; + type_ptr->last_info = NULL; if(NULL == (type_ptr->ids = H5SL_create(H5SL_TYPE_HID, NULL))) HGOTO_ERROR(H5E_ATOM, H5E_CANTCREATE, FAIL, "skip list creation failed") } /* end if */ @@ -807,6 +809,9 @@ H5I_register(H5I_type_t type, const void *object, hbool_t app_ref) /* Sanity check for the 'nextid' getting too large and wrapping around */ HDassert(type_ptr->nextid <= ID_MASK); + /* Set the most recent ID to this object */ + type_ptr->last_info = id_ptr; + /* Set return value */ ret_value = new_id; @@ -878,6 +883,9 @@ H5I_register_using_existing_id(H5I_type_t type, void *object, hbool_t app_ref, h HGOTO_ERROR(H5E_ATOM, H5E_CANTINSERT, FAIL, "can't insert ID node into skip list") type_ptr->id_count++; + /* Set the most recent ID to this object */ + type_ptr->last_info = id_ptr; + done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5I_register_using_existing_id() */ @@ -1236,6 +1244,10 @@ H5I__remove_common(H5I_id_type_t *type_ptr, hid_t id) if(NULL == (curr_id = (H5I_id_info_t *)H5SL_remove(type_ptr->ids, &id))) HGOTO_ERROR(H5E_ATOM, H5E_CANTDELETE, NULL, "can't remove ID node from skip list") + /* Check if this ID was the last one accessed */ + if(type_ptr->last_info == curr_id) + type_ptr->last_info = NULL; + ret_value = (void *)curr_id->obj_ptr; /* (Casting away const OK -QAK) */ curr_id = H5FL_FREE(H5I_id_info_t, curr_id); @@ -2185,8 +2197,16 @@ H5I__find_id(hid_t id) if(!type_ptr || type_ptr->init_count <= 0) HGOTO_DONE(NULL) - /* Locate the ID node for the ID */ - ret_value = (H5I_id_info_t *)H5SL_search(type_ptr->ids, &id); + /* Check for same ID as we have looked up last time */ + if(type_ptr->last_info && type_ptr->last_info->id == id) + ret_value = type_ptr->last_info; + else { + /* Locate the ID node for the ID */ + ret_value = (H5I_id_info_t *)H5SL_search(type_ptr->ids, &id); + + /* Remember this ID */ + type_ptr->last_info = ret_value; + } /* end else */ done: FUNC_LEAVE_NOAPI(ret_value) -- cgit v0.12 From 1e038bf49588d163762965c7a15fb76e3a689ef2 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 10 Jun 2020 11:40:59 -0700 Subject: Fix MANIFEST --- MANIFEST | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MANIFEST b/MANIFEST index d9d8ab8..e3c3c50 100644 --- a/MANIFEST +++ b/MANIFEST @@ -145,6 +145,8 @@ ./config/solaris #warnings files for both autotools and CMake +./config/clang-cxxflags +./config/clang-flags ./config/clang-warnings/developer-general ./config/clang-warnings/error-general ./config/clang-warnings/general -- cgit v0.12 From 20eab963899841c9a003baebead8e3bc07d9e127 Mon Sep 17 00:00:00 2001 From: Larry Knox Date: Wed, 10 Jun 2020 15:17:32 -0500 Subject: Remove duplicate entries in MANIFEST. --- MANIFEST | 2 -- 1 file changed, 2 deletions(-) diff --git a/MANIFEST b/MANIFEST index 998009a..e3c3c50 100644 --- a/MANIFEST +++ b/MANIFEST @@ -119,8 +119,6 @@ ./config/apple ./config/cce-fflags ./config/cce-flags -./config/clang-cxxflags -./config/clang-flags ./config/commence.am ./config/conclude.am ./config/conclude_fc.am -- cgit v0.12