R Under development (unstable) (2024-07-02 r86866 ucrt) -- "Unsuffered Consequences" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > source("incl/start.R") Loading required package: future [13:31:10.348] plan(): Setting new future strategy stack: [13:31:10.349] List of future strategies: [13:31:10.349] 1. mirai_multisession: [13:31:10.349] - args: function (expr, substitute = TRUE, envir = parent.frame(), ..., workers = availableCores()) [13:31:10.349] - tweaked: FALSE [13:31:10.349] - call: future::plan(future.mirai::mirai_multisession) [13:31:10.362] plan(): plan_init() of 'mirai_multisession', 'mirai_cluster', 'mirai', 'multiprocess', 'future', 'function' ... [13:31:10.362] < mirai [$data] > [13:31:10.367] getGlobalsAndPackages() ... [13:31:10.367] Not searching for globals [13:31:10.367] - globals: [0] [13:31:10.367] getGlobalsAndPackages() ... DONE [13:31:10.368] getGlobalsAndPackages() ... [13:31:10.368] [13:31:10.368] - globals: [0] [13:31:10.368] getGlobalsAndPackages() ... DONE [13:31:10.640] Packages needed by the future expression (n = 0): [13:31:10.641] Packages needed by future strategies (n = 0): [13:31:10.642] { [13:31:10.642] { [13:31:10.642] { [13:31:10.642] ...future.startTime <- base::Sys.time() [13:31:10.642] { [13:31:10.642] { [13:31:10.642] { [13:31:10.642] base::local({ [13:31:10.642] has_future <- base::requireNamespace("future", [13:31:10.642] quietly = TRUE) [13:31:10.642] if (has_future) { [13:31:10.642] ns <- base::getNamespace("future") [13:31:10.642] version <- ns[[".package"]][["version"]] [13:31:10.642] if (is.null(version)) [13:31:10.642] version <- utils::packageVersion("future") [13:31:10.642] } [13:31:10.642] else { [13:31:10.642] version <- NULL [13:31:10.642] } [13:31:10.642] if (!has_future || version < "1.8.0") { [13:31:10.642] info <- base::c(r_version = base::gsub("R version ", [13:31:10.642] "", base::R.version$version.string), [13:31:10.642] platform = base::sprintf("%s (%s-bit)", [13:31:10.642] base::R.version$platform, 8 * base::.Machine$sizeof.pointer), [13:31:10.642] os = base::paste(base::Sys.info()[base::c("sysname", [13:31:10.642] "release", "version")], collapse = " "), [13:31:10.642] hostname = base::Sys.info()[["nodename"]]) [13:31:10.642] info <- base::sprintf("%s: %s", base::names(info), [13:31:10.642] info) [13:31:10.642] info <- base::paste(info, collapse = "; ") [13:31:10.642] if (!has_future) { [13:31:10.642] msg <- base::sprintf("Package 'future' is not installed on worker (%s)", [13:31:10.642] info) [13:31:10.642] } [13:31:10.642] else { [13:31:10.642] msg <- base::sprintf("Package 'future' on worker (%s) must be of version >= 1.8.0: %s", [13:31:10.642] info, version) [13:31:10.642] } [13:31:10.642] base::stop(msg) [13:31:10.642] } [13:31:10.642] }) [13:31:10.642] } [13:31:10.642] ...future.strategy.old <- future::plan("list") [13:31:10.642] options(future.plan = NULL) [13:31:10.642] Sys.unsetenv("R_FUTURE_PLAN") [13:31:10.642] future::plan("default", .cleanup = FALSE, .init = FALSE) [13:31:10.642] } [13:31:10.642] ...future.workdir <- getwd() [13:31:10.642] } [13:31:10.642] ...future.oldOptions <- base::as.list(base::.Options) [13:31:10.642] ...future.oldEnvVars <- base::Sys.getenv() [13:31:10.642] } [13:31:10.642] base::options(future.startup.script = FALSE, future.globals.onMissing = NULL, [13:31:10.642] future.globals.maxSize = NULL, future.globals.method = NULL, [13:31:10.642] future.globals.onMissing = NULL, future.globals.onReference = NULL, [13:31:10.642] future.globals.resolve = NULL, future.resolve.recursive = NULL, [13:31:10.642] future.rng.onMisuse = NULL, future.rng.onMisuse.keepFuture = NULL, [13:31:10.642] future.stdout.windows.reencode = NULL, width = 80L) [13:31:10.642] ...future.futureOptionsAdded <- base::setdiff(base::names(base::.Options), [13:31:10.642] base::names(...future.oldOptions)) [13:31:10.642] } [13:31:10.642] if (FALSE) { [13:31:10.642] } [13:31:10.642] else { [13:31:10.642] if (TRUE) { [13:31:10.642] ...future.stdout <- base::rawConnection(base::raw(0L), [13:31:10.642] open = "w") [13:31:10.642] } [13:31:10.642] else { [13:31:10.642] ...future.stdout <- base::file(base::switch(.Platform$OS.type, [13:31:10.642] windows = "NUL", "/dev/null"), open = "w") [13:31:10.642] } [13:31:10.642] base::sink(...future.stdout, type = "output", split = FALSE) [13:31:10.642] base::on.exit(if (!base::is.null(...future.stdout)) { [13:31:10.642] base::sink(type = "output", split = FALSE) [13:31:10.642] base::close(...future.stdout) [13:31:10.642] }, add = TRUE) [13:31:10.642] } [13:31:10.642] ...future.frame <- base::sys.nframe() [13:31:10.642] ...future.conditions <- base::list() [13:31:10.642] ...future.rng <- base::globalenv()$.Random.seed [13:31:10.642] if (FALSE) { [13:31:10.642] ...future.globalenv.names <- c(base::names(base::.GlobalEnv), [13:31:10.642] "...future.value", "...future.globalenv.names", ".Random.seed") [13:31:10.642] } [13:31:10.642] ...future.result <- base::tryCatch({ [13:31:10.642] base::withCallingHandlers({ [13:31:10.642] ...future.value <- base::withVisible(base::local(NA)) [13:31:10.642] future::FutureResult(value = ...future.value$value, [13:31:10.642] visible = ...future.value$visible, rng = !identical(base::globalenv()$.Random.seed, [13:31:10.642] ...future.rng), globalenv = if (FALSE) [13:31:10.642] list(added = base::setdiff(base::names(base::.GlobalEnv), [13:31:10.642] ...future.globalenv.names)) [13:31:10.642] else NULL, started = ...future.startTime, version = "1.8") [13:31:10.642] }, condition = base::local({ [13:31:10.642] c <- base::c [13:31:10.642] inherits <- base::inherits [13:31:10.642] invokeRestart <- base::invokeRestart [13:31:10.642] length <- base::length [13:31:10.642] list <- base::list [13:31:10.642] seq.int <- base::seq.int [13:31:10.642] signalCondition <- base::signalCondition [13:31:10.642] sys.calls <- base::sys.calls [13:31:10.642] `[[` <- base::`[[` [13:31:10.642] `+` <- base::`+` [13:31:10.642] `<<-` <- base::`<<-` [13:31:10.642] sysCalls <- function(calls = sys.calls(), from = 1L) { [13:31:10.642] calls[seq.int(from = from + 12L, to = length(calls) - [13:31:10.642] 3L)] [13:31:10.642] } [13:31:10.642] function(cond) { [13:31:10.642] is_error <- inherits(cond, "error") [13:31:10.642] ignore <- !is_error && !is.null(NULL) && inherits(cond, [13:31:10.642] NULL) [13:31:10.642] if (is_error) { [13:31:10.642] sessionInformation <- function() { [13:31:10.642] list(r = base::R.Version(), locale = base::Sys.getlocale(), [13:31:10.642] rngkind = base::RNGkind(), namespaces = base::loadedNamespaces(), [13:31:10.642] search = base::search(), system = base::Sys.info()) [13:31:10.642] } [13:31:10.642] ...future.conditions[[length(...future.conditions) + [13:31:10.642] 1L]] <<- list(condition = cond, calls = c(sysCalls(from = ...future.frame), [13:31:10.642] cond$call), session = sessionInformation(), [13:31:10.642] timestamp = base::Sys.time(), signaled = 0L) [13:31:10.642] signalCondition(cond) [13:31:10.642] } [13:31:10.642] else if (!ignore && TRUE && inherits(cond, "condition")) { [13:31:10.642] signal <- FALSE && inherits(cond, character(0)) [13:31:10.642] ...future.conditions[[length(...future.conditions) + [13:31:10.642] 1L]] <<- list(condition = cond, signaled = base::as.integer(signal)) [13:31:10.642] if (FALSE && !signal) { [13:31:10.642] muffleCondition <- function (cond, pattern = "^muffle") [13:31:10.642] { [13:31:10.642] inherits <- base::inherits [13:31:10.642] invokeRestart <- base::invokeRestart [13:31:10.642] is.null <- base::is.null [13:31:10.642] muffled <- FALSE [13:31:10.642] if (inherits(cond, "message")) { [13:31:10.642] muffled <- grepl(pattern, "muffleMessage") [13:31:10.642] if (muffled) [13:31:10.642] invokeRestart("muffleMessage") [13:31:10.642] } [13:31:10.642] else if (inherits(cond, "warning")) { [13:31:10.642] muffled <- grepl(pattern, "muffleWarning") [13:31:10.642] if (muffled) [13:31:10.642] invokeRestart("muffleWarning") [13:31:10.642] } [13:31:10.642] else if (inherits(cond, "condition")) { [13:31:10.642] if (!is.null(pattern)) { [13:31:10.642] computeRestarts <- base::computeRestarts [13:31:10.642] grepl <- base::grepl [13:31:10.642] restarts <- computeRestarts(cond) [13:31:10.642] for (restart in restarts) { [13:31:10.642] name <- restart$name [13:31:10.642] if (is.null(name)) [13:31:10.642] next [13:31:10.642] if (!grepl(pattern, name)) [13:31:10.642] next [13:31:10.642] invokeRestart(restart) [13:31:10.642] muffled <- TRUE [13:31:10.642] break [13:31:10.642] } [13:31:10.642] } [13:31:10.642] } [13:31:10.642] invisible(muffled) [13:31:10.642] } [13:31:10.642] muffleCondition(cond, pattern = "^muffle") [13:31:10.642] } [13:31:10.642] } [13:31:10.642] else { [13:31:10.642] if (TRUE) { [13:31:10.642] muffleCondition <- function (cond, pattern = "^muffle") [13:31:10.642] { [13:31:10.642] inherits <- base::inherits [13:31:10.642] invokeRestart <- base::invokeRestart [13:31:10.642] is.null <- base::is.null [13:31:10.642] muffled <- FALSE [13:31:10.642] if (inherits(cond, "message")) { [13:31:10.642] muffled <- grepl(pattern, "muffleMessage") [13:31:10.642] if (muffled) [13:31:10.642] invokeRestart("muffleMessage") [13:31:10.642] } [13:31:10.642] else if (inherits(cond, "warning")) { [13:31:10.642] muffled <- grepl(pattern, "muffleWarning") [13:31:10.642] if (muffled) [13:31:10.642] invokeRestart("muffleWarning") [13:31:10.642] } [13:31:10.642] else if (inherits(cond, "condition")) { [13:31:10.642] if (!is.null(pattern)) { [13:31:10.642] computeRestarts <- base::computeRestarts [13:31:10.642] grepl <- base::grepl [13:31:10.642] restarts <- computeRestarts(cond) [13:31:10.642] for (restart in restarts) { [13:31:10.642] name <- restart$name [13:31:10.642] if (is.null(name)) [13:31:10.642] next [13:31:10.642] if (!grepl(pattern, name)) [13:31:10.642] next [13:31:10.642] invokeRestart(restart) [13:31:10.642] muffled <- TRUE [13:31:10.642] break [13:31:10.642] } [13:31:10.642] } [13:31:10.642] } [13:31:10.642] invisible(muffled) [13:31:10.642] } [13:31:10.642] muffleCondition(cond, pattern = "^muffle") [13:31:10.642] } [13:31:10.642] } [13:31:10.642] } [13:31:10.642] })) [13:31:10.642] }, error = function(ex) { [13:31:10.642] base::structure(base::list(value = NULL, visible = NULL, [13:31:10.642] conditions = ...future.conditions, rng = !identical(base::globalenv()$.Random.seed, [13:31:10.642] ...future.rng), started = ...future.startTime, [13:31:10.642] finished = Sys.time(), session_uuid = NA_character_, [13:31:10.642] version = "1.8"), class = "FutureResult") [13:31:10.642] }, finally = { [13:31:10.642] if (!identical(...future.workdir, getwd())) [13:31:10.642] setwd(...future.workdir) [13:31:10.642] { [13:31:10.642] if (identical(getOption("nwarnings"), ...future.oldOptions$nwarnings)) { [13:31:10.642] ...future.oldOptions$nwarnings <- NULL [13:31:10.642] } [13:31:10.642] base::options(...future.oldOptions) [13:31:10.642] if (.Platform$OS.type == "windows") { [13:31:10.642] old_names <- names(...future.oldEnvVars) [13:31:10.642] envs <- base::Sys.getenv() [13:31:10.642] names <- names(envs) [13:31:10.642] common <- intersect(names, old_names) [13:31:10.642] added <- setdiff(names, old_names) [13:31:10.642] removed <- setdiff(old_names, names) [13:31:10.642] changed <- common[...future.oldEnvVars[common] != [13:31:10.642] envs[common]] [13:31:10.642] NAMES <- toupper(changed) [13:31:10.642] args <- list() [13:31:10.642] for (kk in seq_along(NAMES)) { [13:31:10.642] name <- changed[[kk]] [13:31:10.642] NAME <- NAMES[[kk]] [13:31:10.642] if (name != NAME && is.element(NAME, old_names)) [13:31:10.642] next [13:31:10.642] args[[name]] <- ...future.oldEnvVars[[name]] [13:31:10.642] } [13:31:10.642] NAMES <- toupper(added) [13:31:10.642] for (kk in seq_along(NAMES)) { [13:31:10.642] name <- added[[kk]] [13:31:10.642] NAME <- NAMES[[kk]] [13:31:10.642] if (name != NAME && is.element(NAME, old_names)) [13:31:10.642] next [13:31:10.642] args[[name]] <- "" [13:31:10.642] } [13:31:10.642] NAMES <- toupper(removed) [13:31:10.642] for (kk in seq_along(NAMES)) { [13:31:10.642] name <- removed[[kk]] [13:31:10.642] NAME <- NAMES[[kk]] [13:31:10.642] if (name != NAME && is.element(NAME, old_names)) [13:31:10.642] next [13:31:10.642] args[[name]] <- ...future.oldEnvVars[[name]] [13:31:10.642] } [13:31:10.642] if (length(args) > 0) [13:31:10.642] base::do.call(base::Sys.setenv, args = args) [13:31:10.642] args <- names <- old_names <- NAMES <- envs <- common <- added <- removed <- NULL [13:31:10.642] } [13:31:10.642] else { [13:31:10.642] base::do.call(base::Sys.setenv, args = base::as.list(...future.oldEnvVars)) [13:31:10.642] } [13:31:10.642] { [13:31:10.642] if (base::length(...future.futureOptionsAdded) > [13:31:10.642] 0L) { [13:31:10.642] opts <- base::vector("list", length = base::length(...future.futureOptionsAdded)) [13:31:10.642] base::names(opts) <- ...future.futureOptionsAdded [13:31:10.642] base::options(opts) [13:31:10.642] } [13:31:10.642] { [13:31:10.642] NULL [13:31:10.642] options(future.plan = NULL) [13:31:10.642] if (is.na(NA_character_)) [13:31:10.642] Sys.unsetenv("R_FUTURE_PLAN") [13:31:10.642] else Sys.setenv(R_FUTURE_PLAN = NA_character_) [13:31:10.642] future::plan(...future.strategy.old, .cleanup = FALSE, [13:31:10.642] .init = FALSE) [13:31:10.642] } [13:31:10.642] } [13:31:10.642] } [13:31:10.642] }) [13:31:10.642] if (TRUE) { [13:31:10.642] base::sink(type = "output", split = FALSE) [13:31:10.642] if (TRUE) { [13:31:10.642] ...future.result$stdout <- base::rawToChar(base::rawConnectionValue(...future.stdout)) [13:31:10.642] } [13:31:10.642] else { [13:31:10.642] ...future.result["stdout"] <- base::list(NULL) [13:31:10.642] } [13:31:10.642] base::close(...future.stdout) [13:31:10.642] ...future.stdout <- NULL [13:31:10.642] } [13:31:10.642] ...future.result$conditions <- ...future.conditions [13:31:10.642] ...future.result$finished <- base::Sys.time() [13:31:10.642] ...future.result [13:31:10.642] } [13:31:10.764] plan(): plan_init() of 'mirai_multisession', 'mirai_cluster', 'mirai', 'multiprocess', 'future', 'function' ... DONE [13:31:10.765] plan(): nbrOfWorkers() = 2 > > plan(mirai_multisession) [13:31:10.765] plan(): Setting new future strategy stack: [13:31:10.766] List of future strategies: [13:31:10.766] 1. mirai_multisession: [13:31:10.766] - args: function (expr, substitute = TRUE, envir = parent.frame(), ..., workers = availableCores()) [13:31:10.766] - tweaked: FALSE [13:31:10.766] - call: plan(mirai_multisession) [13:31:10.780] plan(): plan_init() of 'mirai_multisession', 'mirai_cluster', 'mirai', 'multiprocess', 'future', 'function' ... [13:31:10.780] < mirai [$data] > [13:31:10.782] getGlobalsAndPackages() ... [13:31:10.783] Not searching for globals [13:31:10.783] - globals: [0] [13:31:10.783] getGlobalsAndPackages() ... DONE [13:31:10.783] getGlobalsAndPackages() ... [13:31:10.783] [13:31:10.783] - globals: [0] [13:31:10.784] getGlobalsAndPackages() ... DONE [13:31:10.784] Packages needed by the future expression (n = 0): [13:31:10.784] Packages needed by future strategies (n = 0): [13:31:10.785] { [13:31:10.785] { [13:31:10.785] { [13:31:10.785] ...future.startTime <- base::Sys.time() [13:31:10.785] { [13:31:10.785] { [13:31:10.785] { [13:31:10.785] base::local({ [13:31:10.785] has_future <- base::requireNamespace("future", [13:31:10.785] quietly = TRUE) [13:31:10.785] if (has_future) { [13:31:10.785] ns <- base::getNamespace("future") [13:31:10.785] version <- ns[[".package"]][["version"]] [13:31:10.785] if (is.null(version)) [13:31:10.785] version <- utils::packageVersion("future") [13:31:10.785] } [13:31:10.785] else { [13:31:10.785] version <- NULL [13:31:10.785] } [13:31:10.785] if (!has_future || version < "1.8.0") { [13:31:10.785] info <- base::c(r_version = base::gsub("R version ", [13:31:10.785] "", base::R.version$version.string), [13:31:10.785] platform = base::sprintf("%s (%s-bit)", [13:31:10.785] base::R.version$platform, 8 * base::.Machine$sizeof.pointer), [13:31:10.785] os = base::paste(base::Sys.info()[base::c("sysname", [13:31:10.785] "release", "version")], collapse = " "), [13:31:10.785] hostname = base::Sys.info()[["nodename"]]) [13:31:10.785] info <- base::sprintf("%s: %s", base::names(info), [13:31:10.785] info) [13:31:10.785] info <- base::paste(info, collapse = "; ") [13:31:10.785] if (!has_future) { [13:31:10.785] msg <- base::sprintf("Package 'future' is not installed on worker (%s)", [13:31:10.785] info) [13:31:10.785] } [13:31:10.785] else { [13:31:10.785] msg <- base::sprintf("Package 'future' on worker (%s) must be of version >= 1.8.0: %s", [13:31:10.785] info, version) [13:31:10.785] } [13:31:10.785] base::stop(msg) [13:31:10.785] } [13:31:10.785] }) [13:31:10.785] } [13:31:10.785] ...future.strategy.old <- future::plan("list") [13:31:10.785] options(future.plan = NULL) [13:31:10.785] Sys.unsetenv("R_FUTURE_PLAN") [13:31:10.785] future::plan("default", .cleanup = FALSE, .init = FALSE) [13:31:10.785] } [13:31:10.785] ...future.workdir <- getwd() [13:31:10.785] } [13:31:10.785] ...future.oldOptions <- base::as.list(base::.Options) [13:31:10.785] ...future.oldEnvVars <- base::Sys.getenv() [13:31:10.785] } [13:31:10.785] base::options(future.startup.script = FALSE, future.globals.onMissing = NULL, [13:31:10.785] future.globals.maxSize = NULL, future.globals.method = NULL, [13:31:10.785] future.globals.onMissing = NULL, future.globals.onReference = NULL, [13:31:10.785] future.globals.resolve = NULL, future.resolve.recursive = NULL, [13:31:10.785] future.rng.onMisuse = NULL, future.rng.onMisuse.keepFuture = NULL, [13:31:10.785] future.stdout.windows.reencode = NULL, width = 80L) [13:31:10.785] ...future.futureOptionsAdded <- base::setdiff(base::names(base::.Options), [13:31:10.785] base::names(...future.oldOptions)) [13:31:10.785] } [13:31:10.785] if (FALSE) { [13:31:10.785] } [13:31:10.785] else { [13:31:10.785] if (TRUE) { [13:31:10.785] ...future.stdout <- base::rawConnection(base::raw(0L), [13:31:10.785] open = "w") [13:31:10.785] } [13:31:10.785] else { [13:31:10.785] ...future.stdout <- base::file(base::switch(.Platform$OS.type, [13:31:10.785] windows = "NUL", "/dev/null"), open = "w") [13:31:10.785] } [13:31:10.785] base::sink(...future.stdout, type = "output", split = FALSE) [13:31:10.785] base::on.exit(if (!base::is.null(...future.stdout)) { [13:31:10.785] base::sink(type = "output", split = FALSE) [13:31:10.785] base::close(...future.stdout) [13:31:10.785] }, add = TRUE) [13:31:10.785] } [13:31:10.785] ...future.frame <- base::sys.nframe() [13:31:10.785] ...future.conditions <- base::list() [13:31:10.785] ...future.rng <- base::globalenv()$.Random.seed [13:31:10.785] if (FALSE) { [13:31:10.785] ...future.globalenv.names <- c(base::names(base::.GlobalEnv), [13:31:10.785] "...future.value", "...future.globalenv.names", ".Random.seed") [13:31:10.785] } [13:31:10.785] ...future.result <- base::tryCatch({ [13:31:10.785] base::withCallingHandlers({ [13:31:10.785] ...future.value <- base::withVisible(base::local(NA)) [13:31:10.785] future::FutureResult(value = ...future.value$value, [13:31:10.785] visible = ...future.value$visible, rng = !identical(base::globalenv()$.Random.seed, [13:31:10.785] ...future.rng), globalenv = if (FALSE) [13:31:10.785] list(added = base::setdiff(base::names(base::.GlobalEnv), [13:31:10.785] ...future.globalenv.names)) [13:31:10.785] else NULL, started = ...future.startTime, version = "1.8") [13:31:10.785] }, condition = base::local({ [13:31:10.785] c <- base::c [13:31:10.785] inherits <- base::inherits [13:31:10.785] invokeRestart <- base::invokeRestart [13:31:10.785] length <- base::length [13:31:10.785] list <- base::list [13:31:10.785] seq.int <- base::seq.int [13:31:10.785] signalCondition <- base::signalCondition [13:31:10.785] sys.calls <- base::sys.calls [13:31:10.785] `[[` <- base::`[[` [13:31:10.785] `+` <- base::`+` [13:31:10.785] `<<-` <- base::`<<-` [13:31:10.785] sysCalls <- function(calls = sys.calls(), from = 1L) { [13:31:10.785] calls[seq.int(from = from + 12L, to = length(calls) - [13:31:10.785] 3L)] [13:31:10.785] } [13:31:10.785] function(cond) { [13:31:10.785] is_error <- inherits(cond, "error") [13:31:10.785] ignore <- !is_error && !is.null(NULL) && inherits(cond, [13:31:10.785] NULL) [13:31:10.785] if (is_error) { [13:31:10.785] sessionInformation <- function() { [13:31:10.785] list(r = base::R.Version(), locale = base::Sys.getlocale(), [13:31:10.785] rngkind = base::RNGkind(), namespaces = base::loadedNamespaces(), [13:31:10.785] search = base::search(), system = base::Sys.info()) [13:31:10.785] } [13:31:10.785] ...future.conditions[[length(...future.conditions) + [13:31:10.785] 1L]] <<- list(condition = cond, calls = c(sysCalls(from = ...future.frame), [13:31:10.785] cond$call), session = sessionInformation(), [13:31:10.785] timestamp = base::Sys.time(), signaled = 0L) [13:31:10.785] signalCondition(cond) [13:31:10.785] } [13:31:10.785] else if (!ignore && TRUE && inherits(cond, "condition")) { [13:31:10.785] signal <- FALSE && inherits(cond, character(0)) [13:31:10.785] ...future.conditions[[length(...future.conditions) + [13:31:10.785] 1L]] <<- list(condition = cond, signaled = base::as.integer(signal)) [13:31:10.785] if (FALSE && !signal) { [13:31:10.785] muffleCondition <- function (cond, pattern = "^muffle") [13:31:10.785] { [13:31:10.785] inherits <- base::inherits [13:31:10.785] invokeRestart <- base::invokeRestart [13:31:10.785] is.null <- base::is.null [13:31:10.785] muffled <- FALSE [13:31:10.785] if (inherits(cond, "message")) { [13:31:10.785] muffled <- grepl(pattern, "muffleMessage") [13:31:10.785] if (muffled) [13:31:10.785] invokeRestart("muffleMessage") [13:31:10.785] } [13:31:10.785] else if (inherits(cond, "warning")) { [13:31:10.785] muffled <- grepl(pattern, "muffleWarning") [13:31:10.785] if (muffled) [13:31:10.785] invokeRestart("muffleWarning") [13:31:10.785] } [13:31:10.785] else if (inherits(cond, "condition")) { [13:31:10.785] if (!is.null(pattern)) { [13:31:10.785] computeRestarts <- base::computeRestarts [13:31:10.785] grepl <- base::grepl [13:31:10.785] restarts <- computeRestarts(cond) [13:31:10.785] for (restart in restarts) { [13:31:10.785] name <- restart$name [13:31:10.785] if (is.null(name)) [13:31:10.785] next [13:31:10.785] if (!grepl(pattern, name)) [13:31:10.785] next [13:31:10.785] invokeRestart(restart) [13:31:10.785] muffled <- TRUE [13:31:10.785] break [13:31:10.785] } [13:31:10.785] } [13:31:10.785] } [13:31:10.785] invisible(muffled) [13:31:10.785] } [13:31:10.785] muffleCondition(cond, pattern = "^muffle") [13:31:10.785] } [13:31:10.785] } [13:31:10.785] else { [13:31:10.785] if (TRUE) { [13:31:10.785] muffleCondition <- function (cond, pattern = "^muffle") [13:31:10.785] { [13:31:10.785] inherits <- base::inherits [13:31:10.785] invokeRestart <- base::invokeRestart [13:31:10.785] is.null <- base::is.null [13:31:10.785] muffled <- FALSE [13:31:10.785] if (inherits(cond, "message")) { [13:31:10.785] muffled <- grepl(pattern, "muffleMessage") [13:31:10.785] if (muffled) [13:31:10.785] invokeRestart("muffleMessage") [13:31:10.785] } [13:31:10.785] else if (inherits(cond, "warning")) { [13:31:10.785] muffled <- grepl(pattern, "muffleWarning") [13:31:10.785] if (muffled) [13:31:10.785] invokeRestart("muffleWarning") [13:31:10.785] } [13:31:10.785] else if (inherits(cond, "condition")) { [13:31:10.785] if (!is.null(pattern)) { [13:31:10.785] computeRestarts <- base::computeRestarts [13:31:10.785] grepl <- base::grepl [13:31:10.785] restarts <- computeRestarts(cond) [13:31:10.785] for (restart in restarts) { [13:31:10.785] name <- restart$name [13:31:10.785] if (is.null(name)) [13:31:10.785] next [13:31:10.785] if (!grepl(pattern, name)) [13:31:10.785] next [13:31:10.785] invokeRestart(restart) [13:31:10.785] muffled <- TRUE [13:31:10.785] break [13:31:10.785] } [13:31:10.785] } [13:31:10.785] } [13:31:10.785] invisible(muffled) [13:31:10.785] } [13:31:10.785] muffleCondition(cond, pattern = "^muffle") [13:31:10.785] } [13:31:10.785] } [13:31:10.785] } [13:31:10.785] })) [13:31:10.785] }, error = function(ex) { [13:31:10.785] base::structure(base::list(value = NULL, visible = NULL, [13:31:10.785] conditions = ...future.conditions, rng = !identical(base::globalenv()$.Random.seed, [13:31:10.785] ...future.rng), started = ...future.startTime, [13:31:10.785] finished = Sys.time(), session_uuid = NA_character_, [13:31:10.785] version = "1.8"), class = "FutureResult") [13:31:10.785] }, finally = { [13:31:10.785] if (!identical(...future.workdir, getwd())) [13:31:10.785] setwd(...future.workdir) [13:31:10.785] { [13:31:10.785] if (identical(getOption("nwarnings"), ...future.oldOptions$nwarnings)) { [13:31:10.785] ...future.oldOptions$nwarnings <- NULL [13:31:10.785] } [13:31:10.785] base::options(...future.oldOptions) [13:31:10.785] if (.Platform$OS.type == "windows") { [13:31:10.785] old_names <- names(...future.oldEnvVars) [13:31:10.785] envs <- base::Sys.getenv() [13:31:10.785] names <- names(envs) [13:31:10.785] common <- intersect(names, old_names) [13:31:10.785] added <- setdiff(names, old_names) [13:31:10.785] removed <- setdiff(old_names, names) [13:31:10.785] changed <- common[...future.oldEnvVars[common] != [13:31:10.785] envs[common]] [13:31:10.785] NAMES <- toupper(changed) [13:31:10.785] args <- list() [13:31:10.785] for (kk in seq_along(NAMES)) { [13:31:10.785] name <- changed[[kk]] [13:31:10.785] NAME <- NAMES[[kk]] [13:31:10.785] if (name != NAME && is.element(NAME, old_names)) [13:31:10.785] next [13:31:10.785] args[[name]] <- ...future.oldEnvVars[[name]] [13:31:10.785] } [13:31:10.785] NAMES <- toupper(added) [13:31:10.785] for (kk in seq_along(NAMES)) { [13:31:10.785] name <- added[[kk]] [13:31:10.785] NAME <- NAMES[[kk]] [13:31:10.785] if (name != NAME && is.element(NAME, old_names)) [13:31:10.785] next [13:31:10.785] args[[name]] <- "" [13:31:10.785] } [13:31:10.785] NAMES <- toupper(removed) [13:31:10.785] for (kk in seq_along(NAMES)) { [13:31:10.785] name <- removed[[kk]] [13:31:10.785] NAME <- NAMES[[kk]] [13:31:10.785] if (name != NAME && is.element(NAME, old_names)) [13:31:10.785] next [13:31:10.785] args[[name]] <- ...future.oldEnvVars[[name]] [13:31:10.785] } [13:31:10.785] if (length(args) > 0) [13:31:10.785] base::do.call(base::Sys.setenv, args = args) [13:31:10.785] args <- names <- old_names <- NAMES <- envs <- common <- added <- removed <- NULL [13:31:10.785] } [13:31:10.785] else { [13:31:10.785] base::do.call(base::Sys.setenv, args = base::as.list(...future.oldEnvVars)) [13:31:10.785] } [13:31:10.785] { [13:31:10.785] if (base::length(...future.futureOptionsAdded) > [13:31:10.785] 0L) { [13:31:10.785] opts <- base::vector("list", length = base::length(...future.futureOptionsAdded)) [13:31:10.785] base::names(opts) <- ...future.futureOptionsAdded [13:31:10.785] base::options(opts) [13:31:10.785] } [13:31:10.785] { [13:31:10.785] NULL [13:31:10.785] options(future.plan = NULL) [13:31:10.785] if (is.na(NA_character_)) [13:31:10.785] Sys.unsetenv("R_FUTURE_PLAN") [13:31:10.785] else Sys.setenv(R_FUTURE_PLAN = NA_character_) [13:31:10.785] future::plan(...future.strategy.old, .cleanup = FALSE, [13:31:10.785] .init = FALSE) [13:31:10.785] } [13:31:10.785] } [13:31:10.785] } [13:31:10.785] }) [13:31:10.785] if (TRUE) { [13:31:10.785] base::sink(type = "output", split = FALSE) [13:31:10.785] if (TRUE) { [13:31:10.785] ...future.result$stdout <- base::rawToChar(base::rawConnectionValue(...future.stdout)) [13:31:10.785] } [13:31:10.785] else { [13:31:10.785] ...future.result["stdout"] <- base::list(NULL) [13:31:10.785] } [13:31:10.785] base::close(...future.stdout) [13:31:10.785] ...future.stdout <- NULL [13:31:10.785] } [13:31:10.785] ...future.result$conditions <- ...future.conditions [13:31:10.785] ...future.result$finished <- base::Sys.time() [13:31:10.785] ...future.result [13:31:10.785] } [13:31:10.908] plan(): plan_init() of 'mirai_multisession', 'mirai_cluster', 'mirai', 'multiprocess', 'future', 'function' ... DONE [13:31:10.908] plan(): nbrOfWorkers() = 2 > > message("*** Globals - manually ...") *** Globals - manually ... > > message("*** Globals manually specified as named list ...") *** Globals manually specified as named list ... > > globals <- list( + a = 1, + b = 2, + sumtwo = function(x) x[1] + x[2] + ) > > ## Assign 'globals' globally > attach_locally(globals) > > ## Truth > v0 <- local({ + x <- 1:10 + sumtwo(a + b * x) + }) > > > message("*** Globals - automatic ...") *** Globals - automatic ... > > attach_locally(globals) > f <- future({ + x <- 1:10 + sumtwo(a + b * x) + }, globals = TRUE) [13:31:10.912] getGlobalsAndPackages() ... [13:31:10.912] Searching for globals... [13:31:10.923] - globals found: [9] '{', '<-', ':', 'sumtwo', '+', 'a', '*', 'b', '[' [13:31:10.924] Searching for globals ... DONE [13:31:10.924] Resolving globals: FALSE [13:31:10.925] The total size of the 3 globals is 1.20 KiB (1232 bytes) [13:31:10.926] The total size of the 3 globals exported for future expression ('{; x <- 1:10; sumtwo(a + b * x); }') is 1.20 KiB.. This exceeds the maximum allowed size of 500.00 MiB (option 'future.globals.maxSize'). There are three globals: 'sumtwo' (1.09 KiB of class 'function'), 'a' (56 bytes of class 'numeric') and 'b' (56 bytes of class 'numeric') [13:31:10.926] - globals: [3] 'sumtwo', 'a', 'b' [13:31:10.926] [13:31:10.926] getGlobalsAndPackages() ... DONE [13:31:10.927] run() for 'Future' ... [13:31:10.927] - state: 'created' [13:31:10.927] - Future backend: 'FutureStrategy', 'mirai_multisession', 'mirai_cluster', 'mirai', 'multiprocess', 'future', 'function' [13:31:10.930] - Future class: 'MiraiFuture', 'MultiprocessFuture', 'Future', 'environment' [13:31:10.930] - Copy elements of temporary 'MiraiFuture' to final 'Future' object ... [13:31:10.930] - Field: 'label' [13:31:10.930] - Field: 'local' [13:31:10.930] - Field: 'owner' [13:31:10.930] - Field: 'envir' [13:31:10.931] - Field: 'packages' [13:31:10.931] - Field: 'gc' [13:31:10.931] - Field: 'conditions' [13:31:10.931] - Field: 'expr' [13:31:10.931] - Field: 'uuid' [13:31:10.932] - Field: 'seed' [13:31:10.932] - Field: 'version' [13:31:10.932] - Field: 'result' [13:31:10.932] - Field: 'asynchronous' [13:31:10.932] - Field: 'calls' [13:31:10.932] - Field: 'globals' [13:31:10.933] - Field: 'stdout' [13:31:10.933] - Field: 'earlySignal' [13:31:10.933] - Field: 'lazy' [13:31:10.933] - Field: 'state' [13:31:10.933] - Field: '.cluster' [13:31:10.933] - Copy elements of temporary 'MiraiFuture' to final 'Future' object ... done [13:31:10.934] - Launch lazy future ... [13:31:10.934] Packages needed by the future expression (n = 0): [13:31:10.934] Packages needed by future strategies (n = 0): [13:31:10.935] { [13:31:10.935] { [13:31:10.935] { [13:31:10.935] ...future.startTime <- base::Sys.time() [13:31:10.935] { [13:31:10.935] { [13:31:10.935] { [13:31:10.935] base::local({ [13:31:10.935] has_future <- base::requireNamespace("future", [13:31:10.935] quietly = TRUE) [13:31:10.935] if (has_future) { [13:31:10.935] ns <- base::getNamespace("future") [13:31:10.935] version <- ns[[".package"]][["version"]] [13:31:10.935] if (is.null(version)) [13:31:10.935] version <- utils::packageVersion("future") [13:31:10.935] } [13:31:10.935] else { [13:31:10.935] version <- NULL [13:31:10.935] } [13:31:10.935] if (!has_future || version < "1.8.0") { [13:31:10.935] info <- base::c(r_version = base::gsub("R version ", [13:31:10.935] "", base::R.version$version.string), [13:31:10.935] platform = base::sprintf("%s (%s-bit)", [13:31:10.935] base::R.version$platform, 8 * base::.Machine$sizeof.pointer), [13:31:10.935] os = base::paste(base::Sys.info()[base::c("sysname", [13:31:10.935] "release", "version")], collapse = " "), [13:31:10.935] hostname = base::Sys.info()[["nodename"]]) [13:31:10.935] info <- base::sprintf("%s: %s", base::names(info), [13:31:10.935] info) [13:31:10.935] info <- base::paste(info, collapse = "; ") [13:31:10.935] if (!has_future) { [13:31:10.935] msg <- base::sprintf("Package 'future' is not installed on worker (%s)", [13:31:10.935] info) [13:31:10.935] } [13:31:10.935] else { [13:31:10.935] msg <- base::sprintf("Package 'future' on worker (%s) must be of version >= 1.8.0: %s", [13:31:10.935] info, version) [13:31:10.935] } [13:31:10.935] base::stop(msg) [13:31:10.935] } [13:31:10.935] }) [13:31:10.935] } [13:31:10.935] ...future.strategy.old <- future::plan("list") [13:31:10.935] options(future.plan = NULL) [13:31:10.935] Sys.unsetenv("R_FUTURE_PLAN") [13:31:10.935] future::plan("default", .cleanup = FALSE, .init = FALSE) [13:31:10.935] } [13:31:10.935] ...future.workdir <- getwd() [13:31:10.935] } [13:31:10.935] ...future.oldOptions <- base::as.list(base::.Options) [13:31:10.935] ...future.oldEnvVars <- base::Sys.getenv() [13:31:10.935] } [13:31:10.935] base::options(future.startup.script = FALSE, future.globals.onMissing = NULL, [13:31:10.935] future.globals.maxSize = NULL, future.globals.method = NULL, [13:31:10.935] future.globals.onMissing = NULL, future.globals.onReference = NULL, [13:31:10.935] future.globals.resolve = NULL, future.resolve.recursive = NULL, [13:31:10.935] future.rng.onMisuse = NULL, future.rng.onMisuse.keepFuture = NULL, [13:31:10.935] future.stdout.windows.reencode = NULL, width = 80L) [13:31:10.935] ...future.futureOptionsAdded <- base::setdiff(base::names(base::.Options), [13:31:10.935] base::names(...future.oldOptions)) [13:31:10.935] } [13:31:10.935] if (FALSE) { [13:31:10.935] } [13:31:10.935] else { [13:31:10.935] if (TRUE) { [13:31:10.935] ...future.stdout <- base::rawConnection(base::raw(0L), [13:31:10.935] open = "w") [13:31:10.935] } [13:31:10.935] else { [13:31:10.935] ...future.stdout <- base::file(base::switch(.Platform$OS.type, [13:31:10.935] windows = "NUL", "/dev/null"), open = "w") [13:31:10.935] } [13:31:10.935] base::sink(...future.stdout, type = "output", split = FALSE) [13:31:10.935] base::on.exit(if (!base::is.null(...future.stdout)) { [13:31:10.935] base::sink(type = "output", split = FALSE) [13:31:10.935] base::close(...future.stdout) [13:31:10.935] }, add = TRUE) [13:31:10.935] } [13:31:10.935] ...future.frame <- base::sys.nframe() [13:31:10.935] ...future.conditions <- base::list() [13:31:10.935] ...future.rng <- base::globalenv()$.Random.seed [13:31:10.935] if (FALSE) { [13:31:10.935] ...future.globalenv.names <- c(base::names(base::.GlobalEnv), [13:31:10.935] "...future.value", "...future.globalenv.names", ".Random.seed") [13:31:10.935] } [13:31:10.935] ...future.result <- base::tryCatch({ [13:31:10.935] base::withCallingHandlers({ [13:31:10.935] ...future.value <- base::withVisible(base::local({ [13:31:10.935] x <- 1:10 [13:31:10.935] sumtwo(a + b * x) [13:31:10.935] })) [13:31:10.935] future::FutureResult(value = ...future.value$value, [13:31:10.935] visible = ...future.value$visible, rng = !identical(base::globalenv()$.Random.seed, [13:31:10.935] ...future.rng), globalenv = if (FALSE) [13:31:10.935] list(added = base::setdiff(base::names(base::.GlobalEnv), [13:31:10.935] ...future.globalenv.names)) [13:31:10.935] else NULL, started = ...future.startTime, version = "1.8") [13:31:10.935] }, condition = base::local({ [13:31:10.935] c <- base::c [13:31:10.935] inherits <- base::inherits [13:31:10.935] invokeRestart <- base::invokeRestart [13:31:10.935] length <- base::length [13:31:10.935] list <- base::list [13:31:10.935] seq.int <- base::seq.int [13:31:10.935] signalCondition <- base::signalCondition [13:31:10.935] sys.calls <- base::sys.calls [13:31:10.935] `[[` <- base::`[[` [13:31:10.935] `+` <- base::`+` [13:31:10.935] `<<-` <- base::`<<-` [13:31:10.935] sysCalls <- function(calls = sys.calls(), from = 1L) { [13:31:10.935] calls[seq.int(from = from + 12L, to = length(calls) - [13:31:10.935] 3L)] [13:31:10.935] } [13:31:10.935] function(cond) { [13:31:10.935] is_error <- inherits(cond, "error") [13:31:10.935] ignore <- !is_error && !is.null(NULL) && inherits(cond, [13:31:10.935] NULL) [13:31:10.935] if (is_error) { [13:31:10.935] sessionInformation <- function() { [13:31:10.935] list(r = base::R.Version(), locale = base::Sys.getlocale(), [13:31:10.935] rngkind = base::RNGkind(), namespaces = base::loadedNamespaces(), [13:31:10.935] search = base::search(), system = base::Sys.info()) [13:31:10.935] } [13:31:10.935] ...future.conditions[[length(...future.conditions) + [13:31:10.935] 1L]] <<- list(condition = cond, calls = c(sysCalls(from = ...future.frame), [13:31:10.935] cond$call), session = sessionInformation(), [13:31:10.935] timestamp = base::Sys.time(), signaled = 0L) [13:31:10.935] signalCondition(cond) [13:31:10.935] } [13:31:10.935] else if (!ignore && TRUE && inherits(cond, "condition")) { [13:31:10.935] signal <- FALSE && inherits(cond, character(0)) [13:31:10.935] ...future.conditions[[length(...future.conditions) + [13:31:10.935] 1L]] <<- list(condition = cond, signaled = base::as.integer(signal)) [13:31:10.935] if (FALSE && !signal) { [13:31:10.935] muffleCondition <- function (cond, pattern = "^muffle") [13:31:10.935] { [13:31:10.935] inherits <- base::inherits [13:31:10.935] invokeRestart <- base::invokeRestart [13:31:10.935] is.null <- base::is.null [13:31:10.935] muffled <- FALSE [13:31:10.935] if (inherits(cond, "message")) { [13:31:10.935] muffled <- grepl(pattern, "muffleMessage") [13:31:10.935] if (muffled) [13:31:10.935] invokeRestart("muffleMessage") [13:31:10.935] } [13:31:10.935] else if (inherits(cond, "warning")) { [13:31:10.935] muffled <- grepl(pattern, "muffleWarning") [13:31:10.935] if (muffled) [13:31:10.935] invokeRestart("muffleWarning") [13:31:10.935] } [13:31:10.935] else if (inherits(cond, "condition")) { [13:31:10.935] if (!is.null(pattern)) { [13:31:10.935] computeRestarts <- base::computeRestarts [13:31:10.935] grepl <- base::grepl [13:31:10.935] restarts <- computeRestarts(cond) [13:31:10.935] for (restart in restarts) { [13:31:10.935] name <- restart$name [13:31:10.935] if (is.null(name)) [13:31:10.935] next [13:31:10.935] if (!grepl(pattern, name)) [13:31:10.935] next [13:31:10.935] invokeRestart(restart) [13:31:10.935] muffled <- TRUE [13:31:10.935] break [13:31:10.935] } [13:31:10.935] } [13:31:10.935] } [13:31:10.935] invisible(muffled) [13:31:10.935] } [13:31:10.935] muffleCondition(cond, pattern = "^muffle") [13:31:10.935] } [13:31:10.935] } [13:31:10.935] else { [13:31:10.935] if (TRUE) { [13:31:10.935] muffleCondition <- function (cond, pattern = "^muffle") [13:31:10.935] { [13:31:10.935] inherits <- base::inherits [13:31:10.935] invokeRestart <- base::invokeRestart [13:31:10.935] is.null <- base::is.null [13:31:10.935] muffled <- FALSE [13:31:10.935] if (inherits(cond, "message")) { [13:31:10.935] muffled <- grepl(pattern, "muffleMessage") [13:31:10.935] if (muffled) [13:31:10.935] invokeRestart("muffleMessage") [13:31:10.935] } [13:31:10.935] else if (inherits(cond, "warning")) { [13:31:10.935] muffled <- grepl(pattern, "muffleWarning") [13:31:10.935] if (muffled) [13:31:10.935] invokeRestart("muffleWarning") [13:31:10.935] } [13:31:10.935] else if (inherits(cond, "condition")) { [13:31:10.935] if (!is.null(pattern)) { [13:31:10.935] computeRestarts <- base::computeRestarts [13:31:10.935] grepl <- base::grepl [13:31:10.935] restarts <- computeRestarts(cond) [13:31:10.935] for (restart in restarts) { [13:31:10.935] name <- restart$name [13:31:10.935] if (is.null(name)) [13:31:10.935] next [13:31:10.935] if (!grepl(pattern, name)) [13:31:10.935] next [13:31:10.935] invokeRestart(restart) [13:31:10.935] muffled <- TRUE [13:31:10.935] break [13:31:10.935] } [13:31:10.935] } [13:31:10.935] } [13:31:10.935] invisible(muffled) [13:31:10.935] } [13:31:10.935] muffleCondition(cond, pattern = "^muffle") [13:31:10.935] } [13:31:10.935] } [13:31:10.935] } [13:31:10.935] })) [13:31:10.935] }, error = function(ex) { [13:31:10.935] base::structure(base::list(value = NULL, visible = NULL, [13:31:10.935] conditions = ...future.conditions, rng = !identical(base::globalenv()$.Random.seed, [13:31:10.935] ...future.rng), started = ...future.startTime, [13:31:10.935] finished = Sys.time(), session_uuid = NA_character_, [13:31:10.935] version = "1.8"), class = "FutureResult") [13:31:10.935] }, finally = { [13:31:10.935] if (!identical(...future.workdir, getwd())) [13:31:10.935] setwd(...future.workdir) [13:31:10.935] { [13:31:10.935] if (identical(getOption("nwarnings"), ...future.oldOptions$nwarnings)) { [13:31:10.935] ...future.oldOptions$nwarnings <- NULL [13:31:10.935] } [13:31:10.935] base::options(...future.oldOptions) [13:31:10.935] if (.Platform$OS.type == "windows") { [13:31:10.935] old_names <- names(...future.oldEnvVars) [13:31:10.935] envs <- base::Sys.getenv() [13:31:10.935] names <- names(envs) [13:31:10.935] common <- intersect(names, old_names) [13:31:10.935] added <- setdiff(names, old_names) [13:31:10.935] removed <- setdiff(old_names, names) [13:31:10.935] changed <- common[...future.oldEnvVars[common] != [13:31:10.935] envs[common]] [13:31:10.935] NAMES <- toupper(changed) [13:31:10.935] args <- list() [13:31:10.935] for (kk in seq_along(NAMES)) { [13:31:10.935] name <- changed[[kk]] [13:31:10.935] NAME <- NAMES[[kk]] [13:31:10.935] if (name != NAME && is.element(NAME, old_names)) [13:31:10.935] next [13:31:10.935] args[[name]] <- ...future.oldEnvVars[[name]] [13:31:10.935] } [13:31:10.935] NAMES <- toupper(added) [13:31:10.935] for (kk in seq_along(NAMES)) { [13:31:10.935] name <- added[[kk]] [13:31:10.935] NAME <- NAMES[[kk]] [13:31:10.935] if (name != NAME && is.element(NAME, old_names)) [13:31:10.935] next [13:31:10.935] args[[name]] <- "" [13:31:10.935] } [13:31:10.935] NAMES <- toupper(removed) [13:31:10.935] for (kk in seq_along(NAMES)) { [13:31:10.935] name <- removed[[kk]] [13:31:10.935] NAME <- NAMES[[kk]] [13:31:10.935] if (name != NAME && is.element(NAME, old_names)) [13:31:10.935] next [13:31:10.935] args[[name]] <- ...future.oldEnvVars[[name]] [13:31:10.935] } [13:31:10.935] if (length(args) > 0) [13:31:10.935] base::do.call(base::Sys.setenv, args = args) [13:31:10.935] args <- names <- old_names <- NAMES <- envs <- common <- added <- removed <- NULL [13:31:10.935] } [13:31:10.935] else { [13:31:10.935] base::do.call(base::Sys.setenv, args = base::as.list(...future.oldEnvVars)) [13:31:10.935] } [13:31:10.935] { [13:31:10.935] if (base::length(...future.futureOptionsAdded) > [13:31:10.935] 0L) { [13:31:10.935] opts <- base::vector("list", length = base::length(...future.futureOptionsAdded)) [13:31:10.935] base::names(opts) <- ...future.futureOptionsAdded [13:31:10.935] base::options(opts) [13:31:10.935] } [13:31:10.935] { [13:31:10.935] NULL [13:31:10.935] options(future.plan = NULL) [13:31:10.935] if (is.na(NA_character_)) [13:31:10.935] Sys.unsetenv("R_FUTURE_PLAN") [13:31:10.935] else Sys.setenv(R_FUTURE_PLAN = NA_character_) [13:31:10.935] future::plan(...future.strategy.old, .cleanup = FALSE, [13:31:10.935] .init = FALSE) [13:31:10.935] } [13:31:10.935] } [13:31:10.935] } [13:31:10.935] }) [13:31:10.935] if (TRUE) { [13:31:10.935] base::sink(type = "output", split = FALSE) [13:31:10.935] if (TRUE) { [13:31:10.935] ...future.result$stdout <- base::rawToChar(base::rawConnectionValue(...future.stdout)) [13:31:10.935] } [13:31:10.935] else { [13:31:10.935] ...future.result["stdout"] <- base::list(NULL) [13:31:10.935] } [13:31:10.935] base::close(...future.stdout) [13:31:10.935] ...future.stdout <- NULL [13:31:10.935] } [13:31:10.935] ...future.result$conditions <- ...future.conditions [13:31:10.935] ...future.result$finished <- base::Sys.time() [13:31:10.935] ...future.result [13:31:10.935] } [13:31:10.938] - Launch lazy future ... done [13:31:10.939] run() for 'MiraiFuture' ... done > print(f) MiraiFuture: Label: '' Expression: { x <- 1:10 sumtwo(a + b * x) } Lazy evaluation: FALSE Asynchronous evaluation: TRUE Local evaluation: TRUE Environment: R_GlobalEnv Capture standard output: TRUE Capture condition classes: 'condition' (excluding 'nothing') Globals: 3 objects totaling 1.20 KiB (function 'sumtwo' of 1.09 KiB, numeric 'a' of 56 bytes, numeric 'b' of 56 bytes) Packages: L'Ecuyer-CMRG RNG seed: (seed = FALSE) [13:31:10.940] resolved() for 'MiraiFuture' ... [13:31:10.940] - state: 'running' [13:31:10.940] - run: TRUE [13:31:10.941] - result: 'NULL' [13:31:10.941] - resolved: FALSE [13:31:10.941] resolved() for 'MiraiFuture' ... done Resolved: FALSE Value: Conditions captured: Early signaling: FALSE Owner process: 37e9731f-23fc-4fe3-e1ef-fa9694a30142 Class: 'MiraiFuture', 'MultiprocessFuture', 'Future', 'environment' > rm(list = names(globals)) > y <- value(f) > print(y) [1] 8 > stopifnot(all.equal(y, v0)) > > attach_locally(globals) > y %<-% { + x <- 1:10 + sumtwo(a + b * x) + } %globals% TRUE [13:31:10.943] getGlobalsAndPackages() ... [13:31:10.944] Searching for globals... [13:31:10.947] - globals found: [9] '{', '<-', ':', 'sumtwo', '+', 'a', '*', 'b', '[' [13:31:10.947] Searching for globals ... DONE [13:31:10.947] Resolving globals: FALSE [13:31:10.948] The total size of the 3 globals is 1.20 KiB (1232 bytes) [13:31:10.948] The total size of the 3 globals exported for future expression ('{; x <- 1:10; sumtwo(a + b * x); }') is 1.20 KiB.. This exceeds the maximum allowed size of 500.00 MiB (option 'future.globals.maxSize'). There are three globals: 'sumtwo' (1.09 KiB of class 'function'), 'a' (56 bytes of class 'numeric') and 'b' (56 bytes of class 'numeric') [13:31:10.948] - globals: [3] 'sumtwo', 'a', 'b' [13:31:10.949] [13:31:10.949] getGlobalsAndPackages() ... DONE [13:31:10.949] run() for 'Future' ... [13:31:10.949] - state: 'created' [13:31:10.949] - Future backend: 'FutureStrategy', 'mirai_multisession', 'mirai_cluster', 'mirai', 'multiprocess', 'future', 'function' [13:31:10.954] - Future class: 'MiraiFuture', 'MultiprocessFuture', 'Future', 'environment' [13:31:10.954] - Copy elements of temporary 'MiraiFuture' to final 'Future' object ... [13:31:10.954] - Field: 'label' [13:31:10.954] - Field: 'local' [13:31:10.954] - Field: 'owner' [13:31:10.954] - Field: 'envir' [13:31:10.955] - Field: 'packages' [13:31:10.955] - Field: 'gc' [13:31:10.955] - Field: 'conditions' [13:31:10.955] - Field: 'expr' [13:31:10.955] - Field: 'uuid' [13:31:10.955] - Field: 'seed' [13:31:10.956] - Field: 'version' [13:31:10.956] - Field: 'result' [13:31:10.956] - Field: 'asynchronous' [13:31:10.956] - Field: 'calls' [13:31:10.956] - Field: 'globals' [13:31:10.956] - Field: 'stdout' [13:31:10.957] - Field: 'earlySignal' [13:31:10.957] - Field: 'lazy' [13:31:10.957] - Field: 'state' [13:31:10.957] - Field: '.cluster' [13:31:10.957] - Copy elements of temporary 'MiraiFuture' to final 'Future' object ... done [13:31:10.957] - Launch lazy future ... [13:31:10.958] Packages needed by the future expression (n = 0): [13:31:10.958] Packages needed by future strategies (n = 0): [13:31:10.958] { [13:31:10.958] { [13:31:10.958] { [13:31:10.958] ...future.startTime <- base::Sys.time() [13:31:10.958] { [13:31:10.958] { [13:31:10.958] { [13:31:10.958] base::local({ [13:31:10.958] has_future <- base::requireNamespace("future", [13:31:10.958] quietly = TRUE) [13:31:10.958] if (has_future) { [13:31:10.958] ns <- base::getNamespace("future") [13:31:10.958] version <- ns[[".package"]][["version"]] [13:31:10.958] if (is.null(version)) [13:31:10.958] version <- utils::packageVersion("future") [13:31:10.958] } [13:31:10.958] else { [13:31:10.958] version <- NULL [13:31:10.958] } [13:31:10.958] if (!has_future || version < "1.8.0") { [13:31:10.958] info <- base::c(r_version = base::gsub("R version ", [13:31:10.958] "", base::R.version$version.string), [13:31:10.958] platform = base::sprintf("%s (%s-bit)", [13:31:10.958] base::R.version$platform, 8 * base::.Machine$sizeof.pointer), [13:31:10.958] os = base::paste(base::Sys.info()[base::c("sysname", [13:31:10.958] "release", "version")], collapse = " "), [13:31:10.958] hostname = base::Sys.info()[["nodename"]]) [13:31:10.958] info <- base::sprintf("%s: %s", base::names(info), [13:31:10.958] info) [13:31:10.958] info <- base::paste(info, collapse = "; ") [13:31:10.958] if (!has_future) { [13:31:10.958] msg <- base::sprintf("Package 'future' is not installed on worker (%s)", [13:31:10.958] info) [13:31:10.958] } [13:31:10.958] else { [13:31:10.958] msg <- base::sprintf("Package 'future' on worker (%s) must be of version >= 1.8.0: %s", [13:31:10.958] info, version) [13:31:10.958] } [13:31:10.958] base::stop(msg) [13:31:10.958] } [13:31:10.958] }) [13:31:10.958] } [13:31:10.958] ...future.strategy.old <- future::plan("list") [13:31:10.958] options(future.plan = NULL) [13:31:10.958] Sys.unsetenv("R_FUTURE_PLAN") [13:31:10.958] future::plan("default", .cleanup = FALSE, .init = FALSE) [13:31:10.958] } [13:31:10.958] ...future.workdir <- getwd() [13:31:10.958] } [13:31:10.958] ...future.oldOptions <- base::as.list(base::.Options) [13:31:10.958] ...future.oldEnvVars <- base::Sys.getenv() [13:31:10.958] } [13:31:10.958] base::options(future.startup.script = FALSE, future.globals.onMissing = NULL, [13:31:10.958] future.globals.maxSize = NULL, future.globals.method = NULL, [13:31:10.958] future.globals.onMissing = NULL, future.globals.onReference = NULL, [13:31:10.958] future.globals.resolve = NULL, future.resolve.recursive = NULL, [13:31:10.958] future.rng.onMisuse = NULL, future.rng.onMisuse.keepFuture = NULL, [13:31:10.958] future.stdout.windows.reencode = NULL, width = 80L) [13:31:10.958] ...future.futureOptionsAdded <- base::setdiff(base::names(base::.Options), [13:31:10.958] base::names(...future.oldOptions)) [13:31:10.958] } [13:31:10.958] if (FALSE) { [13:31:10.958] } [13:31:10.958] else { [13:31:10.958] if (TRUE) { [13:31:10.958] ...future.stdout <- base::rawConnection(base::raw(0L), [13:31:10.958] open = "w") [13:31:10.958] } [13:31:10.958] else { [13:31:10.958] ...future.stdout <- base::file(base::switch(.Platform$OS.type, [13:31:10.958] windows = "NUL", "/dev/null"), open = "w") [13:31:10.958] } [13:31:10.958] base::sink(...future.stdout, type = "output", split = FALSE) [13:31:10.958] base::on.exit(if (!base::is.null(...future.stdout)) { [13:31:10.958] base::sink(type = "output", split = FALSE) [13:31:10.958] base::close(...future.stdout) [13:31:10.958] }, add = TRUE) [13:31:10.958] } [13:31:10.958] ...future.frame <- base::sys.nframe() [13:31:10.958] ...future.conditions <- base::list() [13:31:10.958] ...future.rng <- base::globalenv()$.Random.seed [13:31:10.958] if (FALSE) { [13:31:10.958] ...future.globalenv.names <- c(base::names(base::.GlobalEnv), [13:31:10.958] "...future.value", "...future.globalenv.names", ".Random.seed") [13:31:10.958] } [13:31:10.958] ...future.result <- base::tryCatch({ [13:31:10.958] base::withCallingHandlers({ [13:31:10.958] ...future.value <- base::withVisible(base::local({ [13:31:10.958] x <- 1:10 [13:31:10.958] sumtwo(a + b * x) [13:31:10.958] })) [13:31:10.958] future::FutureResult(value = ...future.value$value, [13:31:10.958] visible = ...future.value$visible, rng = !identical(base::globalenv()$.Random.seed, [13:31:10.958] ...future.rng), globalenv = if (FALSE) [13:31:10.958] list(added = base::setdiff(base::names(base::.GlobalEnv), [13:31:10.958] ...future.globalenv.names)) [13:31:10.958] else NULL, started = ...future.startTime, version = "1.8") [13:31:10.958] }, condition = base::local({ [13:31:10.958] c <- base::c [13:31:10.958] inherits <- base::inherits [13:31:10.958] invokeRestart <- base::invokeRestart [13:31:10.958] length <- base::length [13:31:10.958] list <- base::list [13:31:10.958] seq.int <- base::seq.int [13:31:10.958] signalCondition <- base::signalCondition [13:31:10.958] sys.calls <- base::sys.calls [13:31:10.958] `[[` <- base::`[[` [13:31:10.958] `+` <- base::`+` [13:31:10.958] `<<-` <- base::`<<-` [13:31:10.958] sysCalls <- function(calls = sys.calls(), from = 1L) { [13:31:10.958] calls[seq.int(from = from + 12L, to = length(calls) - [13:31:10.958] 3L)] [13:31:10.958] } [13:31:10.958] function(cond) { [13:31:10.958] is_error <- inherits(cond, "error") [13:31:10.958] ignore <- !is_error && !is.null(NULL) && inherits(cond, [13:31:10.958] NULL) [13:31:10.958] if (is_error) { [13:31:10.958] sessionInformation <- function() { [13:31:10.958] list(r = base::R.Version(), locale = base::Sys.getlocale(), [13:31:10.958] rngkind = base::RNGkind(), namespaces = base::loadedNamespaces(), [13:31:10.958] search = base::search(), system = base::Sys.info()) [13:31:10.958] } [13:31:10.958] ...future.conditions[[length(...future.conditions) + [13:31:10.958] 1L]] <<- list(condition = cond, calls = c(sysCalls(from = ...future.frame), [13:31:10.958] cond$call), session = sessionInformation(), [13:31:10.958] timestamp = base::Sys.time(), signaled = 0L) [13:31:10.958] signalCondition(cond) [13:31:10.958] } [13:31:10.958] else if (!ignore && TRUE && inherits(cond, "condition")) { [13:31:10.958] signal <- FALSE && inherits(cond, character(0)) [13:31:10.958] ...future.conditions[[length(...future.conditions) + [13:31:10.958] 1L]] <<- list(condition = cond, signaled = base::as.integer(signal)) [13:31:10.958] if (FALSE && !signal) { [13:31:10.958] muffleCondition <- function (cond, pattern = "^muffle") [13:31:10.958] { [13:31:10.958] inherits <- base::inherits [13:31:10.958] invokeRestart <- base::invokeRestart [13:31:10.958] is.null <- base::is.null [13:31:10.958] muffled <- FALSE [13:31:10.958] if (inherits(cond, "message")) { [13:31:10.958] muffled <- grepl(pattern, "muffleMessage") [13:31:10.958] if (muffled) [13:31:10.958] invokeRestart("muffleMessage") [13:31:10.958] } [13:31:10.958] else if (inherits(cond, "warning")) { [13:31:10.958] muffled <- grepl(pattern, "muffleWarning") [13:31:10.958] if (muffled) [13:31:10.958] invokeRestart("muffleWarning") [13:31:10.958] } [13:31:10.958] else if (inherits(cond, "condition")) { [13:31:10.958] if (!is.null(pattern)) { [13:31:10.958] computeRestarts <- base::computeRestarts [13:31:10.958] grepl <- base::grepl [13:31:10.958] restarts <- computeRestarts(cond) [13:31:10.958] for (restart in restarts) { [13:31:10.958] name <- restart$name [13:31:10.958] if (is.null(name)) [13:31:10.958] next [13:31:10.958] if (!grepl(pattern, name)) [13:31:10.958] next [13:31:10.958] invokeRestart(restart) [13:31:10.958] muffled <- TRUE [13:31:10.958] break [13:31:10.958] } [13:31:10.958] } [13:31:10.958] } [13:31:10.958] invisible(muffled) [13:31:10.958] } [13:31:10.958] muffleCondition(cond, pattern = "^muffle") [13:31:10.958] } [13:31:10.958] } [13:31:10.958] else { [13:31:10.958] if (TRUE) { [13:31:10.958] muffleCondition <- function (cond, pattern = "^muffle") [13:31:10.958] { [13:31:10.958] inherits <- base::inherits [13:31:10.958] invokeRestart <- base::invokeRestart [13:31:10.958] is.null <- base::is.null [13:31:10.958] muffled <- FALSE [13:31:10.958] if (inherits(cond, "message")) { [13:31:10.958] muffled <- grepl(pattern, "muffleMessage") [13:31:10.958] if (muffled) [13:31:10.958] invokeRestart("muffleMessage") [13:31:10.958] } [13:31:10.958] else if (inherits(cond, "warning")) { [13:31:10.958] muffled <- grepl(pattern, "muffleWarning") [13:31:10.958] if (muffled) [13:31:10.958] invokeRestart("muffleWarning") [13:31:10.958] } [13:31:10.958] else if (inherits(cond, "condition")) { [13:31:10.958] if (!is.null(pattern)) { [13:31:10.958] computeRestarts <- base::computeRestarts [13:31:10.958] grepl <- base::grepl [13:31:10.958] restarts <- computeRestarts(cond) [13:31:10.958] for (restart in restarts) { [13:31:10.958] name <- restart$name [13:31:10.958] if (is.null(name)) [13:31:10.958] next [13:31:10.958] if (!grepl(pattern, name)) [13:31:10.958] next [13:31:10.958] invokeRestart(restart) [13:31:10.958] muffled <- TRUE [13:31:10.958] break [13:31:10.958] } [13:31:10.958] } [13:31:10.958] } [13:31:10.958] invisible(muffled) [13:31:10.958] } [13:31:10.958] muffleCondition(cond, pattern = "^muffle") [13:31:10.958] } [13:31:10.958] } [13:31:10.958] } [13:31:10.958] })) [13:31:10.958] }, error = function(ex) { [13:31:10.958] base::structure(base::list(value = NULL, visible = NULL, [13:31:10.958] conditions = ...future.conditions, rng = !identical(base::globalenv()$.Random.seed, [13:31:10.958] ...future.rng), started = ...future.startTime, [13:31:10.958] finished = Sys.time(), session_uuid = NA_character_, [13:31:10.958] version = "1.8"), class = "FutureResult") [13:31:10.958] }, finally = { [13:31:10.958] if (!identical(...future.workdir, getwd())) [13:31:10.958] setwd(...future.workdir) [13:31:10.958] { [13:31:10.958] if (identical(getOption("nwarnings"), ...future.oldOptions$nwarnings)) { [13:31:10.958] ...future.oldOptions$nwarnings <- NULL [13:31:10.958] } [13:31:10.958] base::options(...future.oldOptions) [13:31:10.958] if (.Platform$OS.type == "windows") { [13:31:10.958] old_names <- names(...future.oldEnvVars) [13:31:10.958] envs <- base::Sys.getenv() [13:31:10.958] names <- names(envs) [13:31:10.958] common <- intersect(names, old_names) [13:31:10.958] added <- setdiff(names, old_names) [13:31:10.958] removed <- setdiff(old_names, names) [13:31:10.958] changed <- common[...future.oldEnvVars[common] != [13:31:10.958] envs[common]] [13:31:10.958] NAMES <- toupper(changed) [13:31:10.958] args <- list() [13:31:10.958] for (kk in seq_along(NAMES)) { [13:31:10.958] name <- changed[[kk]] [13:31:10.958] NAME <- NAMES[[kk]] [13:31:10.958] if (name != NAME && is.element(NAME, old_names)) [13:31:10.958] next [13:31:10.958] args[[name]] <- ...future.oldEnvVars[[name]] [13:31:10.958] } [13:31:10.958] NAMES <- toupper(added) [13:31:10.958] for (kk in seq_along(NAMES)) { [13:31:10.958] name <- added[[kk]] [13:31:10.958] NAME <- NAMES[[kk]] [13:31:10.958] if (name != NAME && is.element(NAME, old_names)) [13:31:10.958] next [13:31:10.958] args[[name]] <- "" [13:31:10.958] } [13:31:10.958] NAMES <- toupper(removed) [13:31:10.958] for (kk in seq_along(NAMES)) { [13:31:10.958] name <- removed[[kk]] [13:31:10.958] NAME <- NAMES[[kk]] [13:31:10.958] if (name != NAME && is.element(NAME, old_names)) [13:31:10.958] next [13:31:10.958] args[[name]] <- ...future.oldEnvVars[[name]] [13:31:10.958] } [13:31:10.958] if (length(args) > 0) [13:31:10.958] base::do.call(base::Sys.setenv, args = args) [13:31:10.958] args <- names <- old_names <- NAMES <- envs <- common <- added <- removed <- NULL [13:31:10.958] } [13:31:10.958] else { [13:31:10.958] base::do.call(base::Sys.setenv, args = base::as.list(...future.oldEnvVars)) [13:31:10.958] } [13:31:10.958] { [13:31:10.958] if (base::length(...future.futureOptionsAdded) > [13:31:10.958] 0L) { [13:31:10.958] opts <- base::vector("list", length = base::length(...future.futureOptionsAdded)) [13:31:10.958] base::names(opts) <- ...future.futureOptionsAdded [13:31:10.958] base::options(opts) [13:31:10.958] } [13:31:10.958] { [13:31:10.958] NULL [13:31:10.958] options(future.plan = NULL) [13:31:10.958] if (is.na(NA_character_)) [13:31:10.958] Sys.unsetenv("R_FUTURE_PLAN") [13:31:10.958] else Sys.setenv(R_FUTURE_PLAN = NA_character_) [13:31:10.958] future::plan(...future.strategy.old, .cleanup = FALSE, [13:31:10.958] .init = FALSE) [13:31:10.958] } [13:31:10.958] } [13:31:10.958] } [13:31:10.958] }) [13:31:10.958] if (TRUE) { [13:31:10.958] base::sink(type = "output", split = FALSE) [13:31:10.958] if (TRUE) { [13:31:10.958] ...future.result$stdout <- base::rawToChar(base::rawConnectionValue(...future.stdout)) [13:31:10.958] } [13:31:10.958] else { [13:31:10.958] ...future.result["stdout"] <- base::list(NULL) [13:31:10.958] } [13:31:10.958] base::close(...future.stdout) [13:31:10.958] ...future.stdout <- NULL [13:31:10.958] } [13:31:10.958] ...future.result$conditions <- ...future.conditions [13:31:10.958] ...future.result$finished <- base::Sys.time() [13:31:10.958] ...future.result [13:31:10.958] } [13:31:10.962] - Launch lazy future ... done [13:31:10.962] run() for 'MiraiFuture' ... done > rm(list = names(globals)) > print(y) [1] 8 > stopifnot(all.equal(y, v0)) > > ## No need to search for globals > y %<-% { 1 } %globals% FALSE [13:31:10.966] getGlobalsAndPackages() ... [13:31:10.966] Not searching for globals [13:31:10.966] - globals: [0] [13:31:10.966] getGlobalsAndPackages() ... DONE [13:31:10.967] run() for 'Future' ... [13:31:10.967] - state: 'created' [13:31:10.967] - Future backend: 'FutureStrategy', 'mirai_multisession', 'mirai_cluster', 'mirai', 'multiprocess', 'future', 'function' [13:31:10.969] - Future class: 'MiraiFuture', 'MultiprocessFuture', 'Future', 'environment' [13:31:10.969] - Copy elements of temporary 'MiraiFuture' to final 'Future' object ... [13:31:10.970] - Field: 'label' [13:31:10.970] - Field: 'local' [13:31:10.970] - Field: 'owner' [13:31:10.970] - Field: 'envir' [13:31:10.970] - Field: 'packages' [13:31:10.970] - Field: 'gc' [13:31:10.971] - Field: 'conditions' [13:31:10.971] - Field: 'expr' [13:31:10.971] - Field: 'uuid' [13:31:10.971] - Field: 'seed' [13:31:10.971] - Field: 'version' [13:31:10.971] - Field: 'result' [13:31:10.972] - Field: 'asynchronous' [13:31:10.972] - Field: 'calls' [13:31:10.972] - Field: 'globals' [13:31:10.972] - Field: 'stdout' [13:31:10.972] - Field: 'earlySignal' [13:31:10.972] - Field: 'lazy' [13:31:10.973] - Field: 'state' [13:31:10.973] - Field: '.cluster' [13:31:10.973] - Copy elements of temporary 'MiraiFuture' to final 'Future' object ... done [13:31:10.973] - Launch lazy future ... [13:31:10.973] Packages needed by the future expression (n = 0): [13:31:10.973] Packages needed by future strategies (n = 0): [13:31:10.974] { [13:31:10.974] { [13:31:10.974] { [13:31:10.974] ...future.startTime <- base::Sys.time() [13:31:10.974] { [13:31:10.974] { [13:31:10.974] { [13:31:10.974] base::local({ [13:31:10.974] has_future <- base::requireNamespace("future", [13:31:10.974] quietly = TRUE) [13:31:10.974] if (has_future) { [13:31:10.974] ns <- base::getNamespace("future") [13:31:10.974] version <- ns[[".package"]][["version"]] [13:31:10.974] if (is.null(version)) [13:31:10.974] version <- utils::packageVersion("future") [13:31:10.974] } [13:31:10.974] else { [13:31:10.974] version <- NULL [13:31:10.974] } [13:31:10.974] if (!has_future || version < "1.8.0") { [13:31:10.974] info <- base::c(r_version = base::gsub("R version ", [13:31:10.974] "", base::R.version$version.string), [13:31:10.974] platform = base::sprintf("%s (%s-bit)", [13:31:10.974] base::R.version$platform, 8 * base::.Machine$sizeof.pointer), [13:31:10.974] os = base::paste(base::Sys.info()[base::c("sysname", [13:31:10.974] "release", "version")], collapse = " "), [13:31:10.974] hostname = base::Sys.info()[["nodename"]]) [13:31:10.974] info <- base::sprintf("%s: %s", base::names(info), [13:31:10.974] info) [13:31:10.974] info <- base::paste(info, collapse = "; ") [13:31:10.974] if (!has_future) { [13:31:10.974] msg <- base::sprintf("Package 'future' is not installed on worker (%s)", [13:31:10.974] info) [13:31:10.974] } [13:31:10.974] else { [13:31:10.974] msg <- base::sprintf("Package 'future' on worker (%s) must be of version >= 1.8.0: %s", [13:31:10.974] info, version) [13:31:10.974] } [13:31:10.974] base::stop(msg) [13:31:10.974] } [13:31:10.974] }) [13:31:10.974] } [13:31:10.974] ...future.strategy.old <- future::plan("list") [13:31:10.974] options(future.plan = NULL) [13:31:10.974] Sys.unsetenv("R_FUTURE_PLAN") [13:31:10.974] future::plan("default", .cleanup = FALSE, .init = FALSE) [13:31:10.974] } [13:31:10.974] ...future.workdir <- getwd() [13:31:10.974] } [13:31:10.974] ...future.oldOptions <- base::as.list(base::.Options) [13:31:10.974] ...future.oldEnvVars <- base::Sys.getenv() [13:31:10.974] } [13:31:10.974] base::options(future.startup.script = FALSE, future.globals.onMissing = NULL, [13:31:10.974] future.globals.maxSize = NULL, future.globals.method = NULL, [13:31:10.974] future.globals.onMissing = NULL, future.globals.onReference = NULL, [13:31:10.974] future.globals.resolve = NULL, future.resolve.recursive = NULL, [13:31:10.974] future.rng.onMisuse = NULL, future.rng.onMisuse.keepFuture = NULL, [13:31:10.974] future.stdout.windows.reencode = NULL, width = 80L) [13:31:10.974] ...future.futureOptionsAdded <- base::setdiff(base::names(base::.Options), [13:31:10.974] base::names(...future.oldOptions)) [13:31:10.974] } [13:31:10.974] if (FALSE) { [13:31:10.974] } [13:31:10.974] else { [13:31:10.974] if (TRUE) { [13:31:10.974] ...future.stdout <- base::rawConnection(base::raw(0L), [13:31:10.974] open = "w") [13:31:10.974] } [13:31:10.974] else { [13:31:10.974] ...future.stdout <- base::file(base::switch(.Platform$OS.type, [13:31:10.974] windows = "NUL", "/dev/null"), open = "w") [13:31:10.974] } [13:31:10.974] base::sink(...future.stdout, type = "output", split = FALSE) [13:31:10.974] base::on.exit(if (!base::is.null(...future.stdout)) { [13:31:10.974] base::sink(type = "output", split = FALSE) [13:31:10.974] base::close(...future.stdout) [13:31:10.974] }, add = TRUE) [13:31:10.974] } [13:31:10.974] ...future.frame <- base::sys.nframe() [13:31:10.974] ...future.conditions <- base::list() [13:31:10.974] ...future.rng <- base::globalenv()$.Random.seed [13:31:10.974] if (FALSE) { [13:31:10.974] ...future.globalenv.names <- c(base::names(base::.GlobalEnv), [13:31:10.974] "...future.value", "...future.globalenv.names", ".Random.seed") [13:31:10.974] } [13:31:10.974] ...future.result <- base::tryCatch({ [13:31:10.974] base::withCallingHandlers({ [13:31:10.974] ...future.value <- base::withVisible(base::local({ [13:31:10.974] 1 [13:31:10.974] })) [13:31:10.974] future::FutureResult(value = ...future.value$value, [13:31:10.974] visible = ...future.value$visible, rng = !identical(base::globalenv()$.Random.seed, [13:31:10.974] ...future.rng), globalenv = if (FALSE) [13:31:10.974] list(added = base::setdiff(base::names(base::.GlobalEnv), [13:31:10.974] ...future.globalenv.names)) [13:31:10.974] else NULL, started = ...future.startTime, version = "1.8") [13:31:10.974] }, condition = base::local({ [13:31:10.974] c <- base::c [13:31:10.974] inherits <- base::inherits [13:31:10.974] invokeRestart <- base::invokeRestart [13:31:10.974] length <- base::length [13:31:10.974] list <- base::list [13:31:10.974] seq.int <- base::seq.int [13:31:10.974] signalCondition <- base::signalCondition [13:31:10.974] sys.calls <- base::sys.calls [13:31:10.974] `[[` <- base::`[[` [13:31:10.974] `+` <- base::`+` [13:31:10.974] `<<-` <- base::`<<-` [13:31:10.974] sysCalls <- function(calls = sys.calls(), from = 1L) { [13:31:10.974] calls[seq.int(from = from + 12L, to = length(calls) - [13:31:10.974] 3L)] [13:31:10.974] } [13:31:10.974] function(cond) { [13:31:10.974] is_error <- inherits(cond, "error") [13:31:10.974] ignore <- !is_error && !is.null(NULL) && inherits(cond, [13:31:10.974] NULL) [13:31:10.974] if (is_error) { [13:31:10.974] sessionInformation <- function() { [13:31:10.974] list(r = base::R.Version(), locale = base::Sys.getlocale(), [13:31:10.974] rngkind = base::RNGkind(), namespaces = base::loadedNamespaces(), [13:31:10.974] search = base::search(), system = base::Sys.info()) [13:31:10.974] } [13:31:10.974] ...future.conditions[[length(...future.conditions) + [13:31:10.974] 1L]] <<- list(condition = cond, calls = c(sysCalls(from = ...future.frame), [13:31:10.974] cond$call), session = sessionInformation(), [13:31:10.974] timestamp = base::Sys.time(), signaled = 0L) [13:31:10.974] signalCondition(cond) [13:31:10.974] } [13:31:10.974] else if (!ignore && TRUE && inherits(cond, "condition")) { [13:31:10.974] signal <- FALSE && inherits(cond, character(0)) [13:31:10.974] ...future.conditions[[length(...future.conditions) + [13:31:10.974] 1L]] <<- list(condition = cond, signaled = base::as.integer(signal)) [13:31:10.974] if (FALSE && !signal) { [13:31:10.974] muffleCondition <- function (cond, pattern = "^muffle") [13:31:10.974] { [13:31:10.974] inherits <- base::inherits [13:31:10.974] invokeRestart <- base::invokeRestart [13:31:10.974] is.null <- base::is.null [13:31:10.974] muffled <- FALSE [13:31:10.974] if (inherits(cond, "message")) { [13:31:10.974] muffled <- grepl(pattern, "muffleMessage") [13:31:10.974] if (muffled) [13:31:10.974] invokeRestart("muffleMessage") [13:31:10.974] } [13:31:10.974] else if (inherits(cond, "warning")) { [13:31:10.974] muffled <- grepl(pattern, "muffleWarning") [13:31:10.974] if (muffled) [13:31:10.974] invokeRestart("muffleWarning") [13:31:10.974] } [13:31:10.974] else if (inherits(cond, "condition")) { [13:31:10.974] if (!is.null(pattern)) { [13:31:10.974] computeRestarts <- base::computeRestarts [13:31:10.974] grepl <- base::grepl [13:31:10.974] restarts <- computeRestarts(cond) [13:31:10.974] for (restart in restarts) { [13:31:10.974] name <- restart$name [13:31:10.974] if (is.null(name)) [13:31:10.974] next [13:31:10.974] if (!grepl(pattern, name)) [13:31:10.974] next [13:31:10.974] invokeRestart(restart) [13:31:10.974] muffled <- TRUE [13:31:10.974] break [13:31:10.974] } [13:31:10.974] } [13:31:10.974] } [13:31:10.974] invisible(muffled) [13:31:10.974] } [13:31:10.974] muffleCondition(cond, pattern = "^muffle") [13:31:10.974] } [13:31:10.974] } [13:31:10.974] else { [13:31:10.974] if (TRUE) { [13:31:10.974] muffleCondition <- function (cond, pattern = "^muffle") [13:31:10.974] { [13:31:10.974] inherits <- base::inherits [13:31:10.974] invokeRestart <- base::invokeRestart [13:31:10.974] is.null <- base::is.null [13:31:10.974] muffled <- FALSE [13:31:10.974] if (inherits(cond, "message")) { [13:31:10.974] muffled <- grepl(pattern, "muffleMessage") [13:31:10.974] if (muffled) [13:31:10.974] invokeRestart("muffleMessage") [13:31:10.974] } [13:31:10.974] else if (inherits(cond, "warning")) { [13:31:10.974] muffled <- grepl(pattern, "muffleWarning") [13:31:10.974] if (muffled) [13:31:10.974] invokeRestart("muffleWarning") [13:31:10.974] } [13:31:10.974] else if (inherits(cond, "condition")) { [13:31:10.974] if (!is.null(pattern)) { [13:31:10.974] computeRestarts <- base::computeRestarts [13:31:10.974] grepl <- base::grepl [13:31:10.974] restarts <- computeRestarts(cond) [13:31:10.974] for (restart in restarts) { [13:31:10.974] name <- restart$name [13:31:10.974] if (is.null(name)) [13:31:10.974] next [13:31:10.974] if (!grepl(pattern, name)) [13:31:10.974] next [13:31:10.974] invokeRestart(restart) [13:31:10.974] muffled <- TRUE [13:31:10.974] break [13:31:10.974] } [13:31:10.974] } [13:31:10.974] } [13:31:10.974] invisible(muffled) [13:31:10.974] } [13:31:10.974] muffleCondition(cond, pattern = "^muffle") [13:31:10.974] } [13:31:10.974] } [13:31:10.974] } [13:31:10.974] })) [13:31:10.974] }, error = function(ex) { [13:31:10.974] base::structure(base::list(value = NULL, visible = NULL, [13:31:10.974] conditions = ...future.conditions, rng = !identical(base::globalenv()$.Random.seed, [13:31:10.974] ...future.rng), started = ...future.startTime, [13:31:10.974] finished = Sys.time(), session_uuid = NA_character_, [13:31:10.974] version = "1.8"), class = "FutureResult") [13:31:10.974] }, finally = { [13:31:10.974] if (!identical(...future.workdir, getwd())) [13:31:10.974] setwd(...future.workdir) [13:31:10.974] { [13:31:10.974] if (identical(getOption("nwarnings"), ...future.oldOptions$nwarnings)) { [13:31:10.974] ...future.oldOptions$nwarnings <- NULL [13:31:10.974] } [13:31:10.974] base::options(...future.oldOptions) [13:31:10.974] if (.Platform$OS.type == "windows") { [13:31:10.974] old_names <- names(...future.oldEnvVars) [13:31:10.974] envs <- base::Sys.getenv() [13:31:10.974] names <- names(envs) [13:31:10.974] common <- intersect(names, old_names) [13:31:10.974] added <- setdiff(names, old_names) [13:31:10.974] removed <- setdiff(old_names, names) [13:31:10.974] changed <- common[...future.oldEnvVars[common] != [13:31:10.974] envs[common]] [13:31:10.974] NAMES <- toupper(changed) [13:31:10.974] args <- list() [13:31:10.974] for (kk in seq_along(NAMES)) { [13:31:10.974] name <- changed[[kk]] [13:31:10.974] NAME <- NAMES[[kk]] [13:31:10.974] if (name != NAME && is.element(NAME, old_names)) [13:31:10.974] next [13:31:10.974] args[[name]] <- ...future.oldEnvVars[[name]] [13:31:10.974] } [13:31:10.974] NAMES <- toupper(added) [13:31:10.974] for (kk in seq_along(NAMES)) { [13:31:10.974] name <- added[[kk]] [13:31:10.974] NAME <- NAMES[[kk]] [13:31:10.974] if (name != NAME && is.element(NAME, old_names)) [13:31:10.974] next [13:31:10.974] args[[name]] <- "" [13:31:10.974] } [13:31:10.974] NAMES <- toupper(removed) [13:31:10.974] for (kk in seq_along(NAMES)) { [13:31:10.974] name <- removed[[kk]] [13:31:10.974] NAME <- NAMES[[kk]] [13:31:10.974] if (name != NAME && is.element(NAME, old_names)) [13:31:10.974] next [13:31:10.974] args[[name]] <- ...future.oldEnvVars[[name]] [13:31:10.974] } [13:31:10.974] if (length(args) > 0) [13:31:10.974] base::do.call(base::Sys.setenv, args = args) [13:31:10.974] args <- names <- old_names <- NAMES <- envs <- common <- added <- removed <- NULL [13:31:10.974] } [13:31:10.974] else { [13:31:10.974] base::do.call(base::Sys.setenv, args = base::as.list(...future.oldEnvVars)) [13:31:10.974] } [13:31:10.974] { [13:31:10.974] if (base::length(...future.futureOptionsAdded) > [13:31:10.974] 0L) { [13:31:10.974] opts <- base::vector("list", length = base::length(...future.futureOptionsAdded)) [13:31:10.974] base::names(opts) <- ...future.futureOptionsAdded [13:31:10.974] base::options(opts) [13:31:10.974] } [13:31:10.974] { [13:31:10.974] NULL [13:31:10.974] options(future.plan = NULL) [13:31:10.974] if (is.na(NA_character_)) [13:31:10.974] Sys.unsetenv("R_FUTURE_PLAN") [13:31:10.974] else Sys.setenv(R_FUTURE_PLAN = NA_character_) [13:31:10.974] future::plan(...future.strategy.old, .cleanup = FALSE, [13:31:10.974] .init = FALSE) [13:31:10.974] } [13:31:10.974] } [13:31:10.974] } [13:31:10.974] }) [13:31:10.974] if (TRUE) { [13:31:10.974] base::sink(type = "output", split = FALSE) [13:31:10.974] if (TRUE) { [13:31:10.974] ...future.result$stdout <- base::rawToChar(base::rawConnectionValue(...future.stdout)) [13:31:10.974] } [13:31:10.974] else { [13:31:10.974] ...future.result["stdout"] <- base::list(NULL) [13:31:10.974] } [13:31:10.974] base::close(...future.stdout) [13:31:10.974] ...future.stdout <- NULL [13:31:10.974] } [13:31:10.974] ...future.result$conditions <- ...future.conditions [13:31:10.974] ...future.result$finished <- base::Sys.time() [13:31:10.974] ...future.result [13:31:10.974] } [13:31:10.978] - Launch lazy future ... done [13:31:10.978] run() for 'MiraiFuture' ... done > print(y) [1] 1 > stopifnot(identical(y, 1)) > > ## Exception - missing global > attach_locally(globals) > f <- future({ + x <- 1:10 + sumtwo(a + b * x) + }, globals = FALSE) [13:31:10.980] getGlobalsAndPackages() ... [13:31:10.980] Not searching for globals [13:31:10.980] - globals: [0] [13:31:10.981] getGlobalsAndPackages() ... DONE [13:31:10.981] run() for 'Future' ... [13:31:10.981] - state: 'created' [13:31:10.981] - Future backend: 'FutureStrategy', 'mirai_multisession', 'mirai_cluster', 'mirai', 'multiprocess', 'future', 'function' [13:31:10.984] - Future class: 'MiraiFuture', 'MultiprocessFuture', 'Future', 'environment' [13:31:10.984] - Copy elements of temporary 'MiraiFuture' to final 'Future' object ... [13:31:10.984] - Field: 'label' [13:31:10.984] - Field: 'local' [13:31:10.984] - Field: 'owner' [13:31:10.984] - Field: 'envir' [13:31:10.985] - Field: 'packages' [13:31:10.985] - Field: 'gc' [13:31:10.985] - Field: 'conditions' [13:31:10.985] - Field: 'expr' [13:31:10.985] - Field: 'uuid' [13:31:10.985] - Field: 'seed' [13:31:10.986] - Field: 'version' [13:31:10.986] - Field: 'result' [13:31:10.986] - Field: 'asynchronous' [13:31:10.986] - Field: 'calls' [13:31:10.986] - Field: 'globals' [13:31:10.986] - Field: 'stdout' [13:31:10.987] - Field: 'earlySignal' [13:31:10.987] - Field: 'lazy' [13:31:10.987] - Field: 'state' [13:31:10.987] - Field: '.cluster' [13:31:10.987] - Copy elements of temporary 'MiraiFuture' to final 'Future' object ... done [13:31:10.987] - Launch lazy future ... [13:31:10.988] Packages needed by the future expression (n = 0): [13:31:10.988] Packages needed by future strategies (n = 0): [13:31:10.988] { [13:31:10.988] { [13:31:10.988] { [13:31:10.988] ...future.startTime <- base::Sys.time() [13:31:10.988] { [13:31:10.988] { [13:31:10.988] { [13:31:10.988] base::local({ [13:31:10.988] has_future <- base::requireNamespace("future", [13:31:10.988] quietly = TRUE) [13:31:10.988] if (has_future) { [13:31:10.988] ns <- base::getNamespace("future") [13:31:10.988] version <- ns[[".package"]][["version"]] [13:31:10.988] if (is.null(version)) [13:31:10.988] version <- utils::packageVersion("future") [13:31:10.988] } [13:31:10.988] else { [13:31:10.988] version <- NULL [13:31:10.988] } [13:31:10.988] if (!has_future || version < "1.8.0") { [13:31:10.988] info <- base::c(r_version = base::gsub("R version ", [13:31:10.988] "", base::R.version$version.string), [13:31:10.988] platform = base::sprintf("%s (%s-bit)", [13:31:10.988] base::R.version$platform, 8 * base::.Machine$sizeof.pointer), [13:31:10.988] os = base::paste(base::Sys.info()[base::c("sysname", [13:31:10.988] "release", "version")], collapse = " "), [13:31:10.988] hostname = base::Sys.info()[["nodename"]]) [13:31:10.988] info <- base::sprintf("%s: %s", base::names(info), [13:31:10.988] info) [13:31:10.988] info <- base::paste(info, collapse = "; ") [13:31:10.988] if (!has_future) { [13:31:10.988] msg <- base::sprintf("Package 'future' is not installed on worker (%s)", [13:31:10.988] info) [13:31:10.988] } [13:31:10.988] else { [13:31:10.988] msg <- base::sprintf("Package 'future' on worker (%s) must be of version >= 1.8.0: %s", [13:31:10.988] info, version) [13:31:10.988] } [13:31:10.988] base::stop(msg) [13:31:10.988] } [13:31:10.988] }) [13:31:10.988] } [13:31:10.988] ...future.strategy.old <- future::plan("list") [13:31:10.988] options(future.plan = NULL) [13:31:10.988] Sys.unsetenv("R_FUTURE_PLAN") [13:31:10.988] future::plan("default", .cleanup = FALSE, .init = FALSE) [13:31:10.988] } [13:31:10.988] ...future.workdir <- getwd() [13:31:10.988] } [13:31:10.988] ...future.oldOptions <- base::as.list(base::.Options) [13:31:10.988] ...future.oldEnvVars <- base::Sys.getenv() [13:31:10.988] } [13:31:10.988] base::options(future.startup.script = FALSE, future.globals.onMissing = NULL, [13:31:10.988] future.globals.maxSize = NULL, future.globals.method = NULL, [13:31:10.988] future.globals.onMissing = NULL, future.globals.onReference = NULL, [13:31:10.988] future.globals.resolve = NULL, future.resolve.recursive = NULL, [13:31:10.988] future.rng.onMisuse = NULL, future.rng.onMisuse.keepFuture = NULL, [13:31:10.988] future.stdout.windows.reencode = NULL, width = 80L) [13:31:10.988] ...future.futureOptionsAdded <- base::setdiff(base::names(base::.Options), [13:31:10.988] base::names(...future.oldOptions)) [13:31:10.988] } [13:31:10.988] if (FALSE) { [13:31:10.988] } [13:31:10.988] else { [13:31:10.988] if (TRUE) { [13:31:10.988] ...future.stdout <- base::rawConnection(base::raw(0L), [13:31:10.988] open = "w") [13:31:10.988] } [13:31:10.988] else { [13:31:10.988] ...future.stdout <- base::file(base::switch(.Platform$OS.type, [13:31:10.988] windows = "NUL", "/dev/null"), open = "w") [13:31:10.988] } [13:31:10.988] base::sink(...future.stdout, type = "output", split = FALSE) [13:31:10.988] base::on.exit(if (!base::is.null(...future.stdout)) { [13:31:10.988] base::sink(type = "output", split = FALSE) [13:31:10.988] base::close(...future.stdout) [13:31:10.988] }, add = TRUE) [13:31:10.988] } [13:31:10.988] ...future.frame <- base::sys.nframe() [13:31:10.988] ...future.conditions <- base::list() [13:31:10.988] ...future.rng <- base::globalenv()$.Random.seed [13:31:10.988] if (FALSE) { [13:31:10.988] ...future.globalenv.names <- c(base::names(base::.GlobalEnv), [13:31:10.988] "...future.value", "...future.globalenv.names", ".Random.seed") [13:31:10.988] } [13:31:10.988] ...future.result <- base::tryCatch({ [13:31:10.988] base::withCallingHandlers({ [13:31:10.988] ...future.value <- base::withVisible(base::local({ [13:31:10.988] x <- 1:10 [13:31:10.988] sumtwo(a + b * x) [13:31:10.988] })) [13:31:10.988] future::FutureResult(value = ...future.value$value, [13:31:10.988] visible = ...future.value$visible, rng = !identical(base::globalenv()$.Random.seed, [13:31:10.988] ...future.rng), globalenv = if (FALSE) [13:31:10.988] list(added = base::setdiff(base::names(base::.GlobalEnv), [13:31:10.988] ...future.globalenv.names)) [13:31:10.988] else NULL, started = ...future.startTime, version = "1.8") [13:31:10.988] }, condition = base::local({ [13:31:10.988] c <- base::c [13:31:10.988] inherits <- base::inherits [13:31:10.988] invokeRestart <- base::invokeRestart [13:31:10.988] length <- base::length [13:31:10.988] list <- base::list [13:31:10.988] seq.int <- base::seq.int [13:31:10.988] signalCondition <- base::signalCondition [13:31:10.988] sys.calls <- base::sys.calls [13:31:10.988] `[[` <- base::`[[` [13:31:10.988] `+` <- base::`+` [13:31:10.988] `<<-` <- base::`<<-` [13:31:10.988] sysCalls <- function(calls = sys.calls(), from = 1L) { [13:31:10.988] calls[seq.int(from = from + 12L, to = length(calls) - [13:31:10.988] 3L)] [13:31:10.988] } [13:31:10.988] function(cond) { [13:31:10.988] is_error <- inherits(cond, "error") [13:31:10.988] ignore <- !is_error && !is.null(NULL) && inherits(cond, [13:31:10.988] NULL) [13:31:10.988] if (is_error) { [13:31:10.988] sessionInformation <- function() { [13:31:10.988] list(r = base::R.Version(), locale = base::Sys.getlocale(), [13:31:10.988] rngkind = base::RNGkind(), namespaces = base::loadedNamespaces(), [13:31:10.988] search = base::search(), system = base::Sys.info()) [13:31:10.988] } [13:31:10.988] ...future.conditions[[length(...future.conditions) + [13:31:10.988] 1L]] <<- list(condition = cond, calls = c(sysCalls(from = ...future.frame), [13:31:10.988] cond$call), session = sessionInformation(), [13:31:10.988] timestamp = base::Sys.time(), signaled = 0L) [13:31:10.988] signalCondition(cond) [13:31:10.988] } [13:31:10.988] else if (!ignore && TRUE && inherits(cond, "condition")) { [13:31:10.988] signal <- FALSE && inherits(cond, character(0)) [13:31:10.988] ...future.conditions[[length(...future.conditions) + [13:31:10.988] 1L]] <<- list(condition = cond, signaled = base::as.integer(signal)) [13:31:10.988] if (FALSE && !signal) { [13:31:10.988] muffleCondition <- function (cond, pattern = "^muffle") [13:31:10.988] { [13:31:10.988] inherits <- base::inherits [13:31:10.988] invokeRestart <- base::invokeRestart [13:31:10.988] is.null <- base::is.null [13:31:10.988] muffled <- FALSE [13:31:10.988] if (inherits(cond, "message")) { [13:31:10.988] muffled <- grepl(pattern, "muffleMessage") [13:31:10.988] if (muffled) [13:31:10.988] invokeRestart("muffleMessage") [13:31:10.988] } [13:31:10.988] else if (inherits(cond, "warning")) { [13:31:10.988] muffled <- grepl(pattern, "muffleWarning") [13:31:10.988] if (muffled) [13:31:10.988] invokeRestart("muffleWarning") [13:31:10.988] } [13:31:10.988] else if (inherits(cond, "condition")) { [13:31:10.988] if (!is.null(pattern)) { [13:31:10.988] computeRestarts <- base::computeRestarts [13:31:10.988] grepl <- base::grepl [13:31:10.988] restarts <- computeRestarts(cond) [13:31:10.988] for (restart in restarts) { [13:31:10.988] name <- restart$name [13:31:10.988] if (is.null(name)) [13:31:10.988] next [13:31:10.988] if (!grepl(pattern, name)) [13:31:10.988] next [13:31:10.988] invokeRestart(restart) [13:31:10.988] muffled <- TRUE [13:31:10.988] break [13:31:10.988] } [13:31:10.988] } [13:31:10.988] } [13:31:10.988] invisible(muffled) [13:31:10.988] } [13:31:10.988] muffleCondition(cond, pattern = "^muffle") [13:31:10.988] } [13:31:10.988] } [13:31:10.988] else { [13:31:10.988] if (TRUE) { [13:31:10.988] muffleCondition <- function (cond, pattern = "^muffle") [13:31:10.988] { [13:31:10.988] inherits <- base::inherits [13:31:10.988] invokeRestart <- base::invokeRestart [13:31:10.988] is.null <- base::is.null [13:31:10.988] muffled <- FALSE [13:31:10.988] if (inherits(cond, "message")) { [13:31:10.988] muffled <- grepl(pattern, "muffleMessage") [13:31:10.988] if (muffled) [13:31:10.988] invokeRestart("muffleMessage") [13:31:10.988] } [13:31:10.988] else if (inherits(cond, "warning")) { [13:31:10.988] muffled <- grepl(pattern, "muffleWarning") [13:31:10.988] if (muffled) [13:31:10.988] invokeRestart("muffleWarning") [13:31:10.988] } [13:31:10.988] else if (inherits(cond, "condition")) { [13:31:10.988] if (!is.null(pattern)) { [13:31:10.988] computeRestarts <- base::computeRestarts [13:31:10.988] grepl <- base::grepl [13:31:10.988] restarts <- computeRestarts(cond) [13:31:10.988] for (restart in restarts) { [13:31:10.988] name <- restart$name [13:31:10.988] if (is.null(name)) [13:31:10.988] next [13:31:10.988] if (!grepl(pattern, name)) [13:31:10.988] next [13:31:10.988] invokeRestart(restart) [13:31:10.988] muffled <- TRUE [13:31:10.988] break [13:31:10.988] } [13:31:10.988] } [13:31:10.988] } [13:31:10.988] invisible(muffled) [13:31:10.988] } [13:31:10.988] muffleCondition(cond, pattern = "^muffle") [13:31:10.988] } [13:31:10.988] } [13:31:10.988] } [13:31:10.988] })) [13:31:10.988] }, error = function(ex) { [13:31:10.988] base::structure(base::list(value = NULL, visible = NULL, [13:31:10.988] conditions = ...future.conditions, rng = !identical(base::globalenv()$.Random.seed, [13:31:10.988] ...future.rng), started = ...future.startTime, [13:31:10.988] finished = Sys.time(), session_uuid = NA_character_, [13:31:10.988] version = "1.8"), class = "FutureResult") [13:31:10.988] }, finally = { [13:31:10.988] if (!identical(...future.workdir, getwd())) [13:31:10.988] setwd(...future.workdir) [13:31:10.988] { [13:31:10.988] if (identical(getOption("nwarnings"), ...future.oldOptions$nwarnings)) { [13:31:10.988] ...future.oldOptions$nwarnings <- NULL [13:31:10.988] } [13:31:10.988] base::options(...future.oldOptions) [13:31:10.988] if (.Platform$OS.type == "windows") { [13:31:10.988] old_names <- names(...future.oldEnvVars) [13:31:10.988] envs <- base::Sys.getenv() [13:31:10.988] names <- names(envs) [13:31:10.988] common <- intersect(names, old_names) [13:31:10.988] added <- setdiff(names, old_names) [13:31:10.988] removed <- setdiff(old_names, names) [13:31:10.988] changed <- common[...future.oldEnvVars[common] != [13:31:10.988] envs[common]] [13:31:10.988] NAMES <- toupper(changed) [13:31:10.988] args <- list() [13:31:10.988] for (kk in seq_along(NAMES)) { [13:31:10.988] name <- changed[[kk]] [13:31:10.988] NAME <- NAMES[[kk]] [13:31:10.988] if (name != NAME && is.element(NAME, old_names)) [13:31:10.988] next [13:31:10.988] args[[name]] <- ...future.oldEnvVars[[name]] [13:31:10.988] } [13:31:10.988] NAMES <- toupper(added) [13:31:10.988] for (kk in seq_along(NAMES)) { [13:31:10.988] name <- added[[kk]] [13:31:10.988] NAME <- NAMES[[kk]] [13:31:10.988] if (name != NAME && is.element(NAME, old_names)) [13:31:10.988] next [13:31:10.988] args[[name]] <- "" [13:31:10.988] } [13:31:10.988] NAMES <- toupper(removed) [13:31:10.988] for (kk in seq_along(NAMES)) { [13:31:10.988] name <- removed[[kk]] [13:31:10.988] NAME <- NAMES[[kk]] [13:31:10.988] if (name != NAME && is.element(NAME, old_names)) [13:31:10.988] next [13:31:10.988] args[[name]] <- ...future.oldEnvVars[[name]] [13:31:10.988] } [13:31:10.988] if (length(args) > 0) [13:31:10.988] base::do.call(base::Sys.setenv, args = args) [13:31:10.988] args <- names <- old_names <- NAMES <- envs <- common <- added <- removed <- NULL [13:31:10.988] } [13:31:10.988] else { [13:31:10.988] base::do.call(base::Sys.setenv, args = base::as.list(...future.oldEnvVars)) [13:31:10.988] } [13:31:10.988] { [13:31:10.988] if (base::length(...future.futureOptionsAdded) > [13:31:10.988] 0L) { [13:31:10.988] opts <- base::vector("list", length = base::length(...future.futureOptionsAdded)) [13:31:10.988] base::names(opts) <- ...future.futureOptionsAdded [13:31:10.988] base::options(opts) [13:31:10.988] } [13:31:10.988] { [13:31:10.988] NULL [13:31:10.988] options(future.plan = NULL) [13:31:10.988] if (is.na(NA_character_)) [13:31:10.988] Sys.unsetenv("R_FUTURE_PLAN") [13:31:10.988] else Sys.setenv(R_FUTURE_PLAN = NA_character_) [13:31:10.988] future::plan(...future.strategy.old, .cleanup = FALSE, [13:31:10.988] .init = FALSE) [13:31:10.988] } [13:31:10.988] } [13:31:10.988] } [13:31:10.988] }) [13:31:10.988] if (TRUE) { [13:31:10.988] base::sink(type = "output", split = FALSE) [13:31:10.988] if (TRUE) { [13:31:10.988] ...future.result$stdout <- base::rawToChar(base::rawConnectionValue(...future.stdout)) [13:31:10.988] } [13:31:10.988] else { [13:31:10.988] ...future.result["stdout"] <- base::list(NULL) [13:31:10.988] } [13:31:10.988] base::close(...future.stdout) [13:31:10.988] ...future.stdout <- NULL [13:31:10.988] } [13:31:10.988] ...future.result$conditions <- ...future.conditions [13:31:10.988] ...future.result$finished <- base::Sys.time() [13:31:10.988] ...future.result [13:31:10.988] } [13:31:10.992] - Launch lazy future ... done [13:31:10.992] run() for 'MiraiFuture' ... done > print(f) MiraiFuture: Label: '' Expression: { x <- 1:10 sumtwo(a + b * x) } Lazy evaluation: FALSE Asynchronous evaluation: TRUE Local evaluation: TRUE Environment: R_GlobalEnv Capture standard output: TRUE Capture condition classes: 'condition' (excluding 'nothing') Globals: Packages: L'Ecuyer-CMRG RNG seed: (seed = FALSE) [13:31:10.993] resolved() for 'MiraiFuture' ... [13:31:10.993] - state: 'running' [13:31:10.993] - run: TRUE [13:31:10.993] - result: 'NULL' [13:31:10.994] - resolved: FALSE [13:31:10.994] resolved() for 'MiraiFuture' ... done Resolved: FALSE Value: Conditions captured: Early signaling: FALSE Owner process: 37e9731f-23fc-4fe3-e1ef-fa9694a30142 Class: 'MiraiFuture', 'MultiprocessFuture', 'Future', 'environment' > rm(list = names(globals)) > y <- tryCatch(value(f), error = identity) [13:31:10.994] signalConditions() ... [13:31:10.995] - include = 'immediateCondition' [13:31:10.995] - exclude = [13:31:10.995] - resignal = FALSE [13:31:10.995] - Number of conditions: 1 [13:31:10.996] signalConditions() ... done [13:31:10.996] Future state: 'finished' [13:31:10.996] signalConditions() ... [13:31:10.996] - include = 'condition' [13:31:10.996] - exclude = 'immediateCondition' [13:31:10.996] - resignal = TRUE [13:31:10.997] - Number of conditions: 1 [13:31:10.997] - Condition #1: 'simpleError', 'error', 'condition' [13:31:10.997] signalConditions() ... done > if (!inherits(f, c("MulticoreFuture"))) { + stopifnot(inherits(y, "error")) + } > > message("*** Globals - automatic ... DONE") *** Globals - automatic ... DONE > > > message("*** Globals manually specified as named list ...") *** Globals manually specified as named list ... > > ## Make sure globals do not exist > rm(list = names(globals)) Warning in rm(list = names(globals)) : object 'a' not found Warning in rm(list = names(globals)) : object 'b' not found Warning in rm(list = names(globals)) : object 'sumtwo' not found > > f <- future({ + x <- 1:10 + sumtwo(a + b * x) + }, globals = globals) [13:31:10.998] getGlobalsAndPackages() ... [13:31:10.998] - globals passed as-list: [3] 'a', 'b', 'sumtwo' [13:31:10.999] Resolving globals: FALSE [13:31:11.000] The total size of the 3 globals is 1.20 KiB (1232 bytes) [13:31:11.000] The total size of the 3 globals exported for future expression ('{; x <- 1:10; sumtwo(a + b * x); }') is 1.20 KiB.. This exceeds the maximum allowed size of 500.00 MiB (option 'future.globals.maxSize'). There are three globals: 'sumtwo' (1.09 KiB of class 'function'), 'a' (56 bytes of class 'numeric') and 'b' (56 bytes of class 'numeric') [13:31:11.001] - globals: [3] 'a', 'b', 'sumtwo' [13:31:11.001] [13:31:11.001] getGlobalsAndPackages() ... DONE [13:31:11.001] run() for 'Future' ... [13:31:11.002] - state: 'created' [13:31:11.002] - Future backend: 'FutureStrategy', 'mirai_multisession', 'mirai_cluster', 'mirai', 'multiprocess', 'future', 'function' [13:31:11.004] - Future class: 'MiraiFuture', 'MultiprocessFuture', 'Future', 'environment' [13:31:11.004] - Copy elements of temporary 'MiraiFuture' to final 'Future' object ... [13:31:11.004] - Field: 'label' [13:31:11.004] - Field: 'local' [13:31:11.005] - Field: 'owner' [13:31:11.005] - Field: 'envir' [13:31:11.005] - Field: 'packages' [13:31:11.005] - Field: 'gc' [13:31:11.005] - Field: 'conditions' [13:31:11.006] - Field: 'expr' [13:31:11.006] - Field: 'uuid' [13:31:11.006] - Field: 'seed' [13:31:11.006] - Field: 'version' [13:31:11.006] - Field: 'result' [13:31:11.006] - Field: 'asynchronous' [13:31:11.007] - Field: 'calls' [13:31:11.007] - Field: 'globals' [13:31:11.007] - Field: 'stdout' [13:31:11.007] - Field: 'earlySignal' [13:31:11.007] - Field: 'lazy' [13:31:11.007] - Field: 'state' [13:31:11.008] - Field: '.cluster' [13:31:11.008] - Copy elements of temporary 'MiraiFuture' to final 'Future' object ... done [13:31:11.008] - Launch lazy future ... [13:31:11.008] Packages needed by the future expression (n = 0): [13:31:11.008] Packages needed by future strategies (n = 0): [13:31:11.009] { [13:31:11.009] { [13:31:11.009] { [13:31:11.009] ...future.startTime <- base::Sys.time() [13:31:11.009] { [13:31:11.009] { [13:31:11.009] { [13:31:11.009] base::local({ [13:31:11.009] has_future <- base::requireNamespace("future", [13:31:11.009] quietly = TRUE) [13:31:11.009] if (has_future) { [13:31:11.009] ns <- base::getNamespace("future") [13:31:11.009] version <- ns[[".package"]][["version"]] [13:31:11.009] if (is.null(version)) [13:31:11.009] version <- utils::packageVersion("future") [13:31:11.009] } [13:31:11.009] else { [13:31:11.009] version <- NULL [13:31:11.009] } [13:31:11.009] if (!has_future || version < "1.8.0") { [13:31:11.009] info <- base::c(r_version = base::gsub("R version ", [13:31:11.009] "", base::R.version$version.string), [13:31:11.009] platform = base::sprintf("%s (%s-bit)", [13:31:11.009] base::R.version$platform, 8 * base::.Machine$sizeof.pointer), [13:31:11.009] os = base::paste(base::Sys.info()[base::c("sysname", [13:31:11.009] "release", "version")], collapse = " "), [13:31:11.009] hostname = base::Sys.info()[["nodename"]]) [13:31:11.009] info <- base::sprintf("%s: %s", base::names(info), [13:31:11.009] info) [13:31:11.009] info <- base::paste(info, collapse = "; ") [13:31:11.009] if (!has_future) { [13:31:11.009] msg <- base::sprintf("Package 'future' is not installed on worker (%s)", [13:31:11.009] info) [13:31:11.009] } [13:31:11.009] else { [13:31:11.009] msg <- base::sprintf("Package 'future' on worker (%s) must be of version >= 1.8.0: %s", [13:31:11.009] info, version) [13:31:11.009] } [13:31:11.009] base::stop(msg) [13:31:11.009] } [13:31:11.009] }) [13:31:11.009] } [13:31:11.009] ...future.strategy.old <- future::plan("list") [13:31:11.009] options(future.plan = NULL) [13:31:11.009] Sys.unsetenv("R_FUTURE_PLAN") [13:31:11.009] future::plan("default", .cleanup = FALSE, .init = FALSE) [13:31:11.009] } [13:31:11.009] ...future.workdir <- getwd() [13:31:11.009] } [13:31:11.009] ...future.oldOptions <- base::as.list(base::.Options) [13:31:11.009] ...future.oldEnvVars <- base::Sys.getenv() [13:31:11.009] } [13:31:11.009] base::options(future.startup.script = FALSE, future.globals.onMissing = NULL, [13:31:11.009] future.globals.maxSize = NULL, future.globals.method = NULL, [13:31:11.009] future.globals.onMissing = NULL, future.globals.onReference = NULL, [13:31:11.009] future.globals.resolve = NULL, future.resolve.recursive = NULL, [13:31:11.009] future.rng.onMisuse = NULL, future.rng.onMisuse.keepFuture = NULL, [13:31:11.009] future.stdout.windows.reencode = NULL, width = 80L) [13:31:11.009] ...future.futureOptionsAdded <- base::setdiff(base::names(base::.Options), [13:31:11.009] base::names(...future.oldOptions)) [13:31:11.009] } [13:31:11.009] if (FALSE) { [13:31:11.009] } [13:31:11.009] else { [13:31:11.009] if (TRUE) { [13:31:11.009] ...future.stdout <- base::rawConnection(base::raw(0L), [13:31:11.009] open = "w") [13:31:11.009] } [13:31:11.009] else { [13:31:11.009] ...future.stdout <- base::file(base::switch(.Platform$OS.type, [13:31:11.009] windows = "NUL", "/dev/null"), open = "w") [13:31:11.009] } [13:31:11.009] base::sink(...future.stdout, type = "output", split = FALSE) [13:31:11.009] base::on.exit(if (!base::is.null(...future.stdout)) { [13:31:11.009] base::sink(type = "output", split = FALSE) [13:31:11.009] base::close(...future.stdout) [13:31:11.009] }, add = TRUE) [13:31:11.009] } [13:31:11.009] ...future.frame <- base::sys.nframe() [13:31:11.009] ...future.conditions <- base::list() [13:31:11.009] ...future.rng <- base::globalenv()$.Random.seed [13:31:11.009] if (FALSE) { [13:31:11.009] ...future.globalenv.names <- c(base::names(base::.GlobalEnv), [13:31:11.009] "...future.value", "...future.globalenv.names", ".Random.seed") [13:31:11.009] } [13:31:11.009] ...future.result <- base::tryCatch({ [13:31:11.009] base::withCallingHandlers({ [13:31:11.009] ...future.value <- base::withVisible(base::local({ [13:31:11.009] x <- 1:10 [13:31:11.009] sumtwo(a + b * x) [13:31:11.009] })) [13:31:11.009] future::FutureResult(value = ...future.value$value, [13:31:11.009] visible = ...future.value$visible, rng = !identical(base::globalenv()$.Random.seed, [13:31:11.009] ...future.rng), globalenv = if (FALSE) [13:31:11.009] list(added = base::setdiff(base::names(base::.GlobalEnv), [13:31:11.009] ...future.globalenv.names)) [13:31:11.009] else NULL, started = ...future.startTime, version = "1.8") [13:31:11.009] }, condition = base::local({ [13:31:11.009] c <- base::c [13:31:11.009] inherits <- base::inherits [13:31:11.009] invokeRestart <- base::invokeRestart [13:31:11.009] length <- base::length [13:31:11.009] list <- base::list [13:31:11.009] seq.int <- base::seq.int [13:31:11.009] signalCondition <- base::signalCondition [13:31:11.009] sys.calls <- base::sys.calls [13:31:11.009] `[[` <- base::`[[` [13:31:11.009] `+` <- base::`+` [13:31:11.009] `<<-` <- base::`<<-` [13:31:11.009] sysCalls <- function(calls = sys.calls(), from = 1L) { [13:31:11.009] calls[seq.int(from = from + 12L, to = length(calls) - [13:31:11.009] 3L)] [13:31:11.009] } [13:31:11.009] function(cond) { [13:31:11.009] is_error <- inherits(cond, "error") [13:31:11.009] ignore <- !is_error && !is.null(NULL) && inherits(cond, [13:31:11.009] NULL) [13:31:11.009] if (is_error) { [13:31:11.009] sessionInformation <- function() { [13:31:11.009] list(r = base::R.Version(), locale = base::Sys.getlocale(), [13:31:11.009] rngkind = base::RNGkind(), namespaces = base::loadedNamespaces(), [13:31:11.009] search = base::search(), system = base::Sys.info()) [13:31:11.009] } [13:31:11.009] ...future.conditions[[length(...future.conditions) + [13:31:11.009] 1L]] <<- list(condition = cond, calls = c(sysCalls(from = ...future.frame), [13:31:11.009] cond$call), session = sessionInformation(), [13:31:11.009] timestamp = base::Sys.time(), signaled = 0L) [13:31:11.009] signalCondition(cond) [13:31:11.009] } [13:31:11.009] else if (!ignore && TRUE && inherits(cond, "condition")) { [13:31:11.009] signal <- FALSE && inherits(cond, character(0)) [13:31:11.009] ...future.conditions[[length(...future.conditions) + [13:31:11.009] 1L]] <<- list(condition = cond, signaled = base::as.integer(signal)) [13:31:11.009] if (FALSE && !signal) { [13:31:11.009] muffleCondition <- function (cond, pattern = "^muffle") [13:31:11.009] { [13:31:11.009] inherits <- base::inherits [13:31:11.009] invokeRestart <- base::invokeRestart [13:31:11.009] is.null <- base::is.null [13:31:11.009] muffled <- FALSE [13:31:11.009] if (inherits(cond, "message")) { [13:31:11.009] muffled <- grepl(pattern, "muffleMessage") [13:31:11.009] if (muffled) [13:31:11.009] invokeRestart("muffleMessage") [13:31:11.009] } [13:31:11.009] else if (inherits(cond, "warning")) { [13:31:11.009] muffled <- grepl(pattern, "muffleWarning") [13:31:11.009] if (muffled) [13:31:11.009] invokeRestart("muffleWarning") [13:31:11.009] } [13:31:11.009] else if (inherits(cond, "condition")) { [13:31:11.009] if (!is.null(pattern)) { [13:31:11.009] computeRestarts <- base::computeRestarts [13:31:11.009] grepl <- base::grepl [13:31:11.009] restarts <- computeRestarts(cond) [13:31:11.009] for (restart in restarts) { [13:31:11.009] name <- restart$name [13:31:11.009] if (is.null(name)) [13:31:11.009] next [13:31:11.009] if (!grepl(pattern, name)) [13:31:11.009] next [13:31:11.009] invokeRestart(restart) [13:31:11.009] muffled <- TRUE [13:31:11.009] break [13:31:11.009] } [13:31:11.009] } [13:31:11.009] } [13:31:11.009] invisible(muffled) [13:31:11.009] } [13:31:11.009] muffleCondition(cond, pattern = "^muffle") [13:31:11.009] } [13:31:11.009] } [13:31:11.009] else { [13:31:11.009] if (TRUE) { [13:31:11.009] muffleCondition <- function (cond, pattern = "^muffle") [13:31:11.009] { [13:31:11.009] inherits <- base::inherits [13:31:11.009] invokeRestart <- base::invokeRestart [13:31:11.009] is.null <- base::is.null [13:31:11.009] muffled <- FALSE [13:31:11.009] if (inherits(cond, "message")) { [13:31:11.009] muffled <- grepl(pattern, "muffleMessage") [13:31:11.009] if (muffled) [13:31:11.009] invokeRestart("muffleMessage") [13:31:11.009] } [13:31:11.009] else if (inherits(cond, "warning")) { [13:31:11.009] muffled <- grepl(pattern, "muffleWarning") [13:31:11.009] if (muffled) [13:31:11.009] invokeRestart("muffleWarning") [13:31:11.009] } [13:31:11.009] else if (inherits(cond, "condition")) { [13:31:11.009] if (!is.null(pattern)) { [13:31:11.009] computeRestarts <- base::computeRestarts [13:31:11.009] grepl <- base::grepl [13:31:11.009] restarts <- computeRestarts(cond) [13:31:11.009] for (restart in restarts) { [13:31:11.009] name <- restart$name [13:31:11.009] if (is.null(name)) [13:31:11.009] next [13:31:11.009] if (!grepl(pattern, name)) [13:31:11.009] next [13:31:11.009] invokeRestart(restart) [13:31:11.009] muffled <- TRUE [13:31:11.009] break [13:31:11.009] } [13:31:11.009] } [13:31:11.009] } [13:31:11.009] invisible(muffled) [13:31:11.009] } [13:31:11.009] muffleCondition(cond, pattern = "^muffle") [13:31:11.009] } [13:31:11.009] } [13:31:11.009] } [13:31:11.009] })) [13:31:11.009] }, error = function(ex) { [13:31:11.009] base::structure(base::list(value = NULL, visible = NULL, [13:31:11.009] conditions = ...future.conditions, rng = !identical(base::globalenv()$.Random.seed, [13:31:11.009] ...future.rng), started = ...future.startTime, [13:31:11.009] finished = Sys.time(), session_uuid = NA_character_, [13:31:11.009] version = "1.8"), class = "FutureResult") [13:31:11.009] }, finally = { [13:31:11.009] if (!identical(...future.workdir, getwd())) [13:31:11.009] setwd(...future.workdir) [13:31:11.009] { [13:31:11.009] if (identical(getOption("nwarnings"), ...future.oldOptions$nwarnings)) { [13:31:11.009] ...future.oldOptions$nwarnings <- NULL [13:31:11.009] } [13:31:11.009] base::options(...future.oldOptions) [13:31:11.009] if (.Platform$OS.type == "windows") { [13:31:11.009] old_names <- names(...future.oldEnvVars) [13:31:11.009] envs <- base::Sys.getenv() [13:31:11.009] names <- names(envs) [13:31:11.009] common <- intersect(names, old_names) [13:31:11.009] added <- setdiff(names, old_names) [13:31:11.009] removed <- setdiff(old_names, names) [13:31:11.009] changed <- common[...future.oldEnvVars[common] != [13:31:11.009] envs[common]] [13:31:11.009] NAMES <- toupper(changed) [13:31:11.009] args <- list() [13:31:11.009] for (kk in seq_along(NAMES)) { [13:31:11.009] name <- changed[[kk]] [13:31:11.009] NAME <- NAMES[[kk]] [13:31:11.009] if (name != NAME && is.element(NAME, old_names)) [13:31:11.009] next [13:31:11.009] args[[name]] <- ...future.oldEnvVars[[name]] [13:31:11.009] } [13:31:11.009] NAMES <- toupper(added) [13:31:11.009] for (kk in seq_along(NAMES)) { [13:31:11.009] name <- added[[kk]] [13:31:11.009] NAME <- NAMES[[kk]] [13:31:11.009] if (name != NAME && is.element(NAME, old_names)) [13:31:11.009] next [13:31:11.009] args[[name]] <- "" [13:31:11.009] } [13:31:11.009] NAMES <- toupper(removed) [13:31:11.009] for (kk in seq_along(NAMES)) { [13:31:11.009] name <- removed[[kk]] [13:31:11.009] NAME <- NAMES[[kk]] [13:31:11.009] if (name != NAME && is.element(NAME, old_names)) [13:31:11.009] next [13:31:11.009] args[[name]] <- ...future.oldEnvVars[[name]] [13:31:11.009] } [13:31:11.009] if (length(args) > 0) [13:31:11.009] base::do.call(base::Sys.setenv, args = args) [13:31:11.009] args <- names <- old_names <- NAMES <- envs <- common <- added <- removed <- NULL [13:31:11.009] } [13:31:11.009] else { [13:31:11.009] base::do.call(base::Sys.setenv, args = base::as.list(...future.oldEnvVars)) [13:31:11.009] } [13:31:11.009] { [13:31:11.009] if (base::length(...future.futureOptionsAdded) > [13:31:11.009] 0L) { [13:31:11.009] opts <- base::vector("list", length = base::length(...future.futureOptionsAdded)) [13:31:11.009] base::names(opts) <- ...future.futureOptionsAdded [13:31:11.009] base::options(opts) [13:31:11.009] } [13:31:11.009] { [13:31:11.009] NULL [13:31:11.009] options(future.plan = NULL) [13:31:11.009] if (is.na(NA_character_)) [13:31:11.009] Sys.unsetenv("R_FUTURE_PLAN") [13:31:11.009] else Sys.setenv(R_FUTURE_PLAN = NA_character_) [13:31:11.009] future::plan(...future.strategy.old, .cleanup = FALSE, [13:31:11.009] .init = FALSE) [13:31:11.009] } [13:31:11.009] } [13:31:11.009] } [13:31:11.009] }) [13:31:11.009] if (TRUE) { [13:31:11.009] base::sink(type = "output", split = FALSE) [13:31:11.009] if (TRUE) { [13:31:11.009] ...future.result$stdout <- base::rawToChar(base::rawConnectionValue(...future.stdout)) [13:31:11.009] } [13:31:11.009] else { [13:31:11.009] ...future.result["stdout"] <- base::list(NULL) [13:31:11.009] } [13:31:11.009] base::close(...future.stdout) [13:31:11.009] ...future.stdout <- NULL [13:31:11.009] } [13:31:11.009] ...future.result$conditions <- ...future.conditions [13:31:11.009] ...future.result$finished <- base::Sys.time() [13:31:11.009] ...future.result [13:31:11.009] } [13:31:11.013] - Launch lazy future ... done [13:31:11.013] run() for 'MiraiFuture' ... done > print(f) MiraiFuture: Label: '' Expression: { x <- 1:10 sumtwo(a + b * x) } Lazy evaluation: FALSE Asynchronous evaluation: TRUE Local evaluation: TRUE Environment: R_GlobalEnv Capture standard output: TRUE Capture condition classes: 'condition' (excluding 'nothing') Globals: 3 objects totaling 1.20 KiB (numeric 'a' of 56 bytes, numeric 'b' of 56 bytes, function 'sumtwo' of 1.09 KiB) Packages: L'Ecuyer-CMRG RNG seed: (seed = FALSE) [13:31:11.014] resolved() for 'MiraiFuture' ... [13:31:11.014] - state: 'running' [13:31:11.014] - run: TRUE [13:31:11.014] - result: 'NULL' [13:31:11.014] - resolved: FALSE [13:31:11.014] resolved() for 'MiraiFuture' ... done Resolved: TRUE Value: Conditions captured: Early signaling: FALSE Owner process: 37e9731f-23fc-4fe3-e1ef-fa9694a30142 Class: 'MiraiFuture', 'MultiprocessFuture', 'Future', 'environment' > v <- value(f) > print(v) [1] 8 > stopifnot(all.equal(v, v0)) > > y %<-% { + x <- 1:10 + sumtwo(a + b * x) + } %globals% globals [13:31:11.015] getGlobalsAndPackages() ... [13:31:11.015] - globals passed as-list: [3] 'a', 'b', 'sumtwo' [13:31:11.016] Resolving globals: FALSE [13:31:11.016] The total size of the 3 globals is 1.20 KiB (1232 bytes) [13:31:11.017] The total size of the 3 globals exported for future expression ('{; x <- 1:10; sumtwo(a + b * x); }') is 1.20 KiB.. This exceeds the maximum allowed size of 500.00 MiB (option 'future.globals.maxSize'). There are three globals: 'sumtwo' (1.09 KiB of class 'function'), 'a' (56 bytes of class 'numeric') and 'b' (56 bytes of class 'numeric') [13:31:11.017] - globals: [3] 'a', 'b', 'sumtwo' [13:31:11.017] [13:31:11.017] getGlobalsAndPackages() ... DONE [13:31:11.017] run() for 'Future' ... [13:31:11.018] - state: 'created' [13:31:11.018] - Future backend: 'FutureStrategy', 'mirai_multisession', 'mirai_cluster', 'mirai', 'multiprocess', 'future', 'function' [13:31:11.020] - Future class: 'MiraiFuture', 'MultiprocessFuture', 'Future', 'environment' [13:31:11.020] - Copy elements of temporary 'MiraiFuture' to final 'Future' object ... [13:31:11.020] - Field: 'label' [13:31:11.021] - Field: 'local' [13:31:11.021] - Field: 'owner' [13:31:11.021] - Field: 'envir' [13:31:11.021] - Field: 'packages' [13:31:11.021] - Field: 'gc' [13:31:11.021] - Field: 'conditions' [13:31:11.022] - Field: 'expr' [13:31:11.022] - Field: 'uuid' [13:31:11.022] - Field: 'seed' [13:31:11.022] - Field: 'version' [13:31:11.022] - Field: 'result' [13:31:11.022] - Field: 'asynchronous' [13:31:11.023] - Field: 'calls' [13:31:11.023] - Field: 'globals' [13:31:11.023] - Field: 'stdout' [13:31:11.023] - Field: 'earlySignal' [13:31:11.023] - Field: 'lazy' [13:31:11.023] - Field: 'state' [13:31:11.024] - Field: '.cluster' [13:31:11.024] - Copy elements of temporary 'MiraiFuture' to final 'Future' object ... done [13:31:11.024] - Launch lazy future ... [13:31:11.024] Packages needed by the future expression (n = 0): [13:31:11.024] Packages needed by future strategies (n = 0): [13:31:11.025] { [13:31:11.025] { [13:31:11.025] { [13:31:11.025] ...future.startTime <- base::Sys.time() [13:31:11.025] { [13:31:11.025] { [13:31:11.025] { [13:31:11.025] base::local({ [13:31:11.025] has_future <- base::requireNamespace("future", [13:31:11.025] quietly = TRUE) [13:31:11.025] if (has_future) { [13:31:11.025] ns <- base::getNamespace("future") [13:31:11.025] version <- ns[[".package"]][["version"]] [13:31:11.025] if (is.null(version)) [13:31:11.025] version <- utils::packageVersion("future") [13:31:11.025] } [13:31:11.025] else { [13:31:11.025] version <- NULL [13:31:11.025] } [13:31:11.025] if (!has_future || version < "1.8.0") { [13:31:11.025] info <- base::c(r_version = base::gsub("R version ", [13:31:11.025] "", base::R.version$version.string), [13:31:11.025] platform = base::sprintf("%s (%s-bit)", [13:31:11.025] base::R.version$platform, 8 * base::.Machine$sizeof.pointer), [13:31:11.025] os = base::paste(base::Sys.info()[base::c("sysname", [13:31:11.025] "release", "version")], collapse = " "), [13:31:11.025] hostname = base::Sys.info()[["nodename"]]) [13:31:11.025] info <- base::sprintf("%s: %s", base::names(info), [13:31:11.025] info) [13:31:11.025] info <- base::paste(info, collapse = "; ") [13:31:11.025] if (!has_future) { [13:31:11.025] msg <- base::sprintf("Package 'future' is not installed on worker (%s)", [13:31:11.025] info) [13:31:11.025] } [13:31:11.025] else { [13:31:11.025] msg <- base::sprintf("Package 'future' on worker (%s) must be of version >= 1.8.0: %s", [13:31:11.025] info, version) [13:31:11.025] } [13:31:11.025] base::stop(msg) [13:31:11.025] } [13:31:11.025] }) [13:31:11.025] } [13:31:11.025] ...future.strategy.old <- future::plan("list") [13:31:11.025] options(future.plan = NULL) [13:31:11.025] Sys.unsetenv("R_FUTURE_PLAN") [13:31:11.025] future::plan("default", .cleanup = FALSE, .init = FALSE) [13:31:11.025] } [13:31:11.025] ...future.workdir <- getwd() [13:31:11.025] } [13:31:11.025] ...future.oldOptions <- base::as.list(base::.Options) [13:31:11.025] ...future.oldEnvVars <- base::Sys.getenv() [13:31:11.025] } [13:31:11.025] base::options(future.startup.script = FALSE, future.globals.onMissing = NULL, [13:31:11.025] future.globals.maxSize = NULL, future.globals.method = NULL, [13:31:11.025] future.globals.onMissing = NULL, future.globals.onReference = NULL, [13:31:11.025] future.globals.resolve = NULL, future.resolve.recursive = NULL, [13:31:11.025] future.rng.onMisuse = NULL, future.rng.onMisuse.keepFuture = NULL, [13:31:11.025] future.stdout.windows.reencode = NULL, width = 80L) [13:31:11.025] ...future.futureOptionsAdded <- base::setdiff(base::names(base::.Options), [13:31:11.025] base::names(...future.oldOptions)) [13:31:11.025] } [13:31:11.025] if (FALSE) { [13:31:11.025] } [13:31:11.025] else { [13:31:11.025] if (TRUE) { [13:31:11.025] ...future.stdout <- base::rawConnection(base::raw(0L), [13:31:11.025] open = "w") [13:31:11.025] } [13:31:11.025] else { [13:31:11.025] ...future.stdout <- base::file(base::switch(.Platform$OS.type, [13:31:11.025] windows = "NUL", "/dev/null"), open = "w") [13:31:11.025] } [13:31:11.025] base::sink(...future.stdout, type = "output", split = FALSE) [13:31:11.025] base::on.exit(if (!base::is.null(...future.stdout)) { [13:31:11.025] base::sink(type = "output", split = FALSE) [13:31:11.025] base::close(...future.stdout) [13:31:11.025] }, add = TRUE) [13:31:11.025] } [13:31:11.025] ...future.frame <- base::sys.nframe() [13:31:11.025] ...future.conditions <- base::list() [13:31:11.025] ...future.rng <- base::globalenv()$.Random.seed [13:31:11.025] if (FALSE) { [13:31:11.025] ...future.globalenv.names <- c(base::names(base::.GlobalEnv), [13:31:11.025] "...future.value", "...future.globalenv.names", ".Random.seed") [13:31:11.025] } [13:31:11.025] ...future.result <- base::tryCatch({ [13:31:11.025] base::withCallingHandlers({ [13:31:11.025] ...future.value <- base::withVisible(base::local({ [13:31:11.025] x <- 1:10 [13:31:11.025] sumtwo(a + b * x) [13:31:11.025] })) [13:31:11.025] future::FutureResult(value = ...future.value$value, [13:31:11.025] visible = ...future.value$visible, rng = !identical(base::globalenv()$.Random.seed, [13:31:11.025] ...future.rng), globalenv = if (FALSE) [13:31:11.025] list(added = base::setdiff(base::names(base::.GlobalEnv), [13:31:11.025] ...future.globalenv.names)) [13:31:11.025] else NULL, started = ...future.startTime, version = "1.8") [13:31:11.025] }, condition = base::local({ [13:31:11.025] c <- base::c [13:31:11.025] inherits <- base::inherits [13:31:11.025] invokeRestart <- base::invokeRestart [13:31:11.025] length <- base::length [13:31:11.025] list <- base::list [13:31:11.025] seq.int <- base::seq.int [13:31:11.025] signalCondition <- base::signalCondition [13:31:11.025] sys.calls <- base::sys.calls [13:31:11.025] `[[` <- base::`[[` [13:31:11.025] `+` <- base::`+` [13:31:11.025] `<<-` <- base::`<<-` [13:31:11.025] sysCalls <- function(calls = sys.calls(), from = 1L) { [13:31:11.025] calls[seq.int(from = from + 12L, to = length(calls) - [13:31:11.025] 3L)] [13:31:11.025] } [13:31:11.025] function(cond) { [13:31:11.025] is_error <- inherits(cond, "error") [13:31:11.025] ignore <- !is_error && !is.null(NULL) && inherits(cond, [13:31:11.025] NULL) [13:31:11.025] if (is_error) { [13:31:11.025] sessionInformation <- function() { [13:31:11.025] list(r = base::R.Version(), locale = base::Sys.getlocale(), [13:31:11.025] rngkind = base::RNGkind(), namespaces = base::loadedNamespaces(), [13:31:11.025] search = base::search(), system = base::Sys.info()) [13:31:11.025] } [13:31:11.025] ...future.conditions[[length(...future.conditions) + [13:31:11.025] 1L]] <<- list(condition = cond, calls = c(sysCalls(from = ...future.frame), [13:31:11.025] cond$call), session = sessionInformation(), [13:31:11.025] timestamp = base::Sys.time(), signaled = 0L) [13:31:11.025] signalCondition(cond) [13:31:11.025] } [13:31:11.025] else if (!ignore && TRUE && inherits(cond, "condition")) { [13:31:11.025] signal <- FALSE && inherits(cond, character(0)) [13:31:11.025] ...future.conditions[[length(...future.conditions) + [13:31:11.025] 1L]] <<- list(condition = cond, signaled = base::as.integer(signal)) [13:31:11.025] if (FALSE && !signal) { [13:31:11.025] muffleCondition <- function (cond, pattern = "^muffle") [13:31:11.025] { [13:31:11.025] inherits <- base::inherits [13:31:11.025] invokeRestart <- base::invokeRestart [13:31:11.025] is.null <- base::is.null [13:31:11.025] muffled <- FALSE [13:31:11.025] if (inherits(cond, "message")) { [13:31:11.025] muffled <- grepl(pattern, "muffleMessage") [13:31:11.025] if (muffled) [13:31:11.025] invokeRestart("muffleMessage") [13:31:11.025] } [13:31:11.025] else if (inherits(cond, "warning")) { [13:31:11.025] muffled <- grepl(pattern, "muffleWarning") [13:31:11.025] if (muffled) [13:31:11.025] invokeRestart("muffleWarning") [13:31:11.025] } [13:31:11.025] else if (inherits(cond, "condition")) { [13:31:11.025] if (!is.null(pattern)) { [13:31:11.025] computeRestarts <- base::computeRestarts [13:31:11.025] grepl <- base::grepl [13:31:11.025] restarts <- computeRestarts(cond) [13:31:11.025] for (restart in restarts) { [13:31:11.025] name <- restart$name [13:31:11.025] if (is.null(name)) [13:31:11.025] next [13:31:11.025] if (!grepl(pattern, name)) [13:31:11.025] next [13:31:11.025] invokeRestart(restart) [13:31:11.025] muffled <- TRUE [13:31:11.025] break [13:31:11.025] } [13:31:11.025] } [13:31:11.025] } [13:31:11.025] invisible(muffled) [13:31:11.025] } [13:31:11.025] muffleCondition(cond, pattern = "^muffle") [13:31:11.025] } [13:31:11.025] } [13:31:11.025] else { [13:31:11.025] if (TRUE) { [13:31:11.025] muffleCondition <- function (cond, pattern = "^muffle") [13:31:11.025] { [13:31:11.025] inherits <- base::inherits [13:31:11.025] invokeRestart <- base::invokeRestart [13:31:11.025] is.null <- base::is.null [13:31:11.025] muffled <- FALSE [13:31:11.025] if (inherits(cond, "message")) { [13:31:11.025] muffled <- grepl(pattern, "muffleMessage") [13:31:11.025] if (muffled) [13:31:11.025] invokeRestart("muffleMessage") [13:31:11.025] } [13:31:11.025] else if (inherits(cond, "warning")) { [13:31:11.025] muffled <- grepl(pattern, "muffleWarning") [13:31:11.025] if (muffled) [13:31:11.025] invokeRestart("muffleWarning") [13:31:11.025] } [13:31:11.025] else if (inherits(cond, "condition")) { [13:31:11.025] if (!is.null(pattern)) { [13:31:11.025] computeRestarts <- base::computeRestarts [13:31:11.025] grepl <- base::grepl [13:31:11.025] restarts <- computeRestarts(cond) [13:31:11.025] for (restart in restarts) { [13:31:11.025] name <- restart$name [13:31:11.025] if (is.null(name)) [13:31:11.025] next [13:31:11.025] if (!grepl(pattern, name)) [13:31:11.025] next [13:31:11.025] invokeRestart(restart) [13:31:11.025] muffled <- TRUE [13:31:11.025] break [13:31:11.025] } [13:31:11.025] } [13:31:11.025] } [13:31:11.025] invisible(muffled) [13:31:11.025] } [13:31:11.025] muffleCondition(cond, pattern = "^muffle") [13:31:11.025] } [13:31:11.025] } [13:31:11.025] } [13:31:11.025] })) [13:31:11.025] }, error = function(ex) { [13:31:11.025] base::structure(base::list(value = NULL, visible = NULL, [13:31:11.025] conditions = ...future.conditions, rng = !identical(base::globalenv()$.Random.seed, [13:31:11.025] ...future.rng), started = ...future.startTime, [13:31:11.025] finished = Sys.time(), session_uuid = NA_character_, [13:31:11.025] version = "1.8"), class = "FutureResult") [13:31:11.025] }, finally = { [13:31:11.025] if (!identical(...future.workdir, getwd())) [13:31:11.025] setwd(...future.workdir) [13:31:11.025] { [13:31:11.025] if (identical(getOption("nwarnings"), ...future.oldOptions$nwarnings)) { [13:31:11.025] ...future.oldOptions$nwarnings <- NULL [13:31:11.025] } [13:31:11.025] base::options(...future.oldOptions) [13:31:11.025] if (.Platform$OS.type == "windows") { [13:31:11.025] old_names <- names(...future.oldEnvVars) [13:31:11.025] envs <- base::Sys.getenv() [13:31:11.025] names <- names(envs) [13:31:11.025] common <- intersect(names, old_names) [13:31:11.025] added <- setdiff(names, old_names) [13:31:11.025] removed <- setdiff(old_names, names) [13:31:11.025] changed <- common[...future.oldEnvVars[common] != [13:31:11.025] envs[common]] [13:31:11.025] NAMES <- toupper(changed) [13:31:11.025] args <- list() [13:31:11.025] for (kk in seq_along(NAMES)) { [13:31:11.025] name <- changed[[kk]] [13:31:11.025] NAME <- NAMES[[kk]] [13:31:11.025] if (name != NAME && is.element(NAME, old_names)) [13:31:11.025] next [13:31:11.025] args[[name]] <- ...future.oldEnvVars[[name]] [13:31:11.025] } [13:31:11.025] NAMES <- toupper(added) [13:31:11.025] for (kk in seq_along(NAMES)) { [13:31:11.025] name <- added[[kk]] [13:31:11.025] NAME <- NAMES[[kk]] [13:31:11.025] if (name != NAME && is.element(NAME, old_names)) [13:31:11.025] next [13:31:11.025] args[[name]] <- "" [13:31:11.025] } [13:31:11.025] NAMES <- toupper(removed) [13:31:11.025] for (kk in seq_along(NAMES)) { [13:31:11.025] name <- removed[[kk]] [13:31:11.025] NAME <- NAMES[[kk]] [13:31:11.025] if (name != NAME && is.element(NAME, old_names)) [13:31:11.025] next [13:31:11.025] args[[name]] <- ...future.oldEnvVars[[name]] [13:31:11.025] } [13:31:11.025] if (length(args) > 0) [13:31:11.025] base::do.call(base::Sys.setenv, args = args) [13:31:11.025] args <- names <- old_names <- NAMES <- envs <- common <- added <- removed <- NULL [13:31:11.025] } [13:31:11.025] else { [13:31:11.025] base::do.call(base::Sys.setenv, args = base::as.list(...future.oldEnvVars)) [13:31:11.025] } [13:31:11.025] { [13:31:11.025] if (base::length(...future.futureOptionsAdded) > [13:31:11.025] 0L) { [13:31:11.025] opts <- base::vector("list", length = base::length(...future.futureOptionsAdded)) [13:31:11.025] base::names(opts) <- ...future.futureOptionsAdded [13:31:11.025] base::options(opts) [13:31:11.025] } [13:31:11.025] { [13:31:11.025] NULL [13:31:11.025] options(future.plan = NULL) [13:31:11.025] if (is.na(NA_character_)) [13:31:11.025] Sys.unsetenv("R_FUTURE_PLAN") [13:31:11.025] else Sys.setenv(R_FUTURE_PLAN = NA_character_) [13:31:11.025] future::plan(...future.strategy.old, .cleanup = FALSE, [13:31:11.025] .init = FALSE) [13:31:11.025] } [13:31:11.025] } [13:31:11.025] } [13:31:11.025] }) [13:31:11.025] if (TRUE) { [13:31:11.025] base::sink(type = "output", split = FALSE) [13:31:11.025] if (TRUE) { [13:31:11.025] ...future.result$stdout <- base::rawToChar(base::rawConnectionValue(...future.stdout)) [13:31:11.025] } [13:31:11.025] else { [13:31:11.025] ...future.result["stdout"] <- base::list(NULL) [13:31:11.025] } [13:31:11.025] base::close(...future.stdout) [13:31:11.025] ...future.stdout <- NULL [13:31:11.025] } [13:31:11.025] ...future.result$conditions <- ...future.conditions [13:31:11.025] ...future.result$finished <- base::Sys.time() [13:31:11.025] ...future.result [13:31:11.025] } [13:31:11.029] - Launch lazy future ... done [13:31:11.029] run() for 'MiraiFuture' ... done > print(y) [1] 8 > stopifnot(all.equal(y, v0)) > > message("*** Globals manually specified as named list ... DONE") *** Globals manually specified as named list ... DONE > > > message("*** Globals manually specified by their names ...") *** Globals manually specified by their names ... > > attach_locally(globals) > f <- future({ + x <- 1:10 + sumtwo(a + b * x) + }, globals = c("a", "b", "sumtwo")) [13:31:11.031] getGlobalsAndPackages() ... [13:31:11.031] Retrieving globals ... [13:31:11.031] - globals retrieved: [3] 'a', 'b', 'sumtwo' [13:31:11.032] Retrieving globals ... DONE [13:31:11.032] Resolving globals: FALSE [13:31:11.032] The total size of the 3 globals is 1.20 KiB (1232 bytes) [13:31:11.033] The total size of the 3 globals exported for future expression ('{; x <- 1:10; sumtwo(a + b * x); }') is 1.20 KiB.. This exceeds the maximum allowed size of 500.00 MiB (option 'future.globals.maxSize'). There are three globals: 'sumtwo' (1.09 KiB of class 'function'), 'a' (56 bytes of class 'numeric') and 'b' (56 bytes of class 'numeric') [13:31:11.033] - globals: [3] 'a', 'b', 'sumtwo' [13:31:11.033] [13:31:11.033] getGlobalsAndPackages() ... DONE [13:31:11.034] run() for 'Future' ... [13:31:11.034] - state: 'created' [13:31:11.034] - Future backend: 'FutureStrategy', 'mirai_multisession', 'mirai_cluster', 'mirai', 'multiprocess', 'future', 'function' [13:31:11.036] - Future class: 'MiraiFuture', 'MultiprocessFuture', 'Future', 'environment' [13:31:11.036] - Copy elements of temporary 'MiraiFuture' to final 'Future' object ... [13:31:11.037] - Field: 'label' [13:31:11.037] - Field: 'local' [13:31:11.037] - Field: 'owner' [13:31:11.037] - Field: 'envir' [13:31:11.037] - Field: 'packages' [13:31:11.037] - Field: 'gc' [13:31:11.038] - Field: 'conditions' [13:31:11.038] - Field: 'expr' [13:31:11.038] - Field: 'uuid' [13:31:11.038] - Field: 'seed' [13:31:11.038] - Field: 'version' [13:31:11.038] - Field: 'result' [13:31:11.039] - Field: 'asynchronous' [13:31:11.040] - Field: 'calls' [13:31:11.040] - Field: 'globals' [13:31:11.040] - Field: 'stdout' [13:31:11.040] - Field: 'earlySignal' [13:31:11.041] - Field: 'lazy' [13:31:11.041] - Field: 'state' [13:31:11.041] - Field: '.cluster' [13:31:11.041] - Copy elements of temporary 'MiraiFuture' to final 'Future' object ... done [13:31:11.041] - Launch lazy future ... [13:31:11.041] Packages needed by the future expression (n = 0): [13:31:11.042] Packages needed by future strategies (n = 0): [13:31:11.042] { [13:31:11.042] { [13:31:11.042] { [13:31:11.042] ...future.startTime <- base::Sys.time() [13:31:11.042] { [13:31:11.042] { [13:31:11.042] { [13:31:11.042] base::local({ [13:31:11.042] has_future <- base::requireNamespace("future", [13:31:11.042] quietly = TRUE) [13:31:11.042] if (has_future) { [13:31:11.042] ns <- base::getNamespace("future") [13:31:11.042] version <- ns[[".package"]][["version"]] [13:31:11.042] if (is.null(version)) [13:31:11.042] version <- utils::packageVersion("future") [13:31:11.042] } [13:31:11.042] else { [13:31:11.042] version <- NULL [13:31:11.042] } [13:31:11.042] if (!has_future || version < "1.8.0") { [13:31:11.042] info <- base::c(r_version = base::gsub("R version ", [13:31:11.042] "", base::R.version$version.string), [13:31:11.042] platform = base::sprintf("%s (%s-bit)", [13:31:11.042] base::R.version$platform, 8 * base::.Machine$sizeof.pointer), [13:31:11.042] os = base::paste(base::Sys.info()[base::c("sysname", [13:31:11.042] "release", "version")], collapse = " "), [13:31:11.042] hostname = base::Sys.info()[["nodename"]]) [13:31:11.042] info <- base::sprintf("%s: %s", base::names(info), [13:31:11.042] info) [13:31:11.042] info <- base::paste(info, collapse = "; ") [13:31:11.042] if (!has_future) { [13:31:11.042] msg <- base::sprintf("Package 'future' is not installed on worker (%s)", [13:31:11.042] info) [13:31:11.042] } [13:31:11.042] else { [13:31:11.042] msg <- base::sprintf("Package 'future' on worker (%s) must be of version >= 1.8.0: %s", [13:31:11.042] info, version) [13:31:11.042] } [13:31:11.042] base::stop(msg) [13:31:11.042] } [13:31:11.042] }) [13:31:11.042] } [13:31:11.042] ...future.strategy.old <- future::plan("list") [13:31:11.042] options(future.plan = NULL) [13:31:11.042] Sys.unsetenv("R_FUTURE_PLAN") [13:31:11.042] future::plan("default", .cleanup = FALSE, .init = FALSE) [13:31:11.042] } [13:31:11.042] ...future.workdir <- getwd() [13:31:11.042] } [13:31:11.042] ...future.oldOptions <- base::as.list(base::.Options) [13:31:11.042] ...future.oldEnvVars <- base::Sys.getenv() [13:31:11.042] } [13:31:11.042] base::options(future.startup.script = FALSE, future.globals.onMissing = NULL, [13:31:11.042] future.globals.maxSize = NULL, future.globals.method = NULL, [13:31:11.042] future.globals.onMissing = NULL, future.globals.onReference = NULL, [13:31:11.042] future.globals.resolve = NULL, future.resolve.recursive = NULL, [13:31:11.042] future.rng.onMisuse = NULL, future.rng.onMisuse.keepFuture = NULL, [13:31:11.042] future.stdout.windows.reencode = NULL, width = 80L) [13:31:11.042] ...future.futureOptionsAdded <- base::setdiff(base::names(base::.Options), [13:31:11.042] base::names(...future.oldOptions)) [13:31:11.042] } [13:31:11.042] if (FALSE) { [13:31:11.042] } [13:31:11.042] else { [13:31:11.042] if (TRUE) { [13:31:11.042] ...future.stdout <- base::rawConnection(base::raw(0L), [13:31:11.042] open = "w") [13:31:11.042] } [13:31:11.042] else { [13:31:11.042] ...future.stdout <- base::file(base::switch(.Platform$OS.type, [13:31:11.042] windows = "NUL", "/dev/null"), open = "w") [13:31:11.042] } [13:31:11.042] base::sink(...future.stdout, type = "output", split = FALSE) [13:31:11.042] base::on.exit(if (!base::is.null(...future.stdout)) { [13:31:11.042] base::sink(type = "output", split = FALSE) [13:31:11.042] base::close(...future.stdout) [13:31:11.042] }, add = TRUE) [13:31:11.042] } [13:31:11.042] ...future.frame <- base::sys.nframe() [13:31:11.042] ...future.conditions <- base::list() [13:31:11.042] ...future.rng <- base::globalenv()$.Random.seed [13:31:11.042] if (FALSE) { [13:31:11.042] ...future.globalenv.names <- c(base::names(base::.GlobalEnv), [13:31:11.042] "...future.value", "...future.globalenv.names", ".Random.seed") [13:31:11.042] } [13:31:11.042] ...future.result <- base::tryCatch({ [13:31:11.042] base::withCallingHandlers({ [13:31:11.042] ...future.value <- base::withVisible(base::local({ [13:31:11.042] x <- 1:10 [13:31:11.042] sumtwo(a + b * x) [13:31:11.042] })) [13:31:11.042] future::FutureResult(value = ...future.value$value, [13:31:11.042] visible = ...future.value$visible, rng = !identical(base::globalenv()$.Random.seed, [13:31:11.042] ...future.rng), globalenv = if (FALSE) [13:31:11.042] list(added = base::setdiff(base::names(base::.GlobalEnv), [13:31:11.042] ...future.globalenv.names)) [13:31:11.042] else NULL, started = ...future.startTime, version = "1.8") [13:31:11.042] }, condition = base::local({ [13:31:11.042] c <- base::c [13:31:11.042] inherits <- base::inherits [13:31:11.042] invokeRestart <- base::invokeRestart [13:31:11.042] length <- base::length [13:31:11.042] list <- base::list [13:31:11.042] seq.int <- base::seq.int [13:31:11.042] signalCondition <- base::signalCondition [13:31:11.042] sys.calls <- base::sys.calls [13:31:11.042] `[[` <- base::`[[` [13:31:11.042] `+` <- base::`+` [13:31:11.042] `<<-` <- base::`<<-` [13:31:11.042] sysCalls <- function(calls = sys.calls(), from = 1L) { [13:31:11.042] calls[seq.int(from = from + 12L, to = length(calls) - [13:31:11.042] 3L)] [13:31:11.042] } [13:31:11.042] function(cond) { [13:31:11.042] is_error <- inherits(cond, "error") [13:31:11.042] ignore <- !is_error && !is.null(NULL) && inherits(cond, [13:31:11.042] NULL) [13:31:11.042] if (is_error) { [13:31:11.042] sessionInformation <- function() { [13:31:11.042] list(r = base::R.Version(), locale = base::Sys.getlocale(), [13:31:11.042] rngkind = base::RNGkind(), namespaces = base::loadedNamespaces(), [13:31:11.042] search = base::search(), system = base::Sys.info()) [13:31:11.042] } [13:31:11.042] ...future.conditions[[length(...future.conditions) + [13:31:11.042] 1L]] <<- list(condition = cond, calls = c(sysCalls(from = ...future.frame), [13:31:11.042] cond$call), session = sessionInformation(), [13:31:11.042] timestamp = base::Sys.time(), signaled = 0L) [13:31:11.042] signalCondition(cond) [13:31:11.042] } [13:31:11.042] else if (!ignore && TRUE && inherits(cond, "condition")) { [13:31:11.042] signal <- FALSE && inherits(cond, character(0)) [13:31:11.042] ...future.conditions[[length(...future.conditions) + [13:31:11.042] 1L]] <<- list(condition = cond, signaled = base::as.integer(signal)) [13:31:11.042] if (FALSE && !signal) { [13:31:11.042] muffleCondition <- function (cond, pattern = "^muffle") [13:31:11.042] { [13:31:11.042] inherits <- base::inherits [13:31:11.042] invokeRestart <- base::invokeRestart [13:31:11.042] is.null <- base::is.null [13:31:11.042] muffled <- FALSE [13:31:11.042] if (inherits(cond, "message")) { [13:31:11.042] muffled <- grepl(pattern, "muffleMessage") [13:31:11.042] if (muffled) [13:31:11.042] invokeRestart("muffleMessage") [13:31:11.042] } [13:31:11.042] else if (inherits(cond, "warning")) { [13:31:11.042] muffled <- grepl(pattern, "muffleWarning") [13:31:11.042] if (muffled) [13:31:11.042] invokeRestart("muffleWarning") [13:31:11.042] } [13:31:11.042] else if (inherits(cond, "condition")) { [13:31:11.042] if (!is.null(pattern)) { [13:31:11.042] computeRestarts <- base::computeRestarts [13:31:11.042] grepl <- base::grepl [13:31:11.042] restarts <- computeRestarts(cond) [13:31:11.042] for (restart in restarts) { [13:31:11.042] name <- restart$name [13:31:11.042] if (is.null(name)) [13:31:11.042] next [13:31:11.042] if (!grepl(pattern, name)) [13:31:11.042] next [13:31:11.042] invokeRestart(restart) [13:31:11.042] muffled <- TRUE [13:31:11.042] break [13:31:11.042] } [13:31:11.042] } [13:31:11.042] } [13:31:11.042] invisible(muffled) [13:31:11.042] } [13:31:11.042] muffleCondition(cond, pattern = "^muffle") [13:31:11.042] } [13:31:11.042] } [13:31:11.042] else { [13:31:11.042] if (TRUE) { [13:31:11.042] muffleCondition <- function (cond, pattern = "^muffle") [13:31:11.042] { [13:31:11.042] inherits <- base::inherits [13:31:11.042] invokeRestart <- base::invokeRestart [13:31:11.042] is.null <- base::is.null [13:31:11.042] muffled <- FALSE [13:31:11.042] if (inherits(cond, "message")) { [13:31:11.042] muffled <- grepl(pattern, "muffleMessage") [13:31:11.042] if (muffled) [13:31:11.042] invokeRestart("muffleMessage") [13:31:11.042] } [13:31:11.042] else if (inherits(cond, "warning")) { [13:31:11.042] muffled <- grepl(pattern, "muffleWarning") [13:31:11.042] if (muffled) [13:31:11.042] invokeRestart("muffleWarning") [13:31:11.042] } [13:31:11.042] else if (inherits(cond, "condition")) { [13:31:11.042] if (!is.null(pattern)) { [13:31:11.042] computeRestarts <- base::computeRestarts [13:31:11.042] grepl <- base::grepl [13:31:11.042] restarts <- computeRestarts(cond) [13:31:11.042] for (restart in restarts) { [13:31:11.042] name <- restart$name [13:31:11.042] if (is.null(name)) [13:31:11.042] next [13:31:11.042] if (!grepl(pattern, name)) [13:31:11.042] next [13:31:11.042] invokeRestart(restart) [13:31:11.042] muffled <- TRUE [13:31:11.042] break [13:31:11.042] } [13:31:11.042] } [13:31:11.042] } [13:31:11.042] invisible(muffled) [13:31:11.042] } [13:31:11.042] muffleCondition(cond, pattern = "^muffle") [13:31:11.042] } [13:31:11.042] } [13:31:11.042] } [13:31:11.042] })) [13:31:11.042] }, error = function(ex) { [13:31:11.042] base::structure(base::list(value = NULL, visible = NULL, [13:31:11.042] conditions = ...future.conditions, rng = !identical(base::globalenv()$.Random.seed, [13:31:11.042] ...future.rng), started = ...future.startTime, [13:31:11.042] finished = Sys.time(), session_uuid = NA_character_, [13:31:11.042] version = "1.8"), class = "FutureResult") [13:31:11.042] }, finally = { [13:31:11.042] if (!identical(...future.workdir, getwd())) [13:31:11.042] setwd(...future.workdir) [13:31:11.042] { [13:31:11.042] if (identical(getOption("nwarnings"), ...future.oldOptions$nwarnings)) { [13:31:11.042] ...future.oldOptions$nwarnings <- NULL [13:31:11.042] } [13:31:11.042] base::options(...future.oldOptions) [13:31:11.042] if (.Platform$OS.type == "windows") { [13:31:11.042] old_names <- names(...future.oldEnvVars) [13:31:11.042] envs <- base::Sys.getenv() [13:31:11.042] names <- names(envs) [13:31:11.042] common <- intersect(names, old_names) [13:31:11.042] added <- setdiff(names, old_names) [13:31:11.042] removed <- setdiff(old_names, names) [13:31:11.042] changed <- common[...future.oldEnvVars[common] != [13:31:11.042] envs[common]] [13:31:11.042] NAMES <- toupper(changed) [13:31:11.042] args <- list() [13:31:11.042] for (kk in seq_along(NAMES)) { [13:31:11.042] name <- changed[[kk]] [13:31:11.042] NAME <- NAMES[[kk]] [13:31:11.042] if (name != NAME && is.element(NAME, old_names)) [13:31:11.042] next [13:31:11.042] args[[name]] <- ...future.oldEnvVars[[name]] [13:31:11.042] } [13:31:11.042] NAMES <- toupper(added) [13:31:11.042] for (kk in seq_along(NAMES)) { [13:31:11.042] name <- added[[kk]] [13:31:11.042] NAME <- NAMES[[kk]] [13:31:11.042] if (name != NAME && is.element(NAME, old_names)) [13:31:11.042] next [13:31:11.042] args[[name]] <- "" [13:31:11.042] } [13:31:11.042] NAMES <- toupper(removed) [13:31:11.042] for (kk in seq_along(NAMES)) { [13:31:11.042] name <- removed[[kk]] [13:31:11.042] NAME <- NAMES[[kk]] [13:31:11.042] if (name != NAME && is.element(NAME, old_names)) [13:31:11.042] next [13:31:11.042] args[[name]] <- ...future.oldEnvVars[[name]] [13:31:11.042] } [13:31:11.042] if (length(args) > 0) [13:31:11.042] base::do.call(base::Sys.setenv, args = args) [13:31:11.042] args <- names <- old_names <- NAMES <- envs <- common <- added <- removed <- NULL [13:31:11.042] } [13:31:11.042] else { [13:31:11.042] base::do.call(base::Sys.setenv, args = base::as.list(...future.oldEnvVars)) [13:31:11.042] } [13:31:11.042] { [13:31:11.042] if (base::length(...future.futureOptionsAdded) > [13:31:11.042] 0L) { [13:31:11.042] opts <- base::vector("list", length = base::length(...future.futureOptionsAdded)) [13:31:11.042] base::names(opts) <- ...future.futureOptionsAdded [13:31:11.042] base::options(opts) [13:31:11.042] } [13:31:11.042] { [13:31:11.042] NULL [13:31:11.042] options(future.plan = NULL) [13:31:11.042] if (is.na(NA_character_)) [13:31:11.042] Sys.unsetenv("R_FUTURE_PLAN") [13:31:11.042] else Sys.setenv(R_FUTURE_PLAN = NA_character_) [13:31:11.042] future::plan(...future.strategy.old, .cleanup = FALSE, [13:31:11.042] .init = FALSE) [13:31:11.042] } [13:31:11.042] } [13:31:11.042] } [13:31:11.042] }) [13:31:11.042] if (TRUE) { [13:31:11.042] base::sink(type = "output", split = FALSE) [13:31:11.042] if (TRUE) { [13:31:11.042] ...future.result$stdout <- base::rawToChar(base::rawConnectionValue(...future.stdout)) [13:31:11.042] } [13:31:11.042] else { [13:31:11.042] ...future.result["stdout"] <- base::list(NULL) [13:31:11.042] } [13:31:11.042] base::close(...future.stdout) [13:31:11.042] ...future.stdout <- NULL [13:31:11.042] } [13:31:11.042] ...future.result$conditions <- ...future.conditions [13:31:11.042] ...future.result$finished <- base::Sys.time() [13:31:11.042] ...future.result [13:31:11.042] } [13:31:11.046] - Launch lazy future ... done [13:31:11.046] run() for 'MiraiFuture' ... done > print(f) MiraiFuture: Label: '' Expression: { x <- 1:10 sumtwo(a + b * x) } Lazy evaluation: FALSE Asynchronous evaluation: TRUE Local evaluation: TRUE Environment: R_GlobalEnv Capture standard output: TRUE Capture condition classes: 'condition' (excluding 'nothing') Globals: 3 objects totaling 1.20 KiB (numeric 'a' of 56 bytes, numeric 'b' of 56 bytes, function 'sumtwo' of 1.09 KiB) Packages: L'Ecuyer-CMRG RNG seed: (seed = FALSE) [13:31:11.047] resolved() for 'MiraiFuture' ... [13:31:11.047] - state: 'running' [13:31:11.047] - run: TRUE [13:31:11.047] - result: 'NULL' [13:31:11.048] - resolved: FALSE [13:31:11.048] resolved() for 'MiraiFuture' ... done Resolved: TRUE Value: Conditions captured: Early signaling: FALSE Owner process: 37e9731f-23fc-4fe3-e1ef-fa9694a30142 Class: 'MiraiFuture', 'MultiprocessFuture', 'Future', 'environment' > rm(list = names(globals)) > v <- value(f) > print(v) [1] 8 > stopifnot(all.equal(v, v0)) > > attach_locally(globals) > y %<-% { + x <- 1:10 + sumtwo(a + b * x) + } %globals% c("a", "b", "sumtwo") [13:31:11.049] getGlobalsAndPackages() ... [13:31:11.049] Retrieving globals ... [13:31:11.049] - globals retrieved: [3] 'a', 'b', 'sumtwo' [13:31:11.049] Retrieving globals ... DONE [13:31:11.049] Resolving globals: FALSE [13:31:11.050] The total size of the 3 globals is 1.20 KiB (1232 bytes) [13:31:11.050] The total size of the 3 globals exported for future expression ('{; x <- 1:10; sumtwo(a + b * x); }') is 1.20 KiB.. This exceeds the maximum allowed size of 500.00 MiB (option 'future.globals.maxSize'). There are three globals: 'sumtwo' (1.09 KiB of class 'function'), 'a' (56 bytes of class 'numeric') and 'b' (56 bytes of class 'numeric') [13:31:11.050] - globals: [3] 'a', 'b', 'sumtwo' [13:31:11.051] [13:31:11.051] getGlobalsAndPackages() ... DONE [13:31:11.051] run() for 'Future' ... [13:31:11.051] - state: 'created' [13:31:11.052] - Future backend: 'FutureStrategy', 'mirai_multisession', 'mirai_cluster', 'mirai', 'multiprocess', 'future', 'function' [13:31:11.054] - Future class: 'MiraiFuture', 'MultiprocessFuture', 'Future', 'environment' [13:31:11.054] - Copy elements of temporary 'MiraiFuture' to final 'Future' object ... [13:31:11.054] - Field: 'label' [13:31:11.054] - Field: 'local' [13:31:11.054] - Field: 'owner' [13:31:11.055] - Field: 'envir' [13:31:11.055] - Field: 'packages' [13:31:11.055] - Field: 'gc' [13:31:11.055] - Field: 'conditions' [13:31:11.055] - Field: 'expr' [13:31:11.055] - Field: 'uuid' [13:31:11.056] - Field: 'seed' [13:31:11.056] - Field: 'version' [13:31:11.056] - Field: 'result' [13:31:11.056] - Field: 'asynchronous' [13:31:11.056] - Field: 'calls' [13:31:11.056] - Field: 'globals' [13:31:11.057] - Field: 'stdout' [13:31:11.057] - Field: 'earlySignal' [13:31:11.057] - Field: 'lazy' [13:31:11.057] - Field: 'state' [13:31:11.057] - Field: '.cluster' [13:31:11.057] - Copy elements of temporary 'MiraiFuture' to final 'Future' object ... done [13:31:11.058] - Launch lazy future ... [13:31:11.058] Packages needed by the future expression (n = 0): [13:31:11.058] Packages needed by future strategies (n = 0): [13:31:11.058] { [13:31:11.058] { [13:31:11.058] { [13:31:11.058] ...future.startTime <- base::Sys.time() [13:31:11.058] { [13:31:11.058] { [13:31:11.058] { [13:31:11.058] base::local({ [13:31:11.058] has_future <- base::requireNamespace("future", [13:31:11.058] quietly = TRUE) [13:31:11.058] if (has_future) { [13:31:11.058] ns <- base::getNamespace("future") [13:31:11.058] version <- ns[[".package"]][["version"]] [13:31:11.058] if (is.null(version)) [13:31:11.058] version <- utils::packageVersion("future") [13:31:11.058] } [13:31:11.058] else { [13:31:11.058] version <- NULL [13:31:11.058] } [13:31:11.058] if (!has_future || version < "1.8.0") { [13:31:11.058] info <- base::c(r_version = base::gsub("R version ", [13:31:11.058] "", base::R.version$version.string), [13:31:11.058] platform = base::sprintf("%s (%s-bit)", [13:31:11.058] base::R.version$platform, 8 * base::.Machine$sizeof.pointer), [13:31:11.058] os = base::paste(base::Sys.info()[base::c("sysname", [13:31:11.058] "release", "version")], collapse = " "), [13:31:11.058] hostname = base::Sys.info()[["nodename"]]) [13:31:11.058] info <- base::sprintf("%s: %s", base::names(info), [13:31:11.058] info) [13:31:11.058] info <- base::paste(info, collapse = "; ") [13:31:11.058] if (!has_future) { [13:31:11.058] msg <- base::sprintf("Package 'future' is not installed on worker (%s)", [13:31:11.058] info) [13:31:11.058] } [13:31:11.058] else { [13:31:11.058] msg <- base::sprintf("Package 'future' on worker (%s) must be of version >= 1.8.0: %s", [13:31:11.058] info, version) [13:31:11.058] } [13:31:11.058] base::stop(msg) [13:31:11.058] } [13:31:11.058] }) [13:31:11.058] } [13:31:11.058] ...future.strategy.old <- future::plan("list") [13:31:11.058] options(future.plan = NULL) [13:31:11.058] Sys.unsetenv("R_FUTURE_PLAN") [13:31:11.058] future::plan("default", .cleanup = FALSE, .init = FALSE) [13:31:11.058] } [13:31:11.058] ...future.workdir <- getwd() [13:31:11.058] } [13:31:11.058] ...future.oldOptions <- base::as.list(base::.Options) [13:31:11.058] ...future.oldEnvVars <- base::Sys.getenv() [13:31:11.058] } [13:31:11.058] base::options(future.startup.script = FALSE, future.globals.onMissing = NULL, [13:31:11.058] future.globals.maxSize = NULL, future.globals.method = NULL, [13:31:11.058] future.globals.onMissing = NULL, future.globals.onReference = NULL, [13:31:11.058] future.globals.resolve = NULL, future.resolve.recursive = NULL, [13:31:11.058] future.rng.onMisuse = NULL, future.rng.onMisuse.keepFuture = NULL, [13:31:11.058] future.stdout.windows.reencode = NULL, width = 80L) [13:31:11.058] ...future.futureOptionsAdded <- base::setdiff(base::names(base::.Options), [13:31:11.058] base::names(...future.oldOptions)) [13:31:11.058] } [13:31:11.058] if (FALSE) { [13:31:11.058] } [13:31:11.058] else { [13:31:11.058] if (TRUE) { [13:31:11.058] ...future.stdout <- base::rawConnection(base::raw(0L), [13:31:11.058] open = "w") [13:31:11.058] } [13:31:11.058] else { [13:31:11.058] ...future.stdout <- base::file(base::switch(.Platform$OS.type, [13:31:11.058] windows = "NUL", "/dev/null"), open = "w") [13:31:11.058] } [13:31:11.058] base::sink(...future.stdout, type = "output", split = FALSE) [13:31:11.058] base::on.exit(if (!base::is.null(...future.stdout)) { [13:31:11.058] base::sink(type = "output", split = FALSE) [13:31:11.058] base::close(...future.stdout) [13:31:11.058] }, add = TRUE) [13:31:11.058] } [13:31:11.058] ...future.frame <- base::sys.nframe() [13:31:11.058] ...future.conditions <- base::list() [13:31:11.058] ...future.rng <- base::globalenv()$.Random.seed [13:31:11.058] if (FALSE) { [13:31:11.058] ...future.globalenv.names <- c(base::names(base::.GlobalEnv), [13:31:11.058] "...future.value", "...future.globalenv.names", ".Random.seed") [13:31:11.058] } [13:31:11.058] ...future.result <- base::tryCatch({ [13:31:11.058] base::withCallingHandlers({ [13:31:11.058] ...future.value <- base::withVisible(base::local({ [13:31:11.058] x <- 1:10 [13:31:11.058] sumtwo(a + b * x) [13:31:11.058] })) [13:31:11.058] future::FutureResult(value = ...future.value$value, [13:31:11.058] visible = ...future.value$visible, rng = !identical(base::globalenv()$.Random.seed, [13:31:11.058] ...future.rng), globalenv = if (FALSE) [13:31:11.058] list(added = base::setdiff(base::names(base::.GlobalEnv), [13:31:11.058] ...future.globalenv.names)) [13:31:11.058] else NULL, started = ...future.startTime, version = "1.8") [13:31:11.058] }, condition = base::local({ [13:31:11.058] c <- base::c [13:31:11.058] inherits <- base::inherits [13:31:11.058] invokeRestart <- base::invokeRestart [13:31:11.058] length <- base::length [13:31:11.058] list <- base::list [13:31:11.058] seq.int <- base::seq.int [13:31:11.058] signalCondition <- base::signalCondition [13:31:11.058] sys.calls <- base::sys.calls [13:31:11.058] `[[` <- base::`[[` [13:31:11.058] `+` <- base::`+` [13:31:11.058] `<<-` <- base::`<<-` [13:31:11.058] sysCalls <- function(calls = sys.calls(), from = 1L) { [13:31:11.058] calls[seq.int(from = from + 12L, to = length(calls) - [13:31:11.058] 3L)] [13:31:11.058] } [13:31:11.058] function(cond) { [13:31:11.058] is_error <- inherits(cond, "error") [13:31:11.058] ignore <- !is_error && !is.null(NULL) && inherits(cond, [13:31:11.058] NULL) [13:31:11.058] if (is_error) { [13:31:11.058] sessionInformation <- function() { [13:31:11.058] list(r = base::R.Version(), locale = base::Sys.getlocale(), [13:31:11.058] rngkind = base::RNGkind(), namespaces = base::loadedNamespaces(), [13:31:11.058] search = base::search(), system = base::Sys.info()) [13:31:11.058] } [13:31:11.058] ...future.conditions[[length(...future.conditions) + [13:31:11.058] 1L]] <<- list(condition = cond, calls = c(sysCalls(from = ...future.frame), [13:31:11.058] cond$call), session = sessionInformation(), [13:31:11.058] timestamp = base::Sys.time(), signaled = 0L) [13:31:11.058] signalCondition(cond) [13:31:11.058] } [13:31:11.058] else if (!ignore && TRUE && inherits(cond, "condition")) { [13:31:11.058] signal <- FALSE && inherits(cond, character(0)) [13:31:11.058] ...future.conditions[[length(...future.conditions) + [13:31:11.058] 1L]] <<- list(condition = cond, signaled = base::as.integer(signal)) [13:31:11.058] if (FALSE && !signal) { [13:31:11.058] muffleCondition <- function (cond, pattern = "^muffle") [13:31:11.058] { [13:31:11.058] inherits <- base::inherits [13:31:11.058] invokeRestart <- base::invokeRestart [13:31:11.058] is.null <- base::is.null [13:31:11.058] muffled <- FALSE [13:31:11.058] if (inherits(cond, "message")) { [13:31:11.058] muffled <- grepl(pattern, "muffleMessage") [13:31:11.058] if (muffled) [13:31:11.058] invokeRestart("muffleMessage") [13:31:11.058] } [13:31:11.058] else if (inherits(cond, "warning")) { [13:31:11.058] muffled <- grepl(pattern, "muffleWarning") [13:31:11.058] if (muffled) [13:31:11.058] invokeRestart("muffleWarning") [13:31:11.058] } [13:31:11.058] else if (inherits(cond, "condition")) { [13:31:11.058] if (!is.null(pattern)) { [13:31:11.058] computeRestarts <- base::computeRestarts [13:31:11.058] grepl <- base::grepl [13:31:11.058] restarts <- computeRestarts(cond) [13:31:11.058] for (restart in restarts) { [13:31:11.058] name <- restart$name [13:31:11.058] if (is.null(name)) [13:31:11.058] next [13:31:11.058] if (!grepl(pattern, name)) [13:31:11.058] next [13:31:11.058] invokeRestart(restart) [13:31:11.058] muffled <- TRUE [13:31:11.058] break [13:31:11.058] } [13:31:11.058] } [13:31:11.058] } [13:31:11.058] invisible(muffled) [13:31:11.058] } [13:31:11.058] muffleCondition(cond, pattern = "^muffle") [13:31:11.058] } [13:31:11.058] } [13:31:11.058] else { [13:31:11.058] if (TRUE) { [13:31:11.058] muffleCondition <- function (cond, pattern = "^muffle") [13:31:11.058] { [13:31:11.058] inherits <- base::inherits [13:31:11.058] invokeRestart <- base::invokeRestart [13:31:11.058] is.null <- base::is.null [13:31:11.058] muffled <- FALSE [13:31:11.058] if (inherits(cond, "message")) { [13:31:11.058] muffled <- grepl(pattern, "muffleMessage") [13:31:11.058] if (muffled) [13:31:11.058] invokeRestart("muffleMessage") [13:31:11.058] } [13:31:11.058] else if (inherits(cond, "warning")) { [13:31:11.058] muffled <- grepl(pattern, "muffleWarning") [13:31:11.058] if (muffled) [13:31:11.058] invokeRestart("muffleWarning") [13:31:11.058] } [13:31:11.058] else if (inherits(cond, "condition")) { [13:31:11.058] if (!is.null(pattern)) { [13:31:11.058] computeRestarts <- base::computeRestarts [13:31:11.058] grepl <- base::grepl [13:31:11.058] restarts <- computeRestarts(cond) [13:31:11.058] for (restart in restarts) { [13:31:11.058] name <- restart$name [13:31:11.058] if (is.null(name)) [13:31:11.058] next [13:31:11.058] if (!grepl(pattern, name)) [13:31:11.058] next [13:31:11.058] invokeRestart(restart) [13:31:11.058] muffled <- TRUE [13:31:11.058] break [13:31:11.058] } [13:31:11.058] } [13:31:11.058] } [13:31:11.058] invisible(muffled) [13:31:11.058] } [13:31:11.058] muffleCondition(cond, pattern = "^muffle") [13:31:11.058] } [13:31:11.058] } [13:31:11.058] } [13:31:11.058] })) [13:31:11.058] }, error = function(ex) { [13:31:11.058] base::structure(base::list(value = NULL, visible = NULL, [13:31:11.058] conditions = ...future.conditions, rng = !identical(base::globalenv()$.Random.seed, [13:31:11.058] ...future.rng), started = ...future.startTime, [13:31:11.058] finished = Sys.time(), session_uuid = NA_character_, [13:31:11.058] version = "1.8"), class = "FutureResult") [13:31:11.058] }, finally = { [13:31:11.058] if (!identical(...future.workdir, getwd())) [13:31:11.058] setwd(...future.workdir) [13:31:11.058] { [13:31:11.058] if (identical(getOption("nwarnings"), ...future.oldOptions$nwarnings)) { [13:31:11.058] ...future.oldOptions$nwarnings <- NULL [13:31:11.058] } [13:31:11.058] base::options(...future.oldOptions) [13:31:11.058] if (.Platform$OS.type == "windows") { [13:31:11.058] old_names <- names(...future.oldEnvVars) [13:31:11.058] envs <- base::Sys.getenv() [13:31:11.058] names <- names(envs) [13:31:11.058] common <- intersect(names, old_names) [13:31:11.058] added <- setdiff(names, old_names) [13:31:11.058] removed <- setdiff(old_names, names) [13:31:11.058] changed <- common[...future.oldEnvVars[common] != [13:31:11.058] envs[common]] [13:31:11.058] NAMES <- toupper(changed) [13:31:11.058] args <- list() [13:31:11.058] for (kk in seq_along(NAMES)) { [13:31:11.058] name <- changed[[kk]] [13:31:11.058] NAME <- NAMES[[kk]] [13:31:11.058] if (name != NAME && is.element(NAME, old_names)) [13:31:11.058] next [13:31:11.058] args[[name]] <- ...future.oldEnvVars[[name]] [13:31:11.058] } [13:31:11.058] NAMES <- toupper(added) [13:31:11.058] for (kk in seq_along(NAMES)) { [13:31:11.058] name <- added[[kk]] [13:31:11.058] NAME <- NAMES[[kk]] [13:31:11.058] if (name != NAME && is.element(NAME, old_names)) [13:31:11.058] next [13:31:11.058] args[[name]] <- "" [13:31:11.058] } [13:31:11.058] NAMES <- toupper(removed) [13:31:11.058] for (kk in seq_along(NAMES)) { [13:31:11.058] name <- removed[[kk]] [13:31:11.058] NAME <- NAMES[[kk]] [13:31:11.058] if (name != NAME && is.element(NAME, old_names)) [13:31:11.058] next [13:31:11.058] args[[name]] <- ...future.oldEnvVars[[name]] [13:31:11.058] } [13:31:11.058] if (length(args) > 0) [13:31:11.058] base::do.call(base::Sys.setenv, args = args) [13:31:11.058] args <- names <- old_names <- NAMES <- envs <- common <- added <- removed <- NULL [13:31:11.058] } [13:31:11.058] else { [13:31:11.058] base::do.call(base::Sys.setenv, args = base::as.list(...future.oldEnvVars)) [13:31:11.058] } [13:31:11.058] { [13:31:11.058] if (base::length(...future.futureOptionsAdded) > [13:31:11.058] 0L) { [13:31:11.058] opts <- base::vector("list", length = base::length(...future.futureOptionsAdded)) [13:31:11.058] base::names(opts) <- ...future.futureOptionsAdded [13:31:11.058] base::options(opts) [13:31:11.058] } [13:31:11.058] { [13:31:11.058] NULL [13:31:11.058] options(future.plan = NULL) [13:31:11.058] if (is.na(NA_character_)) [13:31:11.058] Sys.unsetenv("R_FUTURE_PLAN") [13:31:11.058] else Sys.setenv(R_FUTURE_PLAN = NA_character_) [13:31:11.058] future::plan(...future.strategy.old, .cleanup = FALSE, [13:31:11.058] .init = FALSE) [13:31:11.058] } [13:31:11.058] } [13:31:11.058] } [13:31:11.058] }) [13:31:11.058] if (TRUE) { [13:31:11.058] base::sink(type = "output", split = FALSE) [13:31:11.058] if (TRUE) { [13:31:11.058] ...future.result$stdout <- base::rawToChar(base::rawConnectionValue(...future.stdout)) [13:31:11.058] } [13:31:11.058] else { [13:31:11.058] ...future.result["stdout"] <- base::list(NULL) [13:31:11.058] } [13:31:11.058] base::close(...future.stdout) [13:31:11.058] ...future.stdout <- NULL [13:31:11.058] } [13:31:11.058] ...future.result$conditions <- ...future.conditions [13:31:11.058] ...future.result$finished <- base::Sys.time() [13:31:11.058] ...future.result [13:31:11.058] } [13:31:11.062] - Launch lazy future ... done [13:31:11.062] run() for 'MiraiFuture' ... done > rm(list = names(globals)) > print(y) [1] 8 > stopifnot(all.equal(y, v0)) > > message("*** Globals manually specified by their names ... DONE") *** Globals manually specified by their names ... DONE > > > message("*** Globals - manually ... DONE") *** Globals - manually ... DONE > > source("incl/end.R") > > proc.time() user system elapsed 0.42 0.07 1.00