Etienne,
Thanks, I am not sure what I was thinking. "focal" is an example of
functions that do not work well with clusterR.
Robert


On Tue, Nov 6, 2012 at 2:06 PM, Etienne B. Racine <etiennebr@gmail.com>wrote:

> When running Robert's example I get NA stripes depending on the number of
> cores I set.
> plot(stack(rf, rf2))
> all.equal(rf[], rf2[])
>
> I was wondering if it was only on my side. Looking at the source I don't
> see how clusterR is accounting for the buffer around the tiles. So it would
> be normal to have these stripes.
>
>
> 2012/3/27 Robert J. Hijmans <r.hijmans@gmail.com>
>
>> Jonathan,
>>
>> There are only a few functions, see ?beginCluster. However, there is now
>> also a generic approach via clusterR
>>
>> library(raster)
>> r <- raster()
>> r[] <- runif(ncell(r))
>>
>> # focal function
>> rf <- focal(r, w=matrix(1/9,nrow=3,ncol=3))
>>
>> # equivalent to:
>> beginCluster()
>> rf2 <- clusterR(r, focal, args=list(w=matrix(1/9,nrow=3,ncol=3))
>>
>> But I do not think this will help much in speeding things up. Benefits
>> from
>> parallelization with Raster objects can probably be large when doing
>> complex computations for each cell (e.g. a complex model with 'predict' or
>> 'fun' argument in another function), but with focal, data handling (disk
>> i/o) is probably more limiting in most cases and performance might even
>> get
>> worse if you parallelize.
>>
>> Robert
>>
>> On Tue, Mar 27, 2012 at 7:55 AM, Jonathan Greenberg <jgrn@illinois.edu
>> >wrote:
>>
>> > Robert and R-sig-geo'ers:
>> >
>> > I was wondering if there is documentation stating which raster
>> > functions have been parallelized thus far?  Specifically, has focal()
>> > been adapted to work with snow/snowfall?  Cheers!
>> >
>> > --j
>> >
>> > --
>> > Jonathan A. Greenberg, PhD
>> > Assistant Professor
>> > Department of Geography
>> > University of Illinois at Urbana-Champaign
>> > 607 South Mathews Avenue, MC 150
>> > Urbana, IL 61801
>> > Phone: 415-763-5476
>> > AIM: jgrn307, MSN: jgrn307@hotmail.com, Gchat: jgrn307, Skype: jgrn3007
>> > http://www.geog.illinois.edu/people/JonathanGreenberg.html
>> >
>> > _______________________________________________
>> > R-sig-Geo mailing list
>> > R-sig-Geo@r-project.org
>> > https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>> >
>>
>>         [[alternative HTML version deleted]]
>>
>> _______________________________________________
>> R-sig-Geo mailing list
>> R-sig-Geo@r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>
>
>

	[[alternative HTML version deleted]]

