Skip to content

Commit

Permalink
Hash table replacement for skip lists in ID code (#600)
Browse files Browse the repository at this point in the history
* Committing clang-format changes

* Brings over hash table code from Bitbucket

* Can be switched between skip list and hash table implementation
  with H5_USE_ID_HASH_TABLE #define
* Not yet updated to use iterate-safe delete

* Fixes a warning and changes where the problematic test is
commented out.

* Adds mark-and-sweep flags and members

* Final fixes for hash table ID code

* Removes skip list ID code

* Committing clang-format changes

* Formatted source

* Adds a comment about the mark-and-sweep scheme.

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
derobins and github-actions[bot] authored May 4, 2021
1 parent c7d45c2 commit dbe7204
Show file tree
Hide file tree
Showing 8 changed files with 1,327 additions and 69 deletions.
1 change: 1 addition & 0 deletions MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -1114,6 +1114,7 @@
./src/hdf5.h
./src/libhdf5.settings.in
./src/H5win32defs.h
./src/uthash.h

./test/AtomicWriterReader.txt
./test/H5srcdir.h
Expand Down
2 changes: 2 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -971,6 +971,8 @@ set (H5_PRIVATE_HEADERS
${HDF5_SRC_DIR}/H5Zprivate.h

${HDF5_SRC_DIR}/H5win32defs.h

${HDF5_SRC_DIR}/uthash.h
)

set (H5_GENERATED_HEADERS
Expand Down
17 changes: 15 additions & 2 deletions src/H5Idbg.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
#include "H5Gprivate.h" /* Groups */
#include "H5Ipkg.h" /* IDs */
#include "H5RSprivate.h" /* Reference-counted strings */
#include "H5SLprivate.h" /* Skip Lists */
#include "H5Tprivate.h" /* Datatypes */
#include "H5VLprivate.h" /* Virtual Object Layer */

Expand Down Expand Up @@ -86,6 +85,7 @@ H5I__id_dump_cb(void *_item, void H5_ATTR_UNUSED *_key, void *_udata)
HDfprintf(stderr, " id = %" PRIdHID "\n", info->id);
HDfprintf(stderr, " count = %u\n", info->count);
HDfprintf(stderr, " obj = 0x%8p\n", info->object);
HDfprintf(stderr, " marked = %d\n", info->marked);

/* Get the group location, so we get get the name */
switch (type) {
Expand Down Expand Up @@ -173,6 +173,9 @@ H5I_dump_ids_for_type(H5I_type_t type)

if (type_info) {

H5I_id_info_t *item = NULL;
H5I_id_info_t *tmp = NULL;

/* Header */
HDfprintf(stderr, " init_count = %u\n", type_info->init_count);
HDfprintf(stderr, " reserved = %u\n", type_info->cls->reserved);
Expand All @@ -182,7 +185,17 @@ H5I_dump_ids_for_type(H5I_type_t type)
/* List */
if (type_info->id_count > 0) {
HDfprintf(stderr, " List:\n");
H5SL_iterate(type_info->ids, H5I__id_dump_cb, &type);
/* Normally we care about the callback's return value
* (H5I_ITER_CONT, etc.), but this is an iteration over all
* the IDs so we don't care.
*
* XXX: Update this to emit an error message on errors?
*/
HDfprintf(stderr, " (HASH TABLE)\n");
HASH_ITER(hh, type_info->hash_table, item, tmp)
{
H5I__id_dump_cb((void *)item, NULL, (void *)&type);
}
}
}
else
Expand Down
Loading

0 comments on commit dbe7204

Please sign in to comment.