R Under development (unstable) (2023-12-20 r85711 ucrt) -- "Unsuffered Consequences" Copyright (C) 2023 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:14:21.735] plan(): Setting new future strategy stack: [13:14:21.736] List of future strategies: [13:14:21.736] 1. sequential: [13:14:21.736] - args: function (..., envir = parent.frame(), workers = "") [13:14:21.736] - tweaked: FALSE [13:14:21.736] - call: future::plan("sequential") [13:14:21.752] plan(): nbrOfWorkers() = 1 > > message("*** Options in nested parallelization ...") *** Options in nested parallelization ... > > options(future.debug = FALSE) > options(future.apply.debug = FALSE) > options(future.globals.maxSize = 1234000) > > for (cores in 1:availCores) { + message(sprintf("Testing with %d cores ...", cores)) + options(mc.cores = cores) + strategies <- supportedStrategies(cores) + + for (strategy1 in strategies) { + for (strategy2 in strategies) { + message(sprintf("- plan('%s') ...", strategy2)) + plan(list(outer = tweak(strategy1), inner = strategy2)) + + v <- future_lapply(1:2, FUN = function(x) { + outer <- data.frame( + label = "outer", + idx = x, + pid = Sys.getpid(), + maxSize = getOption("future.globals.maxSize", NA_real_) + ) + + inner <- future_lapply(3:4, FUN = function(x) { + data.frame( + label = "inner", + idx = x, + pid = Sys.getpid(), + maxSize = getOption("future.globals.maxSize", NA_real_)) + }) + inner <- do.call(rbind, inner) + rbind(outer, inner) + }) + v <- do.call(rbind, v) + print(v) + stopifnot(!anyNA(v$maxSize)) + } ## for (strategy2 ...) + } ## for (strategy1 ...) + } ## for (cores in ...) Testing with 1 cores ... - plan('sequential') ... label idx pid maxSize 1 outer 1 8264 1234000 2 inner 3 8264 1234000 3 inner 4 8264 1234000 4 outer 2 8264 1234000 5 inner 3 8264 1234000 6 inner 4 8264 1234000 - plan('multisession') ... label idx pid maxSize 1 outer 1 8264 1234000 2 inner 3 8264 1234000 3 inner 4 8264 1234000 4 outer 2 8264 1234000 5 inner 3 8264 1234000 6 inner 4 8264 1234000 - plan('sequential') ... label idx pid maxSize 1 outer 1 8264 1234000 2 inner 3 8264 1234000 3 inner 4 8264 1234000 4 outer 2 8264 1234000 5 inner 3 8264 1234000 6 inner 4 8264 1234000 - plan('multisession') ... label idx pid maxSize 1 outer 1 8264 1234000 2 inner 3 8264 1234000 3 inner 4 8264 1234000 4 outer 2 8264 1234000 5 inner 3 8264 1234000 6 inner 4 8264 1234000 Testing with 2 cores ... - plan('multisession') ... label idx pid maxSize 1 outer 1 2144 1234000 2 inner 3 2144 1234000 3 inner 4 2144 1234000 4 outer 2 13092 1234000 5 inner 3 13092 1234000 6 inner 4 13092 1234000 > > message("*** Options in nested parallelization ... done") *** Options in nested parallelization ... done > > source("incl/end.R") > > proc.time() user system elapsed 0.67 0.01 1.46