R Under development (unstable) (2023-12-19 r85710 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: foreach Loading required package: future R Under development (unstable) (2023-12-19 r85710 ucrt) Platform: x86_64-w64-mingw32/x64 Running under: Windows Server 2022 x64 (build 20348) Matrix products: default 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.1 future_1.33.0 foreach_1.5.2 loaded via a namespace (and not attached): [1] compiler_4.4.0 parallelly_1.36.0 tools_4.4.0 [4] parallel_4.4.0 future.apply_1.11.0 listenv_0.9.0 [7] codetools_0.2-19 iterators_1.0.14 digest_0.6.33 [10] globals_0.16.2 > > 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') ... [08:12:29.331] doFuture() ... [08:12:29.334] - dummy globals (as locals): [1] 'i' [08:12:29.334] - R expression: [08:12:29.335] { [08:12:29.335] doFuture::registerDoFuture() [08:12:29.335] lapply(seq_along(...future.x_ii), FUN = function(jj) { [08:12:29.335] ...future.x_jj <- ...future.x_ii[[jj]] [08:12:29.335] { [08:12:29.335] NULL [08:12:29.335] i <- NULL [08:12:29.335] } [08:12:29.335] ...future.env <- environment() [08:12:29.335] local({ [08:12:29.335] for (name in names(...future.x_jj)) { [08:12:29.335] assign(name, ...future.x_jj[[name]], envir = ...future.env, [08:12:29.335] inherits = FALSE) [08:12:29.335] } [08:12:29.335] }) [08:12:29.335] tryCatch({ [08:12:29.335] dnorm(i, mean = mu, sd = sigma) [08:12:29.335] }, error = identity) [08:12:29.335] }) [08:12:29.335] } [08:12:29.336] - identifying globals and packages ... [08:12:29.362] List of 3 [08:12:29.362] $ ...future.x_ii: NULL [08:12:29.362] $ mu : num 1 [08:12:29.362] $ sigma : num 2 [08:12:29.362] - attr(*, "where")=List of 3 [08:12:29.362] ..$ ...future.x_ii: [08:12:29.362] ..$ mu : [08:12:29.362] ..$ sigma : [08:12:29.362] - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list" [08:12:29.362] - attr(*, "resolved")= logi FALSE [08:12:29.362] - attr(*, "total_size")= num 112 [08:12:29.373] - R expression: [08:12:29.373] { [08:12:29.373] doFuture::registerDoFuture() [08:12:29.373] lapply(seq_along(...future.x_ii), FUN = function(jj) { [08:12:29.373] ...future.x_jj <- ...future.x_ii[[jj]] [08:12:29.373] { [08:12:29.373] NULL [08:12:29.373] i <- NULL [08:12:29.373] } [08:12:29.373] ...future.env <- environment() [08:12:29.373] local({ [08:12:29.373] for (name in names(...future.x_jj)) { [08:12:29.373] assign(name, ...future.x_jj[[name]], envir = ...future.env, [08:12:29.373] inherits = FALSE) [08:12:29.373] } [08:12:29.373] }) [08:12:29.373] tryCatch({ [08:12:29.373] dnorm(i, mean = mu, sd = sigma) [08:12:29.373] }, error = identity) [08:12:29.373] }) [08:12:29.373] } [08:12:29.374] - globals: [3] '...future.x_ii', 'mu', 'sigma' [08:12:29.374] List of 3 [08:12:29.374] $ ...future.x_ii: NULL [08:12:29.374] $ mu : num 1 [08:12:29.374] $ sigma : num 2 [08:12:29.374] - attr(*, "where")=List of 3 [08:12:29.374] ..$ ...future.x_ii: [08:12:29.374] ..$ mu : [08:12:29.374] ..$ sigma : [08:12:29.374] - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list" [08:12:29.374] - attr(*, "resolved")= logi FALSE [08:12:29.374] - attr(*, "total_size")= num 112 [08:12:29.381] - packages: [2] 'doFuture', 'stats' [08:12:29.381] - identifying globals and packages ... DONE [08:12:29.382] Number of chunks: 1 [08:12:29.382] Number of futures (= number of chunks): 1 [08:12:29.382] Launching 1 futures (chunks) ... [08:12:29.383] Chunk #1 of 1 ... [08:12:29.383] - Finding globals in 'args_list' chunk #1 ... [08:12:29.384] [08:12:29.385] [08:12:29.385] - Finding globals in 'args_list' for chunk #1 ... DONE [08:12:29.407] Chunk #1 of 1 ... DONE [08:12:29.407] Launching 1 futures (chunks) ... DONE [08:12:29.407] - resolving futures [08:12:29.408] - gathering results & relaying conditions (except errors) [08:12:29.410] - collecting values of futures [08:12:29.410] - accumulating results [08:12:29.412] - processing errors (handler = 'stop') [08:12:29.412] - extracting results [08:12:29.413] doFuture() ... DONE [[1]] [1] 0.1994711 [[2]] [1] 0.1760327 [[3]] [1] 0.1209854 - plan('sequential') ... DONE - plan('multisession') ... [08:12:30.556] doFuture() ... [08:12:30.558] - dummy globals (as locals): [1] 'i' [08:12:30.558] - R expression: [08:12:30.558] { [08:12:30.558] doFuture::registerDoFuture() [08:12:30.558] lapply(seq_along(...future.x_ii), FUN = function(jj) { [08:12:30.558] ...future.x_jj <- ...future.x_ii[[jj]] [08:12:30.558] { [08:12:30.558] NULL [08:12:30.558] i <- NULL [08:12:30.558] } [08:12:30.558] ...future.env <- environment() [08:12:30.558] local({ [08:12:30.558] for (name in names(...future.x_jj)) { [08:12:30.558] assign(name, ...future.x_jj[[name]], envir = ...future.env, [08:12:30.558] inherits = FALSE) [08:12:30.558] } [08:12:30.558] }) [08:12:30.558] tryCatch({ [08:12:30.558] dnorm(i, mean = mu, sd = sigma) [08:12:30.558] }, error = identity) [08:12:30.558] }) [08:12:30.558] } [08:12:30.559] - identifying globals and packages ... [08:12:30.570] List of 3 [08:12:30.570] $ ...future.x_ii: NULL [08:12:30.570] $ mu : num 1 [08:12:30.570] $ sigma : num 2 [08:12:30.570] - attr(*, "where")=List of 3 [08:12:30.570] ..$ ...future.x_ii: [08:12:30.570] ..$ mu : [08:12:30.570] ..$ sigma : [08:12:30.570] - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list" [08:12:30.570] - attr(*, "resolved")= logi FALSE [08:12:30.570] - attr(*, "total_size")= num 112 [08:12:30.574] - R expression: [08:12:30.574] { [08:12:30.574] doFuture::registerDoFuture() [08:12:30.574] lapply(seq_along(...future.x_ii), FUN = function(jj) { [08:12:30.574] ...future.x_jj <- ...future.x_ii[[jj]] [08:12:30.574] { [08:12:30.574] NULL [08:12:30.574] i <- NULL [08:12:30.574] } [08:12:30.574] ...future.env <- environment() [08:12:30.574] local({ [08:12:30.574] for (name in names(...future.x_jj)) { [08:12:30.574] assign(name, ...future.x_jj[[name]], envir = ...future.env, [08:12:30.574] inherits = FALSE) [08:12:30.574] } [08:12:30.574] }) [08:12:30.574] tryCatch({ [08:12:30.574] dnorm(i, mean = mu, sd = sigma) [08:12:30.574] }, error = identity) [08:12:30.574] }) [08:12:30.574] } [08:12:30.574] - globals: [3] '...future.x_ii', 'mu', 'sigma' [08:12:30.575] List of 3 [08:12:30.575] $ ...future.x_ii: NULL [08:12:30.575] $ mu : num 1 [08:12:30.575] $ sigma : num 2 [08:12:30.575] - attr(*, "where")=List of 3 [08:12:30.575] ..$ ...future.x_ii: [08:12:30.575] ..$ mu : [08:12:30.575] ..$ sigma : [08:12:30.575] - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list" [08:12:30.575] - attr(*, "resolved")= logi FALSE [08:12:30.575] - attr(*, "total_size")= num 112 [08:12:30.579] - packages: [2] 'doFuture', 'stats' [08:12:30.579] - identifying globals and packages ... DONE [08:12:30.585] Number of chunks: 2 [08:12:30.585] Number of futures (= number of chunks): 2 [08:12:30.585] Launching 2 futures (chunks) ... [08:12:30.586] Chunk #1 of 2 ... [08:12:30.586] - Finding globals in 'args_list' chunk #1 ... [08:12:30.587] [08:12:30.587] [08:12:30.587] - Finding globals in 'args_list' for chunk #1 ... DONE [08:12:30.612] Chunk #1 of 2 ... DONE [08:12:30.612] Chunk #2 of 2 ... [08:12:30.612] - Finding globals in 'args_list' chunk #2 ... [08:12:30.613] [08:12:30.613] [08:12:30.613] - Finding globals in 'args_list' for chunk #2 ... DONE [08:12:30.757] Chunk #2 of 2 ... DONE [08:12:30.757] Launching 2 futures (chunks) ... DONE [08:12:30.757] - resolving futures [08:12:30.758] - gathering results & relaying conditions (except errors) [08:12:30.926] - collecting values of futures [08:12:30.927] - accumulating results [08:12:30.927] - processing errors (handler = 'stop') [08:12:30.928] - extracting results [08:12:30.928] doFuture() ... DONE [[1]] [1] 0.1994711 [[2]] [1] 0.1760327 [[3]] [1] 0.1209854 - plan('multisession') ... DONE - plan('cluster') ... [08:12:31.455] doFuture() ... [08:12:31.456] - dummy globals (as locals): [1] 'i' [08:12:31.457] - R expression: [08:12:31.457] { [08:12:31.457] doFuture::registerDoFuture() [08:12:31.457] lapply(seq_along(...future.x_ii), FUN = function(jj) { [08:12:31.457] ...future.x_jj <- ...future.x_ii[[jj]] [08:12:31.457] { [08:12:31.457] NULL [08:12:31.457] i <- NULL [08:12:31.457] } [08:12:31.457] ...future.env <- environment() [08:12:31.457] local({ [08:12:31.457] for (name in names(...future.x_jj)) { [08:12:31.457] assign(name, ...future.x_jj[[name]], envir = ...future.env, [08:12:31.457] inherits = FALSE) [08:12:31.457] } [08:12:31.457] }) [08:12:31.457] tryCatch({ [08:12:31.457] dnorm(i, mean = mu, sd = sigma) [08:12:31.457] }, error = identity) [08:12:31.457] }) [08:12:31.457] } [08:12:31.458] - identifying globals and packages ... [08:12:31.473] List of 3 [08:12:31.473] $ ...future.x_ii: NULL [08:12:31.473] $ mu : num 1 [08:12:31.473] $ sigma : num 2 [08:12:31.473] - attr(*, "where")=List of 3 [08:12:31.473] ..$ ...future.x_ii: [08:12:31.473] ..$ mu : [08:12:31.473] ..$ sigma : [08:12:31.473] - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list" [08:12:31.473] - attr(*, "resolved")= logi FALSE [08:12:31.473] - attr(*, "total_size")= num 112 [08:12:31.480] - R expression: [08:12:31.481] { [08:12:31.481] doFuture::registerDoFuture() [08:12:31.481] lapply(seq_along(...future.x_ii), FUN = function(jj) { [08:12:31.481] ...future.x_jj <- ...future.x_ii[[jj]] [08:12:31.481] { [08:12:31.481] NULL [08:12:31.481] i <- NULL [08:12:31.481] } [08:12:31.481] ...future.env <- environment() [08:12:31.481] local({ [08:12:31.481] for (name in names(...future.x_jj)) { [08:12:31.481] assign(name, ...future.x_jj[[name]], envir = ...future.env, [08:12:31.481] inherits = FALSE) [08:12:31.481] } [08:12:31.481] }) [08:12:31.481] tryCatch({ [08:12:31.481] dnorm(i, mean = mu, sd = sigma) [08:12:31.481] }, error = identity) [08:12:31.481] }) [08:12:31.481] } [08:12:31.482] - globals: [3] '...future.x_ii', 'mu', 'sigma' [08:12:31.482] List of 3 [08:12:31.482] $ ...future.x_ii: NULL [08:12:31.482] $ mu : num 1 [08:12:31.482] $ sigma : num 2 [08:12:31.482] - attr(*, "where")=List of 3 [08:12:31.482] ..$ ...future.x_ii: [08:12:31.482] ..$ mu : [08:12:31.482] ..$ sigma : [08:12:31.482] - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list" [08:12:31.482] - attr(*, "resolved")= logi FALSE [08:12:31.482] - attr(*, "total_size")= num 112 [08:12:31.489] - packages: [2] 'doFuture', 'stats' [08:12:31.489] - identifying globals and packages ... DONE [08:12:31.496] Number of chunks: 2 [08:12:31.496] Number of futures (= number of chunks): 2 [08:12:31.497] Launching 2 futures (chunks) ... [08:12:31.497] Chunk #1 of 2 ... [08:12:31.497] - Finding globals in 'args_list' chunk #1 ... [08:12:31.498] [08:12:31.498] [08:12:31.499] - Finding globals in 'args_list' for chunk #1 ... DONE [08:12:31.530] Chunk #1 of 2 ... DONE [08:12:31.530] Chunk #2 of 2 ... [08:12:31.530] - Finding globals in 'args_list' chunk #2 ... [08:12:31.531] [08:12:31.532] [08:12:31.532] - Finding globals in 'args_list' for chunk #2 ... DONE [08:12:31.684] Chunk #2 of 2 ... DONE [08:12:31.684] Launching 2 futures (chunks) ... DONE [08:12:31.685] - resolving futures [08:12:31.685] - gathering results & relaying conditions (except errors) [08:12:31.873] - collecting values of futures [08:12:31.874] - accumulating results [08:12:31.875] - processing errors (handler = 'stop') [08:12:31.876] - extracting results [08:12:31.876] 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 Under development (unstable) (2023-12-19 r85710 ucrt) Platform: x86_64-w64-mingw32/x64 Running under: Windows Server 2022 x64 (build 20348) Matrix products: default 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.1 future_1.33.0 foreach_1.5.2 loaded via a namespace (and not attached): [1] compiler_4.4.0 parallelly_1.36.0 tools_4.4.0 [4] parallel_4.4.0 future.apply_1.11.0 listenv_0.9.0 [7] codetools_0.2-19 iterators_1.0.14 digest_0.6.33 [10] globals_0.16.2 > > proc.time() user system elapsed 0.90 0.26 3.21