8d933e7dac3e36c187c2b81e13a40164a91299f7
[libcds.git] / tests / unit / map2 / map_delodd.cpp
1 //$$CDS-header$$
2
3 #include "map2/map_delodd.h"
4
5 namespace map2 {
6     CPPUNIT_TEST_SUITE_REGISTRATION( Map_DelOdd );
7
8     void Map_DelOdd::setUpParams( const CppUnitMini::TestCfg& cfg ) {
9         c_nMapSize = cfg.getSizeT("MapSize", c_nMapSize );
10         c_nInsThreadCount = cfg.getSizeT("InsThreadCount", c_nInsThreadCount );
11         c_nDelThreadCount = cfg.getSizeT("DelThreadCount", c_nDelThreadCount );
12         c_nExtractThreadCount = cfg.getSizeT("ExtractThreadCount", c_nExtractThreadCount );
13         c_nMaxLoadFactor = cfg.getSizeT("MaxLoadFactor", c_nMaxLoadFactor );
14         c_bPrintGCState = cfg.getBool("PrintGCStateFlag", true );
15
16         c_nCuckooInitialSize = cfg.getSizeT("CuckooInitialSize", c_nCuckooInitialSize );
17         c_nCuckooProbesetSize = cfg.getSizeT("CuckooProbesetSize", c_nCuckooProbesetSize );
18         c_nCuckooProbesetThreshold = cfg.getSizeT("CuckooProbesetThreshold", c_nCuckooProbesetThreshold );
19
20         c_nFeldmanMap_HeadBits = cfg.getSizeT("FeldmanMapHeadBits", c_nFeldmanMap_HeadBits);
21         c_nFeldmanMap_ArrayBits = cfg.getSizeT("FeldmanMapArrayBits", c_nFeldmanMap_ArrayBits);
22
23         if ( c_nInsThreadCount == 0 )
24             c_nInsThreadCount = cds::OS::topology::processor_count();
25         if ( c_nDelThreadCount == 0 && c_nExtractThreadCount == 0 ) {
26             c_nExtractThreadCount = cds::OS::topology::processor_count() / 2;
27             c_nDelThreadCount = cds::OS::topology::processor_count() - c_nExtractThreadCount;
28         }
29
30         m_arrInsert.resize( c_nMapSize );
31         m_arrRemove.resize( c_nMapSize );
32         for ( size_t i = 0; i < c_nMapSize; ++i ) {
33             m_arrInsert[i] = i;
34             m_arrRemove[i] = i;
35         }
36         shuffle( m_arrInsert.begin(), m_arrInsert.end() );
37         shuffle( m_arrRemove.begin(), m_arrRemove.end() );
38     }
39
40 } // namespace map2