Просмотр исходного кода

The round1a buffer size needs to be a multiple of the number of routers

Ian Goldberg 1 год назад
Родитель
Сommit
a0037dae9f
1 измененных файлов с 5 добавлено и 1 удалено
  1. 5 1
      Enclave/route.cpp

+ 5 - 1
Enclave/route.cpp

@@ -118,7 +118,11 @@ bool route_init()
     uint32_t max_round1b_msgs_to_adj_rtr =
         (g_teems_config.num_routing_nodes-1)*(g_teems_config.num_routing_nodes-1);
     // Ensure columnroute constraint that column height is >= 2*(num_routing_nodes-1)^2
-    uint32_t max_round1a_msgs = std::max(max_round1_msgs, 2*max_round1b_msgs_to_adj_rtr);
+    // and round up to 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) *
+        g_teems_config.num_routing_nodes;
     uint32_t max_round1c_msgs = max_round1a_msgs;
 
     /*