Disables running some stat analysis for benchmarks & Adds some sequential data structures
authorPeizhao Ou <peizhaoo@uci.edu>
Wed, 3 Jan 2018 22:25:54 +0000 (14:25 -0800)
committerPeizhao Ou <peizhaoo@uci.edu>
Wed, 3 Jan 2018 22:25:54 +0000 (14:25 -0800)
24 files changed:
test/stress/map/del3/map_del3.h
test/stress/map/delodd/map_delodd.h
test/stress/map/iter_erase/map_iter_erase.h
test/stress/map/minmax/map_minmax.h
test/stress/queue/pop.cpp
test/stress/queue/push.cpp
test/stress/sequential/sequential-set/CMakeLists.txt
test/stress/sequential/sequential-set/del3/set_del3.cpp
test/stress/sequential/sequential-set/del3/set_del3.h
test/stress/sequential/sequential-set/delodd/set_delodd.cpp
test/stress/sequential/sequential-set/delodd/set_delodd.h
test/stress/sequential/sequential-set/delodd/set_delodd_feldman_hashset.cpp
test/stress/sequential/sequential-set/insdel_find/set_insdelfind.cpp
test/stress/sequential/sequential-set/insdel_find/set_insdelfind.h
test/stress/sequential/sequential-set/insdel_func/set_insdel_func.cpp
test/stress/sequential/sequential-set/insdel_func/set_insdel_func.h
test/stress/sequential/sequential-set/insdel_func/set_insdel_func_feldman_hashset.cpp
test/stress/sequential/sequential-set/set_type_ellen_bintree.h
test/stress/set/del3/set_del3.h
test/stress/set/delodd/set_delodd.h
test/stress/set/iter_erase/set_iter_erase.h
test/stress/stack/intrusive_push_pop.cpp
test/stress/stack/push.cpp
test/stress/stack/push_pop.cpp

index b6ffb891b461f57034672bc12b907e5b90b6aa8b..e4f24bb1b80fc10c253a117301be00cd96ff7215 100644 (file)
@@ -29,6 +29,7 @@
 */
 
 #include "map_type.h"
 */
 
 #include "map_type.h"
+#include "../../misc/common.h"
 #include <cds/os/topology.h>
 
 namespace map {
 #include <cds/os/topology.h>
 
 namespace map {
@@ -691,7 +692,7 @@ namespace map {
                 << std::make_pair( "find_odd_success", nFindOddSuccess )
                 << std::make_pair( "find_odd_failed", nFindOddFailed );
 
                 << std::make_pair( "find_odd_success", nFindOddSuccess )
                 << std::make_pair( "find_odd_failed", nFindOddFailed );
 
-            analyze( testMap );
+            DEBUG(analyze( testMap ));
         }
 
         template <class Map>
         }
 
         template <class Map>
@@ -800,7 +801,7 @@ namespace map {
                 << std::make_pair( "find_odd_success", nFindOddSuccess )
                 << std::make_pair( "find_odd_failed", nFindOddFailed );
 
                 << std::make_pair( "find_odd_success", nFindOddSuccess )
                 << std::make_pair( "find_odd_failed", nFindOddFailed );
 
-            analyze( testMap );
+            DEBUG(analyze( testMap ));
         }
 
         template <class Map>
         }
 
         template <class Map>
index f4db078d192ca0938ef190859e71505e04948008..ea7a7fe5c7af1824965ae42c1d09aa077f8fbaf2 100644 (file)
@@ -29,6 +29,7 @@
 */
 
 #include "map_type.h"
 */
 
 #include "map_type.h"
+#include "../../misc/common.h"
 #include <cds/os/topology.h>
 
 namespace map {
 #include <cds/os/topology.h>
 
 namespace map {
@@ -691,7 +692,7 @@ namespace map {
                 << std::make_pair( "find_odd_success", nFindOddSuccess )
                 << std::make_pair( "find_odd_failed", nFindOddFailed );
 
                 << std::make_pair( "find_odd_success", nFindOddSuccess )
                 << std::make_pair( "find_odd_failed", nFindOddFailed );
 
-            analyze( testMap );
+            DEBUG(analyze( testMap ));
         }
 
         template <class Map>
         }
 
         template <class Map>
@@ -800,7 +801,7 @@ namespace map {
                 << std::make_pair( "find_odd_success", nFindOddSuccess )
                 << std::make_pair( "find_odd_failed", nFindOddFailed );
 
                 << std::make_pair( "find_odd_success", nFindOddSuccess )
                 << std::make_pair( "find_odd_failed", nFindOddFailed );
 
-            analyze( testMap );
+            DEBUG(analyze( testMap ));
         }
 
         template <class Map>
         }
 
         template <class Map>
index cceb358569c9be92c77a3293a9434bf08d7ca56f..073429c7218bd709f944b1875382238739617f28 100644 (file)
@@ -29,6 +29,7 @@
 */
 
 #include "map_type.h"
 */
 
 #include "map_type.h"
+#include "../../misc/common.h"
 #include <cds/os/topology.h>
 
 namespace map {
 #include <cds/os/topology.h>
 
 namespace map {
@@ -673,7 +674,7 @@ namespace map {
                 << std::make_pair( "find_odd_success", nFindOddSuccess )
                 << std::make_pair( "find_odd_failed", nFindOddFailed );
 
                 << std::make_pair( "find_odd_success", nFindOddSuccess )
                 << std::make_pair( "find_odd_failed", nFindOddFailed );
 
-            analyze( testMap );
+            DEBUG(analyze( testMap ));
         }
 
         template <typename Iterator, class Map>
         }
 
         template <typename Iterator, class Map>
@@ -782,7 +783,7 @@ namespace map {
                 << std::make_pair( "find_odd_success", nFindOddSuccess )
                 << std::make_pair( "find_odd_failed", nFindOddFailed );
 
                 << std::make_pair( "find_odd_success", nFindOddSuccess )
                 << std::make_pair( "find_odd_failed", nFindOddFailed );
 
-            analyze( testMap );
+            DEBUG(analyze( testMap ));
         }
 
         template <class Map>
         }
 
         template <class Map>
index 6958d727cb7cd511e0b8474dcb88fd5b2e4989dc..1efcb31bc0e024814edcf831701648fc0c8f75c4 100644 (file)
@@ -29,6 +29,7 @@
 */
 
 #include "map_type.h"
 */
 
 #include "map_type.h"
