Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Xin Wang
codes-dev
Commits
4007795d
Commit
4007795d
authored
Dec 08, 2014
by
Jonathan Jenkins
Browse files
use a different RNG than default for codes_local_latency
parent
56444410
Changes
2
Show whitespace changes
Inline
Side-by-side
codes/codes.h
View file @
4007795d
...
...
@@ -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
);
}
...
...
src/util/codes_mapping.c
View file @
4007795d
...
...
@@ -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
);
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment