Skip to content
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

provide class for suspension of RNG synchronization #862

Merged
merged 2 commits into from Jun 7, 2018

Conversation

Projects
None yet
3 participants
@kevinushey
Copy link
Contributor

kevinushey commented Jun 6, 2018

This PR provides a class, SuspendRNGSynchronizationScope, which can be used to signal that throughout the lifetime of that object Rcpp should not attempt to synchronize the R and C RNG states.

This tool effectively allows users to opt-in to the 'old' Rcpp RNG behavior by creating an instance of this class where desired. This could be used to fix, for example, eddelbuettel/rcppde#14 (comment).

The intention would be for RcppDE to construct an instance of SuspendRNGSynchronizationScope pretty early in the DEOptim_impl implementation.

FWIW, I tested this fix with a locally built copy of RcppDE and it does fix the issue -- I can send a PR if we find that this change looks good.

@eddelbuettel

This comment has been minimized.

Copy link
Member

eddelbuettel commented on 811d229 Jun 6, 2018

Nice and clean at the cost of one int. I like it!

@codecov-io

This comment has been minimized.

Copy link

codecov-io commented Jun 7, 2018

Codecov Report

Merging #862 into master will decrease coverage by 0.15%.
The diff coverage is 50%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #862      +/-   ##
=========================================
- Coverage   90.46%   90.3%   -0.16%     
=========================================
  Files          70      70              
  Lines        3251    3261      +10     
=========================================
+ Hits         2941    2945       +4     
- Misses        310     316       +6
Impacted Files Coverage Δ
src/Rcpp_init.cpp 100% <100%> (ø) ⬆️
src/api.cpp 92.77% <40%> (-7.23%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d1674cf...278dc66. Read the comment docs.

@eddelbuettel eddelbuettel merged commit e664a76 into master Jun 7, 2018

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@eddelbuettel eddelbuettel deleted the feature/suspend-rng-synchronization branch Jul 21, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.