Commit 3059a209 authored by Jonathan Jenkins's avatar Jonathan Jenkins
Browse files

warning squash modelnet (didn't touch the workload programs)

parent aa8aca21
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
// for printf conversions: shorthand for cast to long long unsigned format (llu) // for printf conversions: shorthand for cast to long long unsigned format (llu)
#define LLU(x) ((unsigned long long)(x)) #define LLU(x) ((unsigned long long)(x))
#define LLD(x) ((long long)(x))
// simple deprecation attribute hacking // simple deprecation attribute hacking
#if !defined(DEPRECATED) #if !defined(DEPRECATED)
......
...@@ -51,7 +51,7 @@ struct terminal_message ...@@ -51,7 +51,7 @@ struct terminal_message
int last_hop; int last_hop;
/* For routing */ /* For routing */
int intm_group_id; int intm_group_id;
int chunk_id; uint64_t chunk_id;
uint64_t packet_size; uint64_t packet_size;
uint64_t message_id; uint64_t message_id;
uint64_t total_size; uint64_t total_size;
......
...@@ -79,7 +79,7 @@ struct nodes_message ...@@ -79,7 +79,7 @@ struct nodes_message
int saved_queue; int saved_queue;
/* chunk id of the flit (distinguishes flits) */ /* chunk id of the flit (distinguishes flits) */
int chunk_id; uint64_t chunk_id;
model_net_event_return event_rc; model_net_event_return event_rc;
int is_pull; int is_pull;
......
...@@ -36,8 +36,8 @@ ...@@ -36,8 +36,8 @@
#define DFLY_HASH_TABLE_SIZE 262144 #define DFLY_HASH_TABLE_SIZE 262144
// debugging parameters // debugging parameters
#define TRACK -1 #define TRACK LLU(-1)
#define TRACK_PKT -1 #define TRACK_PKT LLU(-1)
#define TRACK_MSG -1 #define TRACK_MSG -1
#define PRINT_ROUTER_TABLE 1 #define PRINT_ROUTER_TABLE 1
#define DEBUG 0 #define DEBUG 0
...@@ -108,7 +108,7 @@ struct dragonfly_param ...@@ -108,7 +108,7 @@ struct dragonfly_param
int chunk_size; /* full-sized packets are broken into smaller chunks.*/ int chunk_size; /* full-sized packets are broken into smaller chunks.*/
// derived parameters // derived parameters
int num_cn; int num_cn;
int num_groups; unsigned int num_groups;
int radix; int radix;
int total_routers; int total_routers;
int total_terminals; int total_terminals;
...@@ -349,12 +349,6 @@ static int dragonfly_get_msg_sz(void) ...@@ -349,12 +349,6 @@ static int dragonfly_get_msg_sz(void)
return sizeof(terminal_message); return sizeof(terminal_message);
} }
static void free_tmp(void * ptr)
{
struct dfly_qhash_entry * dfly = ptr;
free(dfly->remote_event_data);
free(dfly);
}
static void append_to_terminal_message_list( static void append_to_terminal_message_list(
terminal_message_list ** thisq, terminal_message_list ** thisq,
terminal_message_list ** thistail, terminal_message_list ** thistail,
...@@ -383,6 +377,8 @@ static void prepend_to_terminal_message_list( ...@@ -383,6 +377,8 @@ static void prepend_to_terminal_message_list(
thisq[index] = msg; thisq[index] = msg;
} }
#if 0
// calls commented out - remove entirely?
static void create_prepend_to_terminal_message_list( static void create_prepend_to_terminal_message_list(
terminal_message_list ** thisq, terminal_message_list ** thisq,
terminal_message_list ** thistail, terminal_message_list ** thistail,
...@@ -399,6 +395,7 @@ static void create_prepend_to_terminal_message_list( ...@@ -399,6 +395,7 @@ static void create_prepend_to_terminal_message_list(
} }
prepend_to_terminal_message_list( thisq, thistail, index, new_entry); prepend_to_terminal_message_list( thisq, thistail, index, new_entry);
} }
#endif
static terminal_message_list* return_head( static terminal_message_list* return_head(
terminal_message_list ** thisq, terminal_message_list ** thisq,
...@@ -541,7 +538,7 @@ static void dragonfly_configure(){ ...@@ -541,7 +538,7 @@ static void dragonfly_configure(){
num_params = anno_map->num_annos + (anno_map->has_unanno_lp > 0); num_params = anno_map->num_annos + (anno_map->has_unanno_lp > 0);
all_params = malloc(num_params * sizeof(*all_params)); all_params = malloc(num_params * sizeof(*all_params));
for (uint64_t i = 0; i < anno_map->num_annos; i++){ for (int i = 0; i < anno_map->num_annos; i++){
const char * anno = anno_map->annotations[i].ptr; const char * anno = anno_map->annotations[i].ptr;
dragonfly_read_config(anno, &all_params[i]); dragonfly_read_config(anno, &all_params[i]);
} }
...@@ -578,7 +575,7 @@ static void dragonfly_report_stats() ...@@ -578,7 +575,7 @@ static void dragonfly_report_stats()
/* print statistics */ /* print statistics */
if(!g_tw_mynode) if(!g_tw_mynode)
{ {
printf(" Average number of hops traversed %f average chunk latency %lf us maximum chunk latency %lf us avg message size %lf bytes finished messages %ld finished chunks %ld \n", (float)avg_hops/total_finished_chunks, avg_time/(total_finished_chunks*1000), max_time/1000, (float)final_msg_sz/total_finished_msgs, total_finished_msgs, total_finished_chunks); printf(" Average number of hops traversed %f average chunk latency %lf us maximum chunk latency %lf us avg message size %lf bytes finished messages %lld finished chunks %lld \n", (float)avg_hops/total_finished_chunks, avg_time/(total_finished_chunks*1000), max_time/1000, (float)final_msg_sz/total_finished_msgs, total_finished_msgs, total_finished_chunks);
if(routing == ADAPTIVE || routing == PROG_ADAPTIVE) if(routing == ADAPTIVE || routing == PROG_ADAPTIVE)
printf("\n ADAPTIVE ROUTING STATS: %d chunks routed minimally %d chunks routed non-minimally completed packets %lld \n", printf("\n ADAPTIVE ROUTING STATS: %d chunks routed minimally %d chunks routed non-minimally completed packets %lld \n",
total_minimal_packets, total_nonmin_packets, total_finished_chunks); total_minimal_packets, total_nonmin_packets, total_finished_chunks);
...@@ -621,10 +618,11 @@ void dragonfly_collective_init(terminal_state * s, ...@@ -621,10 +618,11 @@ void dragonfly_collective_init(terminal_state * s,
/* calculate the children of the current node. If its a leaf, no need to set children, /* calculate the children of the current node. If its a leaf, no need to set children,
only set isleaf and break the loop*/ only set isleaf and break the loop*/
tw_lpid total_lps = (tw_lpid)num_lps * (tw_lpid)num_reps;
for( i = 0; i < TREE_DEGREE; i++ ) for( i = 0; i < TREE_DEGREE; i++ )
{ {
tw_lpid next_child = (TREE_DEGREE * s->node_id) + i + 1; tw_lpid next_child = (TREE_DEGREE * s->node_id) + i + 1;
if(next_child < (num_lps * num_reps)) if(next_child < total_lps)
{ {
s->num_children++; s->num_children++;
s->is_leaf = 0; s->is_leaf = 0;
...@@ -805,14 +803,14 @@ void router_setup(router_state * r, tw_lp * lp) ...@@ -805,14 +803,14 @@ void router_setup(router_state * r, tw_lp * lp)
#endif #endif
//round the number of global channels to the nearest even number //round the number of global channels to the nearest even number
#if USE_DIRECT_SCHEME #if USE_DIRECT_SCHEME
int first = r->router_id % p->num_routers; unsigned int first = r->router_id % p->num_routers;
for(int i=0; i < p->num_global_channels; i++) for(int i=0; i < p->num_global_channels; i++)
{ {
int target_grp = first; unsigned int target_grp = first;
if(target_grp == r->group_id) { if(target_grp == r->group_id) {
target_grp = p->num_groups - 1; target_grp = p->num_groups - 1;
} }
int my_pos = r->group_id % p->num_routers; unsigned int my_pos = r->group_id % p->num_routers;
if(r->group_id == p->num_groups - 1) { if(r->group_id == p->num_groups - 1) {
my_pos = target_grp % p->num_routers; my_pos = target_grp % p->num_routers;
} }
...@@ -862,6 +860,8 @@ static tw_stime dragonfly_packet_event( ...@@ -862,6 +860,8 @@ static tw_stime dragonfly_packet_event(
tw_lp *sender, tw_lp *sender,
int is_last_pckt) int is_last_pckt)
{ {
(void)message_offset;
(void)sched_params;
tw_event * e_new; tw_event * e_new;
tw_stime xfer_to_nic_time; tw_stime xfer_to_nic_time;
terminal_message * msg; terminal_message * msg;
...@@ -954,7 +954,7 @@ tw_lpid getRouterFromGroupID(int dest_gid, ...@@ -954,7 +954,7 @@ tw_lpid getRouterFromGroupID(int dest_gid,
} }
/*When a packet is sent from the current router and a buffer slot becomes available, a credit is sent back to schedule another packet event*/ /*When a packet is sent from the current router and a buffer slot becomes available, a credit is sent back to schedule another packet event*/
void router_credit_send(router_state * s, tw_bf * bf, terminal_message * msg, void router_credit_send(router_state * s, terminal_message * msg,
tw_lp * lp, int sq) { tw_lp * lp, int sq) {
tw_event * buf_e; tw_event * buf_e;
tw_stime ts; tw_stime ts;
...@@ -1068,9 +1068,9 @@ void packet_generate(terminal_state * s, tw_bf * bf, terminal_message * msg, ...@@ -1068,9 +1068,9 @@ void packet_generate(terminal_state * s, tw_bf * bf, terminal_message * msg,
//if(msg->dest_terminal_id == TRACK) //if(msg->dest_terminal_id == TRACK)
if(msg->packet_ID == TRACK_PKT) if(msg->packet_ID == TRACK_PKT)
printf("\n Packet %ld generated at terminal %d dest %ld size %d num chunks %d ", printf("\n Packet %llu generated at terminal %d dest %llu size %llu num chunks %d ",
msg->packet_ID, s->terminal_id, msg->dest_terminal_id, msg->packet_ID, s->terminal_id, LLU(msg->dest_terminal_id),
msg->packet_size, num_chunks); LLU(msg->packet_size), num_chunks);
for(i = 0; i < num_chunks; i++) for(i = 0; i < num_chunks; i++)
{ {
...@@ -1224,7 +1224,7 @@ void packet_send(terminal_state * s, tw_bf * bf, terminal_message * msg, ...@@ -1224,7 +1224,7 @@ void packet_send(terminal_state * s, tw_bf * bf, terminal_message * msg,
m->local_event_size_bytes = 0; m->local_event_size_bytes = 0;
tw_event_send(e); tw_event_send(e);
int num_chunks = cur_entry->msg.packet_size/s->params->chunk_size; uint64_t num_chunks = cur_entry->msg.packet_size/s->params->chunk_size;
if(cur_entry->msg.packet_size % s->params->chunk_size) if(cur_entry->msg.packet_size % s->params->chunk_size)
num_chunks++; num_chunks++;
...@@ -1416,7 +1416,7 @@ void packet_arrive(terminal_state * s, tw_bf * bf, terminal_message * msg, ...@@ -1416,7 +1416,7 @@ void packet_arrive(terminal_state * s, tw_bf * bf, terminal_message * msg,
assert(lp->gid == msg->dest_terminal_id); assert(lp->gid == msg->dest_terminal_id);
if(msg->packet_ID == TRACK_PKT) if(msg->packet_ID == TRACK_PKT)
printf("\n Packet %ld arrived at lp %ld hops %d", msg->packet_ID, lp->gid, msg->my_N_hop); printf("\n Packet %llu arrived at lp %llu hops %hd", msg->packet_ID, LLU(lp->gid), msg->my_N_hop);
tw_stime ts = g_tw_lookahead + s->params->credit_delay + tw_rand_unif(lp->rng); tw_stime ts = g_tw_lookahead + s->params->credit_delay + tw_rand_unif(lp->rng);
...@@ -1442,7 +1442,7 @@ void packet_arrive(terminal_state * s, tw_bf * bf, terminal_message * msg, ...@@ -1442,7 +1442,7 @@ void packet_arrive(terminal_state * s, tw_bf * bf, terminal_message * msg,
/* WE do not allow self messages through dragonfly */ /* WE do not allow self messages through dragonfly */
assert(lp->gid != msg->src_terminal_id); assert(lp->gid != msg->src_terminal_id);
int num_chunks = msg->packet_size / s->params->chunk_size; uint64_t num_chunks = msg->packet_size / s->params->chunk_size;
if (msg->packet_size % s->params->chunk_size) if (msg->packet_size % s->params->chunk_size)
num_chunks++; num_chunks++;
...@@ -1599,12 +1599,12 @@ void dragonfly_collective(char const * category, int message_size, int remote_ev ...@@ -1599,12 +1599,12 @@ void dragonfly_collective(char const * category, int message_size, int remote_ev
/* reverse for collective operation of the dragonfly network */ /* reverse for collective operation of the dragonfly network */
void dragonfly_collective_rc(int message_size, tw_lp* sender) void dragonfly_collective_rc(int message_size, tw_lp* sender)
{ {
(void)message_size;
codes_local_latency_reverse(sender); codes_local_latency_reverse(sender);
return; return;
} }
static void send_collective_remote_event(terminal_state * s, static void send_collective_remote_event(terminal_state * s,
tw_bf * bf,
terminal_message * msg, terminal_message * msg,
tw_lp * lp) tw_lp * lp)
{ {
...@@ -1615,7 +1615,7 @@ static void send_collective_remote_event(terminal_state * s, ...@@ -1615,7 +1615,7 @@ static void send_collective_remote_event(terminal_state * s,
tw_stime ts; tw_stime ts;
terminal_message * m; terminal_message * m;
ts = (1/s->params->cn_bandwidth) * msg->remote_event_size_bytes; ts = (1/s->params->cn_bandwidth) * msg->remote_event_size_bytes;
e = codes_event_new(s->origin_svr, ts, lp); e = tw_event_new(s->origin_svr, ts, lp);
m = tw_event_data(e); m = tw_event_data(e);
char* tmp_ptr = (char*)msg; char* tmp_ptr = (char*)msg;
tmp_ptr += dragonfly_get_msg_sz(); tmp_ptr += dragonfly_get_msg_sz();
...@@ -1625,7 +1625,6 @@ static void send_collective_remote_event(terminal_state * s, ...@@ -1625,7 +1625,6 @@ static void send_collective_remote_event(terminal_state * s,
} }
static void node_collective_init(terminal_state * s, static void node_collective_init(terminal_state * s,
tw_bf * bf,
terminal_message * msg, terminal_message * msg,
tw_lp * lp) tw_lp * lp)
{ {
...@@ -1734,7 +1733,7 @@ static void node_collective_fan_in(terminal_state * s, ...@@ -1734,7 +1733,7 @@ static void node_collective_fan_in(terminal_state * s,
bf->c2 = 1; bf->c2 = 1;
msg->saved_fan_nodes = s->num_fan_nodes-1; msg->saved_fan_nodes = s->num_fan_nodes-1;
s->num_fan_nodes = 0; s->num_fan_nodes = 0;
send_collective_remote_event(s, bf, msg, lp); send_collective_remote_event(s, msg, lp);
for( i = 0; i < s->num_children; i++ ) for( i = 0; i < s->num_children; i++ )
{ {
...@@ -1760,7 +1759,7 @@ static void node_collective_fan_in(terminal_state * s, ...@@ -1760,7 +1759,7 @@ static void node_collective_fan_in(terminal_state * s,
msg->remote_event_size_bytes); msg->remote_event_size_bytes);
} }
msg_new->type = D_COLLECTIVE_FAN_OUT; msg_new->type = (enum event_t) D_COLLECTIVE_FAN_OUT;
msg_new->sender_node = s->node_id; msg_new->sender_node = s->node_id;
tw_event_send(e_new); tw_event_send(e_new);
...@@ -1779,7 +1778,7 @@ static void node_collective_fan_out(terminal_state * s, ...@@ -1779,7 +1778,7 @@ static void node_collective_fan_out(terminal_state * s,
bf->c1 = 0; bf->c1 = 0;
bf->c2 = 0; bf->c2 = 0;
send_collective_remote_event(s, bf, msg, lp); send_collective_remote_event(s, msg, lp);
if(!s->is_leaf) if(!s->is_leaf)
{ {
...@@ -1814,7 +1813,7 @@ static void node_collective_fan_out(terminal_state * s, ...@@ -1814,7 +1813,7 @@ static void node_collective_fan_out(terminal_state * s,
} }
msg_new->type = D_COLLECTIVE_FAN_OUT; msg_new->type = (nodes_event_t) D_COLLECTIVE_FAN_OUT;
msg_new->sender_node = s->node_id; msg_new->sender_node = s->node_id;
tw_event_send(e_new); tw_event_send(e_new);
} }
...@@ -1918,7 +1917,7 @@ terminal_event( terminal_state * s, ...@@ -1918,7 +1917,7 @@ terminal_event( terminal_state * s,
break; break;
case D_COLLECTIVE_INIT: case D_COLLECTIVE_INIT:
node_collective_init(s, bf, msg, lp); node_collective_init(s, msg, lp);
break; break;
case D_COLLECTIVE_FAN_IN: case D_COLLECTIVE_FAN_IN:
...@@ -1945,8 +1944,8 @@ dragonfly_terminal_final( terminal_state * s, ...@@ -1945,8 +1944,8 @@ dragonfly_terminal_final( terminal_state * s,
if(!s->terminal_id) if(!s->terminal_id)
written = sprintf(s->output_buf, "# Format <LP id> <Terminal ID> <Total Data Size> <Total Time Spent> <# Packets finished> <Avg hops> <Busy Time>"); written = sprintf(s->output_buf, "# Format <LP id> <Terminal ID> <Total Data Size> <Total Time Spent> <# Packets finished> <Avg hops> <Busy Time>");
written += sprintf(s->output_buf + written, "%lu %u %ld %lf %ld %lf %lf\n", written += sprintf(s->output_buf + written, "%llu %u %ld %lf %ld %lf %lf\n",
lp->gid, s->terminal_id, s->total_msg_size, s->total_time, LLU(lp->gid), s->terminal_id, s->total_msg_size, s->total_time,
s->finished_packets, (double)s->total_hops/s->finished_chunks, s->finished_packets, (double)s->total_hops/s->finished_chunks,
s->busy_time); s->busy_time);
...@@ -1964,7 +1963,7 @@ dragonfly_terminal_final( terminal_state * s, ...@@ -1964,7 +1963,7 @@ dragonfly_terminal_final( terminal_state * s,
fclose(dragonfly_log); fclose(dragonfly_log);
*/ */
if(s->terminal_msgs[0] != NULL) if(s->terminal_msgs[0] != NULL)
printf("[%lu] leftover terminal messages \n", lp->gid); printf("[%llu] leftover terminal messages \n", LLU(lp->gid));
//if(s->packet_gen != s->packet_fin) //if(s->packet_gen != s->packet_fin)
...@@ -1986,11 +1985,11 @@ void dragonfly_router_final(router_state * s, ...@@ -1986,11 +1985,11 @@ void dragonfly_router_final(router_state * s,
for(i = 0; i < s->params->radix; i++) { for(i = 0; i < s->params->radix; i++) {
for(j = 0; j < 3; j++) { for(j = 0; j < 3; j++) {
if(s->queued_msgs[i][j] != NULL) { if(s->queued_msgs[i][j] != NULL) {
printf("[%lu] leftover queued messages %d %d %d\n", lp->gid, i, j, printf("[%llu] leftover queued messages %d %d %d\n", LLU(lp->gid), i, j,
s->vc_occupancy[i][j]); s->vc_occupancy[i][j]);
} }
if(s->pending_msgs[i][j] != NULL) { if(s->pending_msgs[i][j] != NULL) {
printf("[%lu] lefover pending messages %d %d\n", lp->gid, i, j); printf("[%llu] lefover pending messages %d %d\n", LLU(lp->gid), i, j);
} }
} }
} }
...@@ -2005,8 +2004,8 @@ void dragonfly_router_final(router_state * s, ...@@ -2005,8 +2004,8 @@ void dragonfly_router_final(router_state * s,
written += sprintf(s->output_buf + written, "\n # Router ports in the order: %d local channels, %d global channels ", written += sprintf(s->output_buf + written, "\n # Router ports in the order: %d local channels, %d global channels ",
p->num_routers, p->num_global_channels); p->num_routers, p->num_global_channels);
} }
written += sprintf(s->output_buf + written, "\n %ld %d %d ", written += sprintf(s->output_buf + written, "\n %llu %d %d ",
lp->gid, LLU(lp->gid),
s->router_id / p->num_routers, s->router_id / p->num_routers,
s->router_id % p->num_routers); s->router_id % p->num_routers);
for(int d = 0; d < p->num_routers + p->num_global_channels; d++) for(int d = 0; d < p->num_routers + p->num_global_channels; d++)
...@@ -2022,13 +2021,13 @@ void dragonfly_router_final(router_state * s, ...@@ -2022,13 +2021,13 @@ void dragonfly_router_final(router_state * s,
written += sprintf(s->output_buf2 + written, "\n # Router ports in the order: %d local channels, %d global channels ", written += sprintf(s->output_buf2 + written, "\n # Router ports in the order: %d local channels, %d global channels ",
p->num_routers, p->num_global_channels); p->num_routers, p->num_global_channels);
} }
written += sprintf(s->output_buf2 + written, "\n %ld %d %d", written += sprintf(s->output_buf2 + written, "\n %llu %d %d",
lp->gid, LLU(lp->gid),
s->router_id / p->num_routers, s->router_id / p->num_routers,
s->router_id % p->num_routers); s->router_id % p->num_routers);
for(int d = 0; d < p->num_routers + p->num_global_channels; d++) for(int d = 0; d < p->num_routers + p->num_global_channels; d++)
written += sprintf(s->output_buf2 + written, " %ld", s->link_traffic[d]); written += sprintf(s->output_buf2 + written, " %lld", LLD(s->link_traffic[d]));
sprintf(s->output_buf2 + written, "\n"); sprintf(s->output_buf2 + written, "\n");
lp_io_write(lp->gid, "dragonfly-router-traffic", written, s->output_buf2); lp_io_write(lp->gid, "dragonfly-router-traffic", written, s->output_buf2);
...@@ -2038,8 +2037,7 @@ void dragonfly_router_final(router_state * s, ...@@ -2038,8 +2037,7 @@ void dragonfly_router_final(router_state * s,
int get_num_hops(int local_router_id, int get_num_hops(int local_router_id,
int dest_router_id, int dest_router_id,
int num_routers, int num_routers,
int non_min, int total_groups)
int total_groups)
{ {
int local_grp_id = local_router_id / num_routers; int local_grp_id = local_router_id / num_routers;
int dest_group_id = dest_router_id / num_routers; int dest_group_id = dest_router_id / num_routers;
...@@ -2059,13 +2057,13 @@ int get_num_hops(int local_router_id, ...@@ -2059,13 +2057,13 @@ int get_num_hops(int local_router_id,
tw_lpid src_connecting_router = getRouterFromGroupID(dest_group_id, tw_lpid src_connecting_router = getRouterFromGroupID(dest_group_id,
local_grp_id, num_routers, total_groups); local_grp_id, num_routers, total_groups);
if(src_connecting_router == local_router_id) if(src_connecting_router == (tw_lpid)local_router_id)
num_hops--; num_hops--;
tw_lpid dest_connecting_router = getRouterFromGroupID(local_grp_id, tw_lpid dest_connecting_router = getRouterFromGroupID(local_grp_id,
dest_group_id, num_routers, total_groups); dest_group_id, num_routers, total_groups);
if(dest_connecting_router == dest_router_id) if(dest_connecting_router == (tw_lpid)dest_router_id)
num_hops--; num_hops--;
return num_hops; return num_hops;
...@@ -2076,19 +2074,17 @@ int get_num_hops(int local_router_id, ...@@ -2076,19 +2074,17 @@ int get_num_hops(int local_router_id,
* or the destination terminal */ * or the destination terminal */
tw_lpid tw_lpid
get_next_stop(router_state * s, get_next_stop(router_state * s,
tw_bf * bf,
terminal_message * msg, terminal_message * msg,
tw_lp * lp,
int path, int path,
int dest_router_id, int dest_router_id,
int intm_id) int intm_id)
{ {
int dest_lp; int dest_lp;
tw_lpid router_dest_id; tw_lpid router_dest_id;
int dest_group_id; unsigned int dest_group_id;
int local_router_id = s->router_id; int local_router_id = s->router_id;
int origin_grp_id = msg->origin_router_id / s->params->num_routers; unsigned int origin_grp_id = msg->origin_router_id / s->params->num_routers;
dest_group_id = dest_router_id / s->params->num_routers; dest_group_id = dest_router_id / s->params->num_routers;
...@@ -2149,10 +2145,8 @@ get_next_stop(router_state * s, ...@@ -2149,10 +2145,8 @@ get_next_stop(router_state * s,
/* gets the output port corresponding to the next stop of the message */ /* gets the output port corresponding to the next stop of the message */
int int
get_output_port( router_state * s, get_output_port( router_state * s,
tw_bf * bf,
terminal_message * msg, terminal_message * msg,
tw_lp * lp, tw_lpid next_stop )
int next_stop )
{ {
int output_port = -1, terminal_id; int output_port = -1, terminal_id;
codes_mapping_get_lp_info(msg->dest_terminal_id, lp_group_name, codes_mapping_get_lp_info(msg->dest_terminal_id, lp_group_name,
...@@ -2170,13 +2164,13 @@ get_output_port( router_state * s, ...@@ -2170,13 +2164,13 @@ get_output_port( router_state * s,
{ {
codes_mapping_get_lp_info(next_stop, lp_group_name, &mapping_grp_id, codes_mapping_get_lp_info(next_stop, lp_group_name, &mapping_grp_id,
NULL, &mapping_type_id, NULL, &mapping_rep_id, &mapping_offset); NULL, &mapping_type_id, NULL, &mapping_rep_id, &mapping_offset);
int local_router_id = mapping_rep_id + mapping_offset; unsigned int local_router_id = mapping_rep_id + mapping_offset;
int intm_grp_id = local_router_id / s->params->num_routers; unsigned int intm_grp_id = local_router_id / s->params->num_routers;
if(intm_grp_id != s->group_id) if(intm_grp_id != s->group_id)
{ {
#if USE_DIRECT_SCHEME #if USE_DIRECT_SCHEME
int target_grp = intm_grp_id; unsigned int target_grp = intm_grp_id;
if(target_grp == s->params->num_groups - 1) { if(target_grp == s->params->num_groups - 1) {
target_grp = s->group_id; target_grp = s->group_id;
} }
...@@ -2201,19 +2195,17 @@ get_output_port( router_state * s, ...@@ -2201,19 +2195,17 @@ get_output_port( router_state * s,
/* UGAL (first condition is from booksim), output port equality check comes from Dally dragonfly'09*/ /* UGAL (first condition is from booksim), output port equality check comes from Dally dragonfly'09*/
static int do_adaptive_routing( router_state * s, static int do_adaptive_routing( router_state * s,
tw_bf * bf,
terminal_message * msg, terminal_message * msg,
tw_lp * lp,
int dest_router_id, int dest_router_id,
int intm_id) { int intm_id) {
int next_stop; int next_stop;