Commit 4b6b67e7 authored by Misbah Mubarak's avatar Misbah Mubarak

updating synthetic traffic statistics to display avg and max message times

parent 5fcc75db
......@@ -258,6 +258,8 @@ struct nw_state
double compute_time;
/* time spent in message send/isend */
double send_time;
/* max time for synthetic traffic message */
double max_time;
/* time spent in message receive */
double recv_time;
/* time spent in wait operation */
......@@ -813,6 +815,7 @@ void arrive_syn_tr_rc(nw_state * s, tw_bf * bf, nw_message * m, tw_lp * lp)
s->syn_data -= data;
num_syn_bytes_recvd -= data;
s->num_bytes_recvd -= data;
s->send_time = m->rc.saved_send_time;
}
void arrive_syn_tr(nw_state * s, tw_bf * bf, nw_message * m, tw_lp * lp)
{
......@@ -836,6 +839,10 @@ void arrive_syn_tr(nw_state * s, tw_bf * bf, nw_message * m, tw_lp * lp)
upper_threshold += 1048576;
}*/
}
m->rc.saved_send_time = s->send_time;
if(tw_now(lp) - m->fwd.sim_start_time > s->max_time)
s->max_time = tw_now(lp) - m->fwd.sim_start_time;
s->send_time += (tw_now(lp) - m->fwd.sim_start_time);
s->num_recvs++;
int data = m->fwd.num_bytes;
......@@ -1951,6 +1958,7 @@ void nw_test_init(nw_state* s, tw_lp* lp)
s->all_reduce_time = 0;
s->prev_switch = 0;
s->saved_perm_dest = -1;
s->max_time = 0;
char type_name[512];
......@@ -2466,9 +2474,6 @@ void nw_test_finalize(nw_state* s, tw_lp* lp)
int written = 0;
double avg_msg_time = 0;
if(!s->nw_id)
written = sprintf(s->output_buf, "# Format <LP ID> <Terminal ID> <Job ID> <Rank ID> <Total sends> <Total Recvs> <Bytes sent> <Bytes recvd> <Send time> <Comm. time> <Compute time> <Job ID>");
/*if(s->wait_op)
{
lprintf("\n Incomplete wait operation Rank %llu ", s->nw_id);
......@@ -2530,10 +2535,10 @@ void nw_test_finalize(nw_state* s, tw_lp* lp)
written = 0;
if(!s->nw_id)
written = sprintf(s->output_buf, "# Format <LP ID> <Terminal ID> <Job ID> <Local Rank> <Total sends> <Total Recvs> <Bytes sent> <Bytes recvd> <Send time> <Comm. time> <Compute time> <Avg msg time>");
written = sprintf(s->output_buf, "# Format <LP ID> <Terminal ID> <Job ID> <Local Rank> <Total sends> <Total Recvs> <Bytes sent> <Bytes recvd> <Send time> <Comm. time> <Compute time> <Avg msg time> <Max Msg Time>");
written += sprintf(s->output_buf + written, "\n %llu %llu %d %d %ld %ld %ld %ld %lf %lf %lf %lf", LLU(lp->gid), LLU(s->nw_id), s->app_id, s->local_rank, s->num_sends, s->num_recvs, s->num_bytes_sent,
s->num_bytes_recvd, s->send_time, s->elapsed_time - s->compute_time, s->compute_time, avg_msg_time);
written += sprintf(s->output_buf + written, "\n %llu %llu %d %d %ld %ld %ld %ld %lf %lf %lf %lf %lf", LLU(lp->gid), LLU(s->nw_id), s->app_id, s->local_rank, s->num_sends, s->num_recvs, s->num_bytes_sent,
s->num_bytes_recvd, s->send_time, s->elapsed_time - s->compute_time, s->compute_time, avg_msg_time, s->max_time);
lp_io_write(lp->gid, (char*)"mpi-replay-stats", written, s->output_buf);
if(s->elapsed_time - s->compute_time > max_comm_time)
......
......@@ -1542,10 +1542,21 @@ static void router_credit_send(router_state * s, terminal_custom_message * msg,
static void packet_generate_rc(terminal_state * s, tw_bf * bf, terminal_custom_message * msg, tw_lp * lp)
{
int num_qos_levels = s->params->num_qos_levels;
if(bf->c1)
s->is_monitoring_bw = 0;
s->packet_gen--;
packet_gen--;
s->packet_counter--;
if(bf->c2)
num_local_packets_sr--;
if(bf->c3)
num_local_packets_sg--;
if(bf->c4)
num_remote_packets--;
tw_rand_reverse_unif(lp->rng);
int num_chunks = msg->packet_size/s->params->chunk_size;
......@@ -1554,6 +1565,13 @@ static void packet_generate_rc(terminal_state * s, tw_bf * bf, terminal_custom_m
int i;
int vcg = 0;
if(num_qos_levels > 1)
{
vcg = get_vcg_from_category(msg);
assert(vcg == Q_HIGH || vcg == Q_MEDIUM);
}
assert(vcg < num_qos_levels);
for(i = 0; i < num_chunks; i++) {
delete_terminal_custom_message_list(return_tail(s->terminal_msgs,
s->terminal_msgs_tail, vcg));
......@@ -1589,6 +1607,7 @@ static void packet_generate(terminal_state * s, tw_bf * bf, terminal_custom_mess
s->router_id / num_routers_per_mgrp, s->router_id % num_routers_per_mgrp, &router_id);
if(s->is_monitoring_bw == 0)
{
bf->c1 = 1;
/* Issue an event on both terminal and router to monitor bandwidth */
tw_stime bw_ts = bw_reset_window + codes_local_latency(lp);
terminal_custom_message * m;
......@@ -1632,12 +1651,19 @@ static void packet_generate(terminal_state * s, tw_bf * bf, terminal_custom_mess
if(src_grp_id == dest_grp_id)
{
if(dest_router_id == s->router_id)
{
bf->c2 = 1;
num_local_packets_sr++;
}
else
{
bf->c3 = 1;
num_local_packets_sg++;
}
}
else
{
bf->c4 = 1;
num_remote_packets++;
}
nic_ts = g_tw_lookahead + (num_chunks * cn_delay) + tw_rand_unif(lp->rng);
......@@ -1867,7 +1893,6 @@ static void packet_send_rc(terminal_state * s, tw_bf * bf, terminal_custom_messa
{
int num_qos_levels = s->params->num_qos_levels;
int vcg = 0;
if(bf->c1) {
s->in_send_loop = 1;
......
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