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

kevinushey
Copy link
Contributor

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.

@codecov-io
Copy link

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
@eddelbuettel eddelbuettel deleted the feature/suspend-rng-synchronization branch July 21, 2018 23:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants