...
 
Commits (4)
......@@ -352,7 +352,7 @@ static void codes_exec_mpi_recv_rc(
nw_state* s, tw_bf * bf, nw_message* m, tw_lp* lp);
/* execute the computational delay */
static void codes_exec_comp_delay(
nw_state* s, nw_message * m, tw_lp* lp, struct codes_workload_op * mpi_op);
nw_state* s, tw_bf *bf, nw_message * m, tw_lp* lp, struct codes_workload_op * mpi_op);
/* gets the next MPI operation from the network-workloads API. */
static void get_next_mpi_operation(
nw_state* s, tw_bf * bf, nw_message * m, tw_lp * lp);
......@@ -1296,7 +1296,7 @@ static int rm_matching_send(nw_state * ns,
if(qitem->op_type == CODES_WK_IRECV && !is_rend)
{
bf->c9 = 1;
bf->c29 = 1;
update_completed_queue(ns, bf, m, lp, qitem->req_id);
}
else
......@@ -1338,8 +1338,9 @@ static void codes_issue_next_event(tw_lp* lp)
/* Simulate delays between MPI operations */
static void codes_exec_comp_delay(
nw_state* s, nw_message * m, tw_lp* lp, struct codes_workload_op * mpi_op)
nw_state* s, tw_bf *bf, nw_message * m, tw_lp* lp, struct codes_workload_op * mpi_op)
{
bf->c28 = 0;
tw_event* e;
tw_stime ts;
nw_message* msg;
......@@ -1348,7 +1349,10 @@ static void codes_exec_comp_delay(
s->compute_time += mpi_op->u.delay.nsecs;
ts = mpi_op->u.delay.nsecs;
if(ts <= g_tw_lookahead)
{
bf->c28 = 1;
ts = g_tw_lookahead + 0.1 + tw_rand_exponential(lp->rng, noise);
}
//ts += g_tw_lookahead + 0.1 + tw_rand_exponential(lp->rng, noise);
assert(ts > 0);
......@@ -1372,6 +1376,8 @@ static void codes_exec_mpi_recv_rc(
if(bf->c11)
codes_issue_next_event_rc(lp);
if(bf->c6)
codes_issue_next_event_rc(lp);
if(m->fwd.found_match >= 0)
{
ns->recv_time = m->rc.saved_recv_time;
......@@ -1399,12 +1405,10 @@ static void codes_exec_mpi_recv_rc(
index++;
}
}
if(bf->c9)
if(bf->c29)
{
update_completed_queue_rc(ns, bf, m, lp);
}
if(bf->c6)
codes_issue_next_event_rc(lp);
}
else if(m->fwd.found_match < 0)
{
......@@ -1492,7 +1496,12 @@ static void codes_exec_mpi_send_rc(nw_state * s, tw_bf * bf, nw_message * m, tw_
if(bf->c15 || bf->c16)
s->num_sends--;
model_net_event_rc2(lp, &m->event_rc);
if (bf->c15)
model_net_event_rc2(lp, &m->event_rc);
if (bf->c16)
model_net_event_rc2(lp, &m->event_rc);
if (bf->c17)
model_net_event_rc2(lp, &m->event_rc);
if(bf->c4)
codes_issue_next_event_rc(lp);
......@@ -1606,6 +1615,7 @@ static void codes_exec_mpi_send(nw_state* s,
}
else if(is_rend == 1)
{
bf->c17 = 1;
/* initiate the actual data transfer, local completion message is sent
* for any blocking sends. */
local_m.fwd.sim_start_time = mpi_op->sim_start_time;
......@@ -1656,14 +1666,14 @@ static tw_stime ns_to_s(tw_stime ns)
static void update_completed_queue_rc(nw_state * s, tw_bf * bf, nw_message * m, tw_lp * lp)
{
if(bf->c0)
if(bf->c30)
{
struct qlist_head * ent = qlist_pop(&s->completed_reqs);
completed_requests * req = qlist_entry(ent, completed_requests, ql);
free(req);
}
else if(bf->c1)
else if(bf->c31)
{
struct pending_waits* wait_elem = (struct pending_waits*)rc_stack_pop(s->processed_wait_op);
s->wait_op = wait_elem;
......@@ -1681,8 +1691,8 @@ static void update_completed_queue(nw_state* s,
tw_lp * lp,
dumpi_req_id req_id)
{
bf->c0 = 0;
bf->c1 = 0;
bf->c30 = 0;
bf->c31 = 0;
m->fwd.num_matched = 0;
int waiting = 0;
......@@ -1690,7 +1700,7 @@ static void update_completed_queue(nw_state* s,
if(!waiting)
{
bf->c0 = 1;
bf->c30 = 1;
completed_requests * req = (completed_requests*)malloc(sizeof(completed_requests));
req->req_id = req_id;
qlist_add(&req->ql, &s->completed_reqs);
......@@ -1703,7 +1713,7 @@ static void update_completed_queue(nw_state* s,
}
else
{
bf->c1 = 1;
bf->c31 = 1;
m->fwd.num_matched = clear_completed_reqs(s, lp, s->wait_op->req_ids, s->wait_op->count);
m->rc.saved_wait_time = s->wait_time;
......@@ -1793,8 +1803,8 @@ static void update_arrival_queue_rc(nw_state* s,
if(bf->c12)
s->recv_time = m->rc.saved_recv_time;
if(bf->c10)
send_ack_back_rc(s, bf, m, lp);
//if(bf->c10)
// send_ack_back_rc(s, bf, m, lp);
if(bf->c9)
update_completed_queue_rc(s, bf, m, lp);
if(bf->c8)
......@@ -2229,14 +2239,15 @@ static void get_next_mpi_operation_rc(nw_state* s, tw_bf * bf, nw_message * m, t
codes_issue_next_event_rc(lp);
else
{
tw_rand_reverse_unif(lp->rng);
if (bf->c28)
tw_rand_reverse_unif(lp->rng);
s->compute_time = m->rc.saved_delay;
}
}
break;
case CODES_WK_ALLREDUCE:
{
if(bf->c1)
if(bf->c27)
{
s->num_all_reduce--;
s->col_time = m->rc.saved_send_time;
......@@ -2350,7 +2361,7 @@ static void get_next_mpi_operation(nw_state* s, tw_bf * bf, nw_message * m, tw_l
if(disable_delay)
codes_issue_next_event(lp);
else
codes_exec_comp_delay(s, m, lp, mpi_op);
codes_exec_comp_delay(s, bf, m, lp, mpi_op);
}
break;
......@@ -2384,7 +2395,7 @@ static void get_next_mpi_operation(nw_state* s, tw_bf * bf, nw_message * m, tw_l
s->num_cols++;
if(s->col_time > 0)
{
bf->c1 = 1;
bf->c27 = 1;
m->rc.saved_delay = s->all_reduce_time;
s->all_reduce_time += (tw_now(lp) - s->col_time);
m->rc.saved_send_time = s->col_time;
......
......@@ -253,9 +253,12 @@ static void handle_kickoff_rev_event(
{
(void)b;
(void)m;
ns->msg_sent_count--;
model_net_event_rc2(lp, &m->event_rc);
tw_rand_reverse_unif(lp->rng);
ns->msg_sent_count--;
model_net_event_rc2(lp, &m->event_rc);
tw_rand_reverse_unif(lp->rng); // reversing RNG in issue_event
if (traffic == UNIFORM)
tw_rand_reverse_unif(lp->rng);
}
static void handle_kickoff_event(
svr_state * ns,
......
......@@ -1900,7 +1900,7 @@ void switch_packet_receive_rc(switch_state * s,
s_arrive_r++;
#endif
int output_port = msg->saved_vc;
if(s->params->routing != STATIC) {
if(s->params->routing != STATIC && !bf->c10) {
tw_rand_reverse_unif(lp->rng);
}
if(bf->c1)
......@@ -2669,6 +2669,7 @@ int ft_get_output_port( switch_state * s, tw_bf * bf, fattree_message * msg,
tw_lp * lp, int *out_off) {
(void)bf;
(void)lp;
bf->c10 = 0;
int outport = -1;
int start_port, end_port;
fattree_param *p = s->params;
......@@ -2694,6 +2695,7 @@ int ft_get_output_port( switch_state * s, tw_bf * bf, fattree_message * msg,
if(dest_term_local_id >= s->start_lneigh && dest_term_local_id < s->end_lneigh) {
outport = dest_term_local_id - s->start_lneigh;
*out_off = 0;
bf->c10 = 1;
return outport;
} else { //go up the least congested path
start_port = s->num_lcons;
......
......@@ -271,12 +271,12 @@ static model_net_event_return model_net_noop_event(
model_net_event_return num_rng_calls = 0;
tw_stime poffset = mn_in_sequence ? mn_msg_offset : 0.0;
tw_stime delay = codes_local_latency(sender);
num_rng_calls++; // rng call is in codes_local_latency
tw_stime sendTime = message_size * codes_cn_delay;
if (self_event_size && self_event != NULL) {
poffset += delay;
num_rng_calls++;
tw_event *e = tw_event_new(sender->gid, poffset+offset+sendTime, sender);
memcpy(tw_event_data(e), self_event, self_event_size);
tw_event_send(e);
......@@ -284,7 +284,6 @@ static model_net_event_return model_net_noop_event(
if (remote_event_size && remote_event != NULL) {
poffset += delay;
num_rng_calls++;
/* special case - in a "pull" event, the "remote" message is actually
* to self */
tw_event *e = tw_event_new(is_pull ? sender->gid : final_dest_lp,
......