Commit 2756fd6f authored by Misbah Mubarak's avatar Misbah Mubarak

Some bug fixes to mpi sim layer

parent cfe0d6f4
......@@ -2,9 +2,9 @@ LPGROUPS
{
MODELNET_GRP
{
repetitions="114";
nw-lp="3";
modelnet_dragonfly="3";
repetitions="36";
nw-lp="2";
modelnet_dragonfly="2";
dragonfly_router="1";
}
}
......@@ -17,7 +17,7 @@ PARAMS
chunk_size="512";
# modelnet_scheduler="round-robin";
num_vcs="1";
num_routers="6";
num_routers="4";
local_vc_size="32768";
global_vc_size="65536";
cn_vc_size="32768";
......@@ -25,5 +25,5 @@ PARAMS
global_bandwidth="4.7";
cn_bandwidth="5.25";
message_size="544";
routing="adaptive";
routing="minimal";
}
......@@ -13,7 +13,7 @@
#include "codes/model-net.h"
#include "codes/rc-stack.h"
#define TRACE 0
#define TRACE -1
#define TRACK 0
char workload_type[128];
......@@ -822,14 +822,8 @@ static void codes_exec_comp_delay(
tw_stime ts;
nw_message* msg;
if (disable_delay) {
ts = 0.0; // no compute time sim
}
else {
s->compute_time += s_to_ns(mpi_op->u.delay.seconds);
ts = s_to_ns(mpi_op->u.delay.seconds);
}
s->compute_time += s_to_ns(mpi_op->u.delay.seconds);
ts = s_to_ns(mpi_op->u.delay.seconds);
ts += g_tw_lookahead + 0.1 + tw_rand_exponential(lp->rng, noise);
e = tw_event_new( lp->gid, ts , lp );
......@@ -1200,10 +1194,10 @@ static void get_next_mpi_operation_rc(nw_state* s, tw_bf * bf, nw_message * m, t
case CODES_WK_DELAY:
{
s->num_delays--;
if (!disable_delay) {
tw_rand_reverse_unif(lp->rng);
s->compute_time -= s_to_ns(mpi_op->u.delay.seconds);
}
tw_rand_reverse_unif(lp->rng);
if (!disable_delay)
s->compute_time -= s_to_ns(mpi_op->u.delay.seconds);
}
break;
case CODES_WK_BCAST:
......@@ -1256,9 +1250,8 @@ static void get_next_mpi_operation(nw_state* s, tw_bf * bf, nw_message * m, tw_l
s->nw_id, s->num_completed);
m->u.rc.saved_op = mpi_op;
if(mpi_op->op_type == CODES_WK_END && s->num_completed == 50000)
if(mpi_op->op_type == CODES_WK_END)
{
//rc_stack_push(lp, mpi_op, free, s->st);
s->elapsed_time = tw_now(lp) - s->start_time;
return;
}
......@@ -1283,7 +1276,10 @@ static void get_next_mpi_operation(nw_state* s, tw_bf * bf, nw_message * m, tw_l
case CODES_WK_DELAY:
{
s->num_delays++;
codes_exec_comp_delay(s, lp, mpi_op);
if(!disable_delay)
codes_exec_comp_delay(s, lp, mpi_op);
else
codes_issue_next_event(lp);
}
break;
......@@ -1295,13 +1291,19 @@ static void get_next_mpi_operation(nw_state* s, tw_bf * bf, nw_message * m, tw_l
case CODES_WK_REDUCE:
case CODES_WK_ALLREDUCE:
case CODES_WK_COL:
case CODES_WK_WAITSOME:
case CODES_WK_WAITANY:
{
s->num_cols++;
codes_exec_mpi_col(s, lp);
}
break;
case CODES_WK_WAITSOME:
case CODES_WK_WAITANY:
{
s->num_waitsome++;
codes_issue_next_event(lp);
}
break;
case CODES_WK_WAIT:
{
s->num_wait++;
......
......@@ -1311,10 +1311,10 @@ void packet_arrive_rc(terminal_state * s, tw_bf * bf, terminal_message * msg, tw
total_msg_sz -= msg->total_size;
N_finished_msgs--;
stat->recv_time -= msg->saved_start_time;
s->total_msg_time -= msg->saved_start_time;
stat->recv_time = msg->saved_start_time;
s->total_msg_time = msg->saved_start_time;
s->total_msg_size -= msg->total_size;
dragonfly_total_time -= msg->saved_avg_time;
dragonfly_total_time = msg->saved_avg_time;
struct dfly_qhash_entry * d_entry_pop = (struct dfly_qhash_entry*)rc_stack_pop(s->st);
qhash_add(s->rank_tbl, &key, &(d_entry_pop->hash_link));
......@@ -1532,14 +1532,17 @@ void packet_arrive(terminal_state * s, tw_bf * bf, terminal_message * msg,
N_finished_msgs++;
total_msg_sz += msg->total_size;
msg->saved_avg_time = tw_now( lp ) - msg->travel_start_time;
dragonfly_total_time += msg->saved_avg_time;
msg->saved_start_time = (tw_now(lp) - msg->msg_start_time);
stat->recv_time += msg->saved_start_time;
s->finished_msgs++;
s->total_msg_time += msg->saved_start_time;
msg->saved_avg_time = dragonfly_total_time;
dragonfly_total_time += tw_now( lp ) - msg->travel_start_time;
msg->saved_start_time = s->total_msg_time;
stat->recv_time += (tw_now(lp) - msg->msg_start_time);
s->total_msg_time += (tw_now(lp) - msg->msg_start_time);
s->total_msg_size += msg->total_size;
s->finished_msgs++;
if (dragonfly_max_latency < tw_now( lp ) - msg->travel_start_time) {
bf->c3 = 1;
msg->saved_available_time = dragonfly_max_latency;
......
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