Closed mmfink closed 4 years ago
@mmfink thanks for your comment!
Never had this error before. Are both future
and future.apply
packages updated?
Did you try it without parallel processing?
@rvalavi Thinking versions might play into it, I upgraded R to 3.6.3 yesterday and updated all packages, but still had the error. I did try running it without parallel and it ran for ~6 hours before running out of memory, which tells me parallel would also run out of memory (only much faster), though the parallel process isn't even getting to that point. No resources are used before the error message happens. It doesn't seem like the workers are even getting initialized.
Anyway, given the memory issues (these really are ridiculously large rasters), I see I need to find a dataset that will run without parallelization first before further trouble-shooting can happen.
Please stand by. :-)
@mmfink I think the problem is memory. If your machine is out of memory for sequential tasks, there is no way you can do parallel on that as you need several times more memory.
One way to go around it is to sample your rasters e.g. new_r <- raster::sampleRegular(r, size = 5e5, asRaster = TRUE)
, then put the resampled rasters in the function. This can be handled easily, but the process of sampling your rasters might a pain itself as raster
package is very slow. A new replacement of raster
package is under development, the terra
package (it's on CRAN now). Not sure how stable it is right now. But if regular sampling is slow in raster
you might want to try it.
@rvalavi Yep, I can't dispute the memory issue, and my tests with smaller (though different) datasets have not recreated the error. So, closing the issue. Thanks for your time!
The call:
where layerStk is a raster::stack of 12 input rasters. These are very large, continuous value rasters.
Error message:
Error: Initialization of plan() failed, because the test future used for validation failed. The reason was: Unexpected result (of class ‘NULL’ != ‘FutureResult’) retrieved for MultisessionFuture future (label = ‘future-plan-test’, expression = ‘NA’): . This suggests that the communication with MultisessionFuture worker (‘SOCKnode’ #1) is out of sync.
Additional output:
Do you have any suggestions for how to trouble-shoot this? I have successfully used parallel processing on this machine before, using packages parallel, snow, and doSNOW, but I have not worked with future before. @rvalavi