[R-sig-Geo] Problem with using multicore resample in Raster package

Bastien.Ferland-Raymond at mffp.gouv.qc.ca Bastien.Ferland-Raymond at mffp.gouv.qc.ca
Fri Feb 27 15:26:40 CET 2015


Dear all,

I wrote a code last year that was running well.  I've retried the same code this month and it's not working anymore.  The problem arise from using cluster to do resampling in the raster package on multiple threads.  I've tried on two computers, both have the problem.

Here is a reproducible example :

###

library(raster)
#Loading required package: sp
 ## prepare the test rasters
r1 <- raster(nrows=1000, ncols=1000, xmn=0, xmx=1000)
set.seed(123)
values(r1) <- round(rnorm(1000000,100,20))
r2 <- raster(nrows=1000, ncols=1000, xmn=.2, xmx=1000.2)
 ## testing resample without multicore
resamp.single <- resample(r1, r2)
 ## testing resample with multicore
beginCluster(11)
#Loading required namespace: snow
resamp.multi <- resample(r1, r2)
#Using cluster with 11 nodes
#Error in UseMethod("recvOneData") :
# no applicable method for 'recvOneData' applied to an object of class "c('SOCKcluster', 'cluster')"
endCluster()
#Error in UseMethod("stopCluster") :
# no applicable method for 'stopCluster' applied to an object of class "c('SOCKcluster', 'cluster')"
 sessionInfo()
#R version 3.1.2 (2014-10-31)
#Platform: x86_64-w64-mingw32/x64 (64-bit)

#locale:
#[1] LC_COLLATE=French_Canada.1252  LC_CTYPE=French_Canada.1252
#[3] LC_MONETARY=French_Canada.1252 LC_NUMERIC=C
#[5] LC_TIME=French_Canada.1252

#attached base packages:
#[1] stats     graphics  grDevices utils     datasets  methods   base

#other attached packages:
#[1] raster_2.3-24 sp_1.0-17

#loaded via a namespace (and not attached):
#[1] grid_3.1.2      lattice_0.20-30 snow_0.3-13


Any idea what the problem is?

Thanks

Bastien Ferland-Raymond, M.Sc. Stat., M.Sc. Biol.
Division des orientations et projets spéciaux
Direction des inventaires forestiers
Ministère des Forêts, de la Faune et des Parcs


	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list