Displaying 1 result from an estimated 1 matches for "onecore".
Did you mean:
onecare
2011 Jul 02
5
%dopar% parallel processing experiment
...multicore processing, so far with pretty
disappointing results. Here is my simple example:
A <- 100000
randvalues <- abs(rnorm(A))
minfn <- function( x, i ) { log(abs(x))+x^3+i/A+randvalues[i] } ?## an
arbitrary function
ARGV <- commandArgs(trailingOnly=TRUE)
if (ARGV[1] == "do-onecore") {
?library(foreach)
?discard <- foreach(i = 1:A) %do% uniroot( minfn, c(1e-20,9e20), i ) } else
if (ARGV[1] == "do-multicore") {
?library(doMC)
?registerDoMC()
?cat("You have", getDoParWorkers(), "cores\n")
?discard <- foreach(i = 1:A) %dopar%...