[R] problem with parLapply from snow
Uwe Ligges
ligges at statistik.tu-dortmund.de
Sat Feb 5 19:38:39 CET 2011
I just tried with SOCK rather than MPI on my machine and it worked. Just
ask R to
update.packages(checkBuilt=TRUE)
and try again. If you have the same problems, try SOCK rather than MPI.
If MPI is the culprit, please debug your MPI setup.
Uwe Ligges
On 03.02.2011 03:44, Mark.Palmer at csiro.au wrote:
> Hi,
>
> The following function use to work, but now it doesn't giving the error
>
> "> CallSnow(, 100)
> Using snow package, asking for 2 nodes
> 2 slaves are spawned successfully. 0 failed.
> Error in checkForRemoteErrors(val) :
> 2 nodes produced errors; first error: no applicable method for 'lapply' applied to an object of class "list"
> ".
> Where this is the problem line of code "yusum<- parLapply(cl, yu, sum)"
>
>
> 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<- clusterCall(cl, rnorm, Nsamples)
> print(yn)
> return()
> }
>
> This is under R-2.12.1. on a windows Xp machine. This function still runs satisfactorily on a machine running r-2.11.1 under Suse10.3/sles.
>
> Thanks
>
> Mark Palmer
> Senior Statistician
> CSIRO Mathematics, Informatics and Statistics
>
> Phone: +61 8 9333 6293 | Fax: +61 8 9333 6121 | Mobile: 0427502353
> Mark.Palmer at csiro.au<mailto:Mark.Palmer at csiro.au> | www.csiro.au | www.csiro.au/cmis<http://www.csiro.au/cmis>
> Address: Private bag 5, Wembley, WA 6913, Australia
>
> PLEASE NOTE
> The information contained in this email may be confidential or privileged. Any unauthorised use or disclosure is prohibited. If you have received this email in error, please delete it immediately and notify the sender by return email. Thank you. To the extent permitted by law, CSIRO does not represent, warrant and/or guarantee that the integrity of this communication has been maintained or that the communication is free of errors, virus, interception or interference.
>
> Please consider the environment before printing this email.
>
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help
mailing list