From df78ec47ea5cf2364a34fb61bc90f18e6361fb9e Mon Sep 17 00:00:00 2001 From: khizmax Date: Sat, 5 Sep 2015 16:31:23 +0300 Subject: [PATCH] Added MultiLevelHashMap to Map_insdel_int MT-test --- cds/container/details/multilevel_hashmap_base.h | 2 +- projects/Win/vc12/unit-map-insdel.vcxproj | 1 + projects/Win/vc12/unit-map-insdel.vcxproj.filters | 3 +++ projects/source.unit.map.mk | 9 +++++---- tests/data/test-debug.conf | 6 +++++- tests/data/test-express.conf | 6 +++++- tests/data/test.conf | 5 ++++- tests/unit/map2/CMakeLists.txt | 9 +++++---- tests/unit/map2/map_insdel_int.cpp | 3 +++ tests/unit/map2/map_insdel_int.h | 12 +++++++++--- tests/unit/map2/map_insdel_int_multilevelhashmap.cpp | 12 ++++++++++++ 11 files changed, 53 insertions(+), 15 deletions(-) create mode 100644 tests/unit/map2/map_insdel_int_multilevelhashmap.cpp diff --git a/cds/container/details/multilevel_hashmap_base.h b/cds/container/details/multilevel_hashmap_base.h index c9fcaaa5..8ae44546 100644 --- a/cds/container/details/multilevel_hashmap_base.h +++ b/cds/container/details/multilevel_hashmap_base.h @@ -85,7 +85,7 @@ namespace cds { namespace container { */ typedef empty_stat stat; - /// RCU deadlock checking policy (only for \ref cds_container_MultilevelHashSet_rcu "RCU-based MultilevelHashSet") + /// RCU deadlock checking policy (only for \ref cds_container_MultilevelHashMap_rcu "RCU-based MultilevelHashMap") /** @copydetails cds::intrusive::multilevel_hashset::traits::rcu_check_deadlock */ diff --git a/projects/Win/vc12/unit-map-insdel.vcxproj b/projects/Win/vc12/unit-map-insdel.vcxproj index 9d9c05d1..483a9d26 100644 --- a/projects/Win/vc12/unit-map-insdel.vcxproj +++ b/projects/Win/vc12/unit-map-insdel.vcxproj @@ -57,6 +57,7 @@ + diff --git a/projects/Win/vc12/unit-map-insdel.vcxproj.filters b/projects/Win/vc12/unit-map-insdel.vcxproj.filters index 6b1098c0..303b3d71 100644 --- a/projects/Win/vc12/unit-map-insdel.vcxproj.filters +++ b/projects/Win/vc12/unit-map-insdel.vcxproj.filters @@ -82,6 +82,9 @@ map_insdel_string + + map_insdel_int + diff --git a/projects/source.unit.map.mk b/projects/source.unit.map.mk index 676f1e92..4ab10a2d 100644 --- a/projects/source.unit.map.mk +++ b/projects/source.unit.map.mk @@ -40,13 +40,14 @@ CDSUNIT_MAP_SOURCES := \ tests/unit/map2/map_insdel_func_refinable.cpp \ tests/unit/map2/map_insdel_func_cuckoo.cpp \ tests/unit/map2/map_insdel_int.cpp \ + tests/unit/map2/map_insdel_int_bronsonavltree.cpp \ + tests/unit/map2/map_insdel_int_cuckoo.cpp \ + tests/unit/map2/map_insdel_int_ellentree.cpp \ tests/unit/map2/map_insdel_int_michael.cpp \ - tests/unit/map2/map_insdel_int_split.cpp \ + tests/unit/map2/map_insdel_int_multilevelhashmap.cpp \ tests/unit/map2/map_insdel_int_skip.cpp \ - tests/unit/map2/map_insdel_int_ellentree.cpp \ - tests/unit/map2/map_insdel_int_bronsonavltree.cpp \ + tests/unit/map2/map_insdel_int_split.cpp \ tests/unit/map2/map_insdel_int_striped.cpp \ - tests/unit/map2/map_insdel_int_cuckoo.cpp \ tests/unit/map2/map_insdel_item_int.cpp \ tests/unit/map2/map_insdel_item_int_michael.cpp \ tests/unit/map2/map_insdel_item_int_split.cpp \ diff --git a/tests/data/test-debug.conf b/tests/data/test-debug.conf index 7a1650be..88c2207d 100644 --- a/tests/data/test-debug.conf +++ b/tests/data/test-debug.conf @@ -138,11 +138,15 @@ ThreadPassCount=8 MapSize=50000 MaxLoadFactor=4 PrintGCStateFlag=1 -#Cuckoo map properties +# *** Cuckoo map properties CuckooInitialSize=256 CuckooProbesetSize=8 # 0 - use default CuckooProbesetThreshold=0 +# *** MultiLevelHashMap properties +MultiLevelMapHeadBits=8 +MultiLevelMapArrayBits=4 + [Map_InsDel_func] InsertThreadCount=4 diff --git a/tests/data/test-express.conf b/tests/data/test-express.conf index 08c51269..a177efdc 100644 --- a/tests/data/test-express.conf +++ b/tests/data/test-express.conf @@ -136,11 +136,15 @@ ThreadPassCount=2 MapSize=100000 MaxLoadFactor=4 PrintGCStateFlag=1 -#Cuckoo map properties +# *** Cuckoo map properties CuckooInitialSize=1024 CuckooProbesetSize=16 # 0 - use default CuckooProbesetThreshold=0 +# *** MultiLevelHashMap properties +MultiLevelMapHeadBits=8 +MultiLevelMapArrayBits=4 + [Map_InsDel_func] InsertThreadCount=4 diff --git a/tests/data/test.conf b/tests/data/test.conf index f6663b31..97eafc50 100644 --- a/tests/data/test.conf +++ b/tests/data/test.conf @@ -131,11 +131,14 @@ ThreadPassCount=2 MapSize=1000000 MaxLoadFactor=4 PrintGCStateFlag=1 -#Cuckoo map properties +# *** Cuckoo map properties CuckooInitialSize=1024 CuckooProbesetSize=16 # 0 - use default CuckooProbesetThreshold=0 +# *** MultiLevelHashMap properties +MultiLevelMapHeadBits=10 +MultiLevelMapArrayBits=4 [Map_InsDel_func] InsertThreadCount=4 diff --git a/tests/unit/map2/CMakeLists.txt b/tests/unit/map2/CMakeLists.txt index 88996ec2..4d96a296 100644 --- a/tests/unit/map2/CMakeLists.txt +++ b/tests/unit/map2/CMakeLists.txt @@ -41,13 +41,14 @@ set(CDSUNIT_MAP_SOURCES map_insdel_func_refinable.cpp map_insdel_func_cuckoo.cpp map_insdel_int.cpp + map_insdel_int_bronsonavltree.cpp + map_insdel_int_cuckoo.cpp + map_insdel_int_ellentree.cpp map_insdel_int_michael.cpp - map_insdel_int_split.cpp + map_insdel_int_multilevelhashmap.cpp map_insdel_int_skip.cpp - map_insdel_int_ellentree.cpp - map_insdel_int_bronsonavltree.cpp + map_insdel_int_split.cpp map_insdel_int_striped.cpp - map_insdel_int_cuckoo.cpp map_insdel_item_int.cpp map_insdel_item_int_michael.cpp map_insdel_item_int_split.cpp diff --git a/tests/unit/map2/map_insdel_int.cpp b/tests/unit/map2/map_insdel_int.cpp index f824161e..cd636039 100644 --- a/tests/unit/map2/map_insdel_int.cpp +++ b/tests/unit/map2/map_insdel_int.cpp @@ -18,6 +18,9 @@ namespace map2 { c_nCuckooProbesetSize = cfg.getULong("CuckooProbesetSize", static_cast(c_nCuckooProbesetSize) ); c_nCuckooProbesetThreshold = cfg.getULong("CuckooProbesetThreshold", static_cast(c_nCuckooProbesetThreshold) ); + c_nMultiLevelMap_HeadBits = cfg.getULong("MultiLevelMapHeadBits", static_cast(c_nMultiLevelMap_HeadBits) ); + c_nMultiLevelMap_ArrayBits = cfg.getULong("MultiLevelMapArrayBits", static_cast(c_nMultiLevelMap_ArrayBits) ); + c_bPrintGCState = cfg.getBool("PrintGCStateFlag", c_bPrintGCState ); if ( c_nInsertThreadCount == 0 ) diff --git a/tests/unit/map2/map_insdel_int.h b/tests/unit/map2/map_insdel_int.h index 66cd8830..a36c6415 100644 --- a/tests/unit/map2/map_insdel_int.h +++ b/tests/unit/map2/map_insdel_int.h @@ -17,9 +17,13 @@ namespace map2 { size_t c_nDeleteThreadCount = 4; // count of deletion thread size_t c_nThreadPassCount = 4; // pass count for each thread size_t c_nMaxLoadFactor = 8; // maximum load factor - size_t c_nCuckooInitialSize = 1024;// initial size for CuckooMap - size_t c_nCuckooProbesetSize = 16; // CuckooMap probeset size (only for list-based probeset) - size_t c_nCuckooProbesetThreshold = 0; // CUckooMap probeset threshold (o - use default) + + size_t c_nCuckooInitialSize = 1024;// initial size for CuckooMap + size_t c_nCuckooProbesetSize = 16; // CuckooMap probeset size (only for list-based probeset) + size_t c_nCuckooProbesetThreshold = 0; // CUckooMap probeset threshold (o - use default) + + size_t c_nMultiLevelMap_HeadBits = 10; + size_t c_nMultiLevelMap_ArrayBits = 4; bool c_bPrintGCState = true; @@ -248,6 +252,7 @@ namespace map2 { CDSUNIT_DECLARE_SkipListMap CDSUNIT_DECLARE_EllenBinTreeMap CDSUNIT_DECLARE_BronsonAVLTreeMap + CDSUNIT_DECLARE_MultiLevelHashMap CDSUNIT_DECLARE_StripedMap CDSUNIT_DECLARE_RefinableMap CDSUNIT_DECLARE_CuckooMap @@ -259,6 +264,7 @@ namespace map2 { CDSUNIT_TEST_SkipListMap CDSUNIT_TEST_EllenBinTreeMap CDSUNIT_TEST_BronsonAVLTreeMap + CDSUNIT_TEST_MultiLevelHashMap CDSUNIT_TEST_CuckooMap CDSUNIT_TEST_StripedMap CDSUNIT_TEST_RefinableMap diff --git a/tests/unit/map2/map_insdel_int_multilevelhashmap.cpp b/tests/unit/map2/map_insdel_int_multilevelhashmap.cpp new file mode 100644 index 00000000..7ebbb333 --- /dev/null +++ b/tests/unit/map2/map_insdel_int_multilevelhashmap.cpp @@ -0,0 +1,12 @@ +//$$CDS-header$$ + +#include "map2/map_insdel_int.h" +#include "map2/map_type_multilevel_hashmap.h" + +#undef TEST_CASE +#define TEST_CASE(TAG, X) void Map_InsDel_int::X() { run_test::X>(); } +#include "map2/map_defs.h" + +namespace map2 { + CDSUNIT_DECLARE_MultiLevelHashMap +} // namespace map2 -- 2.34.1