[R-sig-Geo] Any Grid Computing or Pararrel Processing using R for spatial analysis

Roger Bivand Roger.Bivand at nhh.no
Thu Feb 8 09:45:43 CET 2007


On Thu, 8 Feb 2007, Hisaji ONO wrote:

> Hello.
> 
>  Does anyone know examples using grid computing using R
> for spatial analysis, or geocomputaion(computational
> geography) like Stan Openshaw's works?
> 

A good deal of the infrastructure is there, this example is on an oldish 
twin processor Xeon 32-bit box using sockets, but I've looked at Duo as 
well, which under Linux and I believe OSX is recognised as SMP:

library(snow)
cl <- makeCluster(c("localhost","localhost"), type = "SOCK")
cl
library(maptools)
library(gpclib)
clusterEvalQ(cl,library(maptools))
clusterEvalQ(cl,library(gpclib))
nc1 <- readShapePoly(system.file("shapes/sids.shp", package="maptools")[1],
 proj4string=CRS("+proj=longlat +ellps=clrk66"))
pl <- slot(nc1, "polygons")
system.time(pl_new <- lapply(pl, checkPolygonsHoles))
system.time(pl_new_c <- parLapply(cl, pl, checkPolygonsHoles))
stopCluster(cl)

with system times on a single processor:

> system.time(pl_new <- lapply(pl, checkPolygonsHoles))
[1] 3.650 0.002 3.651 0.000 0.000

and using two:

> system.time(pl_new_c <- parLapply(cl, pl, checkPolygonsHoles))
[1] 0.024 0.002 2.006 0.000 0.000

so a speed-up of 3.651/2.006 with a very simple setup (system monitor PNG
attached). Putting more work into configuring MPI or PVM would increase
the benefits. But note that snow means Simple Network of Workstations, and
is only for "embarrassingly parallel" work, especially work where each
node takes its share of the data and does its work without communicating
with the other nodes until completion. Essentially where lapply() works,
parLapply() should work. I haven't looked at spTransform(), but that would
be another candidate. The snow package is not available for Windows.

Hope this helps,

Roger

> 
> 
>  Regards.
> 
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> 

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no

-------------- next part --------------
A non-text attachment was scrubbed...
Name: snow.png
Type: image/png
Size: 4888 bytes
Desc: 
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20070208/135c5294/attachment.png>


More information about the R-sig-Geo mailing list