multi-core processing in R on windows XP - via doMC and foreach

前端 未结 3 1193
情书的邮戳
情书的邮戳 2021-02-09 02:10

I\'m posting this question to ask for advice on how to optimize the use of multiple processors from R on a Windows XP machine.

At the moment I\'m creating 4 scripts (eac

相关标签:
3条回答
  • 2021-02-09 02:38

    You could try doSMP from REvolution Computing. For more information, see this blog posting: Parallel Multicore Processing with R (on Windows)

    0 讨论(0)
  • 2021-02-09 02:58

    For completeness, here is the requested answer to Tal's comment which provides a simple and portable alternative. The answer consists of running

     > library(snow)
     > help(makeCluster)
    

    and running the first three lines of code from the top of the Examples: section:

    > cl <- makeCluster(c("localhost","localhost"), type = "SOCK")
    > clusterApply(cl, 1:2, get("+"), 3)
    [[1]]
    [1] 4
    
    [[2]]
    [1] 5
    
    > stopCluster(cl)
    > .Platform$OS.type
    [1] "windows"
    > 
    

    Was that really that hard?

    Add-on packages like doSNOW and thereafter foreach can make use of this in a portable way.

    0 讨论(0)
  • 2021-02-09 03:02

    Try the doSNOW parallel backend- it is supported out of the box on Windows. Use it with a snow socket cluster.

    0 讨论(0)
提交回复
热议问题