Browse Source

Ensuring the size of the blocks sent in round1b are a multiple of the number of routing nodes removes the ceilings and + 1 issues

Ian Goldberg 11 months ago
parent
commit
d210fca4b1
1 changed files with 7 additions and 6 deletions
  1. 7 6
      Enclave/route.cpp

+ 7 - 6
Enclave/route.cpp

@@ -91,9 +91,6 @@ bool route_init()
     uint32_t max_msg_to_each_stg;
     max_msg_to_each_stg = CEILDIV(tot_msg_per_stg, g_teems_config.tot_weight) *
         g_teems_config.my_weight;
-    if (!g_teems_config.private_routing) {
-        max_msg_to_each_stg += 1;
-    }
 
     // But we can't send more messages to each storage server than we
     // could receive in total
@@ -118,10 +115,14 @@ bool route_init()
 
     // Calculating public-routing buffer sizes
     // Weights are not used in public routing
-    uint32_t max_round1b_msgs_to_adj_rtr =
-        (g_teems_config.num_routing_nodes-1)*(g_teems_config.num_routing_nodes-1);
+    // Round up to a multiple of num_routing_nodes
+    uint32_t max_round1b_msgs_to_adj_rtr = CEILDIV(
+        (g_teems_config.num_routing_nodes-1)*(g_teems_config.num_routing_nodes-1),
+        g_teems_config.num_routing_nodes) *
+        g_teems_config.num_routing_nodes;
+
     // Ensure columnroute constraint that column height is >= 2*(num_routing_nodes-1)^2
-    // and round up to a multiple of num_routing_nodes
+    // and a multiple of num_routing_nodes
     uint32_t max_round1a_msgs = CEILDIV(
         std::max(max_round1_msgs, 2*max_round1b_msgs_to_adj_rtr),
         g_teems_config.num_routing_nodes) *