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