R version 4.5.0 alpha (2025-03-15 r87978 ucrt) Copyright (C) 2025 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: foreach Loading required package: future R version 4.5.0 alpha (2025-03-15 r87978 ucrt) Platform: x86_64-w64-mingw32/x64 Running under: Windows Server 2022 x64 (build 20348) Matrix products: default LAPACK version 3.12.1 locale: [1] LC_COLLATE=C LC_CTYPE=German_Germany.utf8 [3] LC_MONETARY=C LC_NUMERIC=C [5] LC_TIME=C time zone: Europe/Berlin tzcode source: internal attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] doFuture_1.0.2 future_1.34.0 foreach_1.5.2 loaded via a namespace (and not attached): [1] compiler_4.5.0 parallelly_1.42.0 tools_4.5.0 [4] parallel_4.5.0 future.apply_1.11.3 listenv_0.9.1 [7] codetools_0.2-20 iterators_1.0.14 digest_0.6.37 [10] globals_0.16.3 > > strategies <- future:::supportedStrategies() > > message("*** doFuture - reproducibility ...") *** doFuture - reproducibility ... > > registerDoFuture() > > res0 <- NULL > > for (strategy in strategies) { + message(sprintf("- plan('%s') ...", strategy)) + plan(strategy) + + mu <- 1.0 + sigma <- 2.0 + res <- foreach(i = 1:3, .packages = "stats") %dopar% { + dnorm(i, mean = mu, sd = sigma) + } + print(res) + + if (is.null(res0)) { + res0 <- res + } else { + stopifnot(all.equal(res, res0)) + } + + # Shutdown current plan + plan(sequential) + + message(sprintf("- plan('%s') ... DONE", strategy)) + } ## for (strategy ...) - plan('sequential') ... [06:32:50.135] doFuture() ... [06:32:50.138] - dummy globals (as locals): [1] 'i' [06:32:50.138] - R expression: [06:32:50.138] { [06:32:50.138] "# doFuture():::doFuture(): Make sure that foreach uses 'doFuture'" [06:32:50.138] "# also in nested calls " [06:32:50.138] doFuture::registerDoFuture() [06:32:50.138] "# doFuture():::doFuture(): process chunk of elements" [06:32:50.138] lapply(seq_along(...future.x_ii), FUN = function(jj) { [06:32:50.138] ...future.x_jj <- ...future.x_ii[[jj]] [06:32:50.138] { [06:32:50.138] NULL [06:32:50.138] i <- NULL [06:32:50.138] } [06:32:50.138] ...future.env <- environment() [06:32:50.138] local({ [06:32:50.138] for (name in names(...future.x_jj)) { [06:32:50.138] assign(name, ...future.x_jj[[name]], envir = ...future.env, [06:32:50.138] inherits = FALSE) [06:32:50.138] } [06:32:50.138] }) [06:32:50.138] tryCatch({ [06:32:50.138] dnorm(i, mean = mu, sd = sigma) [06:32:50.138] }, error = identity) [06:32:50.138] }) [06:32:50.138] } [06:32:50.140] - identifying globals and packages ... [06:32:50.170] List of 3 [06:32:50.170] $ ...future.x_ii: NULL [06:32:50.170] $ mu : num 1 [06:32:50.170] $ sigma : num 2 [06:32:50.170] - attr(*, "where")=List of 3 [06:32:50.170] ..$ ...future.x_ii: [06:32:50.170] ..$ mu : [06:32:50.170] ..$ sigma : [06:32:50.170] - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list" [06:32:50.170] - attr(*, "resolved")= logi FALSE [06:32:50.170] - attr(*, "total_size")= num 105 [06:32:50.182] - R expression: [06:32:50.183] { [06:32:50.183] "# doFuture():::doFuture(): Make sure that foreach uses 'doFuture'" [06:32:50.183] "# also in nested calls " [06:32:50.183] doFuture::registerDoFuture() [06:32:50.183] "# doFuture():::doFuture(): process chunk of elements" [06:32:50.183] lapply(seq_along(...future.x_ii), FUN = function(jj) { [06:32:50.183] ...future.x_jj <- ...future.x_ii[[jj]] [06:32:50.183] { [06:32:50.183] NULL [06:32:50.183] i <- NULL [06:32:50.183] } [06:32:50.183] ...future.env <- environment() [06:32:50.183] local({ [06:32:50.183] for (name in names(...future.x_jj)) { [06:32:50.183] assign(name, ...future.x_jj[[name]], envir = ...future.env, [06:32:50.183] inherits = FALSE) [06:32:50.183] } [06:32:50.183] }) [06:32:50.183] tryCatch({ [06:32:50.183] dnorm(i, mean = mu, sd = sigma) [06:32:50.183] }, error = identity) [06:32:50.183] }) [06:32:50.183] } [06:32:50.184] - globals: [3] '...future.x_ii', 'mu', 'sigma' [06:32:50.184] List of 3 [06:32:50.184] $ ...future.x_ii: NULL [06:32:50.184] $ mu : num 1 [06:32:50.184] $ sigma : num 2 [06:32:50.184] - attr(*, "where")=List of 3 [06:32:50.184] ..$ ...future.x_ii: [06:32:50.184] ..$ mu : [06:32:50.184] ..$ sigma : [06:32:50.184] - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list" [06:32:50.184] - attr(*, "resolved")= logi FALSE [06:32:50.184] - attr(*, "total_size")= num 105 [06:32:50.191] - packages: [2] 'doFuture', 'stats' [06:32:50.191] - identifying globals and packages ... DONE [06:32:50.192] Number of chunks: 1 [06:32:50.192] Number of futures (= number of chunks): 1 [06:32:50.192] Launching 1 futures (chunks) ... [06:32:50.193] Chunk #1 of 1 ... [06:32:50.193] - Finding globals in 'args_list' chunk #1 ... [06:32:50.194] [06:32:50.195] [06:32:50.195] - Finding globals in 'args_list' for chunk #1 ... DONE [06:32:50.217] Chunk #1 of 1 ... DONE [06:32:50.218] Launching 1 futures (chunks) ... DONE [06:32:50.218] - resolving futures [06:32:50.219] - gathering results & relaying conditions (except errors) [06:32:50.220] - collecting values of futures [06:32:50.221] - accumulating results [06:32:50.222] - processing errors (handler = 'stop') [06:32:50.223] - extracting results [06:32:50.223] doFuture() ... DONE [[1]] [1] 0.1994711 [[2]] [1] 0.1760327 [[3]] [1] 0.1209854 - plan('sequential') ... DONE - plan('multisession') ... [06:32:51.364] doFuture() ... [06:32:51.365] - dummy globals (as locals): [1] 'i' [06:32:51.366] - R expression: [06:32:51.366] { [06:32:51.366] "# doFuture():::doFuture(): Make sure that foreach uses 'doFuture'" [06:32:51.366] "# also in nested calls " [06:32:51.366] doFuture::registerDoFuture() [06:32:51.366] "# doFuture():::doFuture(): process chunk of elements" [06:32:51.366] lapply(seq_along(...future.x_ii), FUN = function(jj) { [06:32:51.366] ...future.x_jj <- ...future.x_ii[[jj]] [06:32:51.366] { [06:32:51.366] NULL [06:32:51.366] i <- NULL [06:32:51.366] } [06:32:51.366] ...future.env <- environment() [06:32:51.366] local({ [06:32:51.366] for (name in names(...future.x_jj)) { [06:32:51.366] assign(name, ...future.x_jj[[name]], envir = ...future.env, [06:32:51.366] inherits = FALSE) [06:32:51.366] } [06:32:51.366] }) [06:32:51.366] tryCatch({ [06:32:51.366] dnorm(i, mean = mu, sd = sigma) [06:32:51.366] }, error = identity) [06:32:51.366] }) [06:32:51.366] } [06:32:51.367] - identifying globals and packages ... [06:32:51.380] List of 3 [06:32:51.380] $ ...future.x_ii: NULL [06:32:51.380] $ mu : num 1 [06:32:51.380] $ sigma : num 2 [06:32:51.380] - attr(*, "where")=List of 3 [06:32:51.380] ..$ ...future.x_ii: [06:32:51.380] ..$ mu : [06:32:51.380] ..$ sigma : [06:32:51.380] - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list" [06:32:51.380] - attr(*, "resolved")= logi FALSE [06:32:51.380] - attr(*, "total_size")= num 105 [06:32:51.386] - R expression: [06:32:51.386] { [06:32:51.386] "# doFuture():::doFuture(): Make sure that foreach uses 'doFuture'" [06:32:51.386] "# also in nested calls " [06:32:51.386] doFuture::registerDoFuture() [06:32:51.386] "# doFuture():::doFuture(): process chunk of elements" [06:32:51.386] lapply(seq_along(...future.x_ii), FUN = function(jj) { [06:32:51.386] ...future.x_jj <- ...future.x_ii[[jj]] [06:32:51.386] { [06:32:51.386] NULL [06:32:51.386] i <- NULL [06:32:51.386] } [06:32:51.386] ...future.env <- environment() [06:32:51.386] local({ [06:32:51.386] for (name in names(...future.x_jj)) { [06:32:51.386] assign(name, ...future.x_jj[[name]], envir = ...future.env, [06:32:51.386] inherits = FALSE) [06:32:51.386] } [06:32:51.386] }) [06:32:51.386] tryCatch({ [06:32:51.386] dnorm(i, mean = mu, sd = sigma) [06:32:51.386] }, error = identity) [06:32:51.386] }) [06:32:51.386] } [06:32:51.387] - globals: [3] '...future.x_ii', 'mu', 'sigma' [06:32:51.387] List of 3 [06:32:51.387] $ ...future.x_ii: NULL [06:32:51.387] $ mu : num 1 [06:32:51.387] $ sigma : num 2 [06:32:51.387] - attr(*, "where")=List of 3 [06:32:51.387] ..$ ...future.x_ii: [06:32:51.387] ..$ mu : [06:32:51.387] ..$ sigma : [06:32:51.387] - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list" [06:32:51.387] - attr(*, "resolved")= logi FALSE [06:32:51.387] - attr(*, "total_size")= num 105 [06:32:51.394] - packages: [2] 'doFuture', 'stats' [06:32:51.394] - identifying globals and packages ... DONE [06:32:51.402] Number of chunks: 2 [06:32:51.402] Number of futures (= number of chunks): 2 [06:32:51.402] Launching 2 futures (chunks) ... [06:32:51.403] Chunk #1 of 2 ... [06:32:51.403] - Finding globals in 'args_list' chunk #1 ... [06:32:51.404] [06:32:51.404] [06:32:51.404] - Finding globals in 'args_list' for chunk #1 ... DONE [06:32:51.429] Chunk #1 of 2 ... DONE [06:32:51.430] Chunk #2 of 2 ... [06:32:51.430] - Finding globals in 'args_list' chunk #2 ... [06:32:51.431] [06:32:51.431] [06:32:51.431] - Finding globals in 'args_list' for chunk #2 ... DONE [06:32:51.574] Chunk #2 of 2 ... DONE [06:32:51.574] Launching 2 futures (chunks) ... DONE [06:32:51.575] - resolving futures [06:32:51.575] - gathering results & relaying conditions (except errors) [06:32:51.697] - collecting values of futures [06:32:51.697] - accumulating results [06:32:51.698] - processing errors (handler = 'stop') [06:32:51.699] - extracting results [06:32:51.699] doFuture() ... DONE [[1]] [1] 0.1994711 [[2]] [1] 0.1760327 [[3]] [1] 0.1209854 - plan('multisession') ... DONE - plan('cluster') ... [06:32:52.277] doFuture() ... [06:32:52.278] - dummy globals (as locals): [1] 'i' [06:32:52.278] - R expression: [06:32:52.278] { [06:32:52.278] "# doFuture():::doFuture(): Make sure that foreach uses 'doFuture'" [06:32:52.278] "# also in nested calls " [06:32:52.278] doFuture::registerDoFuture() [06:32:52.278] "# doFuture():::doFuture(): process chunk of elements" [06:32:52.278] lapply(seq_along(...future.x_ii), FUN = function(jj) { [06:32:52.278] ...future.x_jj <- ...future.x_ii[[jj]] [06:32:52.278] { [06:32:52.278] NULL [06:32:52.278] i <- NULL [06:32:52.278] } [06:32:52.278] ...future.env <- environment() [06:32:52.278] local({ [06:32:52.278] for (name in names(...future.x_jj)) { [06:32:52.278] assign(name, ...future.x_jj[[name]], envir = ...future.env, [06:32:52.278] inherits = FALSE) [06:32:52.278] } [06:32:52.278] }) [06:32:52.278] tryCatch({ [06:32:52.278] dnorm(i, mean = mu, sd = sigma) [06:32:52.278] }, error = identity) [06:32:52.278] }) [06:32:52.278] } [06:32:52.279] - identifying globals and packages ... [06:32:52.290] List of 3 [06:32:52.290] $ ...future.x_ii: NULL [06:32:52.290] $ mu : num 1 [06:32:52.290] $ sigma : num 2 [06:32:52.290] - attr(*, "where")=List of 3 [06:32:52.290] ..$ ...future.x_ii: [06:32:52.290] ..$ mu : [06:32:52.290] ..$ sigma : [06:32:52.290] - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list" [06:32:52.290] - attr(*, "resolved")= logi FALSE [06:32:52.290] - attr(*, "total_size")= num 105 [06:32:52.296] - R expression: [06:32:52.296] { [06:32:52.296] "# doFuture():::doFuture(): Make sure that foreach uses 'doFuture'" [06:32:52.296] "# also in nested calls " [06:32:52.296] doFuture::registerDoFuture() [06:32:52.296] "# doFuture():::doFuture(): process chunk of elements" [06:32:52.296] lapply(seq_along(...future.x_ii), FUN = function(jj) { [06:32:52.296] ...future.x_jj <- ...future.x_ii[[jj]] [06:32:52.296] { [06:32:52.296] NULL [06:32:52.296] i <- NULL [06:32:52.296] } [06:32:52.296] ...future.env <- environment() [06:32:52.296] local({ [06:32:52.296] for (name in names(...future.x_jj)) { [06:32:52.296] assign(name, ...future.x_jj[[name]], envir = ...future.env, [06:32:52.296] inherits = FALSE) [06:32:52.296] } [06:32:52.296] }) [06:32:52.296] tryCatch({ [06:32:52.296] dnorm(i, mean = mu, sd = sigma) [06:32:52.296] }, error = identity) [06:32:52.296] }) [06:32:52.296] } [06:32:52.297] - globals: [3] '...future.x_ii', 'mu', 'sigma' [06:32:52.297] List of 3 [06:32:52.297] $ ...future.x_ii: NULL [06:32:52.297] $ mu : num 1 [06:32:52.297] $ sigma : num 2 [06:32:52.297] - attr(*, "where")=List of 3 [06:32:52.297] ..$ ...future.x_ii: [06:32:52.297] ..$ mu : [06:32:52.297] ..$ sigma : [06:32:52.297] - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list" [06:32:52.297] - attr(*, "resolved")= logi FALSE [06:32:52.297] - attr(*, "total_size")= num 105 [06:32:52.301] - packages: [2] 'doFuture', 'stats' [06:32:52.301] - identifying globals and packages ... DONE [06:32:52.306] Number of chunks: 2 [06:32:52.306] Number of futures (= number of chunks): 2 [06:32:52.306] Launching 2 futures (chunks) ... [06:32:52.306] Chunk #1 of 2 ... [06:32:52.307] - Finding globals in 'args_list' chunk #1 ... [06:32:52.307] [06:32:52.307] [06:32:52.307] - Finding globals in 'args_list' for chunk #1 ... DONE [06:32:52.331] Chunk #1 of 2 ... DONE [06:32:52.331] Chunk #2 of 2 ... [06:32:52.331] - Finding globals in 'args_list' chunk #2 ... [06:32:52.332] [06:32:52.332] [06:32:52.332] - Finding globals in 'args_list' for chunk #2 ... DONE [06:32:52.493] Chunk #2 of 2 ... DONE [06:32:52.493] Launching 2 futures (chunks) ... DONE [06:32:52.494] - resolving futures [06:32:52.494] - gathering results & relaying conditions (except errors) [06:32:52.676] - collecting values of futures [06:32:52.677] - accumulating results [06:32:52.678] - processing errors (handler = 'stop') [06:32:52.678] - extracting results [06:32:52.679] doFuture() ... DONE [[1]] [1] 0.1994711 [[2]] [1] 0.1760327 [[3]] [1] 0.1209854 - plan('cluster') ... DONE > > message("*** doFuture - reproducibility ... DONE") *** doFuture - reproducibility ... DONE > > source("incl/end.R") R version 4.5.0 alpha (2025-03-15 r87978 ucrt) Platform: x86_64-w64-mingw32/x64 Running under: Windows Server 2022 x64 (build 20348) Matrix products: default LAPACK version 3.12.1 locale: [1] LC_COLLATE=C LC_CTYPE=German_Germany.utf8 [3] LC_MONETARY=C LC_NUMERIC=C [5] LC_TIME=C time zone: Europe/Berlin tzcode source: internal attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] doFuture_1.0.2 future_1.34.0 foreach_1.5.2 loaded via a namespace (and not attached): [1] compiler_4.5.0 parallelly_1.42.0 tools_4.5.0 [4] parallel_4.5.0 future.apply_1.11.3 listenv_0.9.1 [7] codetools_0.2-20 iterators_1.0.14 digest_0.6.37 [10] globals_0.16.3 > > proc.time() user system elapsed 0.87 0.20 3.18