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

Robert J. Hijmans r.hijmans at gmail.com
Fri Feb 27 19:09:52 CET 2015


Bastien,

This arises from a change in CRAN policy (the requirement to use
"requireNamespace" instead of "require") which somehow creates a
problem for snow::recvOneData. This is all a bit mysterious to me. The
development version uses require again for the snow package such that
things work as they should. Please use that version for now:

install.packages("raster", repos="http://R-Forge.R-project.org")

Robert



On Fri, Feb 27, 2015 at 6:26 AM,
<Bastien.Ferland-Raymond at mffp.gouv.qc.ca> wrote:
> 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]]
>
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>



More information about the R-sig-Geo mailing list