Commit 41ae1387 authored by Giorgis Georgakoudis's avatar Giorgis Georgakoudis

Update the power model

- Incur delay without power savings when transmission is within the t_sleep interval
- Remove t_sleep from fast-wake since it's not applicable
parent f5daad8c
......@@ -1126,7 +1126,7 @@ terminal_custom_init( terminal_state * s,
s->in_send_loop = 0;
s->issueIdle = 0;
#if defined(TRACE_RP)
s->traceRP_next_fast_wake_shutdown_time = s->params->traceRP_t_sleep + s->params->traceRP_t_fast_wake_wait;
s->traceRP_next_fast_wake_shutdown_time = s->params->traceRP_t_fast_wake_wait;
s->traceRP_next_deep_sleep_shutdown_time = s->params->traceRP_t_sleep + s->params->traceRP_t_sleep_wait;
if( s->params->traceRP_enable_fast_wake )
s->traceRP_next_deep_sleep_shutdown_time += s->traceRP_next_fast_wake_shutdown_time;
......@@ -1259,7 +1259,7 @@ void router_custom_setup(router_state * r, tw_lp * lp)
for(int i = 0; i < p->radix; i++) {
r->traceRP_port_to_nodeid[i].type = -1;
r->traceRP_port_to_nodeid[i].id = -1;
r->traceRP_next_fast_wake_shutdown_time[i] = r->params->traceRP_t_sleep + r->params->traceRP_t_fast_wake_wait;
r->traceRP_next_fast_wake_shutdown_time[i] = r->params->traceRP_t_fast_wake_wait;
r->traceRP_next_deep_sleep_shutdown_time[i] = r->params->traceRP_t_sleep + r->params->traceRP_t_sleep_wait;
if( r->params->traceRP_enable_fast_wake )
r->traceRP_next_deep_sleep_shutdown_time[i] += r->traceRP_next_fast_wake_shutdown_time[i];
......@@ -4413,8 +4413,12 @@ static void traceRP_update_activity(
) {
unsigned t_delay = 0;
if(p->traceRP_enable_fast_wake && p->traceRP_enable_deep_sleep) {
tw_stime start_signal_sleep_time = *next_deep_sleep_shutdown_time - p->traceRP_t_sleep;
assert( start_signal_sleep_time >= *next_fast_wake_shutdown_time );
if( *next_fast_wake_shutdown_time < now
&& now < *next_deep_sleep_shutdown_time ) {
&& now <= *next_deep_sleep_shutdown_time ) {
t_delay = p->traceRP_t_fast_wake;
......@@ -4423,6 +4427,12 @@ static void traceRP_update_activity(
assert(now >= *total_fast_wake_time);
}
else if( start_signal_sleep_time <= now && now < *next_deep_sleep_shutdown_time ) {
t_delay = p->traceRP_t_wake;
tw_stime t_fast_wake_time = start_signal_sleep_time - *next_fast_wake_shutdown_time;
*total_fast_wake_time += t_fast_wake_time;
}
else if( *next_deep_sleep_shutdown_time < now ) {
t_delay = p->traceRP_t_wake;
......@@ -4445,7 +4455,7 @@ static void traceRP_update_activity(
}
*available_time += t_delay;
*next_fast_wake_shutdown_time = *available_time + p->traceRP_t_sleep + p->traceRP_t_fast_wake_wait;
*next_fast_wake_shutdown_time = *available_time + p->traceRP_t_fast_wake_wait;
*next_deep_sleep_shutdown_time = *available_time + *next_fast_wake_shutdown_time + p->traceRP_t_sleep + p->traceRP_t_sleep_wait;
}
else if(p->traceRP_enable_fast_wake) {
......@@ -4459,10 +4469,14 @@ static void traceRP_update_activity(
}
*available_time += t_delay;
*next_fast_wake_shutdown_time = *available_time + p->traceRP_t_sleep + p->traceRP_t_fast_wake_wait;
*next_fast_wake_shutdown_time = *available_time + p->traceRP_t_fast_wake_wait;
}
else if(p->traceRP_enable_deep_sleep) {
if( *next_deep_sleep_shutdown_time < now ) {
tw_stime start_signal_sleep_time = *next_deep_sleep_shutdown_time - p->traceRP_t_sleep;
if( start_signal_sleep_time <= now && now < *next_deep_sleep_shutdown_time ) {
t_delay = p->traceRP_t_wake;
}
else if( *next_deep_sleep_shutdown_time < now ) {
t_delay = p->traceRP_t_wake;
tw_stime t_sleeping = now - *next_deep_sleep_shutdown_time;
......
......@@ -975,7 +975,7 @@ terminal_init( terminal_state * s,
s->busy_time_ross_sample = 0.0;
#if defined(TRACE_RP)
s->traceRP_next_fast_wake_shutdown_time = s->params->traceRP_t_sleep + s->params->traceRP_t_fast_wake_wait;
s->traceRP_next_fast_wake_shutdown_time = s->params->traceRP_t_fast_wake_wait;
s->traceRP_next_deep_sleep_shutdown_time = s->params->traceRP_t_sleep + s->params->traceRP_t_sleep_wait;
if( s->params->traceRP_enable_fast_wake )
s->traceRP_next_deep_sleep_shutdown_time += s->traceRP_next_fast_wake_shutdown_time;
......@@ -1155,7 +1155,7 @@ static void router_setup(router_state * r, tw_lp * lp)
for(int i = 0; i < p->radix; i++) {
r->traceRP_port_to_nodeid[i].type = -1;
r->traceRP_port_to_nodeid[i].id = -1;
r->traceRP_next_fast_wake_shutdown_time[i] = r->params->traceRP_t_sleep + r->params->traceRP_t_fast_wake_wait;
r->traceRP_next_fast_wake_shutdown_time[i] = r->params->traceRP_t_fast_wake_wait;
r->traceRP_next_deep_sleep_shutdown_time[i] = r->params->traceRP_t_sleep + r->params->traceRP_t_sleep_wait;
if( r->params->traceRP_enable_fast_wake )
r->traceRP_next_deep_sleep_shutdown_time[i] += r->traceRP_next_fast_wake_shutdown_time[i];
......@@ -4054,8 +4054,12 @@ static void traceRP_update_activity(
) {
unsigned t_delay = 0;
if(p->traceRP_enable_fast_wake && p->traceRP_enable_deep_sleep) {
tw_stime start_signal_sleep_time = *next_deep_sleep_shutdown_time - p->traceRP_t_sleep;
assert( start_signal_sleep_time >= *next_fast_wake_shutdown_time );
if( *next_fast_wake_shutdown_time < now
&& now < *next_deep_sleep_shutdown_time ) {
&& now <= *next_deep_sleep_shutdown_time ) {
t_delay = p->traceRP_t_fast_wake;
......@@ -4064,6 +4068,12 @@ static void traceRP_update_activity(
assert(now >= *total_fast_wake_time);
}
else if( start_signal_sleep_time <= now && now < *next_deep_sleep_shutdown_time ) {
t_delay = p->traceRP_t_wake;
tw_stime t_fast_wake_time = start_signal_sleep_time - *next_fast_wake_shutdown_time;
*total_fast_wake_time += t_fast_wake_time;
}
else if( *next_deep_sleep_shutdown_time < now ) {
t_delay = p->traceRP_t_wake;
......@@ -4086,7 +4096,7 @@ static void traceRP_update_activity(
}
*available_time += t_delay;
*next_fast_wake_shutdown_time = *available_time + p->traceRP_t_sleep + p->traceRP_t_fast_wake_wait;
*next_fast_wake_shutdown_time = *available_time + p->traceRP_t_fast_wake_wait;
*next_deep_sleep_shutdown_time = *available_time + *next_fast_wake_shutdown_time + p->traceRP_t_sleep + p->traceRP_t_sleep_wait;
}
else if(p->traceRP_enable_fast_wake) {
......@@ -4100,10 +4110,14 @@ static void traceRP_update_activity(
}
*available_time += t_delay;
*next_fast_wake_shutdown_time = *available_time + p->traceRP_t_sleep + p->traceRP_t_fast_wake_wait;
*next_fast_wake_shutdown_time = *available_time + p->traceRP_t_fast_wake_wait;
}
else if(p->traceRP_enable_deep_sleep) {
if( *next_deep_sleep_shutdown_time < now ) {
tw_stime start_signal_sleep_time = *next_deep_sleep_shutdown_time - p->traceRP_t_sleep;
if( start_signal_sleep_time <= now && now < *next_deep_sleep_shutdown_time ) {
t_delay = p->traceRP_t_wake;
}
else if( *next_deep_sleep_shutdown_time < now ) {
t_delay = p->traceRP_t_wake;
tw_stime t_sleeping = now - *next_deep_sleep_shutdown_time;
......
......@@ -726,7 +726,7 @@ static void terminal_init( terminal_state * s, tw_lp * lp )
s->issueIdle = 0;
#if defined(TRACE_RP)
s->traceRP_next_fast_wake_shutdown_time = s->params->traceRP_t_sleep + s->params->traceRP_t_fast_wake_wait;
s->traceRP_next_fast_wake_shutdown_time = s->params->traceRP_t_fast_wake_wait;
s->traceRP_next_deep_sleep_shutdown_time = s->params->traceRP_t_sleep + s->params->traceRP_t_sleep_wait;
if( s->params->traceRP_enable_fast_wake )
s->traceRP_next_deep_sleep_shutdown_time += s->traceRP_next_fast_wake_shutdown_time;
......@@ -872,7 +872,7 @@ static void router_setup(router_state * r, tw_lp * lp)
for(int i = 0; i < p->radix; i++) {
r->traceRP_port_to_nodeid[i].type = -1;
r->traceRP_port_to_nodeid[i].id = -1;
r->traceRP_next_fast_wake_shutdown_time[i] = r->params->traceRP_t_sleep + r->params->traceRP_t_fast_wake_wait;
r->traceRP_next_fast_wake_shutdown_time[i] = r->params->traceRP_t_fast_wake_wait;
r->traceRP_next_deep_sleep_shutdown_time[i] = r->params->traceRP_t_sleep + r->params->traceRP_t_sleep_wait;
if( r->params->traceRP_enable_fast_wake )
r->traceRP_next_deep_sleep_shutdown_time[i] += r->traceRP_next_fast_wake_shutdown_time[i];
......@@ -2832,8 +2832,12 @@ static void traceRP_update_activity(
) {
unsigned t_delay = 0;
if(p->traceRP_enable_fast_wake && p->traceRP_enable_deep_sleep) {
tw_stime start_signal_sleep_time = *next_deep_sleep_shutdown_time - p->traceRP_t_sleep;
assert( start_signal_sleep_time >= *next_fast_wake_shutdown_time );
if( *next_fast_wake_shutdown_time < now
&& now < *next_deep_sleep_shutdown_time ) {
&& now <= *next_deep_sleep_shutdown_time ) {
t_delay = p->traceRP_t_fast_wake;
......@@ -2842,6 +2846,12 @@ static void traceRP_update_activity(
assert(now >= *total_fast_wake_time);
}
else if( start_signal_sleep_time <= now && now < *next_deep_sleep_shutdown_time ) {
t_delay = p->traceRP_t_wake;
tw_stime t_fast_wake_time = start_signal_sleep_time - *next_fast_wake_shutdown_time;
*total_fast_wake_time += t_fast_wake_time;
}
else if( *next_deep_sleep_shutdown_time < now ) {
t_delay = p->traceRP_t_wake;
......@@ -2864,7 +2874,7 @@ static void traceRP_update_activity(
}
*available_time += t_delay;
*next_fast_wake_shutdown_time = *available_time + p->traceRP_t_sleep + p->traceRP_t_fast_wake_wait;
*next_fast_wake_shutdown_time = *available_time + p->traceRP_t_fast_wake_wait;
*next_deep_sleep_shutdown_time = *available_time + *next_fast_wake_shutdown_time + p->traceRP_t_sleep + p->traceRP_t_sleep_wait;
}
else if(p->traceRP_enable_fast_wake) {
......@@ -2878,10 +2888,14 @@ static void traceRP_update_activity(
}
*available_time += t_delay;
*next_fast_wake_shutdown_time = *available_time + p->traceRP_t_sleep + p->traceRP_t_fast_wake_wait;
*next_fast_wake_shutdown_time = *available_time + p->traceRP_t_fast_wake_wait;
}
else if(p->traceRP_enable_deep_sleep) {
if( *next_deep_sleep_shutdown_time < now ) {
tw_stime start_signal_sleep_time = *next_deep_sleep_shutdown_time - p->traceRP_t_sleep;
if( start_signal_sleep_time <= now && now < *next_deep_sleep_shutdown_time ) {
t_delay = p->traceRP_t_wake;
}
else if( *next_deep_sleep_shutdown_time < now ) {
t_delay = p->traceRP_t_wake;
tw_stime t_sleeping = now - *next_deep_sleep_shutdown_time;
......@@ -2902,6 +2916,7 @@ static void traceRP_update_activity(
}
}
static void traceRP_terminal_finalize( terminal_state * s, tw_lp * lp ) {
int written = 0;
char output_buf[1024];
......
......@@ -1220,7 +1220,7 @@ void ft_terminal_init( ft_terminal_state * s, tw_lp * lp )
#if defined(TRACE_RP)
s->traceRP_port_to_nodeid[i].type = -1;
s->traceRP_port_to_nodeid[i].id= -1;
s->traceRP_next_fast_wake_shutdown_time[i] = s->params->traceRP_t_sleep + s->params->traceRP_t_fast_wake_wait;
s->traceRP_next_fast_wake_shutdown_time[i] = s->params->traceRP_t_fast_wake_wait;
s->traceRP_next_deep_sleep_shutdown_time[i] = s->params->traceRP_t_sleep + s->params->traceRP_t_sleep_wait;
if( s->params->traceRP_enable_fast_wake )
s->traceRP_next_deep_sleep_shutdown_time[i] += s->traceRP_next_fast_wake_shutdown_time[i];
......@@ -1372,7 +1372,7 @@ void switch_init(switch_state * r, tw_lp * lp)
for(int i = 0; i < r->radix; i++) {
r->traceRP_port_to_nodeid[i].type = -1;
r->traceRP_port_to_nodeid[i].id = -1;
r->traceRP_next_fast_wake_shutdown_time[i] = r->params->traceRP_t_sleep + r->params->traceRP_t_fast_wake_wait;
r->traceRP_next_fast_wake_shutdown_time[i] = r->params->traceRP_t_fast_wake_wait;
r->traceRP_next_deep_sleep_shutdown_time[i] = r->params->traceRP_t_sleep + r->params->traceRP_t_sleep_wait;
if( r->params->traceRP_enable_fast_wake )
r->traceRP_next_deep_sleep_shutdown_time[i] += r->traceRP_next_fast_wake_shutdown_time[i];
......@@ -3525,8 +3525,12 @@ static void traceRP_update_activity(
) {
unsigned t_delay = 0;
if(p->traceRP_enable_fast_wake && p->traceRP_enable_deep_sleep) {
tw_stime start_signal_sleep_time = *next_deep_sleep_shutdown_time - p->traceRP_t_sleep;
assert( start_signal_sleep_time >= *next_fast_wake_shutdown_time );
if( *next_fast_wake_shutdown_time < now
&& now < *next_deep_sleep_shutdown_time ) {
&& now <= *next_deep_sleep_shutdown_time ) {
t_delay = p->traceRP_t_fast_wake;
......@@ -3535,6 +3539,12 @@ static void traceRP_update_activity(
assert(now >= *total_fast_wake_time);
}
else if( start_signal_sleep_time <= now && now < *next_deep_sleep_shutdown_time ) {
t_delay = p->traceRP_t_wake;
tw_stime t_fast_wake_time = start_signal_sleep_time - *next_fast_wake_shutdown_time;
*total_fast_wake_time += t_fast_wake_time;
}
else if( *next_deep_sleep_shutdown_time < now ) {
t_delay = p->traceRP_t_wake;
......@@ -3557,7 +3567,7 @@ static void traceRP_update_activity(
}
*available_time += t_delay;
*next_fast_wake_shutdown_time = *available_time + p->traceRP_t_sleep + p->traceRP_t_fast_wake_wait;
*next_fast_wake_shutdown_time = *available_time + p->traceRP_t_fast_wake_wait;
*next_deep_sleep_shutdown_time = *available_time + *next_fast_wake_shutdown_time + p->traceRP_t_sleep + p->traceRP_t_sleep_wait;
}
else if(p->traceRP_enable_fast_wake) {
......@@ -3571,10 +3581,14 @@ static void traceRP_update_activity(
}
*available_time += t_delay;
*next_fast_wake_shutdown_time = *available_time + p->traceRP_t_sleep + p->traceRP_t_fast_wake_wait;
*next_fast_wake_shutdown_time = *available_time + p->traceRP_t_fast_wake_wait;
}
else if(p->traceRP_enable_deep_sleep) {
if( *next_deep_sleep_shutdown_time < now ) {
tw_stime start_signal_sleep_time = *next_deep_sleep_shutdown_time - p->traceRP_t_sleep;
if( start_signal_sleep_time <= now && now < *next_deep_sleep_shutdown_time ) {
t_delay = p->traceRP_t_wake;
}
else if( *next_deep_sleep_shutdown_time < now ) {
t_delay = p->traceRP_t_wake;
tw_stime t_sleeping = now - *next_deep_sleep_shutdown_time;
......
......@@ -873,7 +873,7 @@ static void torus_init( nodes_state * s,
for(j = 0; j < 2*p->n_dims; j++) {
s->traceRP_port_to_nodeid[j].type = -1;
s->traceRP_port_to_nodeid[j].id = -1;
s->traceRP_next_fast_wake_shutdown_time[j] = s->params->traceRP_t_sleep + s->params->traceRP_t_fast_wake_wait;
s->traceRP_next_fast_wake_shutdown_time[j] = s->params->traceRP_t_fast_wake_wait;
s->traceRP_next_deep_sleep_shutdown_time[j] = s->params->traceRP_t_sleep + s->params->traceRP_t_sleep_wait;
if( s->params->traceRP_enable_fast_wake )
s->traceRP_next_deep_sleep_shutdown_time[j] += s->traceRP_next_fast_wake_shutdown_time[j];
......@@ -2379,8 +2379,12 @@ static void traceRP_update_activity(
) {
unsigned t_delay = 0;
if(p->traceRP_enable_fast_wake && p->traceRP_enable_deep_sleep) {
tw_stime start_signal_sleep_time = *next_deep_sleep_shutdown_time - p->traceRP_t_sleep;
assert( start_signal_sleep_time >= *next_fast_wake_shutdown_time );
if( *next_fast_wake_shutdown_time < now
&& now < *next_deep_sleep_shutdown_time ) {
&& now <= *next_deep_sleep_shutdown_time ) {
t_delay = p->traceRP_t_fast_wake;
......@@ -2389,6 +2393,12 @@ static void traceRP_update_activity(
assert(now >= *total_fast_wake_time);
}
else if( start_signal_sleep_time <= now && now < *next_deep_sleep_shutdown_time ) {
t_delay = p->traceRP_t_wake;
tw_stime t_fast_wake_time = start_signal_sleep_time - *next_fast_wake_shutdown_time;
*total_fast_wake_time += t_fast_wake_time;
}
else if( *next_deep_sleep_shutdown_time < now ) {
t_delay = p->traceRP_t_wake;
......@@ -2411,7 +2421,7 @@ static void traceRP_update_activity(
}
*available_time += t_delay;
*next_fast_wake_shutdown_time = *available_time + p->traceRP_t_sleep + p->traceRP_t_fast_wake_wait;
*next_fast_wake_shutdown_time = *available_time + p->traceRP_t_fast_wake_wait;
*next_deep_sleep_shutdown_time = *available_time + *next_fast_wake_shutdown_time + p->traceRP_t_sleep + p->traceRP_t_sleep_wait;
}
else if(p->traceRP_enable_fast_wake) {
......@@ -2425,10 +2435,14 @@ static void traceRP_update_activity(
}
*available_time += t_delay;
*next_fast_wake_shutdown_time = *available_time + p->traceRP_t_sleep + p->traceRP_t_fast_wake_wait;
*next_fast_wake_shutdown_time = *available_time + p->traceRP_t_fast_wake_wait;
}
else if(p->traceRP_enable_deep_sleep) {
if( *next_deep_sleep_shutdown_time < now ) {
tw_stime start_signal_sleep_time = *next_deep_sleep_shutdown_time - p->traceRP_t_sleep;
if( start_signal_sleep_time <= now && now < *next_deep_sleep_shutdown_time ) {
t_delay = p->traceRP_t_wake;
}
else if( *next_deep_sleep_shutdown_time < now ) {
t_delay = p->traceRP_t_wake;
tw_stime t_sleeping = now - *next_deep_sleep_shutdown_time;
......
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