Displaying 18 results from an estimated 18 matches for "registerdosnow".
2012 May 08
1
revolution foreach oddity
...he
following?
I have a foreach loop to generate random samples. If I run the exact code
below in normal r (2.14.1) it works as expected, but if I run it from
revolution 4.2.0 each loop returns 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(samp...
2012 Sep 21
2
Parallel Programming
I am trying to do parallel programming and I tried this
library(doSNOW)
library(foreach)
testfunc<-function(x){
x<-x+1
x
}
noc<-2
cl <- makeCluster(do.call(rbind,rep(list("localhost"),noc)), type = "SOCK")
registerDoSNOW(cl)
clusterExport(cl=cl,c("testfunc.r"))
testl<-foreach(pp=1:2) %dopar% {
testfunc(pp)
}
And this works but if I try to enclose my commands inside a text file
to be sourced it doesn't work
noc<-2
testfunc<-function(x){
x<-x+1
x
}
cl <- makeCluster(do.call(rbind,r...
2011 Feb 25
1
Question about foreach (with doSNOW), is that a bug?
...o the same thing twice with foreach
# no problem at all
foreach(i=1:2) %do% {
coeftest(lm(length ~ age, data=Mandible, subset=(age <= 28)))
}
# Do the same thing twice with foreach and doSNOW
# it fails!! the error msg was (could not find function "coeftest")
cl<-makeCluster(2)
registerDoSNOW(cl)
foreach(i=1:2) %dopar% {
coeftest(lm(length ~ age, data=Mandible, subset=(age <= 28)))
}
stopCluster(cl)
# However if i put require(lmtest) inside the foreach loop, it works again!
cl<-makeCluster(2)
registerDoSNOW(cl)
foreach(i=1:2) %dopar% {
require(lmtest)
coef...
2010 Dec 17
1
[R-sig-hpc] Error in makeMPIcluster(spec, ...): how to get a minimal example for parallel computing with doSNOW to run?
...nd [the batch system is "LSF"]?) and let me know if you need further.
>
> ## ==== minimal example ====
>
> library(doSNOW) # loads foreach
> library(Rmpi) # for default in makeCluster()
> cl<- makeCluster(3) # create cluster object with the given number of slaves
> registerDoSNOW(cl) # register the cluster object with foreach
> x<- foreach(i = 1:3) %dopar% { # simple test
> sqrt(i)
> }
> x
> stopCluster(cl) # properly shut down the cluster
>
> ## ==== minimal example ====
>
> ## ==== output ====
>
> Sender: LSF System<lsfadmin at a...
2010 May 12
1
snow makeCluster (makeSOCKcluster) not working in R-2.11
Hello,
I was using snow to parallel-process some code in R-2.10 (32-bit
windows. ). The code is as follows:
require(foreach)
require(doSNOW)
cl <- makeCluster(6, type='SOCK')
registerDoSNOW(cl)
bl2 <- foreach(i=icount(length(unqmrno))) %dopar% {
(some code here)
}
stopCluster(cl)
When I run the same code in Windows R-2.11 (either 32-bit or 64-bit), R
hangs at cl<-makeCluster(6, type='SOCK') and no R processes are spawned.
I was wondering if others have encountered thi...
2015 Feb 09
2
R CMD check: Uses the superseded package: ‘doSNOW’
Dear list,
When I run an R CMD check --as-cran on my package (pROC) I get the
following note:
> Uses the superseded package: ?doSNOW?
The fact that it uses the doSNOW package is correct as I have the
following example in an .Rd file:
> #ifdef windows
> if (require(doSNOW)) {
> registerDoSNOW(cl <- makeCluster(2, type = "SOCK"))
> ci(roc2, method="bootstrap", parallel=TRUE)
> \dontrun{ci(roc2, method="bootstrap", parallel=TRUE)}
> \dontshow{ci(roc2, method="bootstrap", parallel=TRUE, boot.n=20)}
> stopCluster(cl)
>...
2011 Mar 13
1
R hangs when connected via VPN [incl. minimal example]
...I start the job from the
command line via R CMD BATCH. What's going on? Is this a known issue?
Cheers,
Marius
library(doSNOW)
library(Rmpi)
library(rlecuyer)
library(foreach)
cl <- makeCluster(mpi.universe.size(), type ="MPI")
tmp <- clusterSetupRNG(cl, seed=rep(1,6))
registerDoSNOW(cl)
counter <- 0
res <- foreach(k = 1:1000) %do% {
counter <- counter + 1
}
tmp <- stopCluster(cl)
unlist(res)
2010 Dec 02
1
using foreach (parallel processing)
...the first time.
I can see all my processor running at full performance when I use a
smaller dataset
require(snow)
require(doSNOW)
require(foreach)
#change the 8 to however many cores\phys processors you have on your machine
cl.tmp = makeCluster(rep("localhost",4), type="SOCK")
registerDoSNOW(cl.tmp)
optData.df <- head(pristine,100000)
system.time(
optData.df$impliedVol <-
foreach(i=1:NROW(optData.df),.packages="RQuantLib") %dopar%
with(optData.df[i,],
tryCatch({EuropeanOptionImpliedVolatility(type,value,underlying,
strike, dividendYield, riskFreeRate, maturity,
vola...
2012 Aug 08
1
random number generator with SNOW/ Parallel/ foreach
...now)
library(doSNOW)
testfun=function(){
options(digits.secs=6)
set.seed(slave.seed <- substring(Sys.time(), 21, 26))
a <- rnorm(5,0,1)
return(a)
}
maxkk <- 5
cl <- makeCluster(5, type = "SOCK")
registerDoSNOW(cl)
results=foreach (i = 1:maxkk, .combine = 'rbind') %dopar% testfun()
results
stopCluster(cl)
#################
2. Suppose I want to use *snow*, according to some reference, I need to use
*rsprng* as a generator. Does this generator relay on seed as well? But it
seems to me that if I do...
2018 Aug 29
2
Get Logical processor count correctly whether NUMA is enabled or disabled
...ectCores()
# [1] 88
This is great!
Then I went on to test with a simple 'foreach()' loop. I started with 64 processors (max limit of 1 processor group). I ran with a simple function of 0.5s sleep.
require(snow)
require(doSNOW)
require(foreach)
cl <- makeCluster(64L, "SOCK")
registerDoSNOW(cl)
system.time(foreach(i=1:64) %dopar% Sys.sleep(0.5))
# user system elapsed
# 0.06 0.00 0.64
system.time(foreach(i=1:65) %dopar% Sys.sleep(0.5))
# user system elapsed
# 0.03 0.01 1.04
stopCluster(cl)
With a cluster of 64 processors and loop running with 64 iterations, it...
2013 Jan 23
3
How to construct a valid seed for l'Ecuyer's method with given .Random.seed?
...mal example:
require(doSNOW)
require(foreach)
doForeach <- function(n, seed=1, type="MPI")
{
## create cluster object
cl <- snow::makeCluster(parallel::detectCores(), type=type)
on.exit(snow::stopCluster(cl)) ## shut down cluster and terminate execution environment
registerDoSNOW(cl) ## register the cluster object with foreach
## seed
if(seed=="L'Ecuyer-CMRG") {
if(!exists(".Random.seed")) stop(".Random.seed does not exist - in l'Ecuyer setting")
.t <- snow::clusterSetupRNG(cl, seed=.Random.seed[2:7]) # =>...
2015 Feb 10
1
R CMD check: Uses the superseded package: ‘doSNOW’
...package (pROC) I get the
>> following note:
>>> Uses the superseded package: ?doSNOW?
>> The fact that it uses the doSNOW package is correct as I have the
>> following example in an .Rd file:
>>> #ifdef windows
>>> if (require(doSNOW)) {
>>> registerDoSNOW(cl <- makeCluster(2, type = "SOCK"))
>>> ci(roc2, method="bootstrap", parallel=TRUE)
>>> \dontrun{ci(roc2, method="bootstrap", parallel=TRUE)}
>>> \dontshow{ci(roc2, method="bootstrap", parallel=TRUE, boot.n=20)}
>...
2018 Sep 03
0
Get Logical processor count correctly whether NUMA is enabled or disabled
...gt; Then I went on to test with a simple 'foreach()' loop. I started with 64 processors (max limit of 1 processor group). I ran with a simple function of 0.5s sleep.
>
> require(snow)
> require(doSNOW)
> require(foreach)
>
> cl <- makeCluster(64L, "SOCK")
> registerDoSNOW(cl)
> system.time(foreach(i=1:64) %dopar% Sys.sleep(0.5))
> # user system elapsed
> # 0.06 0.00 0.64
> system.time(foreach(i=1:65) %dopar% Sys.sleep(0.5))
> # user system elapsed
> # 0.03 0.01 1.04
> stopCluster(cl)
>
> With a cluster of 64 processors...
2015 Feb 10
0
R CMD check: Uses the superseded package: ‘doSNOW’
...D check --as-cran on my package (pROC) I get the
> following note:
> > Uses the superseded package: ?doSNOW?
> The fact that it uses the doSNOW package is correct as I have the
> following example in an .Rd file:
> > #ifdef windows
> > if (require(doSNOW)) {
> > registerDoSNOW(cl <- makeCluster(2, type = "SOCK"))
> > ci(roc2, method="bootstrap", parallel=TRUE)
> > \dontrun{ci(roc2, method="bootstrap", parallel=TRUE)}
> > \dontshow{ci(roc2, method="bootstrap", parallel=TRUE, boot.n=20)}
> >...
2011 Jan 14
0
Fwd: Re: [R-sig-hpc] Working doSNOW foreach openMPI example
...he directory containing rtest.R it is run from the command line with:
> "mpirun -n --hostfile /home/hostfile --no-save -f rtest.R"
>
> Here is the code for rtest.R:
>
> #################
> library(doSNOW)
> library(panel)
>
> cl<-makeMPIcluster(3)
> registerDoSNOW(cl)
>
> clusterEvalQ(cl,library(panel))
>
> res<-clusterCall(cl, function(){Sys.info()["nodename"]})
> print(do.call(rbind,res))
>
> sme<- matrix(rnorm(100),10,10)
> clusterExport(cl,"sme")
>
> myfun<-function()
> {
> for(i in...
2012 Feb 02
0
bigkmeans not parallel
...n bigkmeans
>ans <- bigkmeans(data,200,nstart=5,iter.max=20)
I see only one R process in system monitor, and only one CPU usage is high.
I guess it's not really parallel.
I also tried DoSNOW, though it's used for multi clusters.
>cl <- makeCluster(8,type="SOCK")
>registerDoSNOW(cl)
>ans <- bigkmeans(data,200,nstart = 30)
There are 8 R processes but only 1 running.
Is it because I have something misconfigured? Or is the bigkmeans do not
support parallel?
Thanks in advance to any advise.
Regards,
Lishu
--
View this message in context: http://r.789695.n4.nabble...
2012 Feb 21
0
Running Amelia with parallel processors in Windows
Hi,
I want to impute a data set multiple times with Amelia, 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 lo...
2018 Aug 21
2
Get Logical processor count correctly whether NUMA is enabled or disabled
Dear Tomas, thank you for looking into this. Here's the output:
# number of logical processors - what detectCores() should return
out <- system("wmic cpu get numberoflogicalprocessors", intern=TRUE)
[1] "NumberOfLogicalProcessors \r" "22 \r" "22 \r"
[4] "20 \r"