|
@@ -433,7 +433,6 @@ static void send_round1_msgs(const uint8_t *msgs, const uint64_t *indices,
|
|
|
void ecall_routing_proceed(void *cbpointer)
|
|
|
{
|
|
|
if (route_state.step == ROUTE_NOT_STARTED) {
|
|
|
-
|
|
|
route_state.cbpointer = cbpointer;
|
|
|
MsgBuffer &round1 = route_state.round1;
|
|
|
|
|
@@ -452,9 +451,30 @@ void ecall_routing_proceed(void *cbpointer)
|
|
|
sort_mtobliv(g_teems_config.nthreads, round1.buf,
|
|
|
g_teems_config.msg_size, round1.inserted,
|
|
|
route_state.tot_msg_per_ing, send_round1_msgs);
|
|
|
- round1.reset();
|
|
|
#ifdef PROFILE_ROUTING
|
|
|
printf_with_rtclock_diff(start, "end oblivious sort (%u,%u)\n", inserted, route_state.tot_msg_per_ing);
|
|
|
#endif
|
|
|
+ round1.reset();
|
|
|
+ pthread_mutex_unlock(&round1.mutex);
|
|
|
+ } else if (route_state.step == ROUTE_ROUND_1) {
|
|
|
+ route_state.cbpointer = cbpointer;
|
|
|
+ MsgBuffer &round2 = route_state.round2;
|
|
|
+
|
|
|
+ pthread_mutex_lock(&round2.mutex);
|
|
|
+ // Ensure there are no pending messages currently being inserted
|
|
|
+ // into the buffer
|
|
|
+ while (round2.reserved != round2.inserted) {
|
|
|
+ pthread_mutex_unlock(&round2.mutex);
|
|
|
+ pthread_mutex_lock(&round2.mutex);
|
|
|
+ }
|
|
|
+
|
|
|
+ uint32_t msg_size = g_teems_config.msg_size;
|
|
|
+ for(uint32_t i=0;i<round2.inserted;++i) {
|
|
|
+ uint32_t destaddr = *(uint32_t*)(round2.buf+i*msg_size);
|
|
|
+ printf("%08x\n", destaddr);
|
|
|
+ }
|
|
|
+
|
|
|
+ round2.reset();
|
|
|
+ pthread_mutex_unlock(&round2.mutex);
|
|
|
}
|
|
|
}
|