+#include "../../misc/common.h"
 #include <cds/os/topology.h>
 
 namespace map {
 #include <cds/os/topology.h>
 
 namespace map {
@@ -374,7 +375,7 @@ namespace map {
                 << std::make_pair( "extract_max", nDeleteMax )
                 << std::make_pair( "extract_max_failed", nDeleteMaxFailed );
 
                 << std::make_pair( "extract_max", nDeleteMax )
                 << std::make_pair( "extract_max_failed", nDeleteMaxFailed );
 
-            analyze( testMap );
+            DEBUG(analyze( testMap ));
         }
 
         template <class Map>
         }
 
         template <class Map>
index d6f49812c1a7aca055562ac4fe6c8d4a386c3ff3..4e50200c086be7a386a46fba8fc94b880fdd9ce4 100644 (file)
@@ -29,6 +29,7 @@
 */
 
 #include "queue_type.h"
 */
 
 #include "queue_type.h"
+#include "../misc/common.h"
 
 // Multi-threaded queue test for pop operation
 namespace {
 
 // Multi-threaded queue test for pop operation
 namespace {
@@ -160,7 +161,7 @@ namespace {
 
             propout() << std::make_pair( "duration", duration );
 
 
             propout() << std::make_pair( "duration", duration );
 
-            analyze( q );
+            DEBUG(analyze( q ));
 
             propout() << q.statistics();
         }
 
             propout() << q.statistics();
         }
index 57bb3697d8a30b441232de19a1eedc91c2244c8d..398ca66b197631ba53e1d9ec31310c5093461a2e 100644 (file)
@@ -29,6 +29,7 @@
 */
 
 #include "queue_type.h"
 */
 
 #include "queue_type.h"
+#include "../misc/common.h"
 
 // Multi-threaded queue test for push operation
 namespace {
 
 // Multi-threaded queue test for push operation
 namespace {
@@ -135,7 +136,7 @@ namespace {
 
             propout() << std::make_pair( "duration", duration );
 
 
             propout() << std::make_pair( "duration", duration );
 
-            analyze( q );
+            DEBUG(analyze( q ));
 
             propout() << q.statistics();
         }
 
             propout() << q.statistics();
         }
index b3ac996efb0674aee8a7d96b26cd76294925d3c1..b13ea77ace062e1ebfebb0bfc4572b4d5880417c 100644 (file)
@@ -1,8 +1,8 @@
 
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DCDSUNIT_USE_URCU")
 
 
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DCDSUNIT_USE_URCU")
 
-add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/delodd)
 add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/del3)
 add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/del3)
+add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/delodd)
 add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/insdel_find)
 add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/insdel_func)
 add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/insdel_string)
 add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/insdel_find)
 add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/insdel_func)
 add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/insdel_string)
