diff --git a/DESCRIPTION b/DESCRIPTION index a5ae9e7745c9652f00f1eaaed4462ae1b0539de2..54472395ee56ce0a114f0fba0bdf1201f5d26a5a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -14,7 +14,7 @@ Imports: abind, bigmemory, future, - multiApply (>= 2.1.1), + multiApply (>= 2.1.0), parallel Suggests: easyNCDF, diff --git a/R/Compute.R b/R/Compute.R index d3bfcd7428f0c47a7792c2d11fd97a67da2175c9..29d6be023f661af92e6da63fabb709818f05b9be 100644 --- a/R/Compute.R +++ b/R/Compute.R @@ -51,7 +51,9 @@ Compute <- function(workflow, chunks = 'auto', operation <- eval(parse(text = op_text)) operation <- Step(operation, attr(workflow$fun, 'TargetDims'), - attr(workflow$fun, 'OutputDims')) + attr(workflow$fun, 'OutputDims'), + attr(workflow$fun, 'UseLibraries'), + attr(workflow$fun, 'UseAttributes')) if (!all(sapply(workflow$inputs, class) == 'startR_header')) { stop("Workflows with only one step supported by now.") diff --git a/inst/chunking/load_process_save_chunk.R b/inst/chunking/load_process_save_chunk.R index f2834da320881275acefe95c0c3e3af658b8f6be..7c1bc8a37947517538f60d6148e8e78c7072cf64 100644 --- a/inst/chunking/load_process_save_chunk.R +++ b/inst/chunking/load_process_save_chunk.R @@ -78,9 +78,11 @@ t_load <- as.numeric(difftime(t_end_load, t_begin_load, units = 'secs')) t_begin_compute <- Sys.time() if (!is.null(attr(fun, 'UseLibraries'))) { for (i in seq_along(attr(fun, 'UseLibraries'))) { - require(attr(fun, 'UseLibraries')[i]) + require(attr(fun, 'UseLibraries')[i], character.only = TRUE) } } +chunk_indices <- setNames(as.integer(chunk_indices), names(chunk_indices)) +chunk_indices <- chunk_indices[names(chunks)[which(chunks > 1)]] Apply <- multiApply::Apply res <- do.call("Apply", c( @@ -89,7 +91,7 @@ res <- do.call("Apply", fun = fun, output_dims = attr(fun, 'OutputDims'), use_attributes = attr(fun, 'UseAttributes'), - extra_info = list(chunk_indices = as.integer(chunk_indices)), + extra_info = list(chunk_indices = chunk_indices), ncores = threads_compute), params )