Displaying 6 results from an estimated 6 matches for "getdoparworkers".
2012 May 08
1
revolution foreach oddity
...eturns the same numbers.
The only way I can get revolution to give different numbers is using 1
instead of 8 in
registerDoSNOW(makeCluster(8, type = "SOCK"))
but that seems to defeat the point.
library(foreach)
library(doSNOW)
registerDoSNOW(makeCluster(8, type = "SOCK"))
getDoParWorkers()
getDoParName()
getDoParVersion()
mySamples <- foreach (jj = 1:4, .combine=cbind) %dopar% {
return(sample(1:10,10,replace=TRUE))
}
mySamples
##########
r 2.14.1
##########
> library(foreach)
> library(doSNOW)
> registerDoSNOW(makeCluster(8, type = "SOCK"))
> get...
2011 Jul 02
5
%dopar% parallel processing experiment
...nction
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% uniroot( minfn, c(1e-20,9e20), i ) } else
if (ARGV[1] == "plain")
?for (i in 1:A) discard <- uniroot( minfn, c(1e-20,9e20), i ) else
cat("sorry, but argument", ARGV[1], "is not plain|do-onecore|do-multic...
2012 Feb 02
0
bigkmeans not parallel
I'm using bigkmeans in 'biganalytics' to cluster my 60,000 by 600,000 matrix.
I'm using a 8 core Linux VM.
I have register parallel backend with
>registerDoMC()
And I checked how many cores registered with
>getDoParWorkers()
It returns 8, which is the number of cores I have on my machine.
And I run the test below, whose results shows improved speed due to
parallel.
check <-function(n) {
+ for(i in 1:1000)
+ {
+ sme <- matrix(rnorm(100), 10,10)
+ solve(sme)
+ }
+ }
times <- 100 # times to run the loop
s...
2012 Feb 21
0
Running Amelia with parallel processors in Windows
...elia, but the data set is
large so it takes a long time. As a result, I'm trying to run the multiple
imputation with parallel processors in Windows, but am having trouble. Here
is a quick example:
######
library(foreach)
library(doSNOW)
registerDoSNOW(makeCluster(4, type = "SOCK"))
getDoParWorkers()
getDoParName()
getDoParVersion()
data(africa)
iterations <- 4
foreach(i = 1:iterations) %dopar% {
amelia(x = africa, m=1, cs = "country", ts = "year", logs = "gdp_pc")
}
######
When I run the foreach loop, I receive the following warning
Error in { : task 1 f...
2011 Oct 27
2
help with parallel processing code
Hello R gurus,
I have the code below for which i need help and pointers to make it run in
parallel on a dual core win7 computer with R 2.13.x, using foreach,
iterators,doMC.
library(scatterplot3d) # Loads 3D library.
library(fields)
library(MASS)
library(ROCR)
library(verification)
library(caret)
library(gregmisc)
##simulated data
d=replicate(9, rnorm(40)+10)
2011 Apr 19
0
doSMP package works better than perfect, at least sometimes.
...is package. They occasionally
get kicked for their closed-source addon to R, but it's clear that their
releases of packages like doSMP and foreach are important contributions to
the community.
###### Toy test code follows:######
# Toy SMP
memory.limit(3000)
require(doSMP)
require(reshape2)
getDoParWorkers()
w<- startWorkers(workerCount=3)
registerDoSMP(w)
timeSMP <- function(g, n)
# g = number of groups to process
# n = size of each group.
{
for(rep in 1:3) {
times <- NULL
dd <- data.frame(k=rep(1:g, n), x=runif(g*n))
ddSplit <- split(dd, dd$k)
tt<-system...