-
Notifications
You must be signed in to change notification settings - Fork 6
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
Remove rcppparallel #47
Conversation
…into remove-rcppparallel
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #47 +/- ##
=======================================
Coverage 99.51% 99.52%
=======================================
Files 4 5 +1
Lines 416 418 +2
=======================================
+ Hits 414 416 +2
Misses 2 2 ☔ View full report in Codecov by Sentry. |
…into remove-rcppparallel
…into remove-rcppparallel
Bundle TBB library
Revert "Bundle TBB library"
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.
Some minor comments. I'll run a revdepcheck in the meantime
R/proxy.R
Outdated
threads <- as.integer(getOption("proxyC.threads", -1)) | ||
if (length(threads) != 1 || is.na(threads)) { | ||
stop("proxyC.threads must be an integer") | ||
} |
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'd be inclined to add a helper function, something along the lines of
getThreads <- function() {
threads <- getOption("proxyC.threads", Sys.getenv("RCPP_PARALLEL_NUM_THREADS"))
if (is.null(threads)) {
threads <- -1L
}
threads <- as.integer(threads)
if (length(threads != 1) || is.na(threads)) {
stop("proxyC.threads must be an integer")
}
threads
}
I'd propose still supporting RCPP_PARALLEL_NUM_THREADS
as an environment variable because otherwise this PR is a breaking change.
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.
That makes sense. I added getThreads()
that also takes value from OMP_THREAD_LIMIT
to stop using too many threads in CRAN tests.
revdepcheck is ok!
|
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!
I will submit to CRAN. Thanks. |
This is a rather urgent upgrade of the package to avoid crashes caused by memory leaks (segment fault) in the old TBB library in RcppParallel. Since the package does not update the library, we need to link to the new version of the library ourselves.
The library is avaialble in rtools and windbuilder, so Windows users are not affected . Linux users need to install the library header themselves.