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() > strategies <- setdiff(strategies, "multiprocess") > > message("*** doFuture - reproducibility ...") *** doFuture - reproducibility ... > > res0 <- NULL > > for (strategy in strategies) { + message(sprintf("- plan('%s') ...", strategy)) + plan(strategy) + + mu <- 1.0 + sigma <- 2.0 + res <- foreach(i = 1:3, .options.future = list(packages = "stats")) %dofuture% { + 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:31:55.321] doFuture2() ... [06:31:55.324] Number of chunks: 1 [06:31:55.325] Number of futures (= number of chunks): 1 [06:31:55.325] seed = FALSE [06:31:55.326] NULL [06:31:55.329] seed = FALSE [06:31:55.330] seed = FALSE [06:31:55.330] - %dofuture% R expression: [06:31:55.330] { [06:31:55.330] dnorm(i, mean = mu, sd = sigma) [06:31:55.330] } [06:31:55.331] - foreach iterator arguments: [1] 'i' [06:31:55.331] - dummy globals (as locals): [1] 'i' [06:31:55.332] - R expression (map-reduce expression adjusted for RNG): [06:31:55.332] { [06:31:55.332] NULL [06:31:55.332] "# doFuture():::doFuture2(): process chunk of elements" [06:31:55.332] lapply(seq_along(...future.x_ii), FUN = function(jj) { [06:31:55.332] ...future.x_jj <- ...future.x_ii[[jj]] [06:31:55.332] { [06:31:55.332] NULL [06:31:55.332] i <- NULL [06:31:55.332] } [06:31:55.332] ...future.env <- environment() [06:31:55.332] local({ [06:31:55.332] for (name in names(...future.x_jj)) { [06:31:55.332] assign(name, ...future.x_jj[[name]], envir = ...future.env, [06:31:55.332] inherits = FALSE) [06:31:55.332] } [06:31:55.332] }) [06:31:55.332] NULL [06:31:55.332] tryCatch({ [06:31:55.332] dnorm(i, mean = mu, sd = sigma) [06:31:55.332] }, error = identity) [06:31:55.332] }) [06:31:55.332] } [06:31:55.333] - identifying globals and packages ... [06:31:55.333] - Argument 'globals': [06:31:55.333] logi TRUE [06:31:55.333] - attr(*, "add")= chr "...future.x_ii" [06:31:55.333] - attr(*, "ignore")= chr "i" [06:31:55.337] - R expression (map-reduce expression searched for globals): [06:31:55.337] { [06:31:55.337] NULL [06:31:55.337] "# doFuture():::doFuture2(): process chunk of elements" [06:31:55.337] lapply(seq_along(...future.x_ii), FUN = function(jj) { [06:31:55.337] ...future.x_jj <- ...future.x_ii[[jj]] [06:31:55.337] { [06:31:55.337] NULL [06:31:55.337] i <- NULL [06:31:55.337] } [06:31:55.337] ...future.env <- environment() [06:31:55.337] local({ [06:31:55.337] for (name in names(...future.x_jj)) { [06:31:55.337] assign(name, ...future.x_jj[[name]], envir = ...future.env, [06:31:55.337] inherits = FALSE) [06:31:55.337] } [06:31:55.337] }) [06:31:55.337] NULL [06:31:55.337] tryCatch({ [06:31:55.337] dnorm(i, mean = mu, sd = sigma) [06:31:55.337] }, error = identity) [06:31:55.337] }) [06:31:55.337] } [06:31:55.363] - globals: [3] '...future.x_ii', 'mu', 'sigma' [06:31:55.364] List of 3 [06:31:55.364] $ ...future.x_ii: num 42 [06:31:55.364] $ mu : num 1 [06:31:55.364] $ sigma : num 2 [06:31:55.364] - attr(*, "where")=List of 3 [06:31:55.364] ..$ ...future.x_ii: [06:31:55.364] ..$ mu : [06:31:55.364] ..$ sigma : [06:31:55.364] - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list" [06:31:55.364] - attr(*, "resolved")= logi FALSE [06:31:55.364] - attr(*, "total_size")= num 117 [06:31:55.372] - packages: [2] 'doFuture', 'stats' [06:31:55.373] - identifying globals and packages ... DONE [06:31:55.373] Launching 1 futures (chunks) ... [06:31:55.373] Chunk #1 of 1 ... [06:31:55.374] - Finding globals in 'args_list' for chunk #1 ... [06:31:55.375] [06:31:55.376] [06:31:55.376] - Finding globals in 'args_list' for chunk #1 ... DONE [06:31:55.376] - seeds: [06:31:55.402] Chunk #1 of 1 ... DONE [06:31:55.403] Launching 1 futures (chunks) ... DONE [06:31:55.403] - resolving futures [06:31:55.403] - gathering results & relaying conditions (except errors) [06:31:55.406] - Number of value chunks collected: 1 [06:31:55.406] Resolving 1 futures (chunks) ... DONE [06:31:55.406] Reducing values from 1 chunks ... [06:31:55.407] Raw results: [06:31:55.407] List of 1 [06:31:55.407] $ :List of 3 [06:31:55.407] ..$ : num 0.199 [06:31:55.407] ..$ : num 0.176 [06:31:55.407] ..$ : num 0.121 [06:31:55.411] Combined results: [06:31:55.411] List of 3 [06:31:55.411] $ : num 0.199 [06:31:55.411] $ : num 0.176 [06:31:55.411] $ : num 0.121 [06:31:55.414] - accumulating results [06:31:55.416] - extracting results [06:31:55.416] doFuture2() ... DONE [[1]] [1] 0.1994711 [[2]] [1] 0.1760327 [[3]] [1] 0.1209854 - plan('sequential') ... DONE - plan('multisession') ... [06:31:56.565] doFuture2() ... [06:31:56.572] Number of chunks: 2 [06:31:56.573] Number of futures (= number of chunks): 2 [06:31:56.573] seed = FALSE [06:31:56.574] NULL [06:31:56.574] seed = FALSE [06:31:56.575] seed = FALSE [06:31:56.575] - %dofuture% R expression: [06:31:56.575] { [06:31:56.575] dnorm(i, mean = mu, sd = sigma) [06:31:56.575] } [06:31:56.576] - foreach iterator arguments: [1] 'i' [06:31:56.576] - dummy globals (as locals): [1] 'i' [06:31:56.576] - R expression (map-reduce expression adjusted for RNG): [06:31:56.577] { [06:31:56.577] NULL [06:31:56.577] "# doFuture():::doFuture2(): process chunk of elements" [06:31:56.577] lapply(seq_along(...future.x_ii), FUN = function(jj) { [06:31:56.577] ...future.x_jj <- ...future.x_ii[[jj]] [06:31:56.577] { [06:31:56.577] NULL [06:31:56.577] i <- NULL [06:31:56.577] } [06:31:56.577] ...future.env <- environment() [06:31:56.577] local({ [06:31:56.577] for (name in names(...future.x_jj)) { [06:31:56.577] assign(name, ...future.x_jj[[name]], envir = ...future.env, [06:31:56.577] inherits = FALSE) [06:31:56.577] } [06:31:56.577] }) [06:31:56.577] NULL [06:31:56.577] tryCatch({ [06:31:56.577] dnorm(i, mean = mu, sd = sigma) [06:31:56.577] }, error = identity) [06:31:56.577] }) [06:31:56.577] } [06:31:56.577] - identifying globals and packages ... [06:31:56.578] - Argument 'globals': [06:31:56.578] logi TRUE [06:31:56.578] - attr(*, "add")= chr "...future.x_ii" [06:31:56.578] - attr(*, "ignore")= chr "i" [06:31:56.579] - R expression (map-reduce expression searched for globals): [06:31:56.579] { [06:31:56.579] NULL [06:31:56.579] "# doFuture():::doFuture2(): process chunk of elements" [06:31:56.579] lapply(seq_along(...future.x_ii), FUN = function(jj) { [06:31:56.579] ...future.x_jj <- ...future.x_ii[[jj]] [06:31:56.579] { [06:31:56.579] NULL [06:31:56.579] i <- NULL [06:31:56.579] } [06:31:56.579] ...future.env <- environment() [06:31:56.579] local({ [06:31:56.579] for (name in names(...future.x_jj)) { [06:31:56.579] assign(name, ...future.x_jj[[name]], envir = ...future.env, [06:31:56.579] inherits = FALSE) [06:31:56.579] } [06:31:56.579] }) [06:31:56.579] NULL [06:31:56.579] tryCatch({ [06:31:56.579] dnorm(i, mean = mu, sd = sigma) [06:31:56.579] }, error = identity) [06:31:56.579] }) [06:31:56.579] } [06:31:56.588] - globals: [3] '...future.x_ii', 'mu', 'sigma' [06:31:56.588] List of 3 [06:31:56.588] $ ...future.x_ii: num 42 [06:31:56.588] $ mu : num 1 [06:31:56.588] $ sigma : num 2 [06:31:56.588] - attr(*, "where")=List of 3 [06:31:56.588] ..$ ...future.x_ii: [06:31:56.588] ..$ mu : [06:31:56.588] ..$ sigma : [06:31:56.588] - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list" [06:31:56.588] - attr(*, "resolved")= logi FALSE [06:31:56.588] - attr(*, "total_size")= num 117 [06:31:56.593] - packages: [2] 'doFuture', 'stats' [06:31:56.594] - identifying globals and packages ... DONE [06:31:56.594] Launching 2 futures (chunks) ... [06:31:56.594] Chunk #1 of 2 ... [06:31:56.594] - Finding globals in 'args_list' for chunk #1 ... [06:31:56.595] [06:31:56.595] [06:31:56.595] - Finding globals in 'args_list' for chunk #1 ... DONE [06:31:56.595] - seeds: [06:31:56.623] Chunk #1 of 2 ... DONE [06:31:56.623] Chunk #2 of 2 ... [06:31:56.624] - Finding globals in 'args_list' for chunk #2 ... [06:31:56.625] [06:31:56.625] [06:31:56.626] - Finding globals in 'args_list' for chunk #2 ... DONE [06:31:56.626] - seeds: [06:31:56.797] Chunk #2 of 2 ... DONE [06:31:56.797] Launching 2 futures (chunks) ... DONE [06:31:56.798] - resolving futures [06:31:56.798] - gathering results & relaying conditions (except errors) [06:31:56.949] - Number of value chunks collected: 2 [06:31:56.950] Resolving 2 futures (chunks) ... DONE [06:31:56.950] Reducing values from 2 chunks ... [06:31:56.951] Raw results: [06:31:56.951] List of 2 [06:31:56.951] $ :List of 1 [06:31:56.951] ..$ : num 0.199 [06:31:56.951] $ :List of 2 [06:31:56.951] ..$ : num 0.176 [06:31:56.951] ..$ : num 0.121 [06:31:56.955] Combined results: [06:31:56.956] List of 3 [06:31:56.956] $ : num 0.199 [06:31:56.956] $ : num 0.176 [06:31:56.956] $ : num 0.121 [06:31:56.959] - accumulating results [06:31:56.960] - extracting results [06:31:56.960] doFuture2() ... DONE [[1]] [1] 0.1994711 [[2]] [1] 0.1760327 [[3]] [1] 0.1209854 - plan('multisession') ... DONE - plan('cluster') ... [06:31:57.477] doFuture2() ... [06:31:57.484] Number of chunks: 2 [06:31:57.485] Number of futures (= number of chunks): 2 [06:31:57.485] seed = FALSE [06:31:57.485] NULL [06:31:57.486] seed = FALSE [06:31:57.486] seed = FALSE [06:31:57.486] - %dofuture% R expression: [06:31:57.487] { [06:31:57.487] dnorm(i, mean = mu, sd = sigma) [06:31:57.487] } [06:31:57.487] - foreach iterator arguments: [1] 'i' [06:31:57.487] - dummy globals (as locals): [1] 'i' [06:31:57.488] - R expression (map-reduce expression adjusted for RNG): [06:31:57.488] { [06:31:57.488] NULL [06:31:57.488] "# doFuture():::doFuture2(): process chunk of elements" [06:31:57.488] lapply(seq_along(...future.x_ii), FUN = function(jj) { [06:31:57.488] ...future.x_jj <- ...future.x_ii[[jj]] [06:31:57.488] { [06:31:57.488] NULL [06:31:57.488] i <- NULL [06:31:57.488] } [06:31:57.488] ...future.env <- environment() [06:31:57.488] local({ [06:31:57.488] for (name in names(...future.x_jj)) { [06:31:57.488] assign(name, ...future.x_jj[[name]], envir = ...future.env, [06:31:57.488] inherits = FALSE) [06:31:57.488] } [06:31:57.488] }) [06:31:57.488] NULL [06:31:57.488] tryCatch({ [06:31:57.488] dnorm(i, mean = mu, sd = sigma) [06:31:57.488] }, error = identity) [06:31:57.488] }) [06:31:57.488] } [06:31:57.489] - identifying globals and packages ... [06:31:57.489] - Argument 'globals': [06:31:57.489] logi TRUE [06:31:57.489] - attr(*, "add")= chr "...future.x_ii" [06:31:57.489] - attr(*, "ignore")= chr "i" [06:31:57.491] - R expression (map-reduce expression searched for globals): [06:31:57.491] { [06:31:57.491] NULL [06:31:57.491] "# doFuture():::doFuture2(): process chunk of elements" [06:31:57.491] lapply(seq_along(...future.x_ii), FUN = function(jj) { [06:31:57.491] ...future.x_jj <- ...future.x_ii[[jj]] [06:31:57.491] { [06:31:57.491] NULL [06:31:57.491] i <- NULL [06:31:57.491] } [06:31:57.491] ...future.env <- environment() [06:31:57.491] local({ [06:31:57.491] for (name in names(...future.x_jj)) { [06:31:57.491] assign(name, ...future.x_jj[[name]], envir = ...future.env, [06:31:57.491] inherits = FALSE) [06:31:57.491] } [06:31:57.491] }) [06:31:57.491] NULL [06:31:57.491] tryCatch({ [06:31:57.491] dnorm(i, mean = mu, sd = sigma) [06:31:57.491] }, error = identity) [06:31:57.491] }) [06:31:57.491] } [06:31:57.503] - globals: [3] '...future.x_ii', 'mu', 'sigma' [06:31:57.503] List of 3 [06:31:57.503] $ ...future.x_ii: num 42 [06:31:57.503] $ mu : num 1 [06:31:57.503] $ sigma : num 2 [06:31:57.503] - attr(*, "where")=List of 3 [06:31:57.503] ..$ ...future.x_ii: [06:31:57.503] ..$ mu : [06:31:57.503] ..$ sigma : [06:31:57.503] - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list" [06:31:57.503] - attr(*, "resolved")= logi FALSE [06:31:57.503] - attr(*, "total_size")= num 117 [06:31:57.509] - packages: [2] 'doFuture', 'stats' [06:31:57.510] - identifying globals and packages ... DONE [06:31:57.510] Launching 2 futures (chunks) ... [06:31:57.510] Chunk #1 of 2 ... [06:31:57.510] - Finding globals in 'args_list' for chunk #1 ... [06:31:57.511] [06:31:57.511] [06:31:57.512] - Finding globals in 'args_list' for chunk #1 ... DONE [06:31:57.512] - seeds: [06:31:57.543] Chunk #1 of 2 ... DONE [06:31:57.544] Chunk #2 of 2 ... [06:31:57.544] - Finding globals in 'args_list' for chunk #2 ... [06:31:57.545] [06:31:57.545] [06:31:57.545] - Finding globals in 'args_list' for chunk #2 ... DONE [06:31:57.546] - seeds: [06:31:57.714] Chunk #2 of 2 ... DONE [06:31:57.715] Launching 2 futures (chunks) ... DONE [06:31:57.715] - resolving futures [06:31:57.715] - gathering results & relaying conditions (except errors) [06:31:57.842] - Number of value chunks collected: 2 [06:31:57.842] Resolving 2 futures (chunks) ... DONE [06:31:57.843] Reducing values from 2 chunks ... [06:31:57.843] Raw results: [06:31:57.843] List of 2 [06:31:57.843] $ :List of 1 [06:31:57.843] ..$ : num 0.199 [06:31:57.843] $ :List of 2 [06:31:57.843] ..$ : num 0.176 [06:31:57.843] ..$ : num 0.121 [06:31:57.848] Combined results: [06:31:57.848] List of 3 [06:31:57.848] $ : num 0.199 [06:31:57.848] $ : num 0.176 [06:31:57.848] $ : num 0.121 [06:31:57.851] - accumulating results [06:31:57.852] - extracting results [06:31:57.853] doFuture2() ... 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 1.07 0.10 3.18