Commit f18e903f authored by Misbah Mubarak's avatar Misbah Mubarak
Browse files

Minor updates to dragonfly model

parent c6bc9f8a
...@@ -922,7 +922,7 @@ void packet_generate_rc(terminal_state * s, tw_bf * bf, terminal_message * msg, ...@@ -922,7 +922,7 @@ void packet_generate_rc(terminal_state * s, tw_bf * bf, terminal_message * msg,
num_chunks++; num_chunks++;
if(!num_chunks) if(!num_chunks)
num_chunks++; num_chunks = 1;
int i; int i;
for(i = 0; i < num_chunks; i++) { for(i = 0; i < num_chunks; i++) {
...@@ -959,6 +959,10 @@ void packet_generate(terminal_state * s, tw_bf * bf, terminal_message * msg, ...@@ -959,6 +959,10 @@ void packet_generate(terminal_state * s, tw_bf * bf, terminal_message * msg,
int i, total_event_size; int i, total_event_size;
int num_chunks = msg->packet_size / p->chunk_size; int num_chunks = msg->packet_size / p->chunk_size;
if (msg->packet_size % s->params->chunk_size) num_chunks++; if (msg->packet_size % s->params->chunk_size) num_chunks++;
if(!num_chunks)
num_chunks = 1;
msg->packet_ID = lp->gid + g_tw_nlp * s->packet_counter; msg->packet_ID = lp->gid + g_tw_nlp * s->packet_counter;
msg->travel_start_time = tw_now(lp); msg->travel_start_time = tw_now(lp);
msg->my_N_hop = 0; msg->my_N_hop = 0;
...@@ -1103,6 +1107,9 @@ void packet_send(terminal_state * s, tw_bf * bf, terminal_message * msg, ...@@ -1103,6 +1107,9 @@ void packet_send(terminal_state * s, tw_bf * bf, terminal_message * msg,
if(cur_entry->msg.packet_size % s->params->chunk_size) if(cur_entry->msg.packet_size % s->params->chunk_size)
num_chunks++; num_chunks++;
if(!num_chunks)
num_chunks = 1;
if(cur_entry->msg.chunk_id == num_chunks - 1 && if(cur_entry->msg.chunk_id == num_chunks - 1 &&
(cur_entry->msg.local_event_size_bytes > 0)) { (cur_entry->msg.local_event_size_bytes > 0)) {
bf->c2 = 1; bf->c2 = 1;
...@@ -1187,6 +1194,8 @@ void packet_arrive(terminal_state * s, tw_bf * bf, terminal_message * msg, ...@@ -1187,6 +1194,8 @@ void packet_arrive(terminal_state * s, tw_bf * bf, terminal_message * msg,
int num_chunks = msg->packet_size / s->params->chunk_size; int num_chunks = msg->packet_size / s->params->chunk_size;
if (msg->packet_size % s->params->chunk_size) if (msg->packet_size % s->params->chunk_size)
num_chunks++; num_chunks++;
if(!num_chunks)
num_chunks = 1;
completed_packets++; completed_packets++;
...@@ -1639,7 +1648,7 @@ void dragonfly_router_final(router_state * s, ...@@ -1639,7 +1648,7 @@ void dragonfly_router_final(router_state * s,
tw_lp * lp) tw_lp * lp)
{ {
free(s->global_channel); free(s->global_channel);
char *stats_file = getenv("TRACER_LINK_FILE"); /*char *stats_file = getenv("TRACER_LINK_FILE");
if(stats_file != NULL) { if(stats_file != NULL) {
FILE *fout = fopen(stats_file, "a"); FILE *fout = fopen(stats_file, "a");
const dragonfly_param *p = s->params; const dragonfly_param *p = s->params;
...@@ -1653,7 +1662,7 @@ void dragonfly_router_final(router_state * s, ...@@ -1653,7 +1662,7 @@ void dragonfly_router_final(router_state * s,
fprintf(fout, "\n"); fprintf(fout, "\n");
result = flock(fileno(fout), LOCK_UN); result = flock(fileno(fout), LOCK_UN);
fclose(fout); fclose(fout);
} }*/
int i, j; int i, j;
for(i = 0; i < s->params->radix; i++) { for(i = 0; i < s->params->radix; i++) {
for(j = 0; j < 3; j++) { for(j = 0; j < 3; j++) {
......
...@@ -983,6 +983,7 @@ static void packet_send( nodes_state * s, ...@@ -983,6 +983,7 @@ static void packet_send( nodes_state * s,
if(s->buffer[ tmp_dir + ( tmp_dim * 2 ) ][ 0 ] < s->params->buffer_size) if(s->buffer[ tmp_dir + ( tmp_dim * 2 ) ][ 0 ] < s->params->buffer_size)
{ {
bf->c2 = 1; bf->c2 = 1;
msg->saved_src_dir = tmp_dir; msg->saved_src_dir = tmp_dir;
msg->saved_src_dim = tmp_dim; msg->saved_src_dim = tmp_dim;
...@@ -1070,12 +1071,12 @@ static void packet_arrive( nodes_state * s, ...@@ -1070,12 +1071,12 @@ static void packet_arrive( nodes_state * s,
nodes_message *m; nodes_message *m;
mn_stats* stat; mn_stats* stat;
credit_send( s, bf, lp, msg);
msg->my_N_hop++; msg->my_N_hop++;
ts = 0.1 + tw_rand_exponential(lp->rng, MEAN_INTERVAL/200); ts = 0.1 + tw_rand_exponential(lp->rng, MEAN_INTERVAL/200);
if(msg->packet_ID == TRACE) if(msg->packet_ID == TRACE)
printf("\n packet arrived at lp %d final dest %d ", (int)lp->gid, (int)msg->dest_lp); printf("\n packet arrived at lp %d final dest %d ", (int)lp->gid, (int)msg->dest_lp);
credit_send( s, bf, lp, msg);
if( lp->gid == msg->dest_lp ) if( lp->gid == msg->dest_lp )
{ {
uint64_t num_chunks = msg->packet_size/s->params->chunk_size; uint64_t num_chunks = msg->packet_size/s->params->chunk_size;
......
...@@ -24,5 +24,5 @@ PARAMS ...@@ -24,5 +24,5 @@ PARAMS
global_bandwidth="4.7"; global_bandwidth="4.7";
cn_bandwidth="5.25"; cn_bandwidth="5.25";
message_size="320"; message_size="320";
routing="minimal"; routing="adaptive";
} }
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