R Under development (unstable) (2024-05-14 r86553 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 [10:56:23.896] plan(): Setting new future strategy stack: [10:56:23.897] List of future strategies: [10:56:23.897] 1. mirai_multisession: [10:56:23.897] - args: function (expr, substitute = TRUE, envir = parent.frame(), ..., workers = availableCores()) [10:56:23.897] - tweaked: FALSE [10:56:23.897] - call: future::plan(future.mirai::mirai_multisession) [10:56:23.909] plan(): plan_init() of 'mirai_multisession', 'mirai_cluster', 'mirai', 'multiprocess', 'future', 'function' ... [10:56:23.909] < mirai | $data > [10:56:23.914] getGlobalsAndPackages() ... [10:56:23.915] Not searching for globals [10:56:23.915] - globals: [0] [10:56:23.915] getGlobalsAndPackages() ... DONE [10:56:23.916] getGlobalsAndPackages() ... [10:56:23.916] [10:56:23.916] - globals: [0] [10:56:23.916] getGlobalsAndPackages() ... DONE [10:56:24.258] Packages needed by the future expression (n = 0): [10:56:24.258] Packages needed by future strategies (n = 0): [10:56:24.259] { [10:56:24.259] { [10:56:24.259] { [10:56:24.259] ...future.startTime <- base::Sys.time() [10:56:24.259] { [10:56:24.259] { [10:56:24.259] { [10:56:24.259] base::local({ [10:56:24.259] has_future <- base::requireNamespace("future", [10:56:24.259] quietly = TRUE) [10:56:24.259] if (has_future) { [10:56:24.259] ns <- base::getNamespace("future") [10:56:24.259] version <- ns[[".package"]][["version"]] [10:56:24.259] if (is.null(version)) [10:56:24.259] version <- utils::packageVersion("future") [10:56:24.259] } [10:56:24.259] else { [10:56:24.259] version <- NULL [10:56:24.259] } [10:56:24.259] if (!has_future || version < "1.8.0") { [10:56:24.259] info <- base::c(r_version = base::gsub("R version ", [10:56:24.259] "", base::R.version$version.string), [10:56:24.259] platform = base::sprintf("%s (%s-bit)", [10:56:24.259] base::R.version$platform, 8 * base::.Machine$sizeof.pointer), [10:56:24.259] os = base::paste(base::Sys.info()[base::c("sysname", [10:56:24.259] "release", "version")], collapse = " "), [10:56:24.259] hostname = base::Sys.info()[["nodename"]]) [10:56:24.259] info <- base::sprintf("%s: %s", base::names(info), [10:56:24.259] info) [10:56:24.259] info <- base::paste(info, collapse = "; ") [10:56:24.259] if (!has_future) { [10:56:24.259] msg <- base::sprintf("Package 'future' is not installed on worker (%s)", [10:56:24.259] info) [10:56:24.259] } [10:56:24.259] else { [10:56:24.259] msg <- base::sprintf("Package 'future' on worker (%s) must be of version >= 1.8.0: %s", [10:56:24.259] info, version) [10:56:24.259] } [10:56:24.259] base::stop(msg) [10:56:24.259] } [10:56:24.259] }) [10:56:24.259] } [10:56:24.259] ...future.strategy.old <- future::plan("list") [10:56:24.259] options(future.plan = NULL) [10:56:24.259] Sys.unsetenv("R_FUTURE_PLAN") [10:56:24.259] future::plan("default", .cleanup = FALSE, .init = FALSE) [10:56:24.259] } [10:56:24.259] ...future.workdir <- getwd() [10:56:24.259] } [10:56:24.259] ...future.oldOptions <- base::as.list(base::.Options) [10:56:24.259] ...future.oldEnvVars <- base::Sys.getenv() [10:56:24.259] } [10:56:24.259] base::options(future.startup.script = FALSE, future.globals.onMissing = NULL, [10:56:24.259] future.globals.maxSize = NULL, future.globals.method = NULL, [10:56:24.259] future.globals.onMissing = NULL, future.globals.onReference = NULL, [10:56:24.259] future.globals.resolve = NULL, future.resolve.recursive = NULL, [10:56:24.259] future.rng.onMisuse = NULL, future.rng.onMisuse.keepFuture = NULL, [10:56:24.259] future.stdout.windows.reencode = NULL, width = 80L) [10:56:24.259] ...future.futureOptionsAdded <- base::setdiff(base::names(base::.Options), [10:56:24.259] base::names(...future.oldOptions)) [10:56:24.259] } [10:56:24.259] if (FALSE) { [10:56:24.259] } [10:56:24.259] else { [10:56:24.259] if (TRUE) { [10:56:24.259] ...future.stdout <- base::rawConnection(base::raw(0L), [10:56:24.259] open = "w") [10:56:24.259] } [10:56:24.259] else { [10:56:24.259] ...future.stdout <- base::file(base::switch(.Platform$OS.type, [10:56:24.259] windows = "NUL", "/dev/null"), open = "w") [10:56:24.259] } [10:56:24.259] base::sink(...future.stdout, type = "output", split = FALSE) [10:56:24.259] base::on.exit(if (!base::is.null(...future.stdout)) { [10:56:24.259] base::sink(type = "output", split = FALSE) [10:56:24.259] base::close(...future.stdout) [10:56:24.259] }, add = TRUE) [10:56:24.259] } [10:56:24.259] ...future.frame <- base::sys.nframe() [10:56:24.259] ...future.conditions <- base::list() [10:56:24.259] ...future.rng <- base::globalenv()$.Random.seed [10:56:24.259] if (FALSE) { [10:56:24.259] ...future.globalenv.names <- c(base::names(base::.GlobalEnv), [10:56:24.259] "...future.value", "...future.globalenv.names", ".Random.seed") [10:56:24.259] } [10:56:24.259] ...future.result <- base::tryCatch({ [10:56:24.259] base::withCallingHandlers({ [10:56:24.259] ...future.value <- base::withVisible(base::local(NA)) [10:56:24.259] future::FutureResult(value = ...future.value$value, [10:56:24.259] visible = ...future.value$visible, rng = !identical(base::globalenv()$.Random.seed, [10:56:24.259] ...future.rng), globalenv = if (FALSE) [10:56:24.259] list(added = base::setdiff(base::names(base::.GlobalEnv), [10:56:24.259] ...future.globalenv.names)) [10:56:24.259] else NULL, started = ...future.startTime, version = "1.8") [10:56:24.259] }, condition = base::local({ [10:56:24.259] c <- base::c [10:56:24.259] inherits <- base::inherits [10:56:24.259] invokeRestart <- base::invokeRestart [10:56:24.259] length <- base::length [10:56:24.259] list <- base::list [10:56:24.259] seq.int <- base::seq.int [10:56:24.259] signalCondition <- base::signalCondition [10:56:24.259] sys.calls <- base::sys.calls [10:56:24.259] `[[` <- base::`[[` [10:56:24.259] `+` <- base::`+` [10:56:24.259] `<<-` <- base::`<<-` [10:56:24.259] sysCalls <- function(calls = sys.calls(), from = 1L) { [10:56:24.259] calls[seq.int(from = from + 12L, to = length(calls) - [10:56:24.259] 3L)] [10:56:24.259] } [10:56:24.259] function(cond) { [10:56:24.259] is_error <- inherits(cond, "error") [10:56:24.259] ignore <- !is_error && !is.null(NULL) && inherits(cond, [10:56:24.259] NULL) [10:56:24.259] if (is_error) { [10:56:24.259] sessionInformation <- function() { [10:56:24.259] list(r = base::R.Version(), locale = base::Sys.getlocale(), [10:56:24.259] rngkind = base::RNGkind(), namespaces = base::loadedNamespaces(), [10:56:24.259] search = base::search(), system = base::Sys.info()) [10:56:24.259] } [10:56:24.259] ...future.conditions[[length(...future.conditions) + [10:56:24.259] 1L]] <<- list(condition = cond, calls = c(sysCalls(from = ...future.frame), [10:56:24.259] cond$call), session = sessionInformation(), [10:56:24.259] timestamp = base::Sys.time(), signaled = 0L) [10:56:24.259] signalCondition(cond) [10:56:24.259] } [10:56:24.259] else if (!ignore && TRUE && inherits(cond, "condition")) { [10:56:24.259] signal <- FALSE && inherits(cond, character(0)) [10:56:24.259] ...future.conditions[[length(...future.conditions) + [10:56:24.259] 1L]] <<- list(condition = cond, signaled = base::as.integer(signal)) [10:56:24.259] if (FALSE && !signal) { [10:56:24.259] muffleCondition <- function (cond, pattern = "^muffle") [10:56:24.259] { [10:56:24.259] inherits <- base::inherits [10:56:24.259] invokeRestart <- base::invokeRestart [10:56:24.259] is.null <- base::is.null [10:56:24.259] muffled <- FALSE [10:56:24.259] if (inherits(cond, "message")) { [10:56:24.259] muffled <- grepl(pattern, "muffleMessage") [10:56:24.259] if (muffled) [10:56:24.259] invokeRestart("muffleMessage") [10:56:24.259] } [10:56:24.259] else if (inherits(cond, "warning")) { [10:56:24.259] muffled <- grepl(pattern, "muffleWarning") [10:56:24.259] if (muffled) [10:56:24.259] invokeRestart("muffleWarning") [10:56:24.259] } [10:56:24.259] else if (inherits(cond, "condition")) { [10:56:24.259] if (!is.null(pattern)) { [10:56:24.259] computeRestarts <- base::computeRestarts [10:56:24.259] grepl <- base::grepl [10:56:24.259] restarts <- computeRestarts(cond) [10:56:24.259] for (restart in restarts) { [10:56:24.259] name <- restart$name [10:56:24.259] if (is.null(name)) [10:56:24.259] next [10:56:24.259] if (!grepl(pattern, name)) [10:56:24.259] next [10:56:24.259] invokeRestart(restart) [10:56:24.259] muffled <- TRUE [10:56:24.259] break [10:56:24.259] } [10:56:24.259] } [10:56:24.259] } [10:56:24.259] invisible(muffled) [10:56:24.259] } [10:56:24.259] muffleCondition(cond, pattern = "^muffle") [10:56:24.259] } [10:56:24.259] } [10:56:24.259] else { [10:56:24.259] if (TRUE) { [10:56:24.259] muffleCondition <- function (cond, pattern = "^muffle") [10:56:24.259] { [10:56:24.259] inherits <- base::inherits [10:56:24.259] invokeRestart <- base::invokeRestart [10:56:24.259] is.null <- base::is.null [10:56:24.259] muffled <- FALSE [10:56:24.259] if (inherits(cond, "message")) { [10:56:24.259] muffled <- grepl(pattern, "muffleMessage") [10:56:24.259] if (muffled) [10:56:24.259] invokeRestart("muffleMessage") [10:56:24.259] } [10:56:24.259] else if (inherits(cond, "warning")) { [10:56:24.259] muffled <- grepl(pattern, "muffleWarning") [10:56:24.259] if (muffled) [10:56:24.259] invokeRestart("muffleWarning") [10:56:24.259] } [10:56:24.259] else if (inherits(cond, "condition")) { [10:56:24.259] if (!is.null(pattern)) { [10:56:24.259] computeRestarts <- base::computeRestarts [10:56:24.259] grepl <- base::grepl [10:56:24.259] restarts <- computeRestarts(cond) [10:56:24.259] for (restart in restarts) { [10:56:24.259] name <- restart$name [10:56:24.259] if (is.null(name)) [10:56:24.259] next [10:56:24.259] if (!grepl(pattern, name)) [10:56:24.259] next [10:56:24.259] invokeRestart(restart) [10:56:24.259] muffled <- TRUE [10:56:24.259] break [10:56:24.259] } [10:56:24.259] } [10:56:24.259] } [10:56:24.259] invisible(muffled) [10:56:24.259] } [10:56:24.259] muffleCondition(cond, pattern = "^muffle") [10:56:24.259] } [10:56:24.259] } [10:56:24.259] } [10:56:24.259] })) [10:56:24.259] }, error = function(ex) { [10:56:24.259] base::structure(base::list(value = NULL, visible = NULL, [10:56:24.259] conditions = ...future.conditions, rng = !identical(base::globalenv()$.Random.seed, [10:56:24.259] ...future.rng), started = ...future.startTime, [10:56:24.259] finished = Sys.time(), session_uuid = NA_character_, [10:56:24.259] version = "1.8"), class = "FutureResult") [10:56:24.259] }, finally = { [10:56:24.259] if (!identical(...future.workdir, getwd())) [10:56:24.259] setwd(...future.workdir) [10:56:24.259] { [10:56:24.259] if (identical(getOption("nwarnings"), ...future.oldOptions$nwarnings)) { [10:56:24.259] ...future.oldOptions$nwarnings <- NULL [10:56:24.259] } [10:56:24.259] base::options(...future.oldOptions) [10:56:24.259] if (.Platform$OS.type == "windows") { [10:56:24.259] old_names <- names(...future.oldEnvVars) [10:56:24.259] envs <- base::Sys.getenv() [10:56:24.259] names <- names(envs) [10:56:24.259] common <- intersect(names, old_names) [10:56:24.259] added <- setdiff(names, old_names) [10:56:24.259] removed <- setdiff(old_names, names) [10:56:24.259] changed <- common[...future.oldEnvVars[common] != [10:56:24.259] envs[common]] [10:56:24.259] NAMES <- toupper(changed) [10:56:24.259] args <- list() [10:56:24.259] for (kk in seq_along(NAMES)) { [10:56:24.259] name <- changed[[kk]] [10:56:24.259] NAME <- NAMES[[kk]] [10:56:24.259] if (name != NAME && is.element(NAME, old_names)) [10:56:24.259] next [10:56:24.259] args[[name]] <- ...future.oldEnvVars[[name]] [10:56:24.259] } [10:56:24.259] NAMES <- toupper(added) [10:56:24.259] for (kk in seq_along(NAMES)) { [10:56:24.259] name <- added[[kk]] [10:56:24.259] NAME <- NAMES[[kk]] [10:56:24.259] if (name != NAME && is.element(NAME, old_names)) [10:56:24.259] next [10:56:24.259] args[[name]] <- "" [10:56:24.259] } [10:56:24.259] NAMES <- toupper(removed) [10:56:24.259] for (kk in seq_along(NAMES)) { [10:56:24.259] name <- removed[[kk]] [10:56:24.259] NAME <- NAMES[[kk]] [10:56:24.259] if (name != NAME && is.element(NAME, old_names)) [10:56:24.259] next [10:56:24.259] args[[name]] <- ...future.oldEnvVars[[name]] [10:56:24.259] } [10:56:24.259] if (length(args) > 0) [10:56:24.259] base::do.call(base::Sys.setenv, args = args) [10:56:24.259] args <- names <- old_names <- NAMES <- envs <- common <- added <- removed <- NULL [10:56:24.259] } [10:56:24.259] else { [10:56:24.259] base::do.call(base::Sys.setenv, args = base::as.list(...future.oldEnvVars)) [10:56:24.259] } [10:56:24.259] { [10:56:24.259] if (base::length(...future.futureOptionsAdded) > [10:56:24.259] 0L) { [10:56:24.259] opts <- base::vector("list", length = base::length(...future.futureOptionsAdded)) [10:56:24.259] base::names(opts) <- ...future.futureOptionsAdded [10:56:24.259] base::options(opts) [10:56:24.259] } [10:56:24.259] { [10:56:24.259] NULL [10:56:24.259] options(future.plan = NULL) [10:56:24.259] if (is.na(NA_character_)) [10:56:24.259] Sys.unsetenv("R_FUTURE_PLAN") [10:56:24.259] else Sys.setenv(R_FUTURE_PLAN = NA_character_) [10:56:24.259] future::plan(...future.strategy.old, .cleanup = FALSE, [10:56:24.259] .init = FALSE) [10:56:24.259] } [10:56:24.259] } [10:56:24.259] } [10:56:24.259] }) [10:56:24.259] if (TRUE) { [10:56:24.259] base::sink(type = "output", split = FALSE) [10:56:24.259] if (TRUE) { [10:56:24.259] ...future.result$stdout <- base::rawToChar(base::rawConnectionValue(...future.stdout)) [10:56:24.259] } [10:56:24.259] else { [10:56:24.259] ...future.result["stdout"] <- base::list(NULL) [10:56:24.259] } [10:56:24.259] base::close(...future.stdout) [10:56:24.259] ...future.stdout <- NULL [10:56:24.259] } [10:56:24.259] ...future.result$conditions <- ...future.conditions [10:56:24.259] ...future.result$finished <- base::Sys.time() [10:56:24.259] ...future.result [10:56:24.259] } [10:56:24.423] plan(): plan_init() of 'mirai_multisession', 'mirai_cluster', 'mirai', 'multiprocess', 'future', 'function' ... DONE [10:56:24.424] plan(): nbrOfWorkers() = 2 > > options(future.debug = FALSE) > > message("*** RNG ...") *** RNG ... > > plan(mirai_multisession, workers = 2L) > > message("- run() does not update RNG state") - run() does not update RNG state > > f1 <- future(1, lazy = TRUE) > f2 <- future(2, lazy = TRUE) > > rng0 <- globalenv()$.Random.seed > > f1 <- run(f1) > stopifnot(identical(globalenv()$.Random.seed, rng0)) ## RNG changed? > > f2 <- run(f2) > stopifnot(identical(globalenv()$.Random.seed, rng0)) ## RNG changed? > > v1 <- value(f1) > stopifnot(identical(v1, 1)) > > v2 <- value(f2) > stopifnot(identical(v2, 2)) > > > message("- future() does not update RNG state") - future() does not update RNG state > > rng0 <- globalenv()$.Random.seed > > f1 <- future(1) > stopifnot(identical(globalenv()$.Random.seed, rng0)) ## RNG changed? > > f2 <- future(2) > stopifnot(identical(globalenv()$.Random.seed, rng0)) ## RNG changed? > > v1 <- value(f1) > stopifnot(identical(v1, 1)) > > v2 <- value(f2) > stopifnot(identical(v2, 2)) > > > message("- resolved() does not update RNG state") - resolved() does not update RNG state > > f1 <- future(1) > f2 <- future(2) > > d1 <- resolved(f1) > stopifnot(identical(globalenv()$.Random.seed, rng0)) ## RNG changed? > > d2 <- resolved(f2) > stopifnot(identical(globalenv()$.Random.seed, rng0)) ## RNG changed? > > v1 <- value(f1) > stopifnot(identical(v1, 1)) > > v2 <- value(f2) > stopifnot(identical(v2, 2)) > > > message("- result() does not update RNG state") - result() does not update RNG state > > f1 <- future(1) > f2 <- future(2) > > r1 <- result(f1) > stopifnot(identical(r1$value, 1)) > stopifnot(identical(globalenv()$.Random.seed, rng0)) ## RNG changed? > > r2 <- result(f2) > stopifnot(identical(r2$value, 2)) > stopifnot(identical(globalenv()$.Random.seed, rng0)) ## RNG changed? > > v1 <- value(f1) > stopifnot(identical(v1, 1)) > > v2 <- value(f2) > stopifnot(identical(v2, 2)) > > > message("- value() does not update RNG state") - value() does not update RNG state > > f1 <- future(1) > f2 <- future(2) > > v1 <- value(f1) > stopifnot(identical(v1, 1)) > stopifnot(identical(globalenv()$.Random.seed, rng0)) ## RNG changed? > > v2 <- value(f2) > stopifnot(identical(v2, 2)) > stopifnot(identical(globalenv()$.Random.seed, rng0)) ## RNG changed? > > message("*** RNG ... DONE") *** RNG ... DONE > > source("incl/end.R") > > proc.time() user system elapsed 0.35 0.09 0.98