From cfd3f3c2a1658d166cc961e31a4b8c91e156ae30 Mon Sep 17 00:00:00 2001 From: Peizhao Ou Date: Thu, 15 Feb 2018 14:17:41 -0800 Subject: [PATCH] Constrain parallel map keys to a smaller range --- test/stress/map/insdelfind/map_insdelfind.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/stress/map/insdelfind/map_insdelfind.h b/test/stress/map/insdelfind/map_insdelfind.h index 296b1dad..69cb7021 100644 --- a/test/stress/map/insdelfind/map_insdelfind.h +++ b/test/stress/map/insdelfind/map_insdelfind.h @@ -143,11 +143,12 @@ namespace map { unsigned int i = 0; size_t const nNormalize = size_t(-1) / ( s_nMapSize * 2 ); + size_t const nKeyRange = s_nMapSize * 4; size_t nRand = 0; for (size_t pCount = 0; pCount < s_nPassCount; pCount++) { nRand = cds::bitop::RandXorShift( nRand ); - size_t key = nRand / nNormalize; + size_t key = nRand % nKeyRange + s_nMapSize; nRand = cds::bitop::RandXorShift( nRand ); size_t value = nRand / nNormalize; switch ( s_arrShuffle[i] ) { -- 2.34.1