Commit 8ae7fb49 authored by Noah Wolfe's avatar Noah Wolfe
Browse files

Fixing slimfly indentation

parent 0592e2a4
......@@ -49,12 +49,12 @@
#define N_COLLECT_POINTS 100
/*unsigned long terminal_sends[TEMP_NUM_TERMINALS][N_COLLECT_POINTS];
unsigned long terminal_recvs[TEMP_NUM_TERMINALS][N_COLLECT_POINTS];
unsigned long router_sends[TEMP_NUM_ROUTERS][N_COLLECT_POINTS];
unsigned long router_recvs[TEMP_NUM_ROUTERS][N_COLLECT_POINTS];
int vc_occupancy_storage_router[TEMP_NUM_ROUTERS][TEMP_RADIX][TEMP_NUM_VC][N_COLLECT_POINTS];
int vc_occupancy_storage_terminal[TEMP_NUM_TERMINALS][TEMP_NUM_VC][N_COLLECT_POINTS];
*/FILE * slimfly_terminal_sends_recvs_log = NULL;
unsigned long terminal_recvs[TEMP_NUM_TERMINALS][N_COLLECT_POINTS];
unsigned long router_sends[TEMP_NUM_ROUTERS][N_COLLECT_POINTS];
unsigned long router_recvs[TEMP_NUM_ROUTERS][N_COLLECT_POINTS];
int vc_occupancy_storage_router[TEMP_NUM_ROUTERS][TEMP_RADIX][TEMP_NUM_VC][N_COLLECT_POINTS];
int vc_occupancy_storage_terminal[TEMP_NUM_TERMINALS][TEMP_NUM_VC][N_COLLECT_POINTS];
*/FILE * slimfly_terminal_sends_recvs_log = NULL;
FILE * slimfly_router_sends_recvs_log = NULL;
FILE * slimfly_router_occupancy_log=NULL;
FILE * slimfly_terminal_occupancy_log=NULL;
......@@ -186,9 +186,9 @@ struct terminal_state
slim_terminal_message_list **terminal_msgs;
slim_terminal_message_list **terminal_msgs_tail;
int in_send_loop;
// Terminal generate, sends and arrival T_SEND, T_ARRIVAL, T_GENERATE
// Router-Router Intra-group sends and receives RR_LSEND, RR_LARRIVE
// Router-Router Inter-group sends and receives RR_GSEND, RR_GARRIVE
// Terminal generate, sends and arrival T_SEND, T_ARRIVAL, T_GENERATE
// Router-Router Intra-group sends and receives RR_LSEND, RR_LARRIVE
// Router-Router Inter-group sends and receives RR_GSEND, RR_GARRIVE
struct mn_stats slimfly_stats_array[CATEGORY_MAX];
struct rc_stack * st;
......@@ -341,11 +341,11 @@ static int slimfly_get_msg_sz(void)
}
/*static void free_tmp(void * ptr)
{
{
struct sfly_qhash_entry * sfly = ptr;
free(sfly->remote_event_data);
free(sfly);
}*/
}*/
static void append_to_terminal_message_list(
slim_terminal_message_list ** thisq,
......@@ -1658,7 +1658,7 @@ void slim_packet_arrive_rc(terminal_state * s, tw_bf * bf, slim_terminal_message
N_finished_msgs--;
s->total_msg_size -= msg->total_size;
// struct sfly_qhash_entry * d_entry_pop = (struct sfly_qhash_entry*)rc_stack_pop(s->st);
// struct sfly_qhash_entry * d_entry_pop = (struct sfly_qhash_entry*)rc_stack_pop(s->st);
struct sfly_qhash_entry * d_entry_pop = msg->saved_hash;
qhash_add(s->rank_tbl, &key, &(d_entry_pop->hash_link));
s->rank_tbl_pop++;
......@@ -1931,7 +1931,7 @@ void slim_terminal_buf_update(terminal_state * s,
s->vc_occupancy[0] -= s->params->chunk_size;
#if TERMINAL_OCCUPANCY_LOG
int index = floor(N_COLLECT_POINTS*(tw_now(lp)/g_tw_ts_end));
int index = floor(N_COLLECT_POINTS*(tw_now(lp)/g_tw_ts_end));
vc_occupancy_storage_terminal[s->terminal_id][0][index] = s->vc_occupancy[0]/s->params->chunk_size;
#endif
......@@ -2030,7 +2030,7 @@ void slimfly_terminal_final( terminal_state * s,
lp_io_write(lp->gid, "slimfly-msg-stats", written, s->output_buf);
if(s->terminal_msgs[0] != NULL)
// printf("[%lu] leftover terminal messages \n", lp->gid);
// printf("[%lu] leftover terminal messages \n", lp->gid);
if(!s->terminal_id)
{
......@@ -2080,11 +2080,11 @@ void slimfly_router_final(router_state * s,
for(i = 0; i < s->params->radix; i++) {
for(j = 0; j < s->params->num_vcs; j++) {
if(s->queued_msgs[i][j] != NULL) {
// printf("[%lu] leftover queued messages %d %d %d\n", lp->gid, i, j,
// s->vc_occupancy[i][j]);
// printf("[%lu] leftover queued messages %d %d %d\n", lp->gid, i, j,
// s->vc_occupancy[i][j]);
}
if(s->pending_msgs[i][j] != NULL) {
// printf("[%lu] lefover pending messages %d %d\n", lp->gid, i, j);
// printf("[%lu] lefover pending messages %d %d\n", lp->gid, i, j);
}
}
}
......@@ -2092,7 +2092,7 @@ void slimfly_router_final(router_state * s,
if(s->router_id == 0)
{
/* write metadata file */
/* char meta_fname[64];
/* char meta_fname[64];
sprintf(meta_fname, "slimfly-msg-stats.meta");
FILE * fp = fopen(meta_fname, "w");
......@@ -2100,7 +2100,7 @@ void slimfly_router_final(router_state * s,
fprintf(fp, "# Router ports in the order: %d local channels, %d global channels",
p->num_routers, p->num_global_channels);
fclose(fp);
*/ written = sprintf(s->output_buf,"# Format <LP ID> <Group ID> <Router ID> <Busy time per router port(s)>");
*/ written = sprintf(s->output_buf,"# Format <LP ID> <Group ID> <Router ID> <Busy time per router port(s)>");
}
written += sprintf(s->output_buf + written, "\n %llu %d %d",
LLU(lp->gid),
......@@ -2277,22 +2277,22 @@ tw_lpid getMinimalRouterFromEquations(slim_terminal_message * msg, int rid, rout
// Check for case 1
for(i=0;i<r->params->num_local_channels;i++)
{
#if DEBUG_ROUTING
#if DEBUG_ROUTING
if( msg->packet_ID == TRACK && msg->chunk_id == num_chunks-1)
{
printf("comparing local:%d with dest:%d\n",r->local_channel[i],rid);
}
#endif
#endif
if(r->local_channel[i] == rid)
{
router_id = rid;
match = 1; // Case 1a and 1b
#if DEBUG_ROUTING
#if DEBUG_ROUTING
if( msg->packet_ID == TRACK && msg->chunk_id == num_chunks-1)
{
printf("match:%d case:1a/1b\n",(int)router_id);
}
#endif
#endif
break;
}
}
......@@ -2300,22 +2300,22 @@ tw_lpid getMinimalRouterFromEquations(slim_terminal_message * msg, int rid, rout
{
for(i=0;i<r->params->num_global_channels;i++)
{
#if DEBUG_ROUTING
#if DEBUG_ROUTING
if( msg->packet_ID == TRACK && msg->chunk_id == num_chunks-1)
{
printf("comparing global:%d with dest:%d\n",r->global_channel[i],rid);
}
#endif
#endif
if(r->global_channel[i] == rid)
{
router_id = rid;
match = 1; // Case 1c
#if DEBUG_ROUTING
#if DEBUG_ROUTING
if( msg->packet_ID == TRACK && msg->chunk_id == num_chunks-1)
{
printf("match case:1c\n");
}
#endif
#endif
break;
}
}
......@@ -2627,7 +2627,7 @@ tw_lpid getMinimalRouterFromEquations(slim_terminal_message * msg, int rid, rout
break;
}
}
#if DEBUG_ROUTING
#if DEBUG_ROUTING
if( msg->packet_ID == TRACK && msg->chunk_id == num_chunks-1)
{
if(match == 1)
......@@ -2639,7 +2639,7 @@ tw_lpid getMinimalRouterFromEquations(slim_terminal_message * msg, int rid, rout
printf("source:%d destination:%d no match so defaulting to router:%d\n",(int)r->router_id,rid,(int)router_id);
}
}
#endif
#endif
if(match == 0 && (int)r->router_id != 0)
{
printf("packet_ID:%d source:%d destination:%d no match so defaulting to router:%d\n",(int)msg->packet_ID,(int)r->router_id,rid,(int)router_id);
......@@ -2931,7 +2931,7 @@ void slim_router_packet_receive_rc(router_state * s,
}
/* Packet arrives at the router and a credit is sent back to the sending terminal/router */
void
void
slim_router_packet_receive( router_state * s,
tw_bf * bf,
slim_terminal_message * msg,
......@@ -2968,7 +2968,7 @@ slim_router_packet_receive( router_state * s,
intm_id = tw_rand_integer(lp->rng, 0, s->params->slim_total_routers - 1);
if(intm_id == local_grp_id)
{
// intm_id = (local_grp_id + 2) % s->params->num_groups;
// intm_id = (local_grp_id + 2) % s->params->num_groups;
intm_id = (local_grp_id + 1) % (s->params->slim_total_routers - 1);
}
}
......@@ -3014,7 +3014,7 @@ slim_router_packet_receive( router_state * s,
memcpy(cur_chunk->event_data, m_data_src, msg->remote_event_size_bytes);
}
codes_mapping_get_lp_info(lp->gid, lp_group_name, &mapping_grp_id, NULL,
codes_mapping_get_lp_info(lp->gid, lp_group_name, &mapping_grp_id, NULL,
&mapping_type_id, NULL, &mapping_rep_id, &mapping_offset);
int local_router_id = (mapping_offset + mapping_rep_id);
......@@ -3074,7 +3074,7 @@ codes_mapping_get_lp_info(lp->gid, lp_group_name, &mapping_grp_id, NULL,
s->vc_occupancy[output_port][output_chan] += s->params->chunk_size;
#if ROUTER_OCCUPANCY_LOG
int index = floor(N_COLLECT_POINTS*(tw_now(lp)/g_tw_ts_end));
int index = floor(N_COLLECT_POINTS*(tw_now(lp)/g_tw_ts_end));
vc_occupancy_storage_router[s->router_id][output_port][output_chan][index] = s->vc_occupancy[output_port][output_chan]/s->params->chunk_size;
#endif
......@@ -3146,7 +3146,7 @@ void slim_router_packet_send_rc(router_state * s,
}
/* routes the current packet to the next stop */
void
void
slim_router_packet_send( router_state * s,
tw_bf * bf,
slim_terminal_message * msg, tw_lp * lp)
......@@ -3336,7 +3336,7 @@ void slim_router_buf_update(router_state * s, tw_bf * bf, slim_terminal_message
}
#if ROUTER_OCCUPANCY_LOG
int index = floor(N_COLLECT_POINTS*(tw_now(lp)/g_tw_ts_end));
int index = floor(N_COLLECT_POINTS*(tw_now(lp)/g_tw_ts_end));
vc_occupancy_storage_router[s->router_id][indx][output_chan][index] = s->vc_occupancy[indx][output_chan]/s->params->chunk_size;
#endif
if(s->queued_msgs[indx][output_chan] != NULL) {
......
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