Change default nslots value for chunk cache to 8191 (#5956)

In order to reduce hash collisions and take advantage of modern memory capacity, the default hash table size for the chunk cache has been increased from 521 to 8191. This means the hash table will consume approximately 64 KiB per open dataset. This value can be changed with H5Pset_cache() or H5Pset_chunk_cache(). This value was chosen because it is a prime number close to 8K.
This commit is contained in:
Neil Fortner
2025-10-31 14:48:05 -05:00
committed by GitHub
parent a6d7b94c0c
commit 85f7f8f083
5 changed files with 15 additions and 7 deletions
+2 -2
View File
@@ -720,7 +720,7 @@ public class TestH5Pfapl {
double[] rdcc_w0 = {0};
try {
H5.H5Pget_cache(fapl_id, null, rdcc_nelmts, rdcc_nbytes, rdcc_w0);
assertTrue("H5P_cache default", rdcc_nelmts[0] == 521);
assertTrue("H5P_cache default", rdcc_nelmts[0] == 8191);
assertTrue("H5P_cache default", rdcc_nbytes[0] == (8 * 1024 * 1024));
assertTrue("H5P_cache default", rdcc_w0[0] == 0.75);
}
@@ -748,7 +748,7 @@ public class TestH5Pfapl {
double[] rdcc_w0 = {0};
try {
H5.H5Pget_chunk_cache(dapl_id, rdcc_nslots, rdcc_nbytes, rdcc_w0);
assertTrue("H5P_chunk_cache default", rdcc_nslots[0] == 521);
assertTrue("H5P_chunk_cache default", rdcc_nslots[0] == 8191);
assertTrue("H5P_chunk_cache default", rdcc_nbytes[0] == (8 * 1024 * 1024));
assertTrue("H5P_chunk_cache default", rdcc_w0[0] == 0.75);
}
+4
View File
@@ -193,6 +193,10 @@ All other HDF5 library CMake options are prefixed with `HDF5_`
## Library
### Changed default chunk cache hash table size to 8191
In order to reduce hash collisions and take advantage of modern memory capacity, the default hash table size for the chunk cache has been increased from 521 to 8191. This means the hash table will consume approximately 64 KiB per open dataset. This value can be changed with `H5Pset_cache()` or `H5Pset_chunk_cache()`. This value was chosen because it is a prime number close to 8K.
### Updated default file format to 1.8
By default, HDF5 will now use the 1.8 file format (`H5F_LIBVER_V18`). This provides improved performance and space efficiency, particularly with groups and links. This behavior can be overridden with `H5Pset_libver_bounds()`.
+1 -1
View File
@@ -86,7 +86,7 @@
#define H5F_ACS_META_CACHE_INIT_CONFIG_CMP H5P__facc_cache_config_cmp
/* Definitions for size of raw data chunk cache(slots) */
#define H5F_ACS_DATA_CACHE_NUM_SLOTS_SIZE sizeof(size_t)
#define H5F_ACS_DATA_CACHE_NUM_SLOTS_DEF 521
#define H5F_ACS_DATA_CACHE_NUM_SLOTS_DEF 8191
#define H5F_ACS_DATA_CACHE_NUM_SLOTS_ENC H5P__encode_size_t
#define H5F_ACS_DATA_CACHE_NUM_SLOTS_DEC H5P__decode_size_t
/* Definition for size of raw data chunk cache(bytes) */
+2 -2
View File
@@ -4241,7 +4241,7 @@ H5_DLL herr_t H5Pset_alignment(hid_t fapl_id, hsize_t threshold, hsize_t alignme
* that can fit in \p rdcc_nbytes bytes. For
* maximum performance, this value should be set
* approximately 100 times that number of chunks.
* The default value is 521.
* The default value is 8191.
* \param[in] rdcc_nbytes Total size of the raw data chunk cache in bytes.
* The default size is 8 MiB per dataset.
* \param[in] rdcc_w0 The chunk preemption policy for all datasets.
@@ -7552,7 +7552,7 @@ H5_DLL herr_t H5Pset_append_flush(hid_t dapl_id, unsigned ndims, const hsize_t b
* that can fit in \p rdcc_nbytes bytes. For maximum
* performance, this value should be set
* approximately 100 times that number of chunks.
* The default value is 521. If the value passed is
* The default value is 8191. If the value passed is
* #H5D_CHUNK_CACHE_NSLOTS_DEFAULT, then the
* property will not be set on \p dapl_id and the
* parameter will come from the file access
+6 -2
View File
@@ -2735,6 +2735,10 @@ check_dataset_write_tags(void)
if ((H5Dwrite(did, H5T_NATIVE_INT, sid, sid, H5P_DEFAULT, data)) < 0)
TEST_ERROR;
/* Flush dataset so all index nodes are created */
if (H5Dflush(did) < 0)
TEST_ERROR;
/* =================================== */
/* Verification of Metadata Tag Values */
/* =================================== */
@@ -2745,8 +2749,8 @@ check_dataset_write_tags(void)
dump_cache(fid);
#endif /* NDEBUG */ /* end debugging functions */
/* Verify 10 b-tree nodes belonging to dataset */
for (i = 0; i < 10; i++)
/* Verify 19 b-tree nodes belonging to dataset */
for (i = 0; i < 19; i++)
if (verify_tag(fid, H5AC_BT_ID, d_tag) < 0)
TEST_ERROR;