2010-11-27 6 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はRの32ビット分布では動作しますが、64ビット分布では動作しないようです。

私はまた、次のプログラム

------------------------------------------------------ 
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

ありがとうございました。私はdoMCでLinuxプラットフォームを試してみてください。 doSMPはWindows上の32ビットR専用です。 – Tony

+0

私はかなり降雪パッケージに満足しています:http://cran.r-project.org/web/packages/snowfall/index.html –

+0

私はちょうど降雪を使用してcpu = 8と並列に動作するプログラムをテストしました、それはかなり速いです。 Cheers- Tony – 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)の記事全体を参照してください。