Commit 48b79796 authored by Misbah Mubarak's avatar Misbah Mubarak

Adding updated sizes for data types

parent a5f846fa
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#define CONTROL_MSG_SZ 64 #define CONTROL_MSG_SZ 64
#define TRACE -1 #define TRACE -1
#define MAX_WAIT_REQS 512 #define MAX_WAIT_REQS 512
#define CS_LP_DBG 0 #define CS_LP_DBG 1
#define EAGER_THRESHOLD 81920000 #define EAGER_THRESHOLD 81920000
#define RANK_HASH_TABLE_SZ 2000 #define RANK_HASH_TABLE_SZ 2000
#define NOISE 3.0 #define NOISE 3.0
...@@ -914,7 +914,7 @@ static void codes_exec_mpi_wait_all( ...@@ -914,7 +914,7 @@ static void codes_exec_mpi_wait_all(
int i = 0, num_matched = 0; int i = 0, num_matched = 0;
m->fwd.num_matched = 0; m->fwd.num_matched = 0;
if(lp->gid == TRACK_LP) //if(lp->gid == TRACK_LP)
{ {
printf("\n MPI Wait all posted "); printf("\n MPI Wait all posted ");
print_waiting_reqs(mpi_op->u.waits.req_ids, count); print_waiting_reqs(mpi_op->u.waits.req_ids, count);
...@@ -1082,6 +1082,7 @@ static void codes_issue_next_event(tw_lp* lp) ...@@ -1082,6 +1082,7 @@ static void codes_issue_next_event(tw_lp* lp)
tw_stime ts; tw_stime ts;
ts = g_tw_lookahead + 0.1 + tw_rand_exponential(lp->rng, noise); ts = g_tw_lookahead + 0.1 + tw_rand_exponential(lp->rng, noise);
assert(ts > 0);
e = tw_event_new( lp->gid, ts, lp ); e = tw_event_new( lp->gid, ts, lp );
msg = tw_event_data(e); msg = tw_event_data(e);
...@@ -1102,6 +1103,7 @@ static void codes_exec_comp_delay( ...@@ -1102,6 +1103,7 @@ static void codes_exec_comp_delay(
ts = 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); ts += g_tw_lookahead + 0.1 + tw_rand_exponential(lp->rng, noise);
assert(ts > 0);
e = tw_event_new( lp->gid, ts , lp ); e = tw_event_new( lp->gid, ts , lp );
msg = tw_event_data(e); msg = tw_event_data(e);
...@@ -1560,10 +1562,12 @@ static void update_arrival_queue(nw_state* s, tw_bf * bf, nw_message * m, tw_lp ...@@ -1560,10 +1562,12 @@ static void update_arrival_queue(nw_state* s, tw_bf * bf, nw_message * m, tw_lp
if(m->fwd.num_bytes < EAGER_THRESHOLD) if(m->fwd.num_bytes < EAGER_THRESHOLD)
{ {
tw_stime ts = codes_local_latency(lp);
assert(ts > 0);
bf->c1 = 1; bf->c1 = 1;
tw_event *e_callback = tw_event *e_callback =
tw_event_new(rank_to_lpid(global_src_id), tw_event_new(rank_to_lpid(global_src_id),
codes_local_latency(lp), lp); ts, lp);
nw_message *m_callback = tw_event_data(e_callback); nw_message *m_callback = tw_event_data(e_callback);
m_callback->msg_type = MPI_SEND_ARRIVED_CB; m_callback->msg_type = MPI_SEND_ARRIVED_CB;
m_callback->fwd.msg_send_time = tw_now(lp) - m->fwd.sim_start_time; m_callback->fwd.msg_send_time = tw_now(lp) - m->fwd.sim_start_time;
...@@ -1632,6 +1636,7 @@ void nw_test_init(nw_state* s, tw_lp* lp) ...@@ -1632,6 +1636,7 @@ void nw_test_init(nw_state* s, tw_lp* lp)
s->mpi_wkld_samples = calloc(MAX_STATS, sizeof(struct mpi_workload_sample)); s->mpi_wkld_samples = calloc(MAX_STATS, sizeof(struct mpi_workload_sample));
s->sampling_indx = 0; s->sampling_indx = 0;
s->is_finished = 0; s->is_finished = 0;
s->cur_interval_end = 0;
if(!num_net_traces) if(!num_net_traces)
num_net_traces = num_mpi_lps; num_net_traces = num_mpi_lps;
......
...@@ -412,6 +412,7 @@ int handleDUMPIISend(const dumpi_isend *prm, uint16_t thread, const dumpi_time * ...@@ -412,6 +412,7 @@ int handleDUMPIISend(const dumpi_isend *prm, uint16_t thread, const dumpi_time *
wrkld_per_rank.u.send.count = prm->count; wrkld_per_rank.u.send.count = prm->count;
wrkld_per_rank.u.send.data_type = prm->datatype; 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);
printf("\n Num bytes %lld num bytes %lld ", prm->count, get_num_bytes(myctx,prm->datatype));
assert(wrkld_per_rank.u.send.num_bytes >= 0); assert(wrkld_per_rank.u.send.num_bytes >= 0);
wrkld_per_rank.u.send.req_id = prm->request; wrkld_per_rank.u.send.req_id = prm->request;
wrkld_per_rank.u.send.dest_rank = prm->dest; wrkld_per_rank.u.send.dest_rank = prm->dest;
...@@ -440,7 +441,7 @@ int handleDUMPIIRecv(const dumpi_irecv *prm, uint16_t thread, const dumpi_time * ...@@ -440,7 +441,7 @@ int handleDUMPIIRecv(const dumpi_irecv *prm, uint16_t thread, const dumpi_time *
wrkld_per_rank.u.recv.tag = prm->tag; 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);
assert(wrkld_per_rank.u.recv.num_bytes >= 0); //assert(wrkld_per_rank.u.recv.num_bytes >= 0);
wrkld_per_rank.u.recv.source_rank = prm->source; wrkld_per_rank.u.recv.source_rank = prm->source;
wrkld_per_rank.u.recv.dest_rank = -1; wrkld_per_rank.u.recv.dest_rank = -1;
wrkld_per_rank.u.recv.req_id = prm->request; wrkld_per_rank.u.recv.req_id = prm->request;
...@@ -523,6 +524,7 @@ int handleDUMPISendrecv(const dumpi_sendrecv* prm, uint16_t thread, ...@@ -523,6 +524,7 @@ int handleDUMPISendrecv(const dumpi_sendrecv* prm, uint16_t thread,
wrkld_per_rank.u.send.count = prm->sendcount; wrkld_per_rank.u.send.count = prm->sendcount;
wrkld_per_rank.u.send.data_type = prm->sendtype; 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);
assert(wrkld_per_rank.u.send.num_bytes >= 0); assert(wrkld_per_rank.u.send.num_bytes >= 0);
wrkld_per_rank.u.send.dest_rank = prm->dest; wrkld_per_rank.u.send.dest_rank = prm->dest;
wrkld_per_rank.u.send.source_rank = myctx->my_rank; wrkld_per_rank.u.send.source_rank = myctx->my_rank;
...@@ -926,7 +928,9 @@ int dumpi_trace_nw_workload_load(const char* params, int app_id, int rank) ...@@ -926,7 +928,9 @@ int dumpi_trace_nw_workload_load(const char* params, int app_id, int rank)
return 0; return 0;
} }
/* Data types are for 64-bit archs. Source:
* https://www.tutorialspoint.com/cprogramming/c_data_types.htm
* */
static int64_t get_num_bytes(rank_mpi_context* myctx, dumpi_datatype dt) static int64_t get_num_bytes(rank_mpi_context* myctx, dumpi_datatype dt)
{ {
#ifdef ENABLE_CORTEX #ifdef ENABLE_CORTEX
...@@ -957,28 +961,55 @@ static int64_t get_num_bytes(rank_mpi_context* myctx, dumpi_datatype dt) ...@@ -957,28 +961,55 @@ static int64_t get_num_bytes(rank_mpi_context* myctx, dumpi_datatype dt)
break; break;
case DUMPI_INT: case DUMPI_INT:
return 4;
break;
case DUMPI_UNSIGNED: case DUMPI_UNSIGNED:
return 4;
break;
case DUMPI_FLOAT: case DUMPI_FLOAT:
case DUMPI_FLOAT_INT: case DUMPI_FLOAT_INT:
return 4; return 4;
break; break;
case DUMPI_DOUBLE: case DUMPI_DOUBLE:
return 8;
break;
case DUMPI_LONG: case DUMPI_LONG:
return 8;
break;
case DUMPI_LONG_INT: case DUMPI_LONG_INT:
return 8;
break;
case DUMPI_UNSIGNED_LONG: case DUMPI_UNSIGNED_LONG:
return 8;
break;
case DUMPI_LONG_LONG_INT: case DUMPI_LONG_LONG_INT:
return 8;
break;
case DUMPI_UNSIGNED_LONG_LONG: case DUMPI_UNSIGNED_LONG_LONG:
return 8;
break;
case DUMPI_LONG_LONG: case DUMPI_LONG_LONG:
return 8;
break;
case DUMPI_DOUBLE_INT: case DUMPI_DOUBLE_INT:
return 8; return 8;
break; break;
case DUMPI_LONG_DOUBLE:
case DUMPI_LONG_DOUBLE_INT: case DUMPI_LONG_DOUBLE_INT:
return 16; case DUMPI_LONG_DOUBLE:
break; return 10;
break;
default: default:
{ {
tw_error(TW_LOC, "\n undefined data type"); tw_error(TW_LOC, "\n undefined data type");
......
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