2010-11-27 5 views
4

Windows 7에 R (64 비트) 버전 2.11.1을 설치했으며 병렬 처리를 위해 "REvolution foreach windows bundle"에서 doSMP 및 revoIPC 패키지를 설치했습니다. 그런 다음 라이브러리 doSMP를 R에 업로드하고 다음 메시지가 나타납니다.Windows 7 패키지의 64 비트 R 병렬 처리 doSMP

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

이 문제를 해결하려면 어떻게해야합니까? doSMP는 64 비트 분포가 아닌 R의 32 비트 분포에서 작동하는 것으로 보입니다.

은 또한 다음과 같은 프로그램

------------------------------------------------------ 
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's lazy loading) 
system.time(for(j in 1:times) x <- check(j)) # 4.82 seconds 

# stop workers 
--------------------------------------------------------------------------- 

을 테스트 그리고 R

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

많은 감사를 다음과 같은 메시지를 받았습니다.

토니

답변

1

오류 메시지

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

꽤 명시 적입니다 : 64 비트 R 실행되지만, doSMP를로드하는 데 필요한 모든 하위 구성 요소가없는 패키지 revoIPC 특히 누락.

Revo 고객 인 경우 연락하십시오. 그렇지 않다면 아마도 R에 대한 다른 병렬 컴퓨팅 솔루션을 고려해야 할 것입니다.

+0

감사합니다. Dirk. doMC로 Linux 플랫폼을 사용해 보겠습니다. doSMP가 잠시 동안 Windows에서 32 비트 R에서만 작동한다는 것이 맞습니까? – Tony

+0

나는 강설량 패키지에 꽤 만족합니다 : http://cran.r-project.org/web/packages/snowfall/index.html –

+0

방금 ​​강설량을 사용하여 CPU = 8과 병렬로 실행되는 프로그램을 테스트했는데, 꽤 빠릅니다 . 건배 - 토니 – Tony

0

Revolution R 설치 폴더에 Start..All Programs..Revolution R..Documentation..foreach and iterators - User's Guide이라는 멋진 .pdf 문서가 있습니다. 이 문서에서는 Windows를 실행할 때 R에서 작업을 병렬 처리하는 방법에 대해 설명합니다.

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 
1

이 문제는 오래 전에 고쳐졌으며 Revolution R v6.1의 최신 64 비트 빌드에서 잘 작동합니다.

아래 예제는 Parallel Multicore Processing with R (on Windows)에서 가져 와서 Windows 7 x64에서 Revolution R v6.1 x64를 실행하는 내 컴퓨터에서 잘 작동합니다. 당신이 CRAN에서 설치하지 않아도 패키지 doSMP는, 혁명 R의 핵심 빌드에 내장되어

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's lazy loading) 
system.time(for(j in 1:times) x <- check(j)) # 4.82 seconds 

# stop workers 
stopWorkers(workers) 

주 (이런 이유로, 당신은 패키지 목록에서 찾을 수 없습니다). 단지 require(SMP)으로로드하면됩니다. 비슷한 말로, 패키지 parallel은 v2.14.0 이후의 모든 버전의 R에도 내장되어 있으며 require(parallel)으로로드하십시오.

이 예의 더 중요한 메모는 전체 문서 Parallel Multicore Processing with R (on Windows)을 참조하십시오.

관련 문제