mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-02-23 16:20:57 +08:00
Merge branch 'develop' of https://bitbucket.hdfgroup.org/scm/~lrknox/hdf5_lrk into develop
This commit is contained in:
commit
a33667faf2
4
MANIFEST
4
MANIFEST
@ -119,8 +119,6 @@
|
|||||||
./config/apple
|
./config/apple
|
||||||
./config/cce-fflags
|
./config/cce-fflags
|
||||||
./config/cce-flags
|
./config/cce-flags
|
||||||
./config/clang-cxxflags
|
|
||||||
./config/clang-flags
|
|
||||||
./config/commence.am
|
./config/commence.am
|
||||||
./config/conclude.am
|
./config/conclude.am
|
||||||
./config/conclude_fc.am
|
./config/conclude_fc.am
|
||||||
@ -147,6 +145,8 @@
|
|||||||
./config/solaris
|
./config/solaris
|
||||||
|
|
||||||
#warnings files for both autotools and CMake
|
#warnings files for both autotools and CMake
|
||||||
|
./config/clang-cxxflags
|
||||||
|
./config/clang-flags
|
||||||
./config/clang-warnings/developer-general
|
./config/clang-warnings/developer-general
|
||||||
./config/clang-warnings/error-general
|
./config/clang-warnings/error-general
|
||||||
./config/clang-warnings/general
|
./config/clang-warnings/general
|
||||||
|
@ -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);
|
H5O_storage_chunk_t *sc = &(dset->shared->layout.storage.u.chunk);
|
||||||
herr_t ret_value = SUCCEED; /* Return value */
|
herr_t ret_value = SUCCEED; /* Return value */
|
||||||
|
|
||||||
FUNC_ENTER_STATIC_TAG(dset->oloc.addr)
|
FUNC_ENTER_STATIC
|
||||||
|
|
||||||
HDassert(dset);
|
HDassert(dset);
|
||||||
HDassert(dset->shared);
|
HDassert(dset->shared);
|
||||||
@ -3515,7 +3515,7 @@ done:
|
|||||||
((ent->edge_chunk_state & H5D_RDCC_DISABLE_FILTERS) ? NULL
|
((ent->edge_chunk_state & H5D_RDCC_DISABLE_FILTERS) ? NULL
|
||||||
: &(dset->shared->dcpl_cache.pline)));
|
: &(dset->shared->dcpl_cache.pline)));
|
||||||
|
|
||||||
FUNC_LEAVE_NOAPI_TAG(ret_value)
|
FUNC_LEAVE_NOAPI(ret_value)
|
||||||
} /* end H5D__chunk_flush_entry() */
|
} /* 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);
|
const H5O_storage_chunk_t *sc = &(layout->storage.u.chunk);
|
||||||
herr_t ret_value = SUCCEED; /* Return value */
|
herr_t ret_value = SUCCEED; /* Return value */
|
||||||
|
|
||||||
FUNC_ENTER_PACKAGE_TAG(dset->oloc.addr)
|
FUNC_ENTER_PACKAGE
|
||||||
|
|
||||||
/* Check args */
|
/* Check args */
|
||||||
HDassert(dset && H5D_CHUNKED == layout->type);
|
HDassert(dset && H5D_CHUNKED == layout->type);
|
||||||
@ -4754,7 +4754,7 @@ done:
|
|||||||
H5MM_free(chunk_info.addr);
|
H5MM_free(chunk_info.addr);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
FUNC_LEAVE_NOAPI_TAG(ret_value)
|
FUNC_LEAVE_NOAPI(ret_value)
|
||||||
} /* end H5D__chunk_allocate() */
|
} /* end H5D__chunk_allocate() */
|
||||||
|
|
||||||
|
|
||||||
|
@ -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->store);
|
||||||
HDassert(io_info->u.rbuf);
|
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 */
|
/* Check for only one element in selection */
|
||||||
if(nelmts == 1) {
|
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 */
|
/* 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")
|
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")
|
HGOTO_ERROR(H5E_INTERNAL, H5E_UNSUPPORTED, FAIL, "can't retrieve memory selection offset")
|
||||||
|
|
||||||
/* Set up necessary information for I/O operation */
|
/* Set up necessary information for I/O operation */
|
||||||
file_nseq = mem_nseq = 1;
|
file_nseq = mem_nseq = 1;
|
||||||
curr_mem_seq = curr_file_seq = 0;
|
curr_mem_seq = curr_file_seq = 0;
|
||||||
*file_off *= elmt_size;
|
single_file_off *= elmt_size;
|
||||||
*mem_off *= elmt_size;
|
single_mem_off *= elmt_size;
|
||||||
*file_len = *mem_len = elmt_size;
|
single_file_len = single_mem_len = elmt_size;
|
||||||
|
|
||||||
/* Perform I/O on memory and file sequences */
|
/* Perform I/O on memory and file sequences */
|
||||||
if(io_info->op_type == H5D_IO_OP_READ) {
|
if(io_info->op_type == H5D_IO_OP_READ) {
|
||||||
if((tmp_file_len = (*io_info->layout_ops.readvv)(io_info,
|
if((tmp_file_len = (*io_info->layout_ops.readvv)(io_info,
|
||||||
file_nseq, &curr_file_seq, file_len, file_off,
|
file_nseq, &curr_file_seq, &single_file_len, &single_file_off,
|
||||||
mem_nseq, &curr_mem_seq, mem_len, mem_off)) < 0)
|
mem_nseq, &curr_mem_seq, &single_mem_len, &single_mem_off)) < 0)
|
||||||
HGOTO_ERROR(H5E_DATASPACE, H5E_READERROR, FAIL, "read error")
|
HGOTO_ERROR(H5E_DATASPACE, H5E_READERROR, FAIL, "read error")
|
||||||
} /* end if */
|
} /* end if */
|
||||||
else {
|
else {
|
||||||
HDassert(io_info->op_type == H5D_IO_OP_WRITE);
|
HDassert(io_info->op_type == H5D_IO_OP_WRITE);
|
||||||
if((tmp_file_len = (*io_info->layout_ops.writevv)(io_info,
|
if((tmp_file_len = (*io_info->layout_ops.writevv)(io_info,
|
||||||
file_nseq, &curr_file_seq, file_len, file_off,
|
file_nseq, &curr_file_seq, &single_file_len, &single_file_off,
|
||||||
mem_nseq, &curr_mem_seq, mem_len, mem_off)) < 0)
|
mem_nseq, &curr_mem_seq, &single_mem_len, &single_mem_off)) < 0)
|
||||||
HGOTO_ERROR(H5E_DATASPACE, H5E_WRITEERROR, FAIL, "write error")
|
HGOTO_ERROR(H5E_DATASPACE, H5E_WRITEERROR, FAIL, "write error")
|
||||||
} /* end else */
|
} /* 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 mem_nelem; /* Number of elements used in memory sequences */
|
||||||
size_t file_nelem; /* Number of elements used in file 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 */
|
/* Allocate the iterators */
|
||||||
if(NULL == (mem_iter = H5FL_MALLOC(H5S_sel_iter_t)))
|
if(NULL == (mem_iter = H5FL_MALLOC(H5S_sel_iter_t)))
|
||||||
HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "can't allocate memory iterator")
|
HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "can't allocate memory iterator")
|
||||||
|
24
src/H5I.c
24
src/H5I.c
@ -67,6 +67,7 @@ typedef struct {
|
|||||||
unsigned init_count; /* # of times this type has been initialized*/
|
unsigned init_count; /* # of times this type has been initialized*/
|
||||||
uint64_t id_count; /* Current number of IDs held */
|
uint64_t id_count; /* Current number of IDs held */
|
||||||
uint64_t nextid; /* ID to use for the next atom */
|
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 */
|
H5SL_t *ids; /* Pointer to skip list that stores IDs */
|
||||||
} H5I_id_type_t;
|
} H5I_id_type_t;
|
||||||
|
|
||||||
@ -318,6 +319,7 @@ H5I_register_type(const H5I_class_t *cls)
|
|||||||
type_ptr->cls = cls;
|
type_ptr->cls = cls;
|
||||||
type_ptr->id_count = 0;
|
type_ptr->id_count = 0;
|
||||||
type_ptr->nextid = cls->reserved;
|
type_ptr->nextid = cls->reserved;
|
||||||
|
type_ptr->last_info = NULL;
|
||||||
if(NULL == (type_ptr->ids = H5SL_create(H5SL_TYPE_HID, NULL)))
|
if(NULL == (type_ptr->ids = H5SL_create(H5SL_TYPE_HID, NULL)))
|
||||||
HGOTO_ERROR(H5E_ATOM, H5E_CANTCREATE, FAIL, "skip list creation failed")
|
HGOTO_ERROR(H5E_ATOM, H5E_CANTCREATE, FAIL, "skip list creation failed")
|
||||||
} /* end if */
|
} /* 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 */
|
/* Sanity check for the 'nextid' getting too large and wrapping around */
|
||||||
HDassert(type_ptr->nextid <= ID_MASK);
|
HDassert(type_ptr->nextid <= ID_MASK);
|
||||||
|
|
||||||
|
/* Set the most recent ID to this object */
|
||||||
|
type_ptr->last_info = id_ptr;
|
||||||
|
|
||||||
/* Set return value */
|
/* Set return value */
|
||||||
ret_value = new_id;
|
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")
|
HGOTO_ERROR(H5E_ATOM, H5E_CANTINSERT, FAIL, "can't insert ID node into skip list")
|
||||||
type_ptr->id_count++;
|
type_ptr->id_count++;
|
||||||
|
|
||||||
|
/* Set the most recent ID to this object */
|
||||||
|
type_ptr->last_info = id_ptr;
|
||||||
|
|
||||||
done:
|
done:
|
||||||
FUNC_LEAVE_NOAPI(ret_value)
|
FUNC_LEAVE_NOAPI(ret_value)
|
||||||
} /* end H5I_register_using_existing_id() */
|
} /* 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)))
|
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")
|
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) */
|
ret_value = (void *)curr_id->obj_ptr; /* (Casting away const OK -QAK) */
|
||||||
curr_id = H5FL_FREE(H5I_id_info_t, curr_id);
|
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)
|
if(!type_ptr || type_ptr->init_count <= 0)
|
||||||
HGOTO_DONE(NULL)
|
HGOTO_DONE(NULL)
|
||||||
|
|
||||||
/* Locate the ID node for the ID */
|
/* Check for same ID as we have looked up last time */
|
||||||
ret_value = (H5I_id_info_t *)H5SL_search(type_ptr->ids, &id);
|
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:
|
done:
|
||||||
FUNC_LEAVE_NOAPI(ret_value)
|
FUNC_LEAVE_NOAPI(ret_value)
|
||||||
|
Loading…
Reference in New Issue
Block a user