7

Based on responses to this SO question, R was single-threaded in 2016.

How can I have R utilize more of the processing power on my PC?

Is that still true at the end of 2019?

I have a very large project which will require expanding R to multiple threads and high use of CPU, assuming it's possible.

Advice, suggestions and/or workarounds would be most appreciated!

user332577
  • 171
  • 1
  • 2
  • Hello @user332577. Welcome to StackOverflow. Please read [How to Create a Minimal, Reproducible Example](https://stackoverflow.com/help/minimal-reproducible-example) and update your question. R has a number of packages that provide parallel processing support. In order to help you, we'll need a more specific example of a single threaded problem that you'd like to process in parallel. – Len Greski Dec 08 '19 at 21:23
  • @LenGreski I don't agree with the moderators' assessment wrt a lack of focus in my question and point to the 3 upvotes as evidence for that. Please reopen this query for answers. Thank you. – user332577 Dec 09 '19 at 17:18
  • At least three people with the open / close voting privilege must vote to close a question. To get the question reopened, you must edit it as I noted in my earlier comment by providing a specific example of code you want to run in parallel, and where you're having difficulty using the parallel features in R. For example, here is an SO answer where I illustrate how to use [parallel processing with machine learning models and the caret package](https://stackoverflow.com/questions/50424577/machine-learning-with-caret-how-to-specify-a-timeout/50424858#50424858). – Len Greski Dec 22 '19 at 21:09

1 Answers1

2

The are many ways of doing parallel computation in R, you can start from here: https://www.r-bloggers.com/r-with-parallel-computing-from-user-perspectives/ In addition, some libraries such as data.table are coming with multi thread features.

However, depending on the size and weight of you project, you might want to go to another language or code the critical part of your program in C++, using: http://www.rcpp.org/

Chelmy88
  • 1,106
  • 1
  • 6
  • 17