Parallel processing in R with the 64-bit version of Windows 7 doSMP

I installed R (64-bit) version 2.11.1 on Windows 7, as well as the doSMP and revoIPC packages from the "REVolution foreach windows" package for parallel processing. Then I loaded the doSMP library in R and received the following messages from R

> library(doSMP) Loading required package: revoIPC Error: package 'revoIPC' is not installed for 'arch=x64' 

How to get around this problem? DoSMP seems to work with a 32-bit R distribution, but not with a 64-bit distribution.

I also tested the following program

 ------------------------------------------------------ require(doSMP) workers <- startWorkers(4) # My computer has 2 cores registerDoSMP(workers) # create a function to run in each itteration of the loop check <-function(n) { for(i in 1:1000) { sme <- matrix(rnorm(100), 10,10) solve(sme) } } times <- 10 # times to run the loop # comparing the running time for each loop system.time(x <- foreach(j=1:times ) %dopar% check(j)) # 2.56 seconds (notice that the first run would be slower, because of R lazy loading) system.time(for(j in 1:times ) x <- check(j)) # 4.82 seconds # stop workers --------------------------------------------------------------------------- 

And I received the following messages from R

 > workers <- startWorkers(4) # My computer has 2 cores Error: could not find function "startWorkers" > registerDoSMP(workers) Error: could not find function "registerDoSMP" 

Many thanks for your help.

Tony

+4
source share
3 answers

Error message

 Loading required package: revoIPC Error: package 'revoIPC' is not installed for 'arch=x64' 

quite explicit: you are using 64-bit R, but you do not have all the subcomponents needed to download doSMP , in particular, the revoIPC package is revoIPC .

If you are a Revo customer, contact him. If not, then maybe you need to consider various parallel computing solutions for R.

+1
source

This has been fixed a long time ago and works great in the latest 64-bit build of Revolution R v6.1.

The example below was taken from Parallel multi-core processing with R (on Windows) and works fine on my machine running Revolution R v6.1 x64 on Windows 7 x64.

 require(doSMP) workers <- startWorkers(2) # My computer has 2 cores registerDoSMP(workers) # create a function to run in each itteration of the loop check <-function(n) { for(i in 1:1000) { sme <- matrix(rnorm(100), 10,10) solve(sme) } } times <- 10 # times to run the loop # comparing the running time for each loop system.time(x <- foreach(j=1:times ) %dopar% check(j)) # 2.56 seconds (notice that the first run would be slower, because of R lazy loading) system.time(for(j in 1:times ) x <- check(j)) # 4.82 seconds # stop workers stopWorkers(workers) 

Please note that the doSMP package doSMP built into the R kernel assembly, so you do not need to install it from CRAN (for this reason you will not find it in the package list). All you have to do is load it using require(SMP) . Similarly, the parallel package is also built into all versions of R from v2.14.0 and is loaded using require(parallel) .

For more important notes in this example, see the full article, Parallel Multicore Processing with R (on Windows) .

+1
source

There is a good .pdf document in the Start..All Programs..Revolution R..Documentation..foreach and iterators - User Guide in the Revolution R installation folder. The document describes how to parallelize a task in R when starting Windows. Here are the topics that he covers:

 Parallelizing Loops 1.1 Using foreach 1.2 Parallel Backends 1.2.1 Using the doMC parallel backend 1.2.2 Using the doParallel parallel backend 1.2.3 The doSMP parallel backend 1.2.4 Getting information about the parallel backend 1.3 Nesting Calls to foreach 1.4 Using Iterators 1.4.1 Some Special Iterators 1.4.2 Writing Iterators 
0
source

All Articles