Commit c649f378 authored by Xin Wang's avatar Xin Wang

reverse handler fix v2; add load_change_factor

parent 3455ae08
......@@ -53,7 +53,7 @@ char offset_file[8192];
static int wrkld_id;
static int num_net_traces = 0;
static int num_dumpi_traces = 0;
static int64_t EAGER_THRESHOLD = 8192;
static int64_t EAGER_THRESHOLD = INT_MAX;
static int alloc_spec = 0;
static tw_stime self_overhead = 10.0;
......@@ -304,7 +304,7 @@ struct nw_message
int msg_type;
int op_type;
model_net_event_return event_rc;
model_net_event_return *event_array_rc;
// model_net_event_return *event_array_rc;
struct
{
......@@ -618,12 +618,10 @@ static void gen_synthetic_tr_rc(nw_state * s, tw_bf * bf, nw_message * m, tw_lp
return;
int i;
for (i=0; i < m->rc.saved_syn_length; i++){
model_net_event_rc2(lp, &m->event_array_rc[i]);
model_net_event_rc2(lp, &m->event_rc);
s->gen_data -= payload_sz;
num_syn_bytes_sent -= payload_sz;
}
tw_rand_reverse_unif(lp->rng);
tw_rand_reverse_unif(lp->rng);
}
......@@ -712,7 +710,7 @@ static void gen_synthetic_tr(nw_state * s, tw_bf * bf, nw_message * m, tw_lp * l
if(length > 0)
{
m->event_array_rc = (model_net_event_return) malloc(length * sizeof(model_net_event_return));
// m->event_array_rc = (model_net_event_return) malloc(length * sizeof(model_net_event_return));
//printf("\nRANK %d Dests %d", s->local_rank, length);
for (i = 0; i < length; i++)
{
......@@ -729,7 +727,7 @@ static void gen_synthetic_tr(nw_state * s, tw_bf * bf, nw_message * m, tw_lp * l
remote_m.fwd.app_id = s->app_id;
remote_m.fwd.src_rank = s->local_rank;
m->event_array_rc[i] = model_net_event(net_id, "synthetic-tr", global_dest_id, payload_sz, 0.0,
m->event_rc = model_net_event(net_id, "synthetic-tr", global_dest_id, payload_sz, 0.0,
sizeof(nw_message), (const void*)&remote_m,
0, NULL, lp);
......@@ -1418,18 +1416,19 @@ static void codes_exec_mpi_recv(
int found_matching_sends = rm_matching_send(s, bf, m, lp, recv_op);
/* for mpi irecvs, this is a non-blocking receive so just post it and move on with the trace read. */
if(mpi_op->op_type == CODES_WK_IRECV)
{
bf->c6 = 1;
codes_issue_next_event(lp);
}
/* save the req id inserted in the completed queue for reverse computation. */
if(found_matching_sends < 0)
{
m->fwd.found_match = -1;
qlist_add(&recv_op->ql, &s->pending_recvs_queue);
/* for mpi irecvs, this is a non-blocking receive so just post it and move on with the trace read. */
if(mpi_op->op_type == CODES_WK_IRECV)
{
bf->c6 = 1;
codes_issue_next_event(lp);
return;
}
}
else
{
......@@ -2767,6 +2766,7 @@ int modelnet_mpi_replay(MPI_Comm comm, int* argc, char*** argv )
MPI_Comm_size(MPI_COMM_CODES, &nprocs);
configuration_load((*argv)[2], MPI_COMM_CODES, &config);
printf("\neager_threshold = %d\n", EAGER_THRESHOLD);
nw_add_lp_type();
model_net_register();
......
......@@ -40,6 +40,7 @@
#define MAX_OPERATIONS 32768
#define DUMPI_IGNORE_DELAY 100
#define RANK_HASH_TABLE_SIZE 400
#define LOAD_CHANGE_FACTOR 1
/* This variable is defined in src/network-workloads/model-net-mpi-replay.c */
extern struct codes_jobmap_ctx *jobmap_ctx;
......@@ -421,8 +422,8 @@ int handleDUMPIISend(const dumpi_isend *prm, uint16_t thread, const dumpi_time *
wrkld_per_rank.u.send.tag = prm->tag;
wrkld_per_rank.u.send.count = prm->count;
wrkld_per_rank.u.send.data_type = prm->datatype;
wrkld_per_rank.u.send.num_bytes = prm->count * get_num_bytes(myctx,prm->datatype);
wrkld_per_rank.u.send.num_bytes = prm->count * get_num_bytes(myctx,prm->datatype) * LOAD_CHANGE_FACTOR;
assert(wrkld_per_rank.u.send.num_bytes >= 0);
wrkld_per_rank.u.send.req_id = prm->request;
wrkld_per_rank.u.send.dest_rank = prm->dest;
......@@ -449,7 +450,7 @@ int handleDUMPIIRecv(const dumpi_irecv *prm, uint16_t thread, const dumpi_time *
wrkld_per_rank.u.recv.data_type = prm->datatype;
wrkld_per_rank.u.recv.count = prm->count;
wrkld_per_rank.u.recv.tag = prm->tag;
wrkld_per_rank.u.recv.num_bytes = prm->count * get_num_bytes(myctx,prm->datatype);
wrkld_per_rank.u.recv.num_bytes = prm->count * get_num_bytes(myctx,prm->datatype) * LOAD_CHANGE_FACTOR;
assert(wrkld_per_rank.u.recv.num_bytes >= 0);
wrkld_per_rank.u.recv.source_rank = prm->source;
......@@ -477,7 +478,7 @@ int handleDUMPISend(const dumpi_send *prm, uint16_t thread,
wrkld_per_rank.u.send.tag = prm->tag;
wrkld_per_rank.u.send.count = prm->count;
wrkld_per_rank.u.send.data_type = prm->datatype;
wrkld_per_rank.u.send.num_bytes = prm->count * get_num_bytes(myctx,prm->datatype);
wrkld_per_rank.u.send.num_bytes = prm->count * get_num_bytes(myctx,prm->datatype) * LOAD_CHANGE_FACTOR;
assert(wrkld_per_rank.u.send.num_bytes >= 0);
wrkld_per_rank.u.send.dest_rank = prm->dest;
wrkld_per_rank.u.send.source_rank = myctx->my_rank;
......@@ -505,7 +506,7 @@ int handleDUMPIRecv(const dumpi_recv *prm, uint16_t thread,
wrkld_per_rank.u.recv.tag = prm->tag;
wrkld_per_rank.u.recv.count = prm->count;
wrkld_per_rank.u.recv.data_type = prm->datatype;
wrkld_per_rank.u.recv.num_bytes = prm->count * get_num_bytes(myctx,prm->datatype);
wrkld_per_rank.u.recv.num_bytes = prm->count * get_num_bytes(myctx,prm->datatype) * LOAD_CHANGE_FACTOR;
assert(wrkld_per_rank.u.recv.num_bytes >= 0);
wrkld_per_rank.u.recv.req_id = -1;
wrkld_per_rank.u.recv.source_rank = prm->source;
......@@ -536,7 +537,7 @@ int handleDUMPISendrecv(const dumpi_sendrecv* prm, uint16_t thread,
wrkld_per_rank.u.send.tag = prm->sendtag;
wrkld_per_rank.u.send.count = prm->sendcount;
wrkld_per_rank.u.send.data_type = prm->sendtype;
wrkld_per_rank.u.send.num_bytes = prm->sendcount * get_num_bytes(myctx,prm->sendtype);
wrkld_per_rank.u.send.num_bytes = prm->sendcount * get_num_bytes(myctx,prm->sendtype) * LOAD_CHANGE_FACTOR;
assert(wrkld_per_rank.u.send.num_bytes >= 0);
......@@ -553,7 +554,7 @@ int handleDUMPISendrecv(const dumpi_sendrecv* prm, uint16_t thread,
wrkld_per_rank.u.recv.tag = prm->recvtag;
wrkld_per_rank.u.recv.count = prm->recvcount;
wrkld_per_rank.u.recv.data_type = prm->recvtype;
wrkld_per_rank.u.recv.num_bytes = prm->recvcount * get_num_bytes(myctx,prm->recvtype);
wrkld_per_rank.u.recv.num_bytes = prm->recvcount * get_num_bytes(myctx,prm->recvtype) * LOAD_CHANGE_FACTOR;
assert(wrkld_per_rank.u.recv.num_bytes >= 0);
wrkld_per_rank.u.recv.source_rank = prm->source;
......
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