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