search for: clustercall

Displaying 20 results from an estimated 31 matches for "clustercall".

2007 Aug 21
1
clusterCall with replicate function
...0 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 parallelization. To implement this I used the clusterCall command with the replicate function along the lines of clusterCall(cl, replicate, n, function(args)). Because my function is a monte carlo process it relies on drawing from random distributions to generate output. When I do this, all of my processors generate the same random numbers. I copied...
2010 Aug 25
2
Problem with clusterCall, "Error in checkForRemoteErrors(lapply(cl, recvResult)) : "
...marker ]; x = X[ marker, ]; z = Z[ marker, ]; u[1,] = ui.1.Sample( u[1,] , y , x , beta , z , C[1] , sigma.sq , sd , burnin , iteration )$uFinal; for( i in 2:n) { marker = levels == patients[i]; y = Y[ marker ]; x = X[ marker, ]; z = Z[ marker, ]; print( i ); u[i, ] = clusterCall( cluster , ui.1.Sample, u[i,] , y , x , beta , z , C[i] , sigma.sq , sd , burnin , iteration )$uFinal; print( i ); } stopCluster( cluster ); u; } If anyone could help that would be much appreciated! But big thanks for taking your time to read the post! TelM8 -- View this message in...
2005 Dec 01
1
Snow & rvpm
...U) Origin = "GenuineIntel" Id = 0xf24 Stepping = 4 real memory = 260046848 (248 MB) This machine NbBSD: CPU: Mobile Intel(R) Pentium(R) 4 - M CPU 2.00GHz (1993.54-MHz 686-class CPU) real memory = 536674304 (511 MB) And starting library snow under R I have the following situation clusterCall(cl, function() Sys.info()[c("sysname", "release","nodename","machine")]) [[1]] sysname release nodename machine "FreeBSD" "5.4-RELEASE" "uffbsd.myd" "i386" [[2]] sysname...
2006 Apr 20
1
Parallel computing with the snow package: external file I/O possible?
...appen. I don't understand why the model doesn't get run in the slave mode, but I noticed something described below that I thought might be related. It is hard for me to figure out a short and simple example of my genoud() problem for posting here, so let me start with some code that uses clusterCall(). As I understand the snow package, each execution of the function "fun" from clusterCall() (or of the function fn() from genoud()) should be independent. However, in the code below, the directory created by each node has the same random number in its name. I was expecting the contents...
2012 Aug 08
1
random number generator with SNOW/ Parallel/ foreach
...d to use *rsprng* as a generator. Does this generator relay on seed as well? But it seems to me that if I do not use rsprng, it is also fine. ## code without rsprng ## testfun <- function(){ a <- rnorm(5,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 p...
2011 Feb 03
1
problem with parLapply from snow
...The function is CallSnow <- function (Nnodes = 2, Nsamples = Nnodes) { require(Rmpi) require(snow) cat("Using snow package, asking for ", Nnodes, "nodes \n") cl <- makeCluster(Nnodes, type="MPI") on.exit(stopCluster(cl)) #print(do.call("rbind", clusterCall(cl, function(cl) Sys.info()["nodename"]))) # ## uses RSPRNG if there # #clusterSetupSPRNG(cl) clusterSetupRNGstream(cl, seed = rep(123456, 6)) yu <- clusterCall(cl, runif, Nsamples) yusum <- parLapply(cl, yu, sum) print(yusum) yn <...
2006 Mar 13
1
Parallel computing with the snow package: external file I/O possible?
...ternal file I/O is happening only in the master node and not in the slaves. I have followed Jasjeet Sekhon's suggestion to test the cluster setup, and that is fine: > library(snow) > > #pick two machines > cl <- makeCluster(c("moab","escalante")) > > clusterCall(cl, sin, 2) > The output should be: > > clusterCall(cl, sin, 2) > [[1]] > [1] 0.9092974 > > [[2]] > [1] 0.9092974 > I do indeed get the above result, so I presume the network setup is ok. Next I tested a function that creates a file. Here is the code that I sourced...
2006 Oct 13
3
Rmpi performance
...det_inv = det(inversa) + tr_inv = sum(diag(inversa)) + return(list(c(det=det_inv,tr=tr_inv))) + } >nn = 3000 >XX = matrix(rnorm(nn*nn),nn,nn) # with the master > system.time(op_matrici(XX)) [1] 42.283 1.883 44.168 0.000 0.000 # with the cluster > system.time(clusterCall(cl,op_matrici,XX)) [1] 11.523 12.612 71.562 0.000 0.000 You can see that using the master it takes 44.168 seconds for computing the function on matrix XX while it takes 71.562 seconds (more time!!!) with the cluster. Can you give us some advice in order to understand why the cluster is slower...
2008 Sep 30
1
prblems changing directory in mpi snow clusters
...n, I cannot change the working directory in my nodes. > noclusters<-2 > cl <- makeCluster(noclusters, type = "MPI") 2 slaves are spawned successfully. 0 failed. > foo<-clusterApply(cl,1:noclusters,function(noderank) {2+2}) > foo [[1]] [1] 4 [[2]] [1] 4 > clusterCall(cl,setwd("C:/")) Error in checkForRemoteErrors(lapply(cl, recvResult)) : 2 nodes produced errors; first error: variable "C:/" of mode "function" was not found > Any suggestions ? Thanks in advance, Tolga Generally, this communication is for informational p...
2018 Mar 04
3
Random Seed Location
...ve reproducible results. In the example that Bill gave, I think the problem is that set.seed() only resets the seed in the main thread, the nodes continue to operate with unreset RNG. To demonstrate this to yourself you can do library(parallel) cl <- parallel::makeCluster(3) parallel::clusterCall(cl, function()set.seed(100)) parallel::clusterCall(cl, function()RNGkind()) parallel::clusterCall(cl, function()runif(2)) # similar result from all nodes # [1] 0.3077661 0.2576725 However, do *NOT* do that in real work. You will be getting the s...
2010 Dec 02
1
parLapply - Error in do.call("fun", lapply(args, enquote)) : could not find function "fun"
...,n2=n2,MC_1st_obs2=MC_1st_obs2) using this it gives me the follow error: Error in do.call("fun", lapply(args, enquote)) : could not find function "fun" but, this works correctly when I just use lapply (it's just a bit slower than I need it to be). Also, I know that the clusterCall function works fine with my homemade function because all the nodes of the cluster return the appropriate results when I try this: clusterCall(cl,M.set.find,setin=setin[[1]],month=month,n1=n1,n2=n2,MC_1st_obs2=MC_1st_obs2) but that will only let me do this calculation one at a time. I perused th...
2006 Apr 04
1
Mpirun with R CMD scripts
...eaha ~]$ R R : Copyright 2005, The R Foundation for Statistical Computing Version 2.2.0 (2005-10-06 r35749) ISBN 3-900051-07-0 > library(snow) > c1<-makeCluster(3, type="MPI") Loading required package: Rmpi 3 slaves are spawned successfully. 0 failed. > > > > clusterCall(c1,function() Sys.info()[c("nodename","machine")]) [[1]] nodename machine "cheaha.ac.uab.edu" "x86_64" [[2]] nodename machine "compute-0-12.local" "x86_64" [[3]]...
2018 Mar 04
0
Random Seed Location
...ts. > > In the example that Bill gave, I think the problem is that set.seed() only resets the seed in the main thread, the nodes continue to operate with unreset RNG. To demonstrate this to yourself you can do > > library(parallel) > cl <- parallel::makeCluster(3) > parallel::clusterCall(cl, function()set.seed(100)) > parallel::clusterCall(cl, function()RNGkind()) > parallel::clusterCall(cl, function()runif(2)) # similar result from all nodes > # [1] 0.3077661 0.2576725 > > However, do *NOT* do that in real work. You wil...
2002 Aug 19
4
question about Rpvm, SNOW, etc.
...aged to get the following, using the same example that Prof. Tierney used: > system.time(nuke.boot <- + boot(nuke.data, nuke.fun, R=999, m=1, + fit.pred=new.fit, x.pred=new.data)) [1] 29.38 0.52 30.68 0.00 0.00 > system.time(cl.nuke.boot <- + clusterCall(cl,boot,nuke.data, nuke.fun, R=500, m=1, + fit.pred=new.fit, x.pred=new.data)) [1] 0.03 0.00 15.44 0.00 0.00 So I'm getting almost twice the performance, which is great. Now the questions: 1. Since each of these boxes has two CPUs, how do I spawn more than one sl...
2018 Mar 04
2
Random Seed Location
...In the example that Bill gave, I think the problem is that set.seed() only resets the seed in the main thread, the nodes continue to operate with unreset RNG. To demonstrate this to yourself you can do >> >> library(parallel) >> cl <- parallel::makeCluster(3) >> parallel::clusterCall(cl, function()set.seed(100)) >> parallel::clusterCall(cl, function()RNGkind()) >> parallel::clusterCall(cl, function()runif(2)) # similar result from all nodes >> # [1] 0.3077661 0.2576725 >> >> However, do *NOT* do that in...
2005 Jan 21
2
Parallel computations using snow: how to combine boot objects?
...t (Linux cluster) in order to estimate confidence intervals for a certain parameter. Following the example in the documentation of the "snow" package (http://www.stat.uiowa.edu/~luke/R/cluster/cluster.html), I launch my computations by something like > cl.nuke.boot <- + clusterCall(cl,boot,nuke.data, nuke.fun, R=500, m=1, + fit.pred=new.fit, x.pred=new.data) which gives me a list of n boot objects (where n is the number of nodes in my cluster). So far, so good. However, if I now want to go further, I need to combine all these boot objects to a single...
2018 Mar 04
0
Random Seed Location
...hat Bill gave, I think the problem is that set.seed() only resets the seed in the main thread, the nodes continue to operate with unreset RNG. To demonstrate this to yourself you can do >>> >>> library(parallel) >>> cl <- parallel::makeCluster(3) >>> parallel::clusterCall(cl, function()set.seed(100)) >>> parallel::clusterCall(cl, function()RNGkind()) >>> parallel::clusterCall(cl, function()runif(2)) # similar result from all nodes >>> # [1] 0.3077661 0.2576725 >>> >>> However...
2011 Feb 24
1
parallel bootstrap linear model on multicore mac (re-post)
...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 "fun" I am stuck and at the limit of my programming knowledge and am punting to the...
2018 Mar 05
1
Random Seed Location
...d() >>>> only resets the seed in the main thread, the nodes continue to operate with >>>> unreset RNG. To demonstrate this to yourself you can do >>>> >>>> library(parallel) >>>> cl <- parallel::makeCluster(3) >>>> parallel::clusterCall(cl, function()set.seed(100)) >>>> parallel::clusterCall(cl, function()RNGkind()) >>>> parallel::clusterCall(cl, function()runif(2)) # similar result from all >>>> nodes >>>> # [1] 0.3077661 0.2576725 >...
2005 Dec 02
0
problems with R and snow on a debian box only
...akeCluster(3,type="PVM") R complains that tid<0 and I cannot go further even thoug R goes on working. Case 2) One of the 2 fbsd boxes as master and the others as slaves: R and snow seem to work; I can makeCluster but R freezes as soon as I try to execute a cluster order like parApply, clusterCall, etc. What should I check? Vittorio