|
@@ -125,14 +125,25 @@ bool route_init()
|
|
|
printf("users_per_ing=%u, tot_msg_per_ing=%u, max_msg_from_each_ing=%u, max_round1_msgs=%u, users_per_stg=%u, tot_msg_per_stg=%u, max_msg_to_each_stg=%u, max_round2_msgs=%u, max_stg_msgs=%u\n", users_per_ing, tot_msg_per_ing, max_msg_from_each_ing, max_round1_msgs, users_per_stg, tot_msg_per_stg, max_msg_to_each_stg, max_round2_msgs, max_stg_msgs);
|
|
|
*/
|
|
|
|
|
|
+#ifdef TRACK_HEAP_USAGE
|
|
|
+ printf("route_init H1 heap %u\n", g_peak_heap_used);
|
|
|
+#endif
|
|
|
// Create the route state
|
|
|
uint8_t my_roles = g_teems_config.roles[g_teems_config.my_node_num];
|
|
|
try {
|
|
|
if (my_roles & ROLE_INGESTION) {
|
|
|
route_state.ingbuf.alloc(tot_msg_per_ing);
|
|
|
}
|
|
|
+#ifdef TRACK_HEAP_USAGE
|
|
|
+ printf("route_init alloc %u msgs\n", tot_msg_per_ing);
|
|
|
+ printf("route_init H2 heap %u\n", g_peak_heap_used);
|
|
|
+#endif
|
|
|
if (my_roles & ROLE_ROUTING) {
|
|
|
route_state.round1.alloc(max_round2_msgs);
|
|
|
+#ifdef TRACK_HEAP_USAGE
|
|
|
+ printf("route_init alloc %u msgs\n", max_round2_msgs);
|
|
|
+ printf("route_init H3 heap %u\n", g_peak_heap_used);
|
|
|
+#endif
|
|
|
if (!g_teems_config.private_routing) {
|
|
|
route_state.round1a.alloc(max_round1a_msgs);
|
|
|
route_state.round1a_sorted.alloc(max_round1a_msgs);
|
|
@@ -140,10 +151,22 @@ bool route_init()
|
|
|
route_state.round1b_prev.alloc(2*max_round1b_msgs_to_adj_rtr);
|
|
|
route_state.round1b_next.alloc(2*max_round1b_msgs_to_adj_rtr);
|
|
|
route_state.round1c.alloc(max_round1c_msgs);
|
|
|
+#ifdef TRACK_HEAP_USAGE
|
|
|
+ printf("route_init alloc %u msgs\n", max_round1a_msgs);
|
|
|
+ printf("route_init alloc %u msgs\n", max_round1a_msgs);
|
|
|
+ printf("route_init alloc %u msgs\n", 2*max_round1b_msgs_to_adj_rtr);
|
|
|
+ printf("route_init alloc %u msgs\n", 2*max_round1b_msgs_to_adj_rtr);
|
|
|
+ printf("route_init alloc %u msgs\n", max_round1c_msgs);
|
|
|
+ printf("route_init H4 heap %u\n", g_peak_heap_used);
|
|
|
+#endif
|
|
|
}
|
|
|
}
|
|
|
if (my_roles & ROLE_STORAGE) {
|
|
|
route_state.round2.alloc(max_stg_msgs);
|
|
|
+#ifdef TRACK_HEAP_USAGE
|
|
|
+ printf("route_init alloc %u msgs\n", max_stg_msgs);
|
|
|
+ printf("route_init H5 heap %u\n", g_peak_heap_used);
|
|
|
+#endif
|
|
|
if (!storage_init(users_per_stg, max_stg_msgs)) {
|
|
|
return false;
|
|
|
}
|
|
@@ -182,6 +205,9 @@ bool route_init()
|
|
|
}
|
|
|
#ifdef PROFILE_ROUTING
|
|
|
printf_with_rtclock_diff(start, "end precompute evalplans\n");
|
|
|
+#endif
|
|
|
+#ifdef TRACK_HEAP_USAGE
|
|
|
+ printf("route_init end heap %u\n", g_peak_heap_used);
|
|
|
#endif
|
|
|
return true;
|
|
|
}
|