Commit 334b14ae authored by Misbah Mubarak's avatar Misbah Mubarak

changes to VC assignment and statistics recording

parent 80f4b79d
...@@ -366,7 +366,6 @@ struct router_state ...@@ -366,7 +366,6 @@ struct router_state
int* cur_hist_num; int* cur_hist_num;
char output_buf[4096]; char output_buf[4096];
char output_buf2[4096];
struct dfly_router_sample * rsamples; struct dfly_router_sample * rsamples;
...@@ -2294,24 +2293,25 @@ void dragonfly_custom_router_final(router_state * s, ...@@ -2294,24 +2293,25 @@ void dragonfly_custom_router_final(router_state * s,
s->busy_time[d]); s->busy_time[d]);
} }
} }
map< int, vector<bLink> > &curMap = interGroupLinks[s->router_id]; map< int, vector<bLink> > &curMap = interGroupLinks[s->router_id];
map< int, vector<bLink> >::iterator it = curMap.begin(); map< int, vector<bLink> >::iterator it = curMap.begin();
for(; it != curMap.end(); it++) for(; it != curMap.end(); it++)
{ {
int grp_id = it->first; /* TODO: Works only for single global connections right now. Make it functional
int dest_rtr_id = interGroupLinks[s->router_id][grp_id][0].dest;
/* TODO: Works only for 1-D dragonfly right now. Make it functional
* for a 2-D dragonfly. */ * for a 2-D dragonfly. */
int offset = interGroupLinks[s->router_id][grp_id][0].offset; for(int l = 0; l < it->second.size(); l++) {
written += sprintf(s->output_buf + written, "\n%d %s %d %s %s %llu %lf", int dest_rtr_id = it->second[l].dest;
s->router_id, int offset = it->second[l].offset;
"R", assert(offset >= 0 && offset < p->num_global_channels);
dest_rtr_id, written += sprintf(s->output_buf + written, "\n%d %s %d %s %s %llu %lf",
"R", s->router_id,
"G", "R",
s->link_traffic[offset], dest_rtr_id,
s->busy_time[offset]); "R",
"G",
s->link_traffic[offset],
s->busy_time[offset]);
}
} }
sprintf(s->output_buf + written, "\n"); sprintf(s->output_buf + written, "\n");
lp_io_write(lp->gid, (char*)"dragonfly-link-stats", written, s->output_buf); lp_io_write(lp->gid, (char*)"dragonfly-link-stats", written, s->output_buf);
...@@ -3277,30 +3277,23 @@ router_packet_receive( router_state * s, ...@@ -3277,30 +3277,23 @@ router_packet_receive( router_state * s,
output_chan = 0; output_chan = 0;
if(output_port < s->params->intra_grp_radix) { if(output_port < s->params->intra_grp_radix) {
if(DF_DALLY == 0) if(DF_DALLY == 1)
{ {
if(cur_chunk->msg.my_g_hop == 1) { if(cur_chunk->msg.my_g_hop == 1) {
if(cur_chunk->msg.my_l_hop < 1) { output_chan = 1;
cur_chunk->msg.my_l_hop = 1;
}
} else if (cur_chunk->msg.my_g_hop == 2) { } else if (cur_chunk->msg.my_g_hop == 2) {
if(cur_chunk->msg.my_l_hop < 4) { output_chan = 3;
cur_chunk->msg.my_l_hop = 4;
}
} }
} }
else { else {
/*if(cur_chunk->msg.my_g_hop == 1) { /* TODO: Recheck VC count after things are in order for a 2-D dragonfly. */
if(cur_chunk->msg.my_l_hop < 1){ if(cur_chunk->msg.my_g_hop == 1) {
cur_chunk->msg.my_l_hop = 1; output_chan = 2;
}
} }
else*/ if (cur_chunk->msg.my_g_hop == 2) { else if (cur_chunk->msg.my_g_hop == 2) {
if(cur_chunk->msg.my_l_hop < 2) output_chan = 6;
cur_chunk->msg.my_l_hop = 2;
} }
} }
output_chan = cur_chunk->msg.my_l_hop;
max_vc_size = s->params->local_vc_size; max_vc_size = s->params->local_vc_size;
cur_chunk->msg.my_l_hop++; cur_chunk->msg.my_l_hop++;
} else if(output_port < (s->params->intra_grp_radix + } else if(output_port < (s->params->intra_grp_radix +
......
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