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