Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Is it possible we missed this for all these years?
@carothersc Can you look at this, Chris? It was brought up by Jae-Seung at LLNL.
- Loading branch information
45665b4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
45665b4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few notes/observations while I was looking up my changes from way back when:
tw_define_lps
). As discussed before, it's been discouraged to do our own manual clcg4 seeding and instead rely on the ROSS defaults.tw_rand_init_streams->tw_rand_initial_seed->rng_init_generator
, the SeedType argument is fixed at InitialSeed, which doesn't use the global rng that is initialized as a result oftw_pe_init->tw_rand_init->rng_init
. I should note that none of the other seed types make an appearance in the ROSS codebase, so unless people are hand-crafting LP RNG structures, I have the feeling that this code hasn't been executed in a long time.45665b4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think @JohnPJenkins is right. The LP RNGs are totally separate from this. It looks like this is leftover code from where there was a per-MPI-rank RNG (or maybe a per-PE RNG). I don't think any of the models in carothersc/ROSS-Models use this, so it's probably safe to deprecate it.
45665b4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But the
tw_rng_stream
passed in torng_init_generator()
was set to values derived fromrng->seed
which in turn were set byrng_init()
andg_tw_rng_seed
will be used if it's non-zero.45665b4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right - if you pass in a non-NULL seed array to tw_define_lps it will indeed get used to init the PE RNG. My bad. Does anyone do that though?
Also, your fix results in the following warning:
Which makes sense since rng->seed is a an
int32_t *
whereasg_tw_rng_seed
is atw_seed *
(=int32_t **
). What was wrong with the previous version?45665b4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's an relevant email on RNG seeding from Chris from a while back, coincidentally 2 days from a year ago :). Sounds like manual seeding (g_tw_rng_seed) should just be disabled entirely and the corresponding argument in tw_define_lps be ignored.