Commit 4007795d authored by Jonathan Jenkins's avatar Jonathan Jenkins

use a different RNG than default for codes_local_latency

parent 56444410
......@@ -38,9 +38,10 @@ still have a timestamp that is greater than g_tw_lookahead.
#define CODES_MEAN_LOCAL_LATENCY 0.01
static inline tw_stime codes_local_latency(tw_lp *lp)
{
int r = g_tw_nRNG_per_lp-1;
tw_stime tmp;
tmp = (1.1 * g_tw_lookahead) + tw_rand_exponential(lp->rng, CODES_MEAN_LOCAL_LATENCY);
tmp = (1.1 * g_tw_lookahead) + tw_rand_exponential(&lp->rng[r], CODES_MEAN_LOCAL_LATENCY);
return(tmp);
}
......
......@@ -469,6 +469,11 @@ void codes_mapping_setup_with_seed_offset(int offset)
message_size = 256;
printf("\n Warning: ross message size not defined, resetting it to %d", message_size);
}
// we increment the number of RNGs used to let codes_local_latency use the
// last one
g_tw_nRNG_per_lp++;
tw_define_lps(codes_mapping_get_lps_for_pe(), message_size, 0);
// use a similar computation to codes_mapping_init to compute the lpids and
......@@ -480,7 +485,7 @@ void codes_mapping_setup_with_seed_offset(int offset)
for (tw_lpid l = 0; l < g_tw_nlp; l++){
for (int i = 0; i < g_tw_nRNG_per_lp; i++){
tw_rand_initial_seed(&g_tw_lp[l]->rng[i], (g_tw_lp[l]->gid +
global_nlps * offset) * g_tw_rng_max + i);
global_nlps * offset) * g_tw_nRNG_per_lp + i);
}
}
}
......
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