GitLab maintenance scheduled for Today, 2019-12-05, from 17:00 to 18:00 CT - Services will be unavailable during this time.

Commit 101e99a7 authored by Misbah Mubarak's avatar Misbah Mubarak

Fixing compilers warnings for print format and unused variables, uncommenting sampling functions

parent 6a8509ed
......@@ -91,8 +91,8 @@ FILE * dragonfly_log = NULL;
int sample_bytes_written = 0;
int sample_rtr_bytes_written = 0;
char cn_sample_file[MAX_NAME_LENGTH];
char router_sample_file[MAX_NAME_LENGTH];
char dfly_cn_sample_file[MAX_NAME_LENGTH];
char dfly_rtr_sample_file[MAX_NAME_LENGTH];
typedef struct terminal_message_list terminal_message_list;
struct terminal_message_list {
......@@ -590,9 +590,9 @@ static void dragonfly_read_config(const char * anno, dragonfly_param *params){
configuration_get_value_double(&config, "PARAMS", "router_delay", anno,
&p->router_delay);
configuration_get_value(&config, "PARAMS", "cn_sample_file", anno, cn_sample_file,
configuration_get_value(&config, "PARAMS", "cn_sample_file", anno, dfly_cn_sample_file,
MAX_NAME_LENGTH);
configuration_get_value(&config, "PARAMS", "rt_sample_file", anno, router_sample_file,
configuration_get_value(&config, "PARAMS", "rt_sample_file", anno, dfly_rtr_sample_file,
MAX_NAME_LENGTH);
char routing_str[MAX_NAME_LENGTH];
......@@ -2143,10 +2143,10 @@ static void dragonfly_rsample_fin(router_state * s,
fclose(fp);
}
char rt_fn[MAX_NAME_LENGTH];
if(strcmp(router_sample_file, "") == 0)
if(strcmp(dfly_rtr_sample_file, "") == 0)
sprintf(rt_fn, "dragonfly-router-sampling-%ld.bin", g_tw_mynode);
else
sprintf(rt_fn, "%s-%ld.bin", router_sample_file, g_tw_mynode);
sprintf(rt_fn, "%s-%ld.bin", dfly_rtr_sample_file, g_tw_mynode);
int i = 0;
......@@ -2305,10 +2305,10 @@ static void dragonfly_sample_fin(terminal_state * s,
fclose(fp);
}
char rt_fn[MAX_NAME_LENGTH];
if(strncmp(cn_sample_file, "", 10) == 0)
if(strncmp(dfly_cn_sample_file, "", 10) == 0)
sprintf(rt_fn, "dragonfly-cn-sampling-%ld.bin", g_tw_mynode);
else
sprintf(rt_fn, "%s-%ld.bin", cn_sample_file, g_tw_mynode);
sprintf(rt_fn, "%s-%ld.bin", dfly_cn_sample_file, g_tw_mynode);
FILE * fp = fopen(rt_fn, "a");
fseek(fp, sample_bytes_written, SEEK_SET);
......@@ -3481,8 +3481,8 @@ struct model_net_method dragonfly_method =
.mn_report_stats = dragonfly_report_stats,
.mn_collective_call = dragonfly_collective,
.mn_collective_call_rc = dragonfly_collective_rc,
//.mn_sample_fn = (void*)dragonfly_sample_fn,
//.mn_sample_rc_fn = (void*)dragonfly_sample_rc_fn,
.mn_sample_fn = (void*)dragonfly_sample_fn,
.mn_sample_rc_fn = (void*)dragonfly_sample_rc_fn,
.mn_sample_init_fn = (void*)dragonfly_sample_init,
.mn_sample_fini_fn = (void*)dragonfly_sample_fin,
.mn_model_stat_register = dragonfly_register_model_types,
......@@ -3502,8 +3502,8 @@ struct model_net_method dragonfly_router_method =
.mn_report_stats = NULL, // not yet supported
.mn_collective_call = NULL,
.mn_collective_call_rc = NULL,
//.mn_sample_fn = (void*)dragonfly_rsample_fn,
//.mn_sample_rc_fn = (void*)dragonfly_rsample_rc_fn,
.mn_sample_fn = (void*)dragonfly_rsample_fn,
.mn_sample_rc_fn = (void*)dragonfly_rsample_rc_fn,
.mn_sample_init_fn = (void*)dragonfly_rsample_init,
.mn_sample_fini_fn = (void*)dragonfly_rsample_fin,
.mn_model_stat_register = router_register_model_types,
......
......@@ -50,8 +50,8 @@ static int terminal_magic_num = 0;
static int sample_bytes_written = 0;
static int sample_rtr_bytes_written = 0;
char cn_sample_file[MAX_NAME_LENGTH];
char router_sample_file[MAX_NAME_LENGTH];
char em_cn_sample_file[MAX_NAME_LENGTH];
char em_rtr_sample_file[MAX_NAME_LENGTH];
static void init_message_list(message_list *thism,
em_message *inmsg) {
......@@ -381,9 +381,9 @@ static void em_read_config(const char * anno, em_param *params){
&p->router_delay);
configuration_get_value(&config, "PARAMS", "cn_sample_file", anno,
cn_sample_file, MAX_NAME_LENGTH);
em_cn_sample_file, MAX_NAME_LENGTH);
configuration_get_value(&config, "PARAMS", "rt_sample_file", anno,
router_sample_file, MAX_NAME_LENGTH);
em_rtr_sample_file, MAX_NAME_LENGTH);
char routing_str[MAX_NAME_LENGTH];
configuration_get_value(&config, "PARAMS", "routing", anno, routing_str,
......@@ -1416,12 +1416,12 @@ terminal_final( terminal_state * s, tw_lp * lp )
if(!s->terminal_id)
written = sprintf(s->output_buf, "# Format <LP id> <Terminal ID> <Total Data Size> <Avg packet latency> <# Flits/Packets finished> <Avg hops> <Busy Time>");
written += sprintf(s->output_buf + written, "\n %llu %u %ld %lf %ld %lf %lf",
written += sprintf(s->output_buf + written, "\n %llu %u %llu %lf %ld %lf %lf",
LLU(lp->gid), s->terminal_id, s->total_msg_size, s->total_time,
s->finished_packets, (double)s->total_hops/s->finished_chunks,
s->busy_time);
lp_io_write(lp->gid, "em-msg-stats", written, s->output_buf);
lp_io_write(lp->gid, (char*)"em-msg-stats", written, s->output_buf);
for(int i = 0; i < s->params->num_vcs; i++) {
if(s->terminal_msgs[0][i] != NULL)
......@@ -2169,7 +2169,7 @@ static void router_final(router_state * s,
for(int d = 0; d < p->radix; d++)
written += sprintf(s->output_buf + written, " %lf", s->busy_time[d]);
lp_io_write(lp->gid, "em-router-stats", written, s->output_buf);
lp_io_write(lp->gid, (char*)"em-router-stats", written, s->output_buf);
written = 0;
if(!s->router_id)
......@@ -2184,7 +2184,7 @@ static void router_final(router_state * s,
written += sprintf(s->output_buf2 + written, " %lld", LLD(s->link_traffic[d]));
assert(written < 4096);
lp_io_write(lp->gid, "em-router-traffic", written, s->output_buf2);
lp_io_write(lp->gid, (char*)"em-router-traffic", written, s->output_buf2);
}
static void em_rsample_init(router_state * s,
......@@ -2305,10 +2305,10 @@ static void em_rsample_fin(router_state * s,
fclose(fp);
}
char rt_fn[MAX_NAME_LENGTH];
if(strcmp(router_sample_file, "") == 0)
if(strcmp(em_rtr_sample_file, "") == 0)
sprintf(rt_fn, "em-router-sampling-%ld.bin", g_tw_mynode);
else
sprintf(rt_fn, "%s-%ld.bin", router_sample_file, g_tw_mynode);
sprintf(rt_fn, "%s-%ld.bin", em_rtr_sample_file, g_tw_mynode);
int i = 0;
......@@ -2437,10 +2437,10 @@ static void em_sample_fin(terminal_state * s,
fclose(fp);
}
char rt_fn[MAX_NAME_LENGTH];
if(strncmp(cn_sample_file, "", 10) == 0)
if(strncmp(em_cn_sample_file, "", 10) == 0)
sprintf(rt_fn, "em-cn-sampling-%ld.bin", g_tw_mynode);
else
sprintf(rt_fn, "%s-%ld.bin", cn_sample_file, g_tw_mynode);
sprintf(rt_fn, "%s-%ld.bin", em_cn_sample_file, g_tw_mynode);
FILE * fp = fopen(rt_fn, "a");
fseek(fp, sample_bytes_written, SEEK_SET);
......
......@@ -570,7 +570,7 @@ static void dot_write_open_file(FILE **fout)
}*/
/* sw IDs aren't unique, but level+ID info is */
static void dot_write_switch_info(switch_state *s, int sw_gid, FILE *fout)
static void dot_write_switch_info(switch_state *s, FILE *fout)
{
if(!s || s->unused || !(s->params) || !fout) return;
if(!dump_topo) return;
......@@ -1152,7 +1152,7 @@ void switch_init(switch_state * r, tw_lp * lp)
/* dump partial topology info into DOT format (switch radix, guid, ...) */
if(!dot_file && !r->rail_id)
dot_write_open_file(&dot_file);
dot_write_switch_info(r, lp->gid, dot_file);
dot_write_switch_info(r, dot_file);
#if FATTREE_CONNECTIONS || FATTREE_DEBUG
tw_lpid next_switch_lid;
......@@ -1278,7 +1278,6 @@ void switch_init(switch_state * r, tw_lp * lp)
l0_base++;
}
if(p->num_levels == 3) {
int l2_base = 0;
int rep = p->link_repetitions;
int l2 = ((r->switch_id - p->num_switches[0]) % p->l1_set_size)/rep * p->Ns;
r->con_per_uneigh = 1;
......@@ -1612,7 +1611,7 @@ void ft_packet_generate(ft_terminal_state * s, tw_bf * bf, fattree_message * msg
int target_queue = msg->rail_id;
if(s->params->rail_select == RAIL_ADAPTIVE &&
msg->total_size > s->params->rail_size_limit) {
(int)msg->total_size > s->params->rail_size_limit) {
int curr_buffer = s->terminal_length[target_queue];
for(int i = 1; i < s->params->ports_per_nic; i++) {
int next = (msg->rail_id + i) % s->params->ports_per_nic;
......@@ -1812,7 +1811,7 @@ void ft_packet_send(ft_terminal_state * s, tw_bf * bf, fattree_message * msg,
s->packet_counter++;
s->vc_occupancy[msg->vc_index] += s->params->chunk_size;
cur_entry = return_head(s->terminal_msgs, s->terminal_msgs_tail, msg->vc_index);
rc_stack_push(lp, cur_entry, delete_fattree_message_list, s->st);
rc_stack_push(lp, cur_entry, (void*)delete_fattree_message_list, s->st);
s->terminal_length[msg->vc_index] -= s->params->chunk_size;
// if(s->terminal_id == 1)
......@@ -2090,7 +2089,7 @@ void switch_packet_send( switch_state * s, tw_bf * bf, fattree_message * msg,
cur_entry = return_head(s->pending_msgs, s->pending_msgs_tail,
output_port);
rc_stack_push(lp, cur_entry, delete_fattree_message_list, s->st);
rc_stack_push(lp, cur_entry, (void*)delete_fattree_message_list, s->st);
s->next_output_available_time[output_port] -= s->params->router_delay;
ts -= s->params->router_delay;
......@@ -2747,7 +2746,7 @@ void fattree_terminal_final( ft_terminal_state * s, tw_lp * lp )
if(!s->terminal_id && !s->rail_id)
written = sprintf(s->output_buf, "# Format <LP id> <Terminal ID> <Rail ID> <Total Data Size> <Avg packet latency> <# Flits/Packets finished> <Avg hops> <Busy Time>\n");
written += sprintf(s->output_buf + written, "%llu %u %u %ld %lf %ld %lf %lf\n",
written += sprintf(s->output_buf + written, "%llu %u %u %llu %lf %ld %lf %lf\n",
LLU(lp->gid), s->terminal_id, s->rail_id, s->total_msg_size, s->total_time,
s->finished_packets, (double)s->total_hops/s->finished_chunks,
s->busy_time[0]);
......
......@@ -326,7 +326,7 @@ static model_net_event_return model_net_event_impl_base(
tw_lpid dest_mn_lp = model_net_find_local_device_mctx(net_id, recv_map_ctx,
final_dest_lp);
if (src_mn_lp == dest_mn_lp && message_size < codes_node_eager_limit)
if (src_mn_lp == dest_mn_lp && message_size < (uint64_t)codes_node_eager_limit)
return model_net_noop_event(final_dest_lp, is_pull, offset, message_size,
remote_event_size, remote_event, self_event_size, self_event,
sender);
......
......@@ -596,7 +596,6 @@ static void slimfly_report_stats()
int total_minimal_packets, total_nonmin_packets;
float throughput_avg = 0.0;
float throughput_avg2 = 0.0;
char log[300];
MPI_Reduce( &total_hops, &avg_hops, 1, MPI_LONG_LONG, MPI_SUM, 0, MPI_COMM_WORLD);
MPI_Reduce( &N_finished_packets, &total_finished_packets, 1, MPI_LONG_LONG, MPI_SUM, 0, MPI_COMM_WORLD);
......@@ -1224,7 +1223,8 @@ void slim_packet_generate(terminal_state * s, tw_bf * bf, slim_terminal_message
assert(lp->gid != msg->dest_terminal_id);
const slimfly_param *p = s->params;
int i, total_event_size;
uint64_t i;
int total_event_size;
uint64_t num_chunks = msg->packet_size / p->chunk_size;
if (msg->packet_size % s->params->chunk_size)
num_chunks++;
......@@ -1876,7 +1876,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("[%llu] leftover terminal messages \n", lp->gid);
if(!s->terminal_id)
{
......@@ -1911,11 +1911,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,
printf("[%llu] 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("[%llu] lefover pending messages %d %d\n", lp->gid, i, j);
}
}
}
......
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