summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLarry Knox <lrknox@hdfgroup.org>2020-06-10 20:12:58 (GMT)
committerLarry Knox <lrknox@hdfgroup.org>2020-06-10 20:12:58 (GMT)
commit63f1a713cc264da4f8e5aba2496bff5c72066cf6 (patch)
treeddd4258feb4175de2ee8aef7a53bbcd75660ebda
parent77efb340a1b06465587ca9dd4599271409a86a44 (diff)
parent7f0c0134166275c0745e0e65f9d81b4de72d5ce2 (diff)
downloadhdf5-63f1a713cc264da4f8e5aba2496bff5c72066cf6.zip
hdf5-63f1a713cc264da4f8e5aba2496bff5c72066cf6.tar.gz
hdf5-63f1a713cc264da4f8e5aba2496bff5c72066cf6.tar.bz2
Merging in latest from upstream (HDFFV/hdf5:refs/heads/develop)
* commit '7f0c0134166275c0745e0e65f9d81b4de72d5ce2': Fix MANIFEST Remember the info for the last ID looked up for a given ID type. Eliminate allocating file & memory offset & length arrays when performing I/O on a single element. 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.
-rw-r--r--MANIFEST2
-rw-r--r--src/H5Dchunk.c8
-rw-r--r--src/H5Dselect.c59
-rw-r--r--src/H5I.c24
4 files changed, 60 insertions, 33 deletions
diff --git a/MANIFEST b/MANIFEST
index 11f2926..998009a 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -147,6 +147,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
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() */
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")
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)