Commit a8df7743 authored by Misbah Mubarak's avatar Misbah Mubarak

Modifications to dragonfly, shouldn't be multiplying with chunk_size in a couple of places

parent 45455a04
......@@ -394,7 +394,7 @@ static tw_stime bytes_to_ns(uint64_t bytes, double GB_p_s)
/* bytes to GB */
time = ((double)bytes)/(1024.0*1024.0*1024.0);
/* MB to s */
/* GiB to s */
time = time / GB_p_s;
/* s to ns */
time = time * 1000.0 * 1000.0 * 1000.0;
......@@ -1124,7 +1124,7 @@ void packet_generate(terminal_state * s, tw_bf * bf, terminal_message * msg,
if(!num_chunks)
num_chunks = 1;
nic_ts = g_tw_lookahead + s->params->cn_delay * msg->packet_size + tw_rand_unif(lp->rng);
nic_ts = g_tw_lookahead + s->params->cn_delay + tw_rand_unif(lp->rng);
msg->packet_ID = lp->gid + g_tw_nlp * s->packet_counter;
msg->my_N_hop = 0;
......@@ -1465,7 +1465,7 @@ void packet_arrive(terminal_state * s, tw_bf * bf, terminal_message * msg,
if(hash_link)
tmp = qhash_entry(hash_link, struct dfly_qhash_entry, hash_link);
unsigned int total_chunks = msg->total_size / s->params->chunk_size;
uint64_t total_chunks = msg->total_size / s->params->chunk_size;
printf("\n Msg total size %ld total chunks %lu ", msg->total_size, total_chunks);
if(msg->total_size % s->params->chunk_size)
......@@ -2910,12 +2910,7 @@ router_packet_send( router_state * s,
if(!num_chunks)
num_chunks = 1;
double bytetime;
if((cur_entry->msg.packet_size % s->params->chunk_size) && (cur_entry->msg.chunk_id == num_chunks - 1)) {
bytetime = delay * (cur_entry->msg.packet_size % s->params->chunk_size);
} else {
bytetime = delay * s->params->chunk_size;
}
double bytetime = delay;
ts = g_tw_lookahead + tw_rand_unif( lp->rng) + bytetime + s->params->router_delay;
msg->saved_available_time = s->next_output_available_time[output_port];
......
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