Commit 9897e59c authored by Misbah Mubarak's avatar Misbah Mubarak

chunk computation for zero byte messages in dragonfly-custom

parent db6eeeea
......@@ -64,7 +64,7 @@ def permeate_alloc(job_ranks, total_nodes, cores_per_node):
f.closed
def random_alloc(job_rank, total_nodes, num_seed, cores_per_node):
filename_substr='allocation-'+str(total_nodes)+'-'
filename_substr='rand_node1-alloc-'+str(total_nodes)+'-'
for jobsize in job_rank:
filename_substr += str(jobsize)+'_'
#print filename_substr
......
......@@ -2399,4 +2399,4 @@ int main( int argc, char** argv )
tw_end();
return 0;
}
\ No newline at end of file
}
......@@ -1105,12 +1105,9 @@ static void packet_generate_rc(terminal_state * s, tw_bf * bf, terminal_custom_m
tw_rand_reverse_unif(lp->rng);
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++;
if(!num_chunks)
num_chunks = 1;
int i;
for(i = 0; i < num_chunks; i++) {
delete_terminal_custom_message_list(return_tail(s->terminal_msgs,
......@@ -1147,12 +1144,9 @@ static void packet_generate(terminal_state * s, tw_bf * bf, terminal_custom_mess
uint64_t num_chunks = msg->packet_size / p->chunk_size;
double cn_delay = s->params->cn_delay;
if (msg->packet_size % s->params->chunk_size)
if (msg->packet_size < s->params->chunk_size)
num_chunks++;
if(!num_chunks)
num_chunks = 1;
if(msg->packet_size < s->params->chunk_size)
cn_delay = bytes_to_ns(msg->packet_size % s->params->chunk_size, s->params->cn_bandwidth);
......@@ -1296,14 +1290,11 @@ static void packet_send(terminal_state * s, tw_bf * bf, terminal_custom_message
}
uint64_t num_chunks = cur_entry->msg.packet_size/s->params->chunk_size;
if(cur_entry->msg.packet_size % s->params->chunk_size)
if(cur_entry->msg.packet_size < s->params->chunk_size)
num_chunks++;
if(!num_chunks)
num_chunks = 1;
tw_stime delay = s->params->cn_delay;
if((cur_entry->msg.packet_size % s->params->chunk_size) && (cur_entry->msg.chunk_id == num_chunks - 1))
if((cur_entry->msg.packet_size < s->params->chunk_size) && (cur_entry->msg.chunk_id == num_chunks - 1))
delay = bytes_to_ns(cur_entry->msg.packet_size % s->params->chunk_size, s->params->cn_bandwidth);
msg->saved_available_time = s->terminal_available_time;
......@@ -1584,12 +1575,9 @@ static void packet_arrive(terminal_state * s, tw_bf * bf, terminal_custom_messag
assert(lp->gid != msg->src_terminal_id);
uint64_t 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++;
if(!num_chunks)
num_chunks = 1;
if(msg->path_type == MINIMAL)
minimal_count++;
......@@ -2066,10 +2054,16 @@ dragonfly_custom_terminal_final( terminal_state * s,
tw_lp * lp )
{
model_net_print_stats(lp->gid, s->dragonfly_stats_array);
if(s->terminal_id == 0)
{
char meta_filename[64];
sprintf(meta_filename, "dragonfly-msg-stats.meta");
FILE * fp = fopen(meta_filename, "w+");
fprintf(fp, "# Format <LP id> <Terminal ID> <Total Data Size> <Avg packet latency> <# Flits/Packets finished> <Avg hops> <Busy Time> <Max Latency> <Min Latency >\n");
}
int written = 0;
if(!s->terminal_id)
written = sprintf(s->output_buf, "# Format <LP id> <Terminal ID> <Total Data Size> <Avg packet latency> <# Flits/Packets finished> <Avg hops> <Busy Time> <Max Latency> <Min Latency >\n");
written += sprintf(s->output_buf + written, "%llu %u %llu %lf %ld %lf %lf %lf %lf\n",
LLU(lp->gid), s->terminal_id, LLU(s->total_msg_size), s->total_time/s->finished_chunks,
......@@ -3034,17 +3028,15 @@ router_packet_send( router_state * s,
}
uint64_t num_chunks = cur_entry->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++;
if(!num_chunks)
num_chunks = 1;
double bytetime = delay;
if(cur_entry->msg.packet_size == 0)
bytetime = bytes_to_ns(CREDIT_SIZE, bandwidth);
if((cur_entry->msg.packet_size % s->params->chunk_size) && (cur_entry->msg.chunk_id == num_chunks - 1))
if((cur_entry->msg.packet_size < s->params->chunk_size) && (cur_entry->msg.chunk_id == num_chunks - 1))
bytetime = bytes_to_ns(cur_entry->msg.packet_size % s->params->chunk_size, bandwidth);
ts = g_tw_lookahead + tw_rand_unif( lp->rng) + bytetime + s->params->router_delay;
......
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