|
@@ -5,6 +5,7 @@
|
|
|
#include "sort.hpp"
|
|
|
#include "comms.hpp"
|
|
|
#include "obliv.hpp"
|
|
|
+#include "storage.hpp"
|
|
|
#include "route.hpp"
|
|
|
|
|
|
#define PROFILE_ROUTING
|
|
@@ -574,13 +575,15 @@ void ecall_routing_proceed(void *cbpointer)
|
|
|
// Sort the messages we've received
|
|
|
#ifdef PROFILE_ROUTING
|
|
|
uint32_t inserted = ingbuf.inserted;
|
|
|
- unsigned long start = printf_with_rtclock("begin oblivious sort (%u,%u)\n", inserted, route_state.tot_msg_per_ing);
|
|
|
+ unsigned long start_round1 = printf_with_rtclock("begin round1 processing (%u)\n", inserted);
|
|
|
+ unsigned long start_sort = printf_with_rtclock("begin oblivious sort (%u,%u)\n", inserted, route_state.tot_msg_per_ing);
|
|
|
#endif
|
|
|
sort_mtobliv(g_teems_config.nthreads, ingbuf.buf,
|
|
|
g_teems_config.msg_size, ingbuf.inserted,
|
|
|
route_state.tot_msg_per_ing, send_round1_msgs);
|
|
|
#ifdef PROFILE_ROUTING
|
|
|
- printf_with_rtclock_diff(start, "end oblivious sort (%u,%u)\n", inserted, route_state.tot_msg_per_ing);
|
|
|
+ printf_with_rtclock_diff(start_sort, "end oblivious sort (%u,%u)\n", inserted, route_state.tot_msg_per_ing);
|
|
|
+ printf_with_rtclock_diff(start_round1, "end round1 processing (%u)\n", inserted);
|
|
|
#endif
|
|
|
ingbuf.reset();
|
|
|
pthread_mutex_unlock(&ingbuf.mutex);
|
|
@@ -708,7 +711,6 @@ void ecall_routing_proceed(void *cbpointer)
|
|
|
}
|
|
|
} else if (route_state.step == ROUTE_ROUND_2) {
|
|
|
if (my_roles & ROLE_STORAGE) {
|
|
|
- uint16_t msg_size = g_teems_config.msg_size;
|
|
|
MsgBuffer &round2 = route_state.round2;
|
|
|
|
|
|
pthread_mutex_lock(&round2.mutex);
|
|
@@ -719,12 +721,13 @@ void ecall_routing_proceed(void *cbpointer)
|
|
|
pthread_mutex_lock(&round2.mutex);
|
|
|
}
|
|
|
|
|
|
- printf("Storage server received %u messages:\n", round2.inserted);
|
|
|
- const uint8_t *buf = round2.buf;
|
|
|
- for (uint32_t i=0; i<round2.inserted; ++i) {
|
|
|
- printf("%08x\n", *(const uint32_t*)buf);
|
|
|
- buf += msg_size;
|
|
|
- }
|
|
|
+#ifdef PROFILE_ROUTING
|
|
|
+ unsigned long start = printf_with_rtclock("begin storage processing (%u)\n", round2.inserted);
|
|
|
+#endif
|
|
|
+ storage_received(round2.buf, round2.inserted);
|
|
|
+#ifdef PROFILE_ROUTING
|
|
|
+ printf_with_rtclock_diff(start, "end storage processing (%u)\n", round2.inserted);
|
|
|
+#endif
|
|
|
|
|
|
round2.reset();
|
|
|
pthread_mutex_unlock(&round2.mutex);
|