Added MultiLevelHashMap to Map_insdel_int MT-test
authorkhizmax <libcds.dev@gmail.com>
Sat, 5 Sep 2015 13:31:23 +0000 (16:31 +0300)
committerkhizmax <libcds.dev@gmail.com>
Sat, 5 Sep 2015 13:31:23 +0000 (16:31 +0300)
cds/container/details/multilevel_hashmap_base.h
projects/Win/vc12/unit-map-insdel.vcxproj
projects/Win/vc12/unit-map-insdel.vcxproj.filters
projects/source.unit.map.mk
tests/data/test-debug.conf
tests/data/test-express.conf
tests/data/test.conf
tests/unit/map2/CMakeLists.txt
tests/unit/map2/map_insdel_int.cpp
tests/unit/map2/map_insdel_int.h
tests/unit/map2/map_insdel_int_multilevelhashmap.cpp [new file with mode: 0644]

index c9fcaaa5441930ccf0a127a9c8bb49f22a2d8e2f..8ae44546aaba111f4fbc1bf8e01fb3b39ff9cad7 100644 (file)
@@ -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
             */
index 9d9c05d1ebd171e69a5c32d3f45a9826569e981a..483a9d26bfb4ec6ace35c5785e31b4f5b90d7e4c 100644 (file)
@@ -57,6 +57,7 @@
     <ClCompile Include="..\..\..\tests\unit\map2\map_insdel_int_cuckoo.cpp" />\r
     <ClCompile Include="..\..\..\tests\unit\map2\map_insdel_int_ellentree.cpp" />\r
     <ClCompile Include="..\..\..\tests\unit\map2\map_insdel_int_michael.cpp" />\r
+    <ClCompile Include="..\..\..\tests\unit\map2\map_insdel_int_multilevelhashmap.cpp" />\r
     <ClCompile Include="..\..\..\tests\unit\map2\map_insdel_int_skip.cpp" />\r
     <ClCompile Include="..\..\..\tests\unit\map2\map_insdel_int_split.cpp" />\r
     <ClCompile Include="..\..\..\tests\unit\map2\map_insdel_int_striped.cpp" />\r
index 6b1098c0283a7bbf72212551607a2b301e7777c0..303b3d71a42e098d4b4f8130dc665489d2e082ef 100644 (file)
@@ -82,6 +82,9 @@
     <ClCompile Include="..\..\..\tests\unit\map2\map_insdel_string_striped.cpp">\r
       <Filter>map_insdel_string</Filter>\r
     </ClCompile>\r
+    <ClCompile Include="..\..\..\tests\unit\map2\map_insdel_int_multilevelhashmap.cpp">\r
+      <Filter>map_insdel_int</Filter>\r
+    </ClCompile>\r
   </ItemGroup>\r
   <ItemGroup>\r
     <Filter Include="map_insdel_func">\r
index 676f1e92868aaa5d8e469b9d5ce1cd9465cb6dbe..4ab10a2ddcadfda7766830f36f31f4cb2692d578 100644 (file)
@@ -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 \
index 7a1650be5e6fe136ed08f4358faa3e45752315d4..88c2207d1bdfe0e5b8b32b6f1056c57cad176a8a 100644 (file)
@@ -138,11 +138,15 @@ ThreadPassCount=8
 MapSize=50000\r
 MaxLoadFactor=4\r
 PrintGCStateFlag=1\r
-#Cuckoo map properties\r
+# *** Cuckoo map properties\r
 CuckooInitialSize=256\r
 CuckooProbesetSize=8\r
 # 0 - use default\r
 CuckooProbesetThreshold=0 \r
+# *** MultiLevelHashMap properties\r
+MultiLevelMapHeadBits=8\r
+MultiLevelMapArrayBits=4\r
+\r
 \r
 [Map_InsDel_func]\r
 InsertThreadCount=4\r
index 08c51269292edb53f63b4dcdd370f6ccd0094b28..a177efdc2b49564485ebc765aa4f21b13c396128 100644 (file)
@@ -136,11 +136,15 @@ ThreadPassCount=2
 MapSize=100000\r
 MaxLoadFactor=4\r
 PrintGCStateFlag=1\r
-#Cuckoo map properties\r
+# *** Cuckoo map properties\r
 CuckooInitialSize=1024\r
 CuckooProbesetSize=16\r
 # 0 - use default\r
 CuckooProbesetThreshold=0 \r
+# *** MultiLevelHashMap properties\r
+MultiLevelMapHeadBits=8\r
+MultiLevelMapArrayBits=4\r
+\r
 \r
 [Map_InsDel_func]\r
 InsertThreadCount=4\r
index f6663b318a5d3d4c75a257e991acd79f8c24ddf6..97eafc50bf2dc8c94e5e16ca838fc7c9dd15ef57 100644 (file)
@@ -131,11 +131,14 @@ ThreadPassCount=2
 MapSize=1000000\r
 MaxLoadFactor=4\r
 PrintGCStateFlag=1\r
-#Cuckoo map properties\r
+# *** Cuckoo map properties\r
 CuckooInitialSize=1024\r
 CuckooProbesetSize=16\r
 # 0 - use default\r
 CuckooProbesetThreshold=0 \r
+# *** MultiLevelHashMap properties\r
+MultiLevelMapHeadBits=10\r
+MultiLevelMapArrayBits=4\r
 \r
 [Map_InsDel_func]\r
 InsertThreadCount=4\r
index 88996ec251db8ad716d1d2f32049272c806ceb06..4d96a296de03b25009f322cb2b0ebf80f3a731c1 100644 (file)
@@ -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
index f824161efe7d4b50625e3e70cdaf09ca8b5026dc..cd63603934d7ca18b4a30ca828af84b8b69db316 100644 (file)
@@ -18,6 +18,9 @@ namespace map2 {
         c_nCuckooProbesetSize = cfg.getULong("CuckooProbesetSize", static_cast<unsigned long>(c_nCuckooProbesetSize) );
         c_nCuckooProbesetThreshold = cfg.getULong("CuckooProbesetThreshold", static_cast<unsigned long>(c_nCuckooProbesetThreshold) );
 
+        c_nMultiLevelMap_HeadBits = cfg.getULong("MultiLevelMapHeadBits", static_cast<unsigned long>(c_nMultiLevelMap_HeadBits) );
+        c_nMultiLevelMap_ArrayBits = cfg.getULong("MultiLevelMapArrayBits", static_cast<unsigned long>(c_nMultiLevelMap_ArrayBits) );
+
         c_bPrintGCState = cfg.getBool("PrintGCStateFlag", c_bPrintGCState );
 
         if ( c_nInsertThreadCount == 0 )
index 66cd88305353bffdd0798972da6ce098d61337f8..a36c64156cd46b811dc1bfac640f1744a053f3f4 100644 (file)
@@ -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 (file)
index 0000000..7ebbb33
--- /dev/null
@@ -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<typename map_type< TAG, key_type, value_type>::X>(); }
+#include "map2/map_defs.h"
+
+namespace map2 {
+    CDSUNIT_DECLARE_MultiLevelHashMap
+} // namespace map2