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

Remove rcppparallel #47

Merged
merged 54 commits into from
Apr 4, 2024
Merged

Remove rcppparallel #47

merged 54 commits into from
Apr 4, 2024

Conversation

koheiw
Copy link
Owner

@koheiw koheiw commented Apr 1, 2024

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.

Copy link

codecov bot commented Apr 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.52%. Comparing base (9b139ce) to head (ef2c1ae).

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.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@rcannood rcannood left a 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
Comment on lines 182 to 185
threads <- as.integer(getOption("proxyC.threads", -1))
if (length(threads) != 1 || is.na(threads)) {
stop("proxyC.threads must be an integer")
}
Copy link
Collaborator

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.

Copy link
Owner Author

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.

NEWS.md Show resolved Hide resolved
@rcannood
Copy link
Collaborator

rcannood commented Apr 3, 2024

revdepcheck is ok!

── INSTALL ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── 2 versions ──
Installing CRAN version of proxyC
Installing DEV version of proxyC
── CHECK ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── 12 packages ──
✔ quanteda.textstats 0.96.4              ── E: 0     | W: 0     | N: 0                                                                                                              
✔ dynutils 1.0.11                        ── E: 0     | W: 0     | N: 0                                                                                                              
✔ applicable 0.1.0                       ── E: 1     | W: 0     | N: 0                                                                                                              
✔ LSX 1.4.0                              ── E: 0     | W: 0     | N: 1                                                                                                              
✔ seededlda 1.1.0                        ── E: 0     | W: 0     | N: 4                                                                                                              
✔ simona 1.0.10                          ── E: 0     | W: 1     | N: 2                                                                                                              
✔ scClassify 1.14.0                      ── E: 0     | W: 0     | N: 0                                                                                                              
✔ immcp 1.0.3                            ── E: 0     | W: 0     | N: 0                                                                                                              
✔ SimBu 1.4.3                            ── E: 0     | W: 0     | N: 2                                                                                                              
✔ simplifyEnrichment 1.12.0              ── E: 0     | W: 0     | N: 1                                                                                                              
✔ scMerge 1.18.0                         ── E: 2     | W: 0     | N: 0                                                                                                              
✔ scFeatures 1.3.2                       ── E: 0     | W: 1     | N: 2                                                                                                              
OK: 12                                                                                                                                                                            
BROKEN: 0
Total time: 1 hour
── REPORT ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Writing summary to 'revdep/README.md'
Writing problems to 'revdep/problems.md'
Writing failures to 'revdep/failures.md'
Writing CRAN report to 'revdep/cran.md'

Copy link
Collaborator

@rcannood rcannood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@koheiw koheiw merged commit f3a5f8e into master Apr 4, 2024
8 checks passed
@koheiw
Copy link
Owner Author

koheiw commented Apr 4, 2024

I will submit to CRAN. Thanks.

@koheiw koheiw deleted the remove-rcppparallel branch April 4, 2024 21:37
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.

2 participants