@@ -11,8 +11,8 @@ add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/iter_erase)
 
 add_custom_target( stress-sequential-set
     DEPENDS
 
 add_custom_target( stress-sequential-set
     DEPENDS
-        stress-sequential-set-delodd
         stress-sequential-set-del3
         stress-sequential-set-del3
+        stress-sequential-set-delodd
         stress-sequential-set-insdelfind
         stress-sequential-set-insdel-func
         stress-sequential-set-insdel-string
         stress-sequential-set-insdelfind
         stress-sequential-set-insdel-func
         stress-sequential-set-insdel-string
index 4376fde720afa19ed5b338c194a7edc8db812893..2fd94c41f31d3ca351d7d164fa019bcb0eee93d8 100644 (file)
@@ -39,6 +39,7 @@ namespace set {
     size_t  Set_Del3::s_nExtractThreadCount = 4;
     size_t  Set_Del3::s_nFindThreadCount = 2;
     size_t  Set_Del3::s_nMaxLoadFactor = 8;
     size_t  Set_Del3::s_nExtractThreadCount = 4;
     size_t  Set_Del3::s_nFindThreadCount = 2;
     size_t  Set_Del3::s_nMaxLoadFactor = 8;
+
     size_t  Set_Del3::s_nPassCount = 100;
     size_t  Set_Del3::s_nFeldmanPassCount = 100;
     size_t  Set_Del3::s_nInsertPassCount = 1;
     size_t  Set_Del3::s_nPassCount = 100;
     size_t  Set_Del3::s_nFeldmanPassCount = 100;
     size_t  Set_Del3::s_nInsertPassCount = 1;
index 8a89c962c58a037dea2501a696245eaa2b09ddb4..fdea039d1d743ccdff0ac1056b6405f80361e896 100644 (file)
@@ -124,12 +124,13 @@ namespace set {
         static size_t s_nDelThreadCount;       // delete thread count
         static size_t s_nExtractThreadCount;   // extract thread count
         static size_t s_nMaxLoadFactor;        // maximum load factor
         static size_t s_nDelThreadCount;       // delete thread count
         static size_t s_nExtractThreadCount;   // extract thread count
         static size_t s_nMaxLoadFactor;        // maximum load factor
+        
         static size_t s_nPassCount;
         static size_t s_nFeldmanPassCount;
         static size_t s_nPassCount;
         static size_t s_nFeldmanPassCount;
-
         static size_t s_nInsertPassCount;
         static size_t s_nDeletePassCount;
         static size_t s_nFindPassCount;
         static size_t s_nInsertPassCount;
         static size_t s_nDeletePassCount;
         static size_t s_nFindPassCount;
+
         static size_t s_nFindThreadCount;      // find thread count
 
         static size_t s_nCuckooInitialSize;    // initial size for CuckooSet
         static size_t s_nFindThreadCount;      // find thread count
 
         static size_t s_nCuckooInitialSize;    // initial size for CuckooSet
index f454f1270e6aa065014cf62a3e1f99ca3f022572..0b9eba4e39d8626d4dcc8dd249ca79bca86dd9ca 100644 (file)
@@ -38,7 +38,12 @@ namespace set {
     size_t  Set_DelOdd::s_nExtractThreadCount = 4;
     size_t  Set_DelOdd::s_nFindThreadCount = 2;
     size_t  Set_DelOdd::s_nMaxLoadFactor = 8;
     size_t  Set_DelOdd::s_nExtractThreadCount = 4;
     size_t  Set_DelOdd::s_nFindThreadCount = 2;
     size_t  Set_DelOdd::s_nMaxLoadFactor = 8;
-    size_t  Set_DelOdd::s_nInsertPassCount = 100;
+
+    size_t  Set_DelOdd::s_nPassCount = 100;
+    size_t  Set_DelOdd::s_nFeldmanPassCount = 100;
+    size_t  Set_DelOdd::s_nInsertPassCount = 1;
+    size_t  Set_DelOdd::s_nDeletePassCount = 1;
+    size_t  Set_DelOdd::s_nFindPassCount = 10;
 
     size_t  Set_DelOdd::s_nCuckooInitialSize = 1024;
     size_t  Set_DelOdd::s_nCuckooProbesetSize = 16;
 
     size_t  Set_DelOdd::s_nCuckooInitialSize = 1024;
     size_t  Set_DelOdd::s_nCuckooProbesetSize = 16;
@@ -53,7 +58,7 @@ namespace set {
 
     void Set_DelOdd::SetUpTestCase()
     {
 
     void Set_DelOdd::SetUpTestCase()
     {
-        cds_test::config const& cfg = get_config( "map_delodd" );
+        cds_test::config const& cfg = get_config( "sequential_map_delodd" );
 
         s_nSetSize = cfg.get_size_t( "MapSize", s_nSetSize );
         if ( s_nSetSize < 1000 )
 
         s_nSetSize = cfg.get_size_t( "MapSize", s_nSetSize );
         if ( s_nSetSize < 1000 )
@@ -71,9 +76,27 @@ namespace set {
         if ( s_nMaxLoadFactor == 0 )
             s_nMaxLoadFactor = 1;
 
         if ( s_nMaxLoadFactor == 0 )
             s_nMaxLoadFactor = 1;
 
-        s_nInsertPassCount = cfg.get_size_t( "PassCount", s_nInsertPassCount );
+        s_nPassCount = cfg.get_size_t("PassCount", s_nPassCount);
+        if (s_nPassCount == 0)
+          s_nPassCount = 100;
+
+        s_nFeldmanPassCount =
+            cfg.get_size_t("FeldmanPassCount", s_nFeldmanPassCount);
+        if (s_nFeldmanPassCount == 0)
+          s_nFeldmanPassCount = 500;
+
+        s_nInsertPassCount = cfg.get_size_t( "InsertPassCount", s_nInsertPassCount );
         if ( s_nInsertPassCount == 0 )
         if ( s_nInsertPassCount == 0 )
-            s_nInsertPassCount = 100;
+            s_nInsertPassCount = 1;
+
+        s_nDeletePassCount = cfg.get_size_t( "DeletePassCount", s_nDeletePassCount );
+        if ( s_nDeletePassCount == 0 )
+            s_nDeletePassCount = 1;
+
+        s_nFindPassCount = cfg.get_size_t( "FindPassCount", s_nFindPassCount );
+        if ( s_nFindPassCount == 0 )
+            s_nFindPassCount = 10;
+
 
         s_nCuckooInitialSize = cfg.get_size_t( "CuckooInitialSize", s_nCuckooInitialSize );
         if ( s_nCuckooInitialSize < 256 )
 
         s_nCuckooInitialSize = cfg.get_size_t( "CuckooInitialSize", s_nCuckooInitialSize );
         if ( s_nCuckooInitialSize < 256 )
index 45302cd9da3762892d2f95380a554664180e6efc..8fc84402337dffed1e8348759a0091b119c82fdc 100644 (file)
@@ -122,7 +122,13 @@ namespace set {
         static size_t s_nDelThreadCount;       // delete thread count
         static size_t s_nExtractThreadCount;   // extract thread count
         static size_t s_nMaxLoadFactor;        // maximum load factor
         static size_t s_nDelThreadCount;       // delete thread count
         static size_t s_nExtractThreadCount;   // extract thread count
         static size_t s_nMaxLoadFactor;        // maximum load factor
+        
+        static size_t s_nPassCount;
+        static size_t s_nFeldmanPassCount;
         static size_t s_nInsertPassCount;
         static size_t s_nInsertPassCount;
+        static size_t s_nDeletePassCount;
+        static size_t s_nFindPassCount;
+
         static size_t s_nFindThreadCount;      // find thread count
 
         static size_t s_nCuckooInitialSize;    // initial size for CuckooSet
         static size_t s_nFindThreadCount;      // find thread count
 
         static size_t s_nCuckooInitialSize;    // initial size for CuckooSet
@@ -743,110 +749,137 @@ namespace set {
         }
 
         template <class Set>
         }
 
         template <class Set>
-        void do_test_extract_with( Set& testSet )
-        {
-            typedef Inserter<Set> insert_thread;
-            typedef Deleter<Set> delete_thread;
-            typedef Extractor< typename Set::gc, Set > extract_thread;
-            typedef Observer<Set> observer_thread;
-
-            m_nInsThreadCount.store( s_nInsThreadCount, atomics::memory_order_release );
-
-            cds_test::thread_pool& pool = get_pool();
-            pool.add( new insert_thread( pool, testSet ), s_nInsThreadCount );
-            if ( s_nDelThreadCount )
-                pool.add( new delete_thread( pool, testSet ), s_nDelThreadCount );
-            if ( s_nExtractThreadCount )
-                pool.add( new extract_thread( pool, testSet ), s_nExtractThreadCount );
-            if ( s_nFindThreadCount )
-                pool.add( new observer_thread( pool, testSet ), s_nFindThreadCount );
-
-            propout() << std::make_pair( "insert_thread_count", s_nInsThreadCount )
-                << std::make_pair( "delete_thread_count", s_nDelThreadCount )
-                << std::make_pair( "extract_thread_count", s_nExtractThreadCount )
-                << std::make_pair( "find_thread_count", s_nFindThreadCount )
-                << std::make_pair( "set_size", s_nSetSize )
-                << std::make_pair( "pass_count", s_nInsertPassCount );
-
-            std::chrono::milliseconds duration = pool.run();
-
-            propout() << std::make_pair( "duration", duration );
-
-            size_t nInsertInitFailed = 0;
-            size_t nInsertInitSuccess = 0;
-            size_t nInsertSuccess = 0;
-            size_t nInsertFailed = 0;
-            size_t nDeleteSuccess = 0;
-            size_t nDeleteFailed = 0;
-            size_t nExtractSuccess = 0;
-            size_t nExtractFailed = 0;
-
-            size_t nFindEvenSuccess = 0;
-            size_t nFindEvenFailed = 0;
-            size_t nFindOddSuccess = 0;
-            size_t nFindOddFailed = 0;
-
-            for ( size_t i = 0; i < pool.size(); ++i ) {
-                cds_test::thread& thr = pool.get( i );
-                switch ( thr.type()) {
-                case inserter_thread:
-                    {
-                        insert_thread& inserter = static_cast<insert_thread&>( thr );
-                        nInsertSuccess += inserter.m_nInsertSuccess;
-                        nInsertFailed += inserter.m_nInsertFailed;
-                        nInsertInitSuccess += inserter.m_nInsertInitSuccess;
-                        nInsertInitFailed += inserter.m_nInsertInitFailed;
-                    }
-                    break;
-                case deleter_thread:
-                    {
-                        delete_thread& deleter = static_cast<delete_thread&>(thr);
-                        nDeleteSuccess += deleter.m_nDeleteSuccess;
-                        nDeleteFailed += deleter.m_nDeleteFailed;
-                    }
-                    break;
-                case extractor_thread:
-                    {
-                        extract_thread& extractor = static_cast<extract_thread&>(thr);
-                        nExtractSuccess += extractor.m_nExtractSuccess;
-                        nExtractFailed += extractor.m_nExtractFailed;
-                    }
-                    break;
-                case find_thread:
-                    {
-                        observer_thread& observer = static_cast<observer_thread&>( thr );
-                        nFindEvenSuccess = observer.m_nFindEvenSuccess;
-                        nFindEvenFailed = observer.m_nFindEvenFailed;
-                        nFindOddSuccess = observer.m_nFindOddSuccess;
-                        nFindOddFailed = observer.m_nFindOddFailed;
-                    }
-                    break;
-                default:
-                    assert( false );
-                }
-            }
-
-            size_t const nInitialOddKeys = ( s_nSetSize * s_nInsThreadCount ) / 2;
-
-            EXPECT_EQ( nInsertInitFailed, 0u );
-            EXPECT_EQ( nInsertInitSuccess, s_nSetSize * s_nInsThreadCount );
-            EXPECT_EQ( nFindEvenFailed, 0u );
-            EXPECT_GE( nInsertSuccess + nInitialOddKeys, nDeleteSuccess + nExtractSuccess );
-            EXPECT_LE( nInsertSuccess, nDeleteSuccess + nExtractSuccess );
-
-            propout()
-                << std::make_pair( "insert_init_success", nInsertInitSuccess )
-                << std::make_pair( "insert_init_failed", nInsertInitFailed )
-                << std::make_pair( "insert_success", nInsertSuccess )
-                << std::make_pair( "insert_failed", nInsertFailed )
-                << std::make_pair( "delete_success", nDeleteSuccess )
-                << std::make_pair( "delete_failed", nDeleteFailed )
-                << std::make_pair( "extract_success", nExtractSuccess )
-                << std::make_pair( "extract_failed", nExtractFailed )
-                << std::make_pair( "find_even_success", nFindEvenSuccess )
-                << std::make_pair( "find_even_failed", nFindEvenFailed )
-                << std::make_pair( "find_odd_success", nFindOddSuccess )
-                << std::make_pair( "find_odd_failed", nFindOddFailed );
+        void do_test_extract_with(Set &testSet, size_t pass_count) {
+          typedef Inserter<Set> insert_thread;
+          typedef Deleter<Set> delete_thread;
+          typedef Extractor<typename Set::gc, Set> extract_thread;
+          typedef Observer<Set> observer_thread;
+
+          size_t nInsertSuccess = 0;
+          size_t nInsertFailed = 0;
+          size_t nDeleteSuccess = 0;
+          size_t nDeleteFailed = 0;
+          size_t nExtractSuccess = 0;
+          size_t nExtractFailed = 0;
+          size_t nFindEvenSuccess = 0;
+          size_t nFindEvenFailed = 0;
+          size_t nFindOddSuccess = 0;
+          size_t nFindOddFailed = 0;
+
+          auto reset_stat = [&]() {
+            nInsertSuccess = 0;
+            nInsertFailed = 0;
+            nDeleteSuccess = 0;
+            nDeleteFailed = 0;
+            nExtractSuccess = 0;
+            nExtractFailed = 0;
+            nFindEvenSuccess = 0;
+            nFindEvenFailed = 0;
+            nFindOddSuccess = 0;
+            nFindOddFailed = 0;
+          };
+
+          auto insert_func = [&]() {
+            for (auto el : m_arrData) {
+              if (testSet.insert(key_type(el, 0)))
+                ++nInsertSuccess;
+              else
+                ++nInsertFailed;
+            }
+          };
+
+          auto delete_func = [&]() {
+            for (auto el : m_arrData) {
+              if (el & 1) {
+                if (testSet.erase(key_type(el, 0)))
+                  ++nDeleteSuccess;
+                else
+                  ++nDeleteFailed;
+              }
+            }
+          };
+
+          auto extract_func = [&]() {
+            for (auto el : m_arrData) {
+              if (el & 1) {
+                auto gp = testSet.extract(key_type(el, 0));
+                if (gp)
+                  ++nExtractSuccess;
+                else
+                  ++nExtractFailed;
+                gp.release();
+              }
+            }
+          };
+
+          auto find_func = [&]() {
+            for (size_t el : m_arrData) {
+              if (el & 1) {
+                if (testSet.contains(key_thread(el, 0)))
+                  ++nFindOddSuccess;
+                else
+                  ++nFindOddFailed;
+              } else {
+                // even keys MUST be in the map
+                if (testSet.contains(key_thread(el, 0)))
+                  ++nFindEvenSuccess;
+                else
+                  ++nFindEvenFailed;
+              }
+            }
+          };
+
+          auto test_func = [&](size_t count, std::function<void()> func) {
+            for (size_t i = 0; i < count; ++i) {
+              func();
+            }
+          };
+
+          size_t const nInitialOddKeys = s_nSetSize / 2;
+          size_t const nInitialEvenKeys = s_nSetSize / 2;
+          for (size_t nPass = 0; nPass < pass_count; ++nPass) {
+            // Start with an empty set.
+            testSet.clear();
+            reset_stat();
+
+            test_func(s_nInsertPassCount, insert_func);
+            EXPECT_EQ(nInsertSuccess, s_nSetSize);
+            reset_stat();
+
+            test_func(s_nFindPassCount, find_func);
+            EXPECT_EQ(nFindEvenFailed, 0u);
+            EXPECT_EQ(nFindOddFailed, 0u);
+            reset_stat();
+
+            test_func(s_nDeletePassCount, delete_func);
+            EXPECT_EQ(nDeleteSuccess, nInitialOddKeys);
+            reset_stat();
+
+            test_func(s_nInsertPassCount, insert_func);
+            EXPECT_EQ(nInsertSuccess, nInitialOddKeys);
+            reset_stat();
+
+            test_func(s_nDeletePassCount, extract_func);
+            EXPECT_EQ(nExtractSuccess, nInitialOddKeys);
+            reset_stat();
+
+            test_func(s_nFindPassCount, find_func);
+            EXPECT_EQ(nFindEvenFailed, 0u);
+            EXPECT_EQ(nFindOddSuccess, 0u);
+          }
+
+          //          std::chrono::duration<double> time_elapsed;
+          //          std::chrono::duration<double> time_diff;
+          //          std::chrono::time_point<std::chrono::steady_clock>
+          //          time_start;
+          //          std::chrono::time_point<std::chrono::steady_clock>
+          //          time_end;
+          //          time_start = std::chrono::steady_clock::now();
+          //          time_end = std::chrono::steady_clock::now();
+          //          time_diff = time_end - time_start;
+          //          time_elapsed = time_diff;
+          //          std::cout << "Time elapsed: " << time_elapsed.count() <<
+          //          "\n";
         }
 
         template <typename Set>
         }
 
         template <typename Set>
@@ -882,13 +915,12 @@ namespace set {
         }
 
         template <class Set>
         }
 
         template <class Set>
-        void run_test_extract()
+        void run_test_extract(size_t pass_count = s_nPassCount)
         {
             static_assert( Set::c_bExtractSupported, "Set class must support extract() method" );
 
             Set  testSet( *this );
         {
             static_assert( Set::c_bExtractSupported, "Set class must support extract() method" );
 
             Set  testSet( *this );
-            do_test_extract_with( testSet );
-            analyze( testSet );
+            do_test_extract_with( testSet, pass_count);
         }
 
         template <class Map>
         }
 
         template <class Map>
@@ -908,11 +940,11 @@ namespace set {
         }
 
         template <class Set>
         }
 
         template <class Set>
-        void run_test_extract()
+        void run_test_extract(size_t pass_count = s_nPassCount)
         {
             s_nLoadFactor = GetParam();
             propout() << std::make_pair( "load_factor", s_nLoadFactor );
         {
             s_nLoadFactor = GetParam();
             propout() << std::make_pair( "load_factor", s_nLoadFactor );
-            Set_DelOdd::run_test_extract<Set>();
+            Set_DelOdd::run_test_extract<Set>(pass_count);
         }
 
         static std::vector<size_t> get_load_factors();
         }
 
         static std::vector<size_t> get_load_factors();
index 41a2dd4eb4c1ab575e8ad33b22bf939e8d4e2710..889efa169f6e5fb4321458619509fbbe0c685f61 100644 (file)
@@ -42,7 +42,7 @@ namespace set {
         };
         typedef typename Set::template rebind_traits< traits >::result set_type;
 
         };
         typedef typename Set::template rebind_traits< traits >::result set_type;
 
-        run_test_extract<set_type>();
+        run_test_extract<set_type>(s_nFeldmanPassCount);
     }
 
     CDSSTRESS_FeldmanHashSet_fixed( Set_DelOdd, run_feldman, key_thread, size_t )
     }
 
     CDSSTRESS_FeldmanHashSet_fixed( Set_DelOdd, run_feldman, key_thread, size_t )
index afcff02ce501325cd3cc599ba8e46e4336c219a8..a03a87a7f22d17c9f0eb7cca47484ccaf284b661 100644 (file)
@@ -33,6 +33,8 @@
 namespace set {
 
     size_t Set_InsDelFind::s_nSetSize = 500000;      // initial set size
 namespace set {
 
     size_t Set_InsDelFind::s_nSetSize = 500000;      // initial set size
+    size_t Set_InsDelFind::s_nPassCount = 500000;      // initial pass count 
+
     size_t Set_InsDelFind::s_nThreadCount = 8;       // thread count
     size_t Set_InsDelFind::s_nMaxLoadFactor = 8;     // maximum load factor
     unsigned int Set_InsDelFind::s_nInsertPercentage = 5;
     size_t Set_InsDelFind::s_nThreadCount = 8;       // thread count
     size_t Set_InsDelFind::s_nMaxLoadFactor = 8;     // maximum load factor
     unsigned int Set_InsDelFind::s_nInsertPercentage = 5;
@@ -51,12 +53,16 @@ namespace set {
 
     void Set_InsDelFind::SetUpTestCase()
     {
 
     void Set_InsDelFind::SetUpTestCase()
     {
-        cds_test::config const& cfg = get_config( "map_insdelfind" );
+        cds_test::config const& cfg = get_config( "sequential_map_insdelfind" );
 
         s_nSetSize = cfg.get_size_t( "InitialMapSize", s_nSetSize );
         if ( s_nSetSize < 1000 )
             s_nSetSize = 1000;
 
 
         s_nSetSize = cfg.get_size_t( "InitialMapSize", s_nSetSize );
         if ( s_nSetSize < 1000 )
             s_nSetSize = 1000;
 
+        s_nPassCount = cfg.get_size_t( "PassCount", s_nPassCount);
+        if ( s_nPassCount < 1000 )
+            s_nPassCount = 1000;
+
         s_nThreadCount = cfg.get_size_t( "ThreadCount", s_nThreadCount );
         if ( s_nThreadCount == 0 )
             s_nThreadCount = 2;
         s_nThreadCount = cfg.get_size_t( "ThreadCount", s_nThreadCount );
         if ( s_nThreadCount == 0 )
             s_nThreadCount = 2;
index c28ab90af53f40a089840f4a5126903b743ab5b6..ba9a8490134f7b740f885e2d649b3592d5dedd0d 100644 (file)
@@ -36,6 +36,7 @@ namespace set {
     {
     public:
         static size_t s_nSetSize;           // initial set size
     {
     public:
         static size_t s_nSetSize;           // initial set size
+        static size_t s_nPassCount;           // initial set size
         static size_t s_nThreadCount;       // thread count
         static size_t s_nMaxLoadFactor;     // maximum load factor
         static unsigned int s_nInsertPercentage;
         static size_t s_nThreadCount;       // thread count
         static size_t s_nMaxLoadFactor;     // maximum load factor
         static unsigned int s_nInsertPercentage;
@@ -105,9 +106,10 @@ namespace set {
 
                 unsigned int i = 0;
                 size_t const nNormalize = size_t(-1) / ( fixture.s_nSetSize * 2);
 
                 unsigned int i = 0;
                 size_t const nNormalize = size_t(-1) / ( fixture.s_nSetSize * 2);
+                size_t pass_count = fixture.s_nPassCount;
 
                 size_t nRand = 0;
 
                 size_t nRand = 0;
-                while ( !time_elapsed()) {
+                while ( pass_count-- ) {
                     nRand = cds::bitop::RandXorShift(nRand);
                     size_t n = nRand / nNormalize;
                     switch ( s_arrShuffle[i] ) {
                     nRand = cds::bitop::RandXorShift(nRand);
                     size_t n = nRand / nNormalize;
                     switch ( s_arrShuffle[i] ) {
@@ -155,8 +157,10 @@ namespace set {
                 delete [] pInitArr;
             }
 
                 delete [] pInitArr;
             }
 
+            s_nThreadCount = 1;
             cds_test::thread_pool& pool = get_pool();
             cds_test::thread_pool& pool = get_pool();
-            pool.add( new work_thread( pool, testSet ), s_nThreadCount );
+            std::unique_ptr<work_thread> worker(new work_thread(pool, testSet));
+            worker->test();
 
             propout() << std::make_pair( "thread_count", s_nThreadCount )
                 << std::make_pair( "set_size", s_nSetSize )
 
             propout() << std::make_pair( "thread_count", s_nThreadCount )
                 << std::make_pair( "set_size", s_nSetSize )
@@ -164,25 +168,19 @@ namespace set {
                 << std::make_pair( "delete_percentage", s_nDeletePercentage )
                 << std::make_pair( "total_duration", s_nDuration );
 
                 << std::make_pair( "delete_percentage", s_nDeletePercentage )
                 << std::make_pair( "total_duration", s_nDuration );
 
-            std::chrono::milliseconds duration = pool.run( std::chrono::seconds( s_nDuration ));
-
-            propout() << std::make_pair( "duration", duration );
-
             size_t nInsertSuccess = 0;
             size_t nInsertFailed = 0;
             size_t nDeleteSuccess = 0;
             size_t nDeleteFailed = 0;
             size_t nFindSuccess = 0;
             size_t nFindFailed = 0;
             size_t nInsertSuccess = 0;
             size_t nInsertFailed = 0;
             size_t nDeleteSuccess = 0;
             size_t nDeleteFailed = 0;
             size_t nFindSuccess = 0;
             size_t nFindFailed = 0;
-            for ( size_t i = 0; i < pool.size(); ++i ) {
-                work_thread& thr = static_cast<work_thread&>( pool.get( i ));
-                nInsertSuccess += thr.m_nInsertSuccess;
-                nInsertFailed  += thr.m_nInsertFailed;
-                nDeleteSuccess += thr.m_nDeleteSuccess;
-                nDeleteFailed  += thr.m_nDeleteFailed;
-                nFindSuccess   += thr.m_nFindSuccess;
-                nFindFailed    += thr.m_nFindFailed;
-            }
+            work_thread &thr = *worker;
+            nInsertSuccess += thr.m_nInsertSuccess;
+            nInsertFailed += thr.m_nInsertFailed;
+            nDeleteSuccess += thr.m_nDeleteSuccess;
+            nDeleteFailed += thr.m_nDeleteFailed;
+            nFindSuccess += thr.m_nFindSuccess;
+            nFindFailed += thr.m_nFindFailed;
 
             propout()
                 << std::make_pair( "insert_success", nInsertSuccess )
 
             propout()
                 << std::make_pair( "insert_success", nInsertSuccess )
@@ -192,13 +190,6 @@ namespace set {
                 << std::make_pair( "find_success", nFindSuccess )
                 << std::make_pair( "find_failed", nFindFailed );
 
                 << std::make_pair( "find_success", nFindSuccess )
                 << std::make_pair( "find_failed", nFindFailed );
 
-            {
-                ASSERT_TRUE( std::chrono::duration_cast<std::chrono::seconds>(duration).count() > 0 );
-                size_t nTotalOps = nInsertSuccess + nInsertFailed + nDeleteSuccess + nDeleteFailed + nFindSuccess + nFindFailed;
-                propout() << std::make_pair( "avg_speed", nTotalOps / std::chrono::duration_cast<std::chrono::seconds>(duration).count());
-            }
-
-
             testSet.clear();
             EXPECT_TRUE( testSet.empty()) << "set size=" << testSet.size();
 
             testSet.clear();
             EXPECT_TRUE( testSet.empty()) << "set size=" << testSet.size();
 
index 9ce8d9a50ce8adb670b0fbbd1d3bf8c164e133cb..5af59b98f77264863c6339d92094440c2be9748b 100644 (file)
@@ -37,6 +37,7 @@ namespace set {
     size_t Set_InsDel_func::s_nDeleteThreadCount = 4;  // count of deletion thread
     size_t Set_InsDel_func::s_nUpdateThreadCount = 4;  // count of ensure thread
     size_t Set_InsDel_func::s_nThreadPassCount = 4;    // pass count for each thread
     size_t Set_InsDel_func::s_nDeleteThreadCount = 4;  // count of deletion thread
     size_t Set_InsDel_func::s_nUpdateThreadCount = 4;  // count of ensure thread
     size_t Set_InsDel_func::s_nThreadPassCount = 4;    // pass count for each thread
+    size_t Set_InsDel_func::s_nFeldmanThreadPassCount = 4;    // pass count for each thread
     size_t Set_InsDel_func::s_nMaxLoadFactor = 8;      // maximum load factor
 
     size_t Set_InsDel_func::s_nCuckooInitialSize = 1024;// initial size for CuckooSet
     size_t Set_InsDel_func::s_nMaxLoadFactor = 8;      // maximum load factor
 
     size_t Set_InsDel_func::s_nCuckooInitialSize = 1024;// initial size for CuckooSet
@@ -50,7 +51,7 @@ namespace set {
 
     void Set_InsDel_func::SetUpTestCase()
     {
 
     void Set_InsDel_func::SetUpTestCase()
     {
-        cds_test::config const& cfg = get_config( "map_insdel_func" );
+        cds_test::config const& cfg = get_config( "sequential_map_insdel_func" );
 
         s_nSetSize = cfg.get_size_t( "MapSize", s_nSetSize );
         if ( s_nSetSize < 1000 )
 
         s_nSetSize = cfg.get_size_t( "MapSize", s_nSetSize );
         if ( s_nSetSize < 1000 )
@@ -72,6 +73,11 @@ namespace set {
         if ( s_nThreadPassCount == 0 )
             s_nThreadPassCount = 4;
 
         if ( s_nThreadPassCount == 0 )
             s_nThreadPassCount = 4;
 
+        s_nFeldmanThreadPassCount =
+            cfg.get_size_t("FeldmanThreadPassCount", s_nFeldmanThreadPassCount);
+        if (s_nFeldmanThreadPassCount == 0)
+          s_nFeldmanThreadPassCount = 4;
+
         s_nMaxLoadFactor = cfg.get_size_t( "MaxLoadFactor", s_nMaxLoadFactor );
         if ( s_nMaxLoadFactor == 0 )
             s_nMaxLoadFactor = 1;
         s_nMaxLoadFactor = cfg.get_size_t( "MaxLoadFactor", s_nMaxLoadFactor );
         if ( s_nMaxLoadFactor == 0 )
             s_nMaxLoadFactor = 1;
index d7b4439c0d8734cf7a764c110095790751d68c5f..7507b2fb90d79cfcf4fcc4fcd754b17f6149930f 100644 (file)
@@ -40,6 +40,7 @@ namespace set {
         static size_t s_nDeleteThreadCount;     // count of deletion thread
         static size_t s_nUpdateThreadCount;     // count of updating thread
         static size_t s_nThreadPassCount;       // pass count for each thread
         static size_t s_nDeleteThreadCount;     // count of deletion thread
         static size_t s_nUpdateThreadCount;     // count of updating thread
         static size_t s_nThreadPassCount;       // pass count for each thread
+        static size_t s_nFeldmanThreadPassCount;       // pass count for Feldman
         static size_t s_nMaxLoadFactor;         // maximum load factor
 
         static size_t s_nCuckooInitialSize;     // initial size for CuckooSet
         static size_t s_nMaxLoadFactor;         // maximum load factor
 
         static size_t s_nCuckooInitialSize;     // initial size for CuckooSet
@@ -168,29 +169,12 @@ namespace set {
 
                 // func is passed by reference
                 insert_functor  func;
 
                 // func is passed by reference
                 insert_functor  func;
-
-                if ( id() & 1 ) {
-                    for ( size_t nPass = 0; nPass < nPassCount; ++nPass ) {
-                        for ( size_t * p = pKeyFirst; p < pKeyLast; ++p ) {
-                            if ( rSet.insert( *p, std::ref( func )))
-                                ++m_nInsertSuccess;
-                            else
-                                ++m_nInsertFailed;
-                        }
-                    }
+                for (size_t *p = pKeyFirst; p < pKeyLast; ++p) {
+                  if (rSet.insert(*p, std::ref(func)))
+                    ++m_nInsertSuccess;
+                  else
+                    ++m_nInsertFailed;
                 }
                 }
-                else {
-                    for ( size_t nPass = 0; nPass < nPassCount; ++nPass ) {
-                        for ( size_t * p = pKeyLast - 1; p >= pKeyFirst; --p ) {
-                            if ( rSet.insert( *p, std::ref( func )))
-                                ++m_nInsertSuccess;
-                            else
-                                ++m_nInsertFailed;
-                        }
-                    }
-                }
-
-                m_nTestFunctorRef = func.nTestFunctorRef;
             }
         };
 
             }
         };
 
@@ -268,39 +252,17 @@ namespace set {
 
                 update_functor func;
 
 
                 update_functor func;
 
-                if ( id() & 1 ) {
-                    for ( size_t nPass = 0; nPass < nPassCount; ++nPass ) {
-                        for ( size_t * p = pKeyFirst; p < pKeyLast; ++p ) {
-                            std::pair<bool, bool> ret = rSet.update( *p, std::ref( func ), true );
-                            if ( ret.first  ) {
-                                if ( ret.second )
-                                    ++m_nUpdateCreated;
-                                else
-                                    ++m_nUpdateExisted;
-                            }
-                            else
-                                ++m_nUpdateFailed;
-                        }
-                    }
-                }
-                else {
-                    for ( size_t nPass = 0; nPass < nPassCount; ++nPass ) {
-                        for ( size_t * p = pKeyLast - 1 ; p >= pKeyFirst; --p ) {
-                            std::pair<bool, bool> ret = rSet.update( *p, std::ref( func ), true );
-                            if ( ret.first  ) {
-                                if ( ret.second )
-                                    ++m_nUpdateCreated;
-                                else
-                                    ++m_nUpdateExisted;
-                            }
-                            else
-                                ++m_nUpdateFailed;
-                        }
-                    }
+                for (size_t *p = pKeyFirst; p < pKeyLast; ++p) {
+                  std::pair<bool, bool> ret =
+                      rSet.update(*p, std::ref(func), true);
+                  if (ret.first) {
+                    if (ret.second)
+                      ++m_nUpdateCreated;
+                    else
+                      ++m_nUpdateExisted;
+                  } else
+                    ++m_nUpdateFailed;
                 }
                 }
-
-                m_nFunctorCreated = func.nCreated;
-                m_nFunctorModified = func.nModified;
             }
         };
 
             }
         };
 
@@ -381,38 +343,20 @@ namespace set {
 
                 erase_functor   func;
 
 
                 erase_functor   func;
 
-                if ( id() & 1 ) {
-                    for ( size_t nPass = 0; nPass < nPassCount; ++nPass ) {
-                        for ( size_t * p = pKeyFirst; p < pKeyLast; ++p ) {
-                            func.m_cnt.nKeyExpected = *p;
-                            if ( rSet.erase( *p, std::ref( func )))
-                                ++m_nDeleteSuccess;
-                            else
-                                ++m_nDeleteFailed;
-                        }
-                    }
-                }
-                else {
-                    for ( size_t nPass = 0; nPass < nPassCount; ++nPass ) {
-                        for ( size_t * p = pKeyLast - 1; p >= pKeyFirst; --p ) {
-                            func.m_cnt.nKeyExpected = *p;
-                            if ( rSet.erase( *p, std::ref( func )))
-                                ++m_nDeleteSuccess;
-                            else
-                                ++m_nDeleteFailed;
-                        }
-                    }
+                for (size_t *p = pKeyFirst; p < pKeyLast; ++p) {
+                  func.m_cnt.nKeyExpected = *p;
+                  if (rSet.erase(*p, std::ref(func)))
+                    ++m_nDeleteSuccess;
+                  else
+                    ++m_nDeleteFailed;
                 }
                 }
-
-                m_nValueSuccess = func.m_cnt.nSuccessItem;
-                m_nValueFailed = func.m_cnt.nFailedItem;
             }
         };
 
     protected:
 
         template <class Set>
             }
         };
 
     protected:
 
         template <class Set>
-        void run_test( Set& testSet )
+        void run_test( Set& testSet, size_t pass_count)
         {
             typedef Inserter<Set>       InserterThread;
             typedef Deleter<Set>        DeleterThread;
         {
             typedef Inserter<Set>       InserterThread;
             typedef Deleter<Set>        DeleterThread;
@@ -425,116 +369,46 @@ namespace set {
                 m_pKeyArr[i] = i;
             shuffle( m_pKeyFirst, m_pKeyLast );
 
                 m_pKeyArr[i] = i;
             shuffle( m_pKeyFirst, m_pKeyLast );
 
-            cds_test::thread_pool& pool = get_pool();
-            pool.add( new InserterThread( pool, testSet ), s_nInsertThreadCount );
-            pool.add( new DeleterThread( pool, testSet ),  s_nDeleteThreadCount );
-            pool.add( new UpdaterThread( pool, testSet ),  s_nUpdateThreadCount );
-
-            propout() << std::make_pair( "insert_thread_count", s_nInsertThreadCount )
-                << std::make_pair( "update_thread_count", s_nUpdateThreadCount )
-                << std::make_pair( "delete_thread_count", s_nDeleteThreadCount )
-                << std::make_pair( "thread_pass_count", s_nThreadPassCount )
-                << std::make_pair( "set_size", s_nSetSize );
-
-            std::chrono::milliseconds duration = pool.run();
-
-            propout() << std::make_pair( "duration", duration );
-
-            size_t nInsertSuccess = 0;
-            size_t nInsertFailed = 0;
-            size_t nDeleteSuccess = 0;
-            size_t nDeleteFailed = 0;
-            size_t nDelValueSuccess = 0;
-            size_t nDelValueFailed = 0;
-            size_t nUpdateFailed = 0;
-            size_t nUpdateCreated = 0;
-            size_t nUpdateModified = 0;
-            size_t nEnsFuncCreated = 0;
-            size_t nEnsFuncModified = 0;
-            size_t nTestFunctorRef = 0;
-
-            for ( size_t i = 0; i < pool.size(); ++i ) {
-                cds_test::thread& thr = pool.get( i );
-                switch ( thr.type()) {
-                case insert_thread:
-                    {
-                        InserterThread& inserter = static_cast<InserterThread&>( thr );
-                        nInsertSuccess  += inserter.m_nInsertSuccess;
-                        nInsertFailed   += inserter.m_nInsertFailed;
-                        nTestFunctorRef += inserter.m_nTestFunctorRef;
-                    }
-                    break;
-                case update_thread:
-                    {
-                        UpdaterThread& updater = static_cast<UpdaterThread&>(thr);
-                        nUpdateCreated   += updater.m_nUpdateCreated;
-                        nUpdateModified  += updater.m_nUpdateExisted;
-                        nUpdateFailed    += updater.m_nUpdateFailed;
-                        nEnsFuncCreated  += updater.m_nFunctorCreated;
-                        nEnsFuncModified += updater.m_nFunctorModified;
-                    }
-                    break;
-                case delete_thread:
-                    {
-                        DeleterThread& deleter = static_cast<DeleterThread&>(thr);
-                        nDeleteSuccess   += deleter.m_nDeleteSuccess;
-                        nDeleteFailed    += deleter.m_nDeleteFailed;
-                        nDelValueSuccess += deleter.m_nValueSuccess;
-                        nDelValueFailed  += deleter.m_nValueFailed;
-                    }
-                    break;
-                }
+            cds_test::thread_pool &pool = get_pool();
+            std::unique_ptr<InserterThread> inserter(
+                new InserterThread(pool, testSet));
+            std::unique_ptr<DeleterThread> deleter(
+                new DeleterThread(pool, testSet));
+            std::unique_ptr<UpdaterThread> updater(
+                new UpdaterThread(pool, testSet));
+
+            for (size_t i = 0; i < pass_count; i++) {
+              inserter->test();
+              updater->test();
+              deleter->test();
+              updater->test();
             }
 
             }
 
-            propout()
-                << std::make_pair( "insert_success", nInsertSuccess )
-                << std::make_pair( "delete_success", nDeleteSuccess )
-                << std::make_pair( "insert_failed", nInsertFailed )
-                << std::make_pair( "delete_failed", nDeleteFailed )
-                << std::make_pair( "update_created", nUpdateCreated )
-                << std::make_pair( "update_modified", nUpdateModified )
-                << std::make_pair( "update_failed", nUpdateFailed )
-                << std::make_pair( "final_set_size", testSet.size());
-
-
-            EXPECT_EQ( nDelValueFailed, 0u );
-            EXPECT_EQ( nDelValueSuccess, nDeleteSuccess );
-
-            EXPECT_EQ( nUpdateFailed, 0u );
-            EXPECT_EQ( nUpdateCreated, nEnsFuncCreated );
-            EXPECT_EQ( nUpdateModified, nEnsFuncModified );
-
-            // nTestFunctorRef is call count of insert functor
-            EXPECT_EQ( nTestFunctorRef, nInsertSuccess );
-
-            //testSet.clear();
-            for ( size_t * p = m_pKeyFirst; p != m_pKeyLast; ++p )
-                testSet.erase( *p );
-
+            for (size_t *p = m_pKeyFirst; p != m_pKeyLast; ++p)
+              testSet.erase(*p);
             EXPECT_TRUE( testSet.empty());
             EXPECT_EQ( testSet.size(), 0u );
             EXPECT_TRUE( testSet.empty());
             EXPECT_EQ( testSet.size(), 0u );
-
-            additional_check( testSet );
-            print_stat( propout(), testSet  );
-
-            additional_cleanup( testSet );
         }
 
         template <class Set>
         void run_test()
         {
             Set s( *this );
         }
 
         template <class Set>
         void run_test()
         {
             Set s( *this );
-            run_test( s );
+            run_test(s, s_nThreadPassCount);
         }
 
         template <class Set>
         }
 
         template <class Set>
-        void run_test2()
+        void run_feldman()
         {
             Set s( *this );
         {
             Set s( *this );
-            run_test( s );
+            run_test(s, s_nFeldmanThreadPassCount);
+        }
 
 
-            for ( auto it = s.begin(); it != s.end(); ++it )
-                std::cout << "key=" << it->key << std::endl;
+        template <class Set>
+        void run_test2()
+        {
+            Set s( *this );
+            run_test( s, s_nThreadPassCount);
         }
     };
 
         }
     };
 
index b918eb2b040553d55302b975718ff3c0f240047d..eda33747c25fad47a5f49c30b22c190a8335c7c1 100644 (file)
@@ -33,6 +33,6 @@
 
 namespace set {
 
 
 namespace set {
 
-    CDSSTRESS_FeldmanHashSet_fixed( Set_InsDel_func, run_test, size_t, value )
+    CDSSTRESS_FeldmanHashSet_fixed( Set_InsDel_func, run_feldman, size_t, value )
 
 } // namespace set
 
 } // namespace set
index fa5af50ec2ab50194c15953e0dcfa1b1b33bd527..d88a490574cb316075b3d9c124f2a79ebb9420a1 100644 (file)
@@ -337,7 +337,6 @@ namespace set {
 
 #define CDSSTRESS_EllenBinTreeSet_RCU( fixture, test_case, key_type, value_type ) \
     CDSSTRESS_EllenBinTreeSet_case( fixture, test_case, EllenBinTreeSet_rcu_gpb,        key_type, value_type ) \
 
 #define CDSSTRESS_EllenBinTreeSet_RCU( fixture, test_case, key_type, value_type ) \
     CDSSTRESS_EllenBinTreeSet_case( fixture, test_case, EllenBinTreeSet_rcu_gpb,        key_type, value_type ) \
-    CDSSTRESS_EllenBinTreeSet_case( fixture, test_case, EllenBinTreeSet_rcu_gpt,        key_type, value_type ) \
     CDSSTRESS_EllenBinTreeSet_RCU_1( fixture, test_case, key_type, value_type ) \
 
 #define CDSSTRESS_EllenBinTreeSet( fixture, test_case, key_type, value_type ) \
     CDSSTRESS_EllenBinTreeSet_RCU_1( fixture, test_case, key_type, value_type ) \
 
 #define CDSSTRESS_EllenBinTreeSet( fixture, test_case, key_type, value_type ) \
index 012cb9d3e7f2a1de1bfb8364854082e06d7b46d9..f53fb3d8c7b9f8b85533df7b13c6c34b3d20edaf 100644 (file)
@@ -29,6 +29,7 @@
 */
 
 #include "set_type.h"
 */
 
 #include "set_type.h"
+#include "../../misc/common.h"
 #include <cds/os/topology.h>
 
 namespace set {
 #include <cds/os/topology.h>
 
 namespace set {
@@ -878,7 +879,7 @@ namespace set {
 
             Set  testSet( *this );
             do_test_with( testSet );
 
             Set  testSet( *this );
             do_test_with( testSet );
-            analyze( testSet );
+            DEBUG(analyze( testSet ));
         }
 
         template <class Set>
         }
 
         template <class Set>
@@ -888,7 +889,7 @@ namespace set {
 
             Set  testSet( *this );
             do_test_extract_with( testSet );
 
             Set  testSet( *this );
             do_test_extract_with( testSet );
-            analyze( testSet );
+            DEBUG(analyze( testSet ));
         }
 
         template <class Map>
         }
 
         template <class Map>
index 45302cd9da3762892d2f95380a554664180e6efc..4f77e07782ba245faf3309522a62c29af0f59565 100644 (file)
@@ -29,6 +29,7 @@
 */
 
 #include "set_type.h"
 */
 
 #include "set_type.h"
+#include "../../misc/common.h"
 #include <cds/os/topology.h>
 
 namespace set {
 #include <cds/os/topology.h>
 
 namespace set {
@@ -878,7 +879,7 @@ namespace set {
 
             Set  testSet( *this );
             do_test_with( testSet );
 
             Set  testSet( *this );
             do_test_with( testSet );
-            analyze( testSet );
+            DEBUG(analyze( testSet ));
         }
 
         template <class Set>
         }
 
         template <class Set>
@@ -888,7 +889,7 @@ namespace set {
 
             Set  testSet( *this );
             do_test_extract_with( testSet );
 
             Set  testSet( *this );
             do_test_extract_with( testSet );
-            analyze( testSet );
+            DEBUG(analyze( testSet ));
         }
 
         template <class Map>
         }
 
         template <class Map>
index 1615311da8b8b3075f2c4e1909d6258f133c7f71..74a6cee20167c4915546103e4a645fc72dbc156c 100644 (file)
@@ -29,6 +29,7 @@
 */
 
 #include "set_type.h"
 */
 
 #include "set_type.h"
+#include "../../misc/common.h"
 #include <cds/os/topology.h>
 
 namespace set {
 #include <cds/os/topology.h>
 
 namespace set {
@@ -834,7 +835,7 @@ namespace set {
 
             Set  testSet( *this );
             do_test_with<Iterator>( testSet );
 
             Set  testSet( *this );
             do_test_with<Iterator>( testSet );
-            analyze( testSet );
+            DEBUG(analyze( testSet ));
         }
 
         template <class Set, typename Iterator=typename Set::iterator>
         }
 
         template <class Set, typename Iterator=typename Set::iterator>
@@ -844,7 +845,7 @@ namespace set {
 
             Set  testSet( *this );
             do_test_extract_with<Iterator>( testSet );
 
             Set  testSet( *this );
             do_test_extract_with<Iterator>( testSet );
-            analyze( testSet );
+            DEBUG(analyze( testSet ));
         }
 
         template <class Set>
         }
 
         template <class Set>
index 1b42e4bba67c491d5051c93ee00f47f2ccb60993..dc2161ccdda9a2e5ce18e845c6fe0d0c445d0c59 100644 (file)
@@ -29,6 +29,7 @@
 */
 
 #include "intrusive_stack_push_pop.h"
 */
 
 #include "intrusive_stack_push_pop.h"
+#include "../misc/common.h"
 
 namespace cds_test {
     /*static*/ size_t intrusive_stack_push_pop::s_nPushThreadCount = 4;
 
 namespace cds_test {
     /*static*/ size_t intrusive_stack_push_pop::s_nPushThreadCount = 4;
index 491ef1aff5c831127a7a7148e1e031361730851b..1d1fc5465309d7aa01e3f7149872dc604664e6ef 100644 (file)
@@ -29,6 +29,7 @@
 */
 
 #include "stack_type.h"
 */
 
 #include "stack_type.h"
+#include "../misc/common.h"
 
 namespace {
 
 
 namespace {
 
@@ -136,8 +137,7 @@ namespace {
 
             propout() << std::make_pair( "duration", duration );
 
 
             propout() << std::make_pair( "duration", duration );
 
-            analyze( stack );
-
+            DEBUG(analyze( stack ));
             propout() << stack.statistics();
         }
 
             propout() << stack.statistics();
         }
 
index a032ea510d8bd5a9c9469a4975df306e01d9cea2..a571e3efef94f87f741951da4d78dd8cb0d40c91 100644 (file)
@@ -29,6 +29,7 @@
 */
 
 #include "stack_type.h"
 */
 
 #include "stack_type.h"
+#include "../misc/common.h"
 
 namespace {
 
 
 namespace {
 
@@ -205,7 +206,7 @@ namespace {
 
             propout() << std::make_pair( "duration", duration );
 
 
             propout() << std::make_pair( "duration", duration );
 
-            analyze( stack );
+            DEBUG(analyze( stack ));
 
             propout() << stack.statistics();
         }
 
             propout() << stack.statistics();
         }