[R-sig-Geo] slow computation progress for calc function

Sara Shaeri @@r@@h@er| @end|ng |rom y@hoo@com
Tue Jun 25 03:32:30 CEST 2019


Dear community,
I’m trying to use the Calc function in a raster stack (8000 binary format rasters). Each raster covers 2,421,090 cells, as such, I’m using parallel coding to make the most of the available cores for this computation, however, this process is extremely slow on a 36 core and 76 Gb RAM. How could I speed up the calculations? This is the code I’m using: 

beginCluster(30)

interflood <- clusterR(all_predictions, calc, args=list(function(x){y <- rle(as.numeric(x));return(max( y$lengths[y$values == 0]))}))

endCluster()


RegardsSara


-------------------------
Sara Shaeri KarimiPhD Candidate, Department of Environmental SciencesFaculty of Science and EngineeringMacquarie University, NSW 2109 Australia 
Researchgate
Linkedin 






	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list