From 334b14ae855230b5c23fa71a6f99ee2d9386fea2 Mon Sep 17 00:00:00 2001 From: mubarak Date: Mon, 18 Jun 2018 13:33:41 -0400 Subject: [PATCH] changes to VC assignment and statistics recording --- src/networks/model-net/dragonfly-custom.C | 51 ++++++++++------------- 1 file changed, 22 insertions(+), 29 deletions(-) diff --git a/src/networks/model-net/dragonfly-custom.C b/src/networks/model-net/dragonfly-custom.C index e66e4c0..d2cbd68 100644 --- a/src/networks/model-net/dragonfly-custom.C +++ b/src/networks/model-net/dragonfly-custom.C @@ -366,7 +366,6 @@ struct router_state int* cur_hist_num; char output_buf[4096]; - char output_buf2[4096]; struct dfly_router_sample * rsamples; @@ -2294,24 +2293,25 @@ void dragonfly_custom_router_final(router_state * s, s->busy_time[d]); } } - map< int, vector > &curMap = interGroupLinks[s->router_id]; map< int, vector >::iterator it = curMap.begin(); for(; it != curMap.end(); it++) { - int grp_id = it->first; - int dest_rtr_id = interGroupLinks[s->router_id][grp_id][0].dest; - /* TODO: Works only for 1-D dragonfly right now. Make it functional + /* TODO: Works only for single global connections right now. Make it functional * for a 2-D dragonfly. */ - int offset = interGroupLinks[s->router_id][grp_id][0].offset; - written += sprintf(s->output_buf + written, "\n%d %s %d %s %s %llu %lf", - s->router_id, - "R", - dest_rtr_id, - "R", - "G", - s->link_traffic[offset], - s->busy_time[offset]); + for(int l = 0; l < it->second.size(); l++) { + int dest_rtr_id = it->second[l].dest; + int offset = it->second[l].offset; + assert(offset >= 0 && offset < p->num_global_channels); + written += sprintf(s->output_buf + written, "\n%d %s %d %s %s %llu %lf", + s->router_id, + "R", + dest_rtr_id, + "R", + "G", + s->link_traffic[offset], + s->busy_time[offset]); + } } sprintf(s->output_buf + written, "\n"); lp_io_write(lp->gid, (char*)"dragonfly-link-stats", written, s->output_buf); @@ -3277,30 +3277,23 @@ router_packet_receive( router_state * s, output_chan = 0; 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_l_hop < 1) { - cur_chunk->msg.my_l_hop = 1; - } + output_chan = 1; } else if (cur_chunk->msg.my_g_hop == 2) { - if(cur_chunk->msg.my_l_hop < 4) { - cur_chunk->msg.my_l_hop = 4; - } + output_chan = 3; } } else { - /*if(cur_chunk->msg.my_g_hop == 1) { - if(cur_chunk->msg.my_l_hop < 1){ - cur_chunk->msg.my_l_hop = 1; - } + /* TODO: Recheck VC count after things are in order for a 2-D dragonfly. */ + if(cur_chunk->msg.my_g_hop == 1) { + output_chan = 2; } - else*/ if (cur_chunk->msg.my_g_hop == 2) { - if(cur_chunk->msg.my_l_hop < 2) - cur_chunk->msg.my_l_hop = 2; + else if (cur_chunk->msg.my_g_hop == 2) { + output_chan = 6; } } - output_chan = cur_chunk->msg.my_l_hop; max_vc_size = s->params->local_vc_size; cur_chunk->msg.my_l_hop++; } else if(output_port < (s->params->intra_grp_radix + -- 2.26.2