Commit 3c8a8990 authored by Xin Wang's avatar Xin Wang

collect output for bcast

parent 95a285af
......@@ -2035,7 +2035,7 @@ static void get_next_mpi_operation_rc(nw_state* s, tw_bf * bf, nw_message * m, t
{
if(bf->c1)
{
s->col_latency[s->num_msg_sizes] = 0;
s->col_latency[s->num_msg_sizes] = 0;
s->col_msizes[s->num_msg_sizes] = 0;
//todo: reverse handler for num_msg_sizes
s->num_all_reduce--;
......@@ -2050,6 +2050,22 @@ static void get_next_mpi_operation_rc(nw_state* s, tw_bf * bf, nw_message * m, t
}
break;
case CODES_WK_BCAST:
{
if(bf->c1)
{
s->col_latency[s->num_msg_sizes] = 0;
s->col_msizes[s->num_msg_sizes] = 0;
//todo: reverse handler for num_msg_sizes
s->num_all_reduce--;
s->col_time = m->rc.saved_send_time;
s->all_reduce_time -= s->col_time;
}
else
{
s->col_time = 0;
}
codes_issue_next_event_rc(lp);
}
case CODES_WK_ALLGATHER:
case CODES_WK_ALLGATHERV:
case CODES_WK_ALLTOALL:
......@@ -2183,15 +2199,15 @@ static void get_next_mpi_operation(nw_state* s, tw_bf * bf, nw_message * m, tw_l
{
bf->c1 = 1;
m->rc.saved_delay = s->all_reduce_time;
if(s->num_msg_sizes == 0)
{
s->num_msg_sizes += 1;
}
else if(s->col_msizes[s->num_msg_sizes-1] != mpi_op.u.collective.num_bytes)
{
s->num_msg_sizes += 1;
}
s->col_latency[s->num_msg_sizes-1] += (tw_now(lp) - s->col_time);
if(s->num_msg_sizes == 0)
{
s->num_msg_sizes += 1;
}
else if(s->col_msizes[s->num_msg_sizes-1] != mpi_op.u.collective.num_bytes)
{
s->num_msg_sizes += 1;
}
s->col_latency[s->num_msg_sizes-1] += (tw_now(lp) - s->col_time);
s->col_msizes[s->num_msg_sizes-1] = mpi_op.u.collective.num_bytes;
s->all_reduce_time += (tw_now(lp) - s->col_time);
m->rc.saved_send_time = s->col_time;
......@@ -2208,6 +2224,33 @@ static void get_next_mpi_operation(nw_state* s, tw_bf * bf, nw_message * m, tw_l
case CODES_WK_REDUCE:
case CODES_WK_BCAST:
{
s->num_cols++;
if(s->col_time > 0)
{
bf->c1 = 1;
m->rc.saved_delay = s->all_reduce_time;
if(s->num_msg_sizes == 0)
{
s->num_msg_sizes += 1;
}
else if(s->col_msizes[s->num_msg_sizes-1] != mpi_op.u.collective.num_bytes)
{
s->num_msg_sizes += 1;
}
s->col_latency[s->num_msg_sizes-1] += (tw_now(lp) - s->col_time);
s->col_msizes[s->num_msg_sizes-1] = mpi_op.u.collective.num_bytes;
s->all_reduce_time += (tw_now(lp) - s->col_time);
m->rc.saved_send_time = s->col_time;
s->col_time = 0;
s->num_all_reduce++;
}
else
{
s->col_time = tw_now(lp);
}
codes_issue_next_event(lp);
}
case CODES_WK_ALLGATHER:
case CODES_WK_ALLGATHERV:
case CODES_WK_ALLTOALL:
......
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