Issues using the experiment function

12 views
Skip to first unread message

Isolde LS

unread,
May 12, 2018, 4:12:54 PM5/12/18
to SpaDES Users

Hello,

 

I have a simulation that runs reasonably well (albeit with warning messages*), but when I try to carry out multiple runs of it using the experiment function I get the following error message:

 

Error in .local(.Object, ...)

25.

.local(.Object, ...)

 

24.

initialize(value, ...)

 

23.

initialize(value, ...)

 

22.

new("GDALReadOnlyDataset", filename, silent = silent, allowedDrivers = allowedDrivers, options = options)

 

21.

rgdal::GDAL.open(object@file@name, silent = TRUE)

 

20.

.readRasterLayerValues(x, row, nrows, col, ncols)

 

19.

.local(x, ...)

 

18.

getValuesBlock(x, row1, nrows = nr, col = col1, ncols = nc)

 

17.

getValuesBlock(x, row1, nrows = nr, col = col1, ncols = nc)

 

16.

.local(x, y, ...)

 

15.

crop(sim$vegMapInit, studyAreaTmp)

 

14.

crop(sim$vegMapInit, studyAreaTmp) at

scfmCrop.R#69

 

13.

Init(sim) at

scfmCrop.R#37

 

12.

get(moduleCall, envir = fnEnv)(sim, cur[["eventTime"]], cur[["eventType"]])

 

11.

eval(expr, envir, enclos)

 

10.

eval(quotedFnCall)

 

9.

.runEvent(sim, cacheIt, debug, quotedFnCall = quotedFnCall, moduleCall, fnEnv, cur, notOlderThan)

 

8.

doEvent(sim, debug = debug, notOlderThan = notOlderThan)

 

7.

spades(sim_, replicate = ind, ...)

 

6.

spades(sim_, replicate = ind, ...)

 

5.

FUN(X[[i]], ...)

 

4.

(function (X, FUN, ...) { FUN <- match.fun(FUN) if (!is.vector(X) || is.object(X)) ...

 

3.

do.call(get(parFun), args)

 

2.

experiment(sim = mySim, replicates = 2, dirPrefix = "exp1", saveExperiment = FALSE, clearSimEnv = FALSE)

 

1.

experiment(sim = mySim, replicates = 2, dirPrefix = "exp1", saveExperiment = FALSE, clearSimEnv = FALSE)

 

It appears that information within one of my raster objects ‘vegMapInit’ is not being accessed correctly during the crop function in one of my modules, when I use the experiment function.

sim$vegMap <-  crop(sim$vegMapInit, studyAreaTmp)

If I ask for table(sim$vegMapInit[]) I get the following error message:

Error: cannot allocate vector of size 1.6 Gb

 

My understanding is that the crop function is managing to access and select only the information that is required from vegMapInit when the simulation is run independently, but somehow it is unable to do this when it is run through the experiment function, tries to select everything, and becomes overwhelmed. Could this be the case? Why would this be?

 

Thank you!

Tati Micheletti

unread,
May 12, 2018, 4:53:46 PM5/12/18
to SpaDES Users
Hi Isolde,

From your error it looks like you don't have enough RAM to allocate the vector it is trying to create when you use the experiment function. Have you tried running it in a computer with more RAM? I have this problem with my laptop quite frequently when I am dealing with too many rasters or high resolution ones.

Do you have your repo in github? If I can access it I can tell you with more certainty that this is the problem.

Tati
Reply all
Reply to author
Forward
0 new messages