shardsim
shardsim copied to clipboard
Add parameter to override rng seed
While playing with ignore-msb-bits param, there were lots of variance in node overcommit result caused by the rng picking a different seed every run. Possibly confusing an user who expects the param affects sharding inside a node, not distribution across nodes.
It's good to allow the user to feed a consistent seed across runs, such that the results with different ignore-msb-bits values will be less impacted by that variance.
BEFORE:
$ ./shardsim --nodes 10 --vnodes 32 --shard 12 --ignore-msb-bits 0 10 nodes, 32 vnodes, 12 shards maximum node overcommit: 1.29554 maximum shard overcommit: 3.833120
$ ./shardsim --nodes 10 --vnodes 32 --shard 12 --ignore-msb-bits 12 10 nodes, 32 vnodes, 12 shards maximum node overcommit: 1.17842 maximum shard overcommit: 1.184462
AFTER:
$ ./shardsim --nodes 10 --vnodes 32 --shard 12 --ignore-msb-bits 0 --random-seed 690930217 10 nodes, 32 vnodes, 12 shards maximum node overcommit: 1.23774 maximum shard overcommit: 3.793953
$ ./shardsim --nodes 10 --vnodes 32 --shard 12 --ignore-msb-bits 12 --random-seed 690930217 10 nodes, 32 vnodes, 12 shards maximum node overcommit: 1.23774 maximum shard overcommit: 1.240964
Signed-off-by: Raphael S. Carvalho [email protected]