69b78ab5d4db85d9f465cda8776eeebeb74d3234
[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_nMultiLevelMap_HeadBits = cfg.getSizeT("MultiLevelMapHeadBits", c_nMultiLevelMap_HeadBits);
21         c_nMultiLevelMap_ArrayBits = cfg.getSizeT("MultiLevelMapArrayBits", c_nMultiLevelMap_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