From b22a096cbc3fdb02aea6b2062cb3774d99c21e29 Mon Sep 17 00:00:00 2001 From: Csaba Kiraly Date: Fri, 1 Mar 2024 12:32:19 +0100 Subject: [PATCH] set number of copies of rows/columns published Sets how many copies are sent out by the block producer over rows and over columns. Note, previously this was set to match netDegree in both dimensions. We keep this default. Signed-off-by: Csaba Kiraly --- DAS/simulator.py | 7 ++++--- smallConf.py | 5 +++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/DAS/simulator.py b/DAS/simulator.py index a51a291..0253bd4 100644 --- a/DAS/simulator.py +++ b/DAS/simulator.py @@ -41,7 +41,8 @@ class Simulator: # pushed out by the proposer. # 1: the data is sent out exactly once on rows and once on columns (2 copies in total) # self.shape.netDegree: default behavior similar (but not same) to previous code - self.proposerPublishTo = self.shape.netDegree # TODO: make this an external parameter + self.proposerPublishToR = config.evalConf(self, config.proposerPublishToR, shape) + self.proposerPublishToC = config.evalConf(self, config.proposerPublishToR, shape) def initValidators(self): """It initializes all the validators in the network.""" @@ -171,12 +172,12 @@ class Simulator: for v in self.validators: if (self.proposerPublishOnly and v.amIproposer): for id in v.rowIDs: - count = min(self.proposerPublishTo, len(rowChannels[id])) + count = min(self.proposerPublishToR, len(rowChannels[id])) publishTo = random.sample(rowChannels[id], count) for vi in publishTo: v.rowNeighbors[id].update({vi.ID : Neighbor(vi, 0, self.shape.blockSizeR)}) for id in v.columnIDs: - count = min(self.proposerPublishTo, len(columnChannels[id])) + count = min(self.proposerPublishToC, len(columnChannels[id])) publishTo = random.sample(columnChannels[id], count) for vi in publishTo: v.columnNeighbors[id].update({vi.ID : Neighbor(vi, 1, self.shape.blockSizeC)}) diff --git a/smallConf.py b/smallConf.py index 065561c..530fb7e 100644 --- a/smallConf.py +++ b/smallConf.py @@ -62,6 +62,11 @@ blockSizes = range(64, 113, 128) # Per-topic mesh neighborhood size netDegrees = range(8, 9, 2) +# How many copies are sent out by the block producer +# Note, previously this was set to match netDegree +proposerPublishToR = "shape.netDegree" +proposerPublishToC = "shape.netDegree" + # number of rows and columns a validator is interested in chis = range(2, 3, 2)