...
 
Commits (1)
...@@ -2983,13 +2983,13 @@ void dragonfly_plus_terminal_final(terminal_state *s, tw_lp *lp) ...@@ -2983,13 +2983,13 @@ void dragonfly_plus_terminal_final(terminal_state *s, tw_lp *lp)
lp_io_write(lp->gid, (char*)"dragonfly-plus-link-stats", written, s->output_buf); lp_io_write(lp->gid, (char*)"dragonfly-plus-link-stats", written, s->output_buf);
if (s->terminal_id == 0) { // if (s->terminal_id == 0) {
char meta_filename[64]; // char meta_filename[64];
sprintf(meta_filename, "dragonfly-plus-cn-stats.meta"); // sprintf(meta_filename, "dragonfly-plus-cn-stats.meta");
FILE * fp = fopen(meta_filename, "w+"); // FILE * fp = fopen(meta_filename, "w+");
fprintf(fp, "# Format <LP id> <Terminal ID> <Total Data Size> <Avg packet latency> <# Flits/Packets finished> <Busy Time> <Max packet Latency> <Min packet Latency >\n"); // fprintf(fp, "# Format <LP id> <Terminal ID> <Total Data Size> <Avg packet latency> <# Flits/Packets finished> <Busy Time> <Max packet Latency> <Min packet Latency >\n");
} // }
written = 0; written = 0;
written += sprintf(s->output_buf2 + written, "%llu %llu %lf %lf %lf %lf %llu %lf\n", written += sprintf(s->output_buf2 + written, "%llu %llu %lf %lf %lf %lf %llu %lf\n",
...@@ -3084,24 +3084,25 @@ void dragonfly_plus_router_final(router_state *s, tw_lp *lp) ...@@ -3084,24 +3084,25 @@ void dragonfly_plus_router_final(router_state *s, tw_lp *lp)
const dragonfly_plus_param *p = s->params; const dragonfly_plus_param *p = s->params;
int written = 0; int written = 0;
int src_rel_id = s->router_id % p->num_routers;
int local_grp_id = s->router_id / p->num_routers;
for( int d = 0; d < p->intra_grp_radix; d++) vector< Connection > my_local_links = s->connMan->get_connections_by_type(CONN_LOCAL);
for(vector<Connection>::iterator it = my_local_links.begin() ; it != my_local_links.end(); it++)
{ {
if (d != src_rel_id) { int dest_rtr_id = it->dest_gid;
int dest_ab_id = local_grp_id * p->num_routers + d; int port_no = it->port;
written += sprintf(s->output_buf + written, "\n%d %s %d %s %s %llu %lf", assert(port_no >= 0 && port_no < p->radix);
s->router_id, // Format <source_id> <source_type> <dest_id> < dest_type> <link_type> <link_traffic> <link_saturation>
"R", written += sprintf(s->output_buf + written, "\n%d %s %d %s %s %llu %lf",
dest_ab_id, s->router_id,
"R", "R",
"L", dest_rtr_id,
s->link_traffic[d], "R",
s->busy_time[d] ); "L",
} s->link_traffic[port_no],
s->busy_time[port_no] );
} }
vector< Connection > my_global_links = s->connMan->get_connections_by_type(CONN_GLOBAL); vector< Connection > my_global_links = s->connMan->get_connections_by_type(CONN_GLOBAL);
vector< Connection >::iterator it = my_global_links.begin(); vector< Connection >::iterator it = my_global_links.begin();
...@@ -3110,6 +3111,7 @@ void dragonfly_plus_router_final(router_state *s, tw_lp *lp) ...@@ -3110,6 +3111,7 @@ void dragonfly_plus_router_final(router_state *s, tw_lp *lp)
int dest_rtr_id = it->dest_gid; int dest_rtr_id = it->dest_gid;
int port_no = it->port; int port_no = it->port;
assert(port_no >= 0 && port_no < p->radix); assert(port_no >= 0 && port_no < p->radix);
// Format <source_id> <source_type> <dest_id> < dest_type> <link_type> <link_traffic> <link_saturation>
written += sprintf(s->output_buf + written, "\n%d %s %d %s %s %llu %lf", written += sprintf(s->output_buf + written, "\n%d %s %d %s %s %llu %lf",
s->router_id, s->router_id,
"R", "R",
......