-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RNG, add seed in simulation init and initialize PRNG #1599
Conversation
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.
Thanks @nuclearkatie - a few comments on consistency here.
I'm still not sure why the tests are failing.
I'm also not sure about your commit history... perhaps you've used a merge rather than rebase approach?
src/context.cc
Outdated
NewDatum("RNGInfo") | ||
->AddVal("Seed", static_cast<int>(si.seed)) | ||
->AddVal("Stride", static_cast<int>(si.stride)) | ||
->Record(); | ||
|
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 don't think these need to be added here as well as in the "Info" block above. I'm not sure which is better, but I'm guessing the one above will be good enough.
You may still need the static_cast
though.
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.
Wasn't sure if you had an opinion about adding to Info vs their own data table. If you think the former is fine, I'll just do that
src/context.cc
Outdated
seed(kDefaultSeed), | ||
stride(kDefaultStride), |
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.
These should be initialized in the order they are declared in the header file. You can either change all of these, or move the location in which they are ordered in the header file. Note: this is a best practice and is enforced with some compiler options. It may not be true of all current Cyclus practice.
src/sim_init.cc
Outdated
qr = b_->Query("RNGInfo", NULL); | ||
si_.seed = qr.GetVal<int>("Seed"); | ||
si_.stride = qr.GetVal<int>("Stride"); | ||
|
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.
Note above comment about where the data is added - it's in two places above and I advise one that is different from this one.
Yeah I just |
Give it a shot... it may be messy and not worth it. Have you ever done an interactive rebase? That might be the cleanest way, otherwise, I think you'll have many meaningless conflicts to resolve. |
f814283
to
000e33f
Compare
000e33f
to
57d1d3e
Compare
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 little change in the RNG initialization.
We probably need to add some testing of this, as well.
@bennibbelink is going to look into the best way to address the conda failures.... |
Needed to include the Regardless, including the header fixes the problem and is better practice anyway. |
Thanks @bennibbelink! |
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.
Probably can scale back the complexity of the tests.
This looks good now... planning to merge |
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.
LGTM
No description provided.