Commit 885cbe26 authored by Misbah Mubarak's avatar Misbah Mubarak
Browse files

Updates to dragonfly network model: decreasing the event count

parent 14a299b8
...@@ -141,9 +141,6 @@ struct terminal_state ...@@ -141,9 +141,6 @@ struct terminal_state
const char * anno; const char * anno;
const dragonfly_param *params; const dragonfly_param *params;
/* self suspend mode to the dragonfly */
int suspend;
}; };
/* terminal event type (1-4) */ /* terminal event type (1-4) */
...@@ -594,6 +591,10 @@ static void packet_generate_send_rc(terminal_state * s, ...@@ -594,6 +591,10 @@ static void packet_generate_send_rc(terminal_state * s,
if (msg->chunk_id == (msg->num_chunks-1)){ if (msg->chunk_id == (msg->num_chunks-1)){
codes_local_latency_reverse(lp); codes_local_latency_reverse(lp);
} }
if(bf->c1)
codes_local_latency_reverse(lp);
struct mn_stats* stat; struct mn_stats* stat;
stat = model_net_find_stats(msg->category, s->dragonfly_stats_array); stat = model_net_find_stats(msg->category, s->dragonfly_stats_array);
stat->send_count--; stat->send_count--;
...@@ -625,7 +626,6 @@ static void packet_generate_send(terminal_state * s, ...@@ -625,7 +626,6 @@ static void packet_generate_send(terminal_state * s,
msg->num_chunks = num_chunks; msg->num_chunks = num_chunks;
msg->packet_ID = lp->gid + g_tw_nlp * s->packet_counter + tw_rand_integer(lp->rng, 0, lp->gid + g_tw_nlp * s->packet_counter); msg->packet_ID = lp->gid + g_tw_nlp * s->packet_counter + tw_rand_integer(lp->rng, 0, lp->gid + g_tw_nlp * s->packet_counter);
msg->travel_start_time = tw_now(lp);
// Each packet is broken into chunks and then sent over the channel // Each packet is broken into chunks and then sent over the channel
msg->saved_available_time = s->terminal_available_time; msg->saved_available_time = s->terminal_available_time;
...@@ -634,10 +634,13 @@ static void packet_generate_send(terminal_state * s, ...@@ -634,10 +634,13 @@ static void packet_generate_send(terminal_state * s,
s->terminal_available_time = maxd(s->terminal_available_time, tw_now(lp)); s->terminal_available_time = maxd(s->terminal_available_time, tw_now(lp));
s->terminal_available_time += ts; s->terminal_available_time += ts;
if(msg->chunk_id == 0)
msg->travel_start_time = tw_now(lp);
int chan = -1, j; int chan = -1, j;
for(j = 0; j < p->num_vcs; j++) for(j = 0; j < p->num_vcs; j++)
{ {
if(s->vc_occupancy[j] < p->cn_vc_size * num_chunks) if(s->vc_occupancy[j] < p->cn_vc_size)
{ {
chan=j; chan=j;
break; break;
...@@ -716,7 +719,7 @@ static void packet_generate_send(terminal_state * s, ...@@ -716,7 +719,7 @@ static void packet_generate_send(terminal_state * s,
stat = model_net_find_stats(msg->category, s->dragonfly_stats_array); stat = model_net_find_stats(msg->category, s->dragonfly_stats_array);
stat->send_count++; stat->send_count++;
stat->send_bytes += msg->packet_size; stat->send_bytes += msg->packet_size;
stat->send_time += (1/p->cn_bandwidth) * msg->packet_size; stat->send_time += (s->terminal_available_time - tw_now(lp));
if(stat->max_event_size < total_event_size) if(stat->max_event_size < total_event_size)
stat->max_event_size = total_event_size; stat->max_event_size = total_event_size;
...@@ -730,8 +733,7 @@ static void packet_generate_send(terminal_state * s, ...@@ -730,8 +733,7 @@ static void packet_generate_send(terminal_state * s,
void * m_gen_data; void * m_gen_data;
/* Keep the packet generate event a little behind packet send */ /* Keep the packet generate event a little behind packet send */
ts = codes_local_latency(lp); ts = s->terminal_available_time - tw_now(lp) + codes_local_latency(lp);
e_gen = model_net_method_event_new(lp->gid, ts, lp, DRAGONFLY, (void**)&m_gen,(void**)&m_gen_data); e_gen = model_net_method_event_new(lp->gid, ts, lp, DRAGONFLY, (void**)&m_gen,(void**)&m_gen_data);
void *m_gen_data_src = model_net_method_get_edata(DRAGONFLY, msg); void *m_gen_data_src = model_net_method_get_edata(DRAGONFLY, msg);
...@@ -755,13 +757,6 @@ static void packet_generate_send(terminal_state * s, ...@@ -755,13 +757,6 @@ static void packet_generate_send(terminal_state * s,
return; return;
} }
static void packet_send_rc(terminal_state * s,
tw_bf * bf,
terminal_message * msg,
tw_lp * lp)
{
}
static void packet_arrive_rc(terminal_state * s, static void packet_arrive_rc(terminal_state * s,
tw_bf * bf, tw_bf * bf,
terminal_message * msg, terminal_message * msg,
...@@ -783,7 +778,7 @@ static void packet_arrive_rc(terminal_state * s, ...@@ -783,7 +778,7 @@ static void packet_arrive_rc(terminal_state * s,
tw_rand_reverse_unif(lp->rng); tw_rand_reverse_unif(lp->rng);
s->next_credit_available_time = msg->saved_credit_time; s->next_credit_available_time = msg->saved_credit_time;
if(msg->chunk_id == (msg->num_chunks)-1) if(msg->chunk_id == num_chunks-1)
{ {
mn_stats* stat; mn_stats* stat;
stat = model_net_find_stats(msg->category, s->dragonfly_stats_array); stat = model_net_find_stats(msg->category, s->dragonfly_stats_array);
...@@ -1249,11 +1244,18 @@ terminal_buf_update(terminal_state * s, ...@@ -1249,11 +1244,18 @@ terminal_buf_update(terminal_state * s,
{ {
// Update the buffer space associated with this router LP // Update the buffer space associated with this router LP
int msg_indx = msg->vc_index; int msg_indx = msg->vc_index;
s->vc_occupancy[msg_indx]--; s->vc_occupancy[msg_indx]--;
assert(s->vc_occupancy[msg_indx] >= 0);
s->output_vc_state[msg_indx] = VC_IDLE; s->output_vc_state[msg_indx] = VC_IDLE;
if(s->vc_occupancy[msg_indx] < 0)
{
char buf[64];
int written = sprintf(buf,
"terminal %d: error vc occupancy \n",
lp->gid);
lp_io_write(lp->gid, "errors", written, buf);
}
return; return;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment