MODIS icon indicating copy to clipboard operation
MODIS copied to clipboard

Multiprocessing fails

Open mabdelrazek opened this issue 8 years ago • 17 comments

Smoothing failed with beginCluster()

mabdelrazek avatar Sep 21 '16 02:09 mabdelrazek

Hello, One nice improvement would be to renable parallel processing. Runing the example smoothing produce the following error:

Error in val[, a] : object of type 'closure' is not subsettable

Thanks, Mohammad

mabdelrazek avatar Sep 21 '16 03:09 mabdelrazek

Confirmed. Parallel processing has been disabled on the 'release' branch as of 0e03a53ccb826cb0e7ad83476c2124edf7aae705, but its re-implementation is definitely planned for the medium term.

fdetsch avatar Dec 12 '16 15:12 fdetsch

Thanks @fdetsch looking forward to having it back!

mabdelrazek avatar Dec 21 '16 11:12 mabdelrazek

@fdetsch any updates about the parallel processing?

mabdelrazek avatar May 21 '17 10:05 mabdelrazek

Yeah, @MatMatt wanted to have a look into this within the next few weeks.

fdetsch avatar May 22 '17 06:05 fdetsch

Thanks @fdetsch and @MatMatt , looking forward to that :-D

mabdelrazek avatar May 22 '17 09:05 mabdelrazek

hi, is this function already re-implemented?

kimofos avatar Sep 18 '17 10:09 kimofos

Hi, I came across this issue, is there an update regarding parallel processing? That would be very useful!

Muesgen avatar Nov 17 '20 10:11 Muesgen

Hi again,

in my opinion this function is very useful and would like to use it in parallel because my rasters are quite large. I have already tried it with fork and sock clustering, but it did not work so far.

Actually I try mclapply, but that does not work either. See here:

My Idea was to process the values on multiple cores and send the processed blocks everytime to the same core, that only one core opens one file.

Do you have an idea here? or an other idea in general? So that I could try it. @fdetsch @MatMatt

Muesgen avatar Dec 04 '20 18:12 Muesgen

Sorry for being so unresponsive. Parallel processing would definitely be nice to have, but I am currently lacking capacities. @MatMatt how about you?

fdetsch avatar Dec 07 '20 06:12 fdetsch

Ups, I see I have been mentioned several times here, sorry I did not realise that. What about substituting the raster package with the terra package, at least for some parts of MODIS? terra would make in many cases the parallel processing obsolete... https://cran.r-project.org/web/packages/terra/index.html

MatMatt avatar Dec 07 '20 06:12 MatMatt

I have hardly worked with terra so far, do you have any experience yet? If we decided to go down that road, it would in my opinion make sense to replace all related code (whittaker.raster() etc.) to avoid explicit imports of raster and sp altogether. However, I believe this would be a longer-term project..

fdetsch avatar Dec 07 '20 07:12 fdetsch

Yes I have played with terra recently and it is very similar to raster (obviously), so if, than the shift should not be too difficult. I have just looked into whittaker.raster(), and is is soaked full of raster::* conjunctions...I first need to understand again what is going on in there... I come back to you later today.

MatMatt avatar Dec 07 '20 07:12 MatMatt

Ah one more thing, should I look into the 'develop', correct?

MatMatt avatar Dec 07 '20 07:12 MatMatt

Since this will likely involve massive changes, I'd rather create a new branch 'terra' from 'develop' to keep things as clean as possible.

fdetsch avatar Dec 07 '20 07:12 fdetsch

ok, On the mid/long term the shift will be inevitable. But I want to avoid to trigger a too big thing an leaving you alone with the dealing of it. Yes that would be good, if you do create the terra-branch, I can play without endangering anything, and if it becomes to big, I will look at solving it within raster. Thx

MatMatt avatar Dec 07 '20 07:12 MatMatt

Done.

fdetsch avatar Dec 07 '20 07:12 fdetsch