I´m trying to parallelize a simple "extract" operation like this:
UseCores<-detectCores() -1
cl<- makeCluster(UseCores)
registerDoParallel(cl)
all.test.poly_period.test<-extract(stack.ts, test.poly)
stopCluster(cl)
stack.ts= stack of some hundred of images
test.poly= a shapefile with some polygons
But when I go to the task manager I can see that only one core is working.
I was wondering if anyone could give me a short advice about it?
The show() of the stack:
class : RasterStack
dimensions : 1596, 436, 695856, 186 (nrow, ncol, ncell, nlayers)
resolution : 30, 30 (x, y)
extent : 284085, 297165, -2458245, -2410365 (xmin, xmax, ymin, ymax)
coord. ref. : +proj=utm +zone=23 +datum=WGS84 +units=m +no_defs +ellps=WGS84 +towgs84=0,0,0
names : stack_MGM.1, stack_MGM.2, stack_MGM.3, stack_MGM.4, stack_MGM.5, stack_MGM.6, stack_MGM.7, stack_MGM.8, stack_MGM.9, stack_MGM.10, stack_MGM.11, stack_MGM.12, stack_MGM.13, stack_MGM.14, stack_MGM.15, ...
min values : -0.26170975, -0.26808712, -0.27280286, -0.27959326, -0.28714523, -0.25714213, -0.22633411, -0.21442896, -0.20916982, -0.20526922, -0.17409700, -0.16982903, -0.17428745, -0.18175986, -0.18332276, ...
max values : 0.9389138, 1.0646172, 0.8939760, 0.8914277, 0.8828803, 0.8622602, 0.8733163, 0.8952460, 0.9045494, 0.9184299, 1.0648371, 0.8974358, 0.8855312, 0.8626966, 0.8333160, ...