Commit 0164aa2d authored by Jonathan Jenkins's avatar Jonathan Jenkins

scheduler fix for other networks (NOT torus, simplewan)

Torus and simplewan each have problems precluding them from the current
scheduling fix:
- simplewan - each "device" has N input/output ports. It can't simply tell the
  scheduler when they are (it is?) idle because the scheduler doesn't know which
  packets go to which ports
- torus - also has N input/output ports (two for each dimension). Also, the same
  routing "queue" (via the "next_link_available_time" var) is used for incoming
  and outgoing messages, so we can't guarantee the scheduler that we'll be
  available at time x (an incoming msg could arrive and then be routed at time
  x-1). This isn't a problem for the dragonfly network as terminals aren't
  intermediate routers. Ideally what needs to happen here is for the
  intermediate packets/chunks to be queued up in the scheduler.
parent b3650ede
......@@ -620,6 +620,7 @@ void packet_generate(terminal_state * s, tw_bf * bf, terminal_message * msg, tw_
stat->send_time += (1/p->cn_bandwidth) * msg->packet_size;
if(stat->max_event_size < total_event_size)
stat->max_event_size = total_event_size;
return;
}
......@@ -671,6 +672,11 @@ void packet_send(terminal_state * s, tw_bf * bf, terminal_message * msg, tw_lp *
if(msg->chunk_id == num_chunks - 1)
{
// now that message is sent, issue an "idle" event to tell the scheduler
// when I'm next available
model_net_method_idle_event(codes_local_latency(lp) +
s->terminal_available_time - tw_now(lp), lp);
/* local completion message */
if(msg->local_event_size_bytes > 0)
{
......@@ -1629,6 +1635,11 @@ void terminal_rc_event_handler(terminal_state * s, tw_bf * bf, terminal_message
s->vc_occupancy[vc]--;
s->packet_counter--;
s->output_vc_state[vc] = VC_IDLE;
uint64_t num_chunks = msg->packet_size / s->params->chunk_size;
if (msg->chunk_id == num_chunks-1){
codes_local_latency_reverse(lp);
}
}
break;
......
......@@ -458,7 +458,7 @@ void handle_sched_next(
// currently, loggp is the only network implementing the
// callback-based scheduling loop, all others schedule the next packet
// immediately
else if (ns->net_id != LOGGP){
else if (ns->net_id == SIMPLEWAN || ns->net_id == TORUS){
tw_event *e = codes_event_new(lp->gid,
poffset+codes_local_latency(lp), lp);
model_net_wrap_msg *m = tw_event_data(e);
......@@ -479,7 +479,7 @@ void handle_sched_next_rc(
if (b->c0){
ns->in_sched_loop = 1;
}
else if (ns->net_id != LOGGP){
else if (ns->net_id == SIMPLEWAN || ns->net_id == TORUS){
codes_local_latency_reverse(lp);
}
}
......
......@@ -404,6 +404,8 @@ static void handle_msg_start_rev_event(
{
ns->net_send_next_idle = m->net_send_next_idle_saved;
codes_local_latency_reverse(lp);
if(m->local_event_size_bytes > 0)
{
codes_local_latency_reverse(lp);
......@@ -494,6 +496,11 @@ static void handle_msg_start_event(
//print_msg(m_new);
tw_event_send(e_new);
// now that message is sent, issue an "idle" event to tell the scheduler
// when I'm next available
model_net_method_idle_event(codes_local_latency(lp) +
ns->net_send_next_idle - tw_now(lp), lp);
/* if there is a local event to handle, then create an event for it as
* well
*/
......
......@@ -484,6 +484,7 @@ int main(int argc, char *argv[])
}
testsvr_init();
model_net_register();
codes_mapping_setup();
......
......@@ -13,7 +13,7 @@ PARAMS
# modelnet params
packet_size="2097152";
message_size="560";
modelnet_ordering=( "simplenet" );
modelnet_order=( "simplenet" );
net_startup_ns = "6.782182";
# net bandwidth, in floating point MiB/s
......
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