You are right.  Thank you so much.

Xiaochun

From: Hodgess, Erin [mailto:HodgessE@uhd.edu]
Sent: Wednesday, October 28, 2009 12:07 AM
To: Li, Xiaochun; r-sig-hpc@r-project.org
Subject: RE: [R-sig-hpc] snow question


Could it possibly be that it is looking for "c1" (c one) instead of "cl" (c letter l), please?

thanks,
Erin


Erin M. Hodgess, PhD
Associate Professor
Department of Computer and Mathematical Sciences
University of Houston - Downtown
mailto: hodgesse@uhd.edu



-----Original Message-----
From: r-sig-hpc-bounces@r-project.org on behalf of Li, Xiaochun
Sent: Tue 10/27/2009 10:34 PM
To: r-sig-hpc@r-project.org
Subject: [R-sig-hpc] snow question

I encountered this strange problem:

xiaochun@Quarry: ~/OMOP/ParEg005> orterun -n 1 -H b005,b006 r -lsnow,Rmpi rmpi_snow.R
        4 slaves are spawned successfully. 0 failed.
     nodename
[1,] "b006"
[2,] "b005"
[3,] "b006"
[4,] "b005"
Error in integSnow(c1, func, xint, yint, n) : object 'c1' not found

Attached is my code 'rmpi_snow.R"- taken from http://www.jstatsoft.org/v31/i01

Thank you for your help.

Xiaochun

'rmpi_snow.R':

cl <- makeCluster(4, "MPI")
res <- clusterCall(cl,  function() Sys.info()["nodename"])
print(do.call(rbind,res))
###################################################
### chunk number 1: Define problem function
###################################################
xint <- c(-1, 2)
yint <- c(-1, 2)
func <- function(x, y) x^3-3*x + y^3-3*y

###################################################
### chunk number 10: Define function to solve problem in parallel with snow
###################################################
integSnow <- function(cluster, func, xint, yint, n)
{
        nslaves <- length(cluster)
        erg <- clusterApplyLB(cluster, 1:nslaves,
                        slavefunc, nslaves, xint, yint, n, func)
        return( sum(unlist(erg)) )
}

###################################################
### chunk number 12:
###################################################
n <- 10000

###################################################
### chunk number 16: Calculate parallel results with snow eval=FALSE
###################################################
erg <- integSnow(c1, func, xint, yint, n)

_______________________________________________
R-sig-hpc mailing list
R-sig-hpc@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-hpc

	[[alternative HTML version deleted]]

