search for: clustersetuprng

Displaying 10 results from an estimated 10 matches for "clustersetuprng".

2013 Jan 23
3
How to construct a valid seed for l'Ecuyer's method with given .Random.seed?
...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]) # => fails! } ## actual work foreach(i=seq_len(n)) %dopar% { runif(1) } } ## "standard" (base) way of specifying l'Ecuyer RNGkind("L'Ecuyer-CMRG") # => .Random.seed is of length 7 res <- doForeach(10, seed=&q...
2011 Mar 13
1
R hangs when connected via VPN [incl. minimal example]
...goes up to 100%... Same happens if 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)
2007 Aug 21
1
clusterCall with replicate function
I am trying to run a monte carlo process using snow with a MPI cluster. I have ~thirty processors to run the algorithm on and I want to run it 5000 times and take the average of the output. A very simple way to do this is to divide 5000 by the number of processors to get a number n and tell each processor to run the algorithm n times. I realize there are more efficient ways to manage the
2012 Aug 08
1
random number generator with SNOW/ Parallel/ foreach
...0,1) return(a) } library(snow) cl <- makeCluster(5,type="SOCK") clusterCall(cl, testfun) stopCluster(cl) ## code with rsprng ## testfun <- function(){ a <- rnorm(5,0,1) return(a) } library(snow) library(rsprng) cl <- makeCluster(5,type="SOCK") clusterSetupRNG(cl) clusterCall(cl, testfun) stopCluster(cl) 3. Suppose I would like to use the package *parallel, *do I still need * rsprng? *Should I specify any seed in this case? testfun <- function(){ a <- rnorm(5,0,1) return(a) } library(parallel) cl <- makeCluster(5,type="SOCK&q...
2011 Feb 24
1
parallel bootstrap linear model on multicore mac (re-post)
...). This returned a correct result, but did not speed things up. Not sure why... I also tried snowfall and snow. While I can create a cluster and run simple processes (e.g., provided example from literature), I can't get the bootstrap to run. For example, using snow: cl <- makeCluster(8) clusterSetupRNG(cl) clusterEvalQ(cl,library(boot)) clusterEvalQ(cl,library(lme4)) boot.out<-clusterCall(cl,boot(dat.res,boot.fun, R = nboot)) stopCluster() returns the following error: Error in checkForRemoteErrors(lapply(cl, recvResult)) : 8 nodes produced errors; first error: could not find function &quo...
2011 Feb 23
0
parallel bootstrap linear model on multicore mac
...). This returned a correct result, but did not speed things up. Not sure why... I also tried snowfall and snow. While I can create a cluster and run simple processes (e.g., provided example from literature), I can't get the bootstrap to run. For example, using snow: cl <- makeCluster(8) clusterSetupRNG(cl) clusterEvalQ(cl,library(boot)) clusterEvalQ(cl,library(lme4)) m2.ph.rlm.boot<-clusterCall(cl,boot(m2.ph,m2.ph.fun, R = nboot)) stopCluster() returns the following error: Error in checkForRemoteErrors(lapply(cl, recvResult)) : 8 nodes produced errors; first error: could not find function...
2010 Aug 25
2
Problem with clusterCall, "Error in checkForRemoteErrors(lapply(cl, recvResult)) : "
...e function. sd is the diagonal elements of the covariance matrix of the proposal distribution. The following is the particular function: ui.Full.Sample.Cluster = function( levels , Y , X , beta , Z , C , sigma.sq , sd , burnin , iteration ) { cluster = makeCluster( 4 , type = "MPI"); clusterSetupRNG( cluster ); patients = unique( levels ); q = length( X[1,] ); u = ui.Ini( q , length( patients ) ); n = levels[ length(patients) ]; marker = levels == patients[1]; y = Y[ marker ]; x = X[ marker, ]; z = Z[ marker, ]; u[1,] = ui.1.Sample( u[1,] , y , x , beta , z , C[1] , sig...
2008 May 14
0
Parallel computing with rgenoud and snow: external file I/O possible?
...in # Set up the cluster this.host <- system("hostname", intern=T) node <- c(this.host, "escalante") # add additional nodes here setDefaultClusterOptions(master=this.host, type="SOCK", homogeneous=T, outfile="/tmp/cluster1") cl <- makeCluster(node) #clusterSetupRNG(cl) # init random number generator to ensure each node has a different seed # Define the function that will be called by genoud() drive.calib <- function(xx) { # parameter value that is being adjusted working.dir <- "/projects/dhsvm/uvm/test/rhelp/" # HARDWIRED WORKING DIREC...
2011 Oct 31
0
R 2.14.0 is released
...ir namespaces to a reference to parallel, and links explicitly to multicore or snow on help pages). It also contains support for multiple RNG streams following L'Ecuyer _et al_ (2002), with support for both mclapply and snow clusters. This replaces functions like clusterSetupRNG() from snow (which are not in parallel). The version released for R 2.14.0 contains base functionality: higher-level convenience functions are planned (and some are already available in the 'R-devel' version of R). o Building PDF manuals (for R itself or packag...
2011 Oct 31
0
R 2.14.0 is released
...ir namespaces to a reference to parallel, and links explicitly to multicore or snow on help pages). It also contains support for multiple RNG streams following L'Ecuyer _et al_ (2002), with support for both mclapply and snow clusters. This replaces functions like clusterSetupRNG() from snow (which are not in parallel). The version released for R 2.14.0 contains base functionality: higher-level convenience functions are planned (and some are already available in the 'R-devel' version of R). o Building PDF manuals (for R itself or packag...