add config.validatorBasedCustody
the overall number of row/columns taken into custody by a node is determined by a base number (custody) and a class specific multiplier (validatorsPerNode). We support two models: - validatorsBasedCustody: each validator has a unique subset of size custody, and custody is the union of these. I.e. VPN is a "probabilistic multiplier" - !validatorsBasedCustody: VPN is interpreted as a simple custody multiplier Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
This commit is contained in:
parent
3292d70c1a
commit
a634aa07e0
27
DAS/node.py
27
DAS/node.py
|
@ -78,21 +78,22 @@ class Node:
|
||||||
|
|
||||||
self.rowIDs = set(rows)
|
self.rowIDs = set(rows)
|
||||||
self.columnIDs = set(columns)
|
self.columnIDs = set(columns)
|
||||||
if (self.vpn * self.shape.custodyRows) > self.shape.nbRows:
|
if config.validatorBasedCustody:
|
||||||
self.logger.warning("Row custody (*vpn) larger than number of rows!", extra=self.format)
|
for v in validators:
|
||||||
self.rowIDs = range(self.shape.nbRows)
|
self.rowIDs = self.rowIDs.union(v.rowIDs)
|
||||||
|
self.columnIDs = self.columnIDs.union(v.columnIDs)
|
||||||
else:
|
else:
|
||||||
self.rowIDs = set(random.sample(range(self.shape.nbRows), self.vpn*self.shape.custodyRows))
|
if (self.vpn * self.shape.custodyRows) > self.shape.nbRows:
|
||||||
|
self.logger.warning("Row custody (*vpn) larger than number of rows!", extra=self.format)
|
||||||
|
self.rowIDs = range(self.shape.nbRows)
|
||||||
|
else:
|
||||||
|
self.rowIDs = set(random.sample(range(self.shape.nbRows), self.vpn*self.shape.custodyRows))
|
||||||
|
|
||||||
if (self.vpn * self.shape.custodyCols) > self.shape.nbCols:
|
if (self.vpn * self.shape.custodyCols) > self.shape.nbCols:
|
||||||
self.logger.warning("Column custody (*vpn) larger than number of columns!", extra=self.format)
|
self.logger.warning("Column custody (*vpn) larger than number of columns!", extra=self.format)
|
||||||
self.columnIDs = range(self.shape.nbCols)
|
self.columnIDs = range(self.shape.nbCols)
|
||||||
else:
|
else:
|
||||||
self.columnIDs = set(random.sample(range(self.shape.nbCols), self.vpn*self.shape.custodyCols))
|
self.columnIDs = set(random.sample(range(self.shape.nbCols), self.vpn*self.shape.custodyCols))
|
||||||
|
|
||||||
#for v in validators:
|
|
||||||
# self.rowIDs = self.rowIDs.union(v.rowIDs)
|
|
||||||
# self.columnIDs = self.columnIDs.union(v.columnIDs)
|
|
||||||
|
|
||||||
self.rowNeighbors = collections.defaultdict(dict)
|
self.rowNeighbors = collections.defaultdict(dict)
|
||||||
self.columnNeighbors = collections.defaultdict(dict)
|
self.columnNeighbors = collections.defaultdict(dict)
|
||||||
|
|
|
@ -62,7 +62,13 @@ blockSizes = range(64, 113, 128)
|
||||||
# Per-topic mesh neighborhood size
|
# Per-topic mesh neighborhood size
|
||||||
netDegrees = range(8, 9, 2)
|
netDegrees = range(8, 9, 2)
|
||||||
|
|
||||||
# number of rows and columns a validator is interested in
|
# the overall number of row/columns taken into custody by a node is determined by
|
||||||
|
# a base number (custody) and a class specific multiplier (validatorsPerNode).
|
||||||
|
# We support two models:
|
||||||
|
# - validatorsBasedCustody: each validator has a unique subset of size custody,
|
||||||
|
# and custody is the union of these. I.e. VPN is a "probabilistic multiplier"
|
||||||
|
# - !validatorsBasedCustody: VPN is interpreted as a simple custody multiplier
|
||||||
|
validatorBasedCustody = False
|
||||||
custody = [2]
|
custody = [2]
|
||||||
|
|
||||||
# ratio of class1 nodes (see below for parameters per class)
|
# ratio of class1 nodes (see below for parameters per class)
|
||||||
|
|
Loading…
Reference in New Issue