Commit b5249590 authored by Misbah Mubarak's avatar Misbah Mubarak
Browse files

Resolving some slimfly warnings

parent 642d84d5
...@@ -122,10 +122,10 @@ tw_lptype svr_lp = { ...@@ -122,10 +122,10 @@ tw_lptype svr_lp = {
const tw_optdef app_opt [] = const tw_optdef app_opt [] =
{ {
TWOPT_GROUP("Model net synthetic traffic " ), TWOPT_GROUP("Model net synthetic traffic " ),
TWOPT_UINT("traffic", traffic, "UNIFORM RANDOM=1, NEAREST NEIGHBOR=2 "), TWOPT_UINT("traffic", traffic, "UNIFORM RANDOM=1, NEAREST NEIGHBOR=2 "),
TWOPT_STIME("arrival_time", arrival_time, "INTER-ARRIVAL TIME"), TWOPT_STIME("arrival_time", arrival_time, "INTER-ARRIVAL TIME"),
TWOPT_STIME("load", load, "percentage of packet inter-arrival rate to simulate"), TWOPT_STIME("load", load, "percentage of packet inter-arrival rate to simulate"),
TWOPT_END() TWOPT_END(),
}; };
const tw_lptype* svr_get_lp_type() const tw_lptype* svr_get_lp_type()
...@@ -156,7 +156,7 @@ static tw_stime bytes_to_ns(uint64_t bytes, double GB_p_s) ...@@ -156,7 +156,7 @@ static tw_stime bytes_to_ns(uint64_t bytes, double GB_p_s)
/** Latest implementation of function to return an array mapping each router with it's corresponding worst-case router pair /** Latest implementation of function to return an array mapping each router with it's corresponding worst-case router pair
* @param[in/out] *worst_dest Router ID to send all messages to * @param[in/out] *worst_dest Router ID to send all messages to
*/ */
void init_worst_case_mapping(int *worst_dest) void init_worst_case_mapping()
{ {
int i,j,k; int i,j,k;
int r1,r2; //Routers to be paired int r1,r2; //Routers to be paired
...@@ -197,7 +197,6 @@ static void issue_event( ...@@ -197,7 +197,6 @@ static void issue_event(
* simulation * simulation
*/ */
const char * anno;
configuration_get_value_int(&config, "PARAMS", "packet_size", NULL, &this_packet_size); configuration_get_value_int(&config, "PARAMS", "packet_size", NULL, &this_packet_size);
if(!this_packet_size) { if(!this_packet_size) {
this_packet_size = 0; this_packet_size = 0;
...@@ -306,7 +305,7 @@ static void handle_kickoff_event( ...@@ -306,7 +305,7 @@ static void handle_kickoff_event(
// printf("\n LP %ld sending to %ld num nodes %d ", rep_id * 2 + offset, local_dest, num_nodes); // printf("\n LP %ld sending to %ld num nodes %d ", rep_id * 2 + offset, local_dest, num_nodes);
} }
//printf("1local_dest:%d global_dest:%d num_nodes:%d\n", local_dest, global_dest, num_nodes); //printf("1local_dest:%d global_dest:%d num_nodes:%d\n", local_dest, global_dest, num_nodes);
assert(local_dest < num_nodes); assert(local_dest < (tw_lpid)num_nodes);
codes_mapping_get_lp_id(group_name, lp_type_name, anno, 1, local_dest / num_servers_per_rep, local_dest % num_servers_per_rep, &global_dest); codes_mapping_get_lp_id(group_name, lp_type_name, anno, 1, local_dest / num_servers_per_rep, local_dest % num_servers_per_rep, &global_dest);
//printf("2local_dest:%d global_dest:%d num_nodes:%d\n", local_dest, global_dest, num_nodes); //printf("2local_dest:%d global_dest:%d num_nodes:%d\n", local_dest, global_dest, num_nodes);
...@@ -485,7 +484,7 @@ int main( ...@@ -485,7 +484,7 @@ int main(
if(traffic == WORST_CASE) if(traffic == WORST_CASE)
{ {
worst_dest = (int*)calloc(total_routers,sizeof(int)); worst_dest = (int*)calloc(total_routers,sizeof(int));
init_worst_case_mapping(worst_dest); init_worst_case_mapping();
#if PRINT_WORST_CASE_MATCH #if PRINT_WORST_CASE_MATCH
int l; int l;
for(l=0; l<total_routers; l++) for(l=0; l<total_routers; l++)
......
...@@ -621,7 +621,7 @@ static void slimfly_configure(){ ...@@ -621,7 +621,7 @@ static void slimfly_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 (uint64_t i = 0; i < (uint64_t)anno_map->num_annos; i++){
const char * anno = anno_map->annotations[i].ptr; const char * anno = anno_map->annotations[i].ptr;
slimfly_read_config(anno, &all_params[i]); slimfly_read_config(anno, &all_params[i]);
} }
...@@ -671,7 +671,7 @@ static void slimfly_report_stats() ...@@ -671,7 +671,7 @@ static void slimfly_report_stats()
if(slimfly_results_log == NULL) if(slimfly_results_log == NULL)
tw_error(TW_LOC, "\n Failed to open slimfly results log file \n"); tw_error(TW_LOC, "\n Failed to open slimfly results log file \n");
printf("Printing Simulation Parameters/Results Log File\n"); printf("Printing Simulation Parameters/Results Log File\n");
fprintf(slimfly_results_log,"%10.3lf, %15.3lf, %11.3lf, %13.3d, %16.3d, %16.3d, %25.5f, %14.5f, ", (float)avg_hops/total_finished_packets, avg_time/(total_finished_packets),max_time,total_minimal_packets,total_nonmin_packets,total_finished_chunks,throughput_avg*100,throughput_avg2); fprintf(slimfly_results_log,"%10.3lf, %15.3lf, %11.3lf, %13.3d, %16.3d, %16.3lld, %25.5f, %14.5f, ", (float)avg_hops/total_finished_packets, avg_time/(total_finished_packets),max_time,total_minimal_packets,total_nonmin_packets,total_finished_chunks,throughput_avg*100,throughput_avg2);
fclose(slimfly_results_log); fclose(slimfly_results_log);
#endif #endif
} }
...@@ -1037,7 +1037,7 @@ void slim_router_setup(router_state * r, tw_lp * lp) ...@@ -1037,7 +1037,7 @@ void slim_router_setup(router_state * r, tw_lp * lp)
} }
// Loop over second subgraph source routers // Loop over second subgraph source routers
for(rid_d==r->params->slim_total_routers-1;rid_d>=0;rid_d--) for(rid_d=r->params->slim_total_routers-1;rid_d>=0;rid_d--)
{ {
// Decompose source and destination Router IDs into 3D subgraph coordinates (subgraph,i,j) // Decompose source and destination Router IDs into 3D subgraph coordinates (subgraph,i,j)
if(rid_d >= r->params->slim_total_routers/2) if(rid_d >= r->params->slim_total_routers/2)
...@@ -1513,12 +1513,12 @@ void slim_packet_send(terminal_state * s, tw_bf * bf, slim_terminal_message * ms ...@@ -1513,12 +1513,12 @@ void slim_packet_send(terminal_state * s, tw_bf * bf, slim_terminal_message * ms
if(cur_entry != NULL && s->vc_occupancy[0] + s->params->chunk_size <= s->params->cn_vc_size) if(cur_entry != NULL && s->vc_occupancy[0] + s->params->chunk_size <= s->params->cn_vc_size)
{ {
bf->c3 = 1; bf->c3 = 1;
slim_terminal_message *m; slim_terminal_message *m_new;
ts = g_tw_lookahead + s->params->cn_delay + tw_rand_unif(lp->rng); ts = g_tw_lookahead + s->params->cn_delay + tw_rand_unif(lp->rng);
tw_event* e = model_net_method_event_new(lp->gid, ts, lp, SLIMFLY, tw_event* e = model_net_method_event_new(lp->gid, ts, lp, SLIMFLY,
(void**)&m, NULL); (void**)&m_new, NULL);
m->type = T_SEND; m_new->type = T_SEND;
m->magic = slim_terminal_magic_num; m_new->magic = slim_terminal_magic_num;
tw_event_send(e); tw_event_send(e);
} }
else else
......
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