Commit daaf1739 authored by Neil McGlohon's avatar Neil McGlohon
Browse files

ModelNet MPI Replay: Rand Perm Traffic Fix

This commit changes the behavior of the random permuation traffic.
My understanding is that s->gen_data is what keeps track of how much
data has been generated by the LP where syn_data keeps track of how much
data has been received by the LP. Since the random permutation traffic
pattern cares about how much data has been _generated_, the use of
syn_data in the gen_synthetic_tr() method's PERMUTATION case has been
changed to gen_data.

Additionally, the previous implementation of the prev_switch, as far
as I could tell, was designed to help keep track of how much data had
been generated by the LP since the last destination change. It didn't
appear to do that. I've made a change that updates this field to be
the amount of data generated at the time of the last switch, therefore
the difference between gen_data and this field will equal the amount
of data generated since last switch which is what we want to compare
against the permuation threshold.

In order to accomodate this behavior, I've had to add one more unsigned
long into the nw_message ROSS message struct. The message size here is
now 640 (changed from 624).

Additionally, this source file hadn't yet been able to accomodate
synthetic5 traffic option. It maxed out at 4. This fix was included
in this commit as synthetic5 is the Random Permutation traffic
parent 56007723
......@@ -333,6 +333,7 @@ struct nw_message
double saved_delay;
int64_t saved_num_bytes;
int saved_syn_length;
unsigned long saved_prev_switch;
} rc;
......@@ -622,7 +623,7 @@ static void gen_synthetic_tr_rc(nw_state * s, tw_bf * bf, nw_message * m, tw_lp
s->prev_switch -= perm_switch_thresh;
s->prev_switch = m->rc.saved_prev_switch;
s->saved_perm_dest = s->rc_perm;
......@@ -673,13 +674,15 @@ static void gen_synthetic_tr(nw_state * s, tw_bf * bf, nw_message * m, tw_lp * l
m->rc.saved_prev_switch = s->prev_switch; //for reverse computation
length = 1;
dest_svr = (int*) calloc(1, sizeof(int));
if(s->syn_data - s->prev_switch > perm_switch_thresh)
if(s->gen_data - s->prev_switch >= perm_switch_thresh)
printf("%d - %d >= %d\n",s->gen_data,s->prev_switch,perm_switch_thresh);
bf->c2 = 1;
s->prev_switch += perm_switch_thresh;
s->prev_switch = s->gen_data; //Amount of data pushed at time when switch initiated
dest_svr[0] = tw_rand_integer(lp->rng, 0, num_clients - 1);
if(dest_svr[0] == s->local_rank)
dest_svr[0] = (s->local_rank + num_clients/2) % num_clients;
......@@ -2019,7 +2022,7 @@ void nw_test_init(nw_state* s, tw_lp* lp)
int synthetic_pattern;
sscanf(file_name_of_job[lid.job], "synthetic%d", &synthetic_pattern);
if(synthetic_pattern <=0 || synthetic_pattern > 4)
if(synthetic_pattern <=0 || synthetic_pattern > 5)
printf("\n Undefined synthetic pattern: setting to uniform random ");
s->synthetic_pattern = 1;
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