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: foreach Loading required package: future R Under development (unstable) (2023-12-20 r85711 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.1 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') ... [13:11:54.395] doFuture() ... [13:11:54.397] - dummy globals (as locals): [1] 'i' [13:11:54.397] - R expression: [13:11:54.398] { [13:11:54.398] doFuture::registerDoFuture() [13:11:54.398] lapply(seq_along(...future.x_ii), FUN = function(jj) { [13:11:54.398] ...future.x_jj <- ...future.x_ii[[jj]] [13:11:54.398] { [13:11:54.398] NULL [13:11:54.398] i <- NULL [13:11:54.398] } [13:11:54.398] ...future.env <- environment() [13:11:54.398] local({ [13:11:54.398] for (name in names(...future.x_jj)) { [13:11:54.398] assign(name, ...future.x_jj[[name]], envir = ...future.env, [13:11:54.398] inherits = FALSE) [13:11:54.398] } [13:11:54.398] }) [13:11:54.398] tryCatch({ [13:11:54.398] dnorm(i, mean = mu, sd = sigma) [13:11:54.398] }, error = identity) [13:11:54.398] }) [13:11:54.398] } [13:11:54.398] - identifying globals and packages ... [13:11:54.415] List of 3 [13:11:54.415] $ ...future.x_ii: NULL [13:11:54.415] $ mu : num 1 [13:11:54.415] $ sigma : num 2 [13:11:54.415] - attr(*, "where")=List of 3 [13:11:54.415] ..$ ...future.x_ii: [13:11:54.415] ..$ mu : [13:11:54.415] ..$ sigma : [13:11:54.415] - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list" [13:11:54.415] - attr(*, "resolved")= logi FALSE [13:11:54.415] - attr(*, "total_size")= num 112 [13:11:54.423] - R expression: [13:11:54.423] { [13:11:54.423] doFuture::registerDoFuture() [13:11:54.423] lapply(seq_along(...future.x_ii), FUN = function(jj) { [13:11:54.423] ...future.x_jj <- ...future.x_ii[[jj]] [13:11:54.423] { [13:11:54.423] NULL [13:11:54.423] i <- NULL [13:11:54.423] } [13:11:54.423] ...future.env <- environment() [13:11:54.423] local({ [13:11:54.423] for (name in names(...future.x_jj)) { [13:11:54.423] assign(name, ...future.x_jj[[name]], envir = ...future.env, [13:11:54.423] inherits = FALSE) [13:11:54.423] } [13:11:54.423] }) [13:11:54.423] tryCatch({ [13:11:54.423] dnorm(i, mean = mu, sd = sigma) [13:11:54.423] }, error = identity) [13:11:54.423] }) [13:11:54.423] } [13:11:54.423] - globals: [3] '...future.x_ii', 'mu', 'sigma' [13:11:54.424] List of 3 [13:11:54.424] $ ...future.x_ii: NULL [13:11:54.424] $ mu : num 1 [13:11:54.424] $ sigma : num 2 [13:11:54.424] - attr(*, "where")=List of 3 [13:11:54.424] ..$ ...future.x_ii: [13:11:54.424] ..$ mu : [13:11:54.424] ..$ sigma : [13:11:54.424] - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list" [13:11:54.424] - attr(*, "resolved")= logi FALSE [13:11:54.424] - attr(*, "total_size")= num 112 [13:11:54.428] - packages: [2] 'doFuture', 'stats' [13:11:54.428] - identifying globals and packages ... DONE [13:11:54.429] Number of chunks: 1 [13:11:54.429] Number of futures (= number of chunks): 1 [13:11:54.429] Launching 1 futures (chunks) ... [13:11:54.429] Chunk #1 of 1 ... [13:11:54.430] - Finding globals in 'args_list' chunk #1 ... [13:11:54.430] [13:11:54.431] [13:11:54.431] - Finding globals in 'args_list' for chunk #1 ... DONE [13:11:54.444] Chunk #1 of 1 ... DONE [13:11:54.444] Launching 1 futures (chunks) ... DONE [13:11:54.445] - resolving futures [13:11:54.445] - gathering results & relaying conditions (except errors) [13:11:54.446] - collecting values of futures [13:11:54.446] - accumulating results [13:11:54.448] - processing errors (handler = 'stop') [13:11:54.448] - extracting results [13:11:54.448] doFuture() ... DONE [[1]] [1] 0.1994711 [[2]] [1] 0.1760327 [[3]] [1] 0.1209854 - plan('sequential') ... DONE - plan('multisession') ... [13:11:55.277] doFuture() ... [13:11:55.278] - dummy globals (as locals): [1] 'i' [13:11:55.278] - R expression: [13:11:55.279] { [13:11:55.279] doFuture::registerDoFuture() [13:11:55.279] lapply(seq_along(...future.x_ii), FUN = function(jj) { [13:11:55.279] ...future.x_jj <- ...future.x_ii[[jj]] [13:11:55.279] { [13:11:55.279] NULL [13:11:55.279] i <- NULL [13:11:55.279] } [13:11:55.279] ...future.env <- environment() [13:11:55.279] local({ [13:11:55.279] for (name in names(...future.x_jj)) { [13:11:55.279] assign(name, ...future.x_jj[[name]], envir = ...future.env, [13:11:55.279] inherits = FALSE) [13:11:55.279] } [13:11:55.279] }) [13:11:55.279] tryCatch({ [13:11:55.279] dnorm(i, mean = mu, sd = sigma) [13:11:55.279] }, error = identity) [13:11:55.279] }) [13:11:55.279] } [13:11:55.279] - identifying globals and packages ... [13:11:55.287] List of 3 [13:11:55.287] $ ...future.x_ii: NULL [13:11:55.287] $ mu : num 1 [13:11:55.287] $ sigma : num 2 [13:11:55.287] - attr(*, "where")=List of 3 [13:11:55.287] ..$ ...future.x_ii: [13:11:55.287] ..$ mu : [13:11:55.287] ..$ sigma : [13:11:55.287] - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list" [13:11:55.287] - attr(*, "resolved")= logi FALSE [13:11:55.287] - attr(*, "total_size")= num 112 [13:11:55.291] - R expression: [13:11:55.291] { [13:11:55.291] doFuture::registerDoFuture() [13:11:55.291] lapply(seq_along(...future.x_ii), FUN = function(jj) { [13:11:55.291] ...future.x_jj <- ...future.x_ii[[jj]] [13:11:55.291] { [13:11:55.291] NULL [13:11:55.291] i <- NULL [13:11:55.291] } [13:11:55.291] ...future.env <- environment() [13:11:55.291] local({ [13:11:55.291] for (name in names(...future.x_jj)) { [13:11:55.291] assign(name, ...future.x_jj[[name]], envir = ...future.env, [13:11:55.291] inherits = FALSE) [13:11:55.291] } [13:11:55.291] }) [13:11:55.291] tryCatch({ [13:11:55.291] dnorm(i, mean = mu, sd = sigma) [13:11:55.291] }, error = identity) [13:11:55.291] }) [13:11:55.291] } [13:11:55.292] - globals: [3] '...future.x_ii', 'mu', 'sigma' [13:11:55.292] List of 3 [13:11:55.292] $ ...future.x_ii: NULL [13:11:55.292] $ mu : num 1 [13:11:55.292] $ sigma : num 2 [13:11:55.292] - attr(*, "where")=List of 3 [13:11:55.292] ..$ ...future.x_ii: [13:11:55.292] ..$ mu : [13:11:55.292] ..$ sigma : [13:11:55.292] - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list" [13:11:55.292] - attr(*, "resolved")= logi FALSE [13:11:55.292] - attr(*, "total_size")= num 112 [13:11:55.296] - packages: [2] 'doFuture', 'stats' [13:11:55.296] - identifying globals and packages ... DONE [13:11:55.300] Number of chunks: 2 [13:11:55.300] Number of futures (= number of chunks): 2 [13:11:55.301] Launching 2 futures (chunks) ... [13:11:55.301] Chunk #1 of 2 ... [13:11:55.301] - Finding globals in 'args_list' chunk #1 ... [13:11:55.302] [13:11:55.302] [13:11:55.302] - Finding globals in 'args_list' for chunk #1 ... DONE [13:11:55.320] Chunk #1 of 2 ... DONE [13:11:55.320] Chunk #2 of 2 ... [13:11:55.320] - Finding globals in 'args_list' chunk #2 ... [13:11:55.321] [13:11:55.321] [13:11:55.321] - Finding globals in 'args_list' for chunk #2 ... DONE [13:11:55.414] Chunk #2 of 2 ... DONE [13:11:55.414] Launching 2 futures (chunks) ... DONE [13:11:55.414] - resolving futures [13:11:55.414] - gathering results & relaying conditions (except errors) [13:11:55.514] - collecting values of futures [13:11:55.514] - accumulating results [13:11:55.515] - processing errors (handler = 'stop') [13:11:55.515] - extracting results [13:11:55.515] doFuture() ... DONE [[1]] [1] 0.1994711 [[2]] [1] 0.1760327 [[3]] [1] 0.1209854 - plan('multisession') ... DONE - plan('cluster') ... [13:11:55.853] doFuture() ... [13:11:55.853] - dummy globals (as locals): [1] 'i' [13:11:55.854] - R expression: [13:11:55.854] { [13:11:55.854] doFuture::registerDoFuture() [13:11:55.854] lapply(seq_along(...future.x_ii), FUN = function(jj) { [13:11:55.854] ...future.x_jj <- ...future.x_ii[[jj]] [13:11:55.854] { [13:11:55.854] NULL [13:11:55.854] i <- NULL [13:11:55.854] } [13:11:55.854] ...future.env <- environment() [13:11:55.854] local({ [13:11:55.854] for (name in names(...future.x_jj)) { [13:11:55.854] assign(name, ...future.x_jj[[name]], envir = ...future.env, [13:11:55.854] inherits = FALSE) [13:11:55.854] } [13:11:55.854] }) [13:11:55.854] tryCatch({ [13:11:55.854] dnorm(i, mean = mu, sd = sigma) [13:11:55.854] }, error = identity) [13:11:55.854] }) [13:11:55.854] } [13:11:55.854] - identifying globals and packages ... [13:11:55.862] List of 3 [13:11:55.862] $ ...future.x_ii: NULL [13:11:55.862] $ mu : num 1 [13:11:55.862] $ sigma : num 2 [13:11:55.862] - attr(*, "where")=List of 3 [13:11:55.862] ..$ ...future.x_ii: [13:11:55.862] ..$ mu : [13:11:55.862] ..$ sigma : [13:11:55.862] - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list" [13:11:55.862] - attr(*, "resolved")= logi FALSE [13:11:55.862] - attr(*, "total_size")= num 112 [13:11:55.866] - R expression: [13:11:55.866] { [13:11:55.866] doFuture::registerDoFuture() [13:11:55.866] lapply(seq_along(...future.x_ii), FUN = function(jj) { [13:11:55.866] ...future.x_jj <- ...future.x_ii[[jj]] [13:11:55.866] { [13:11:55.866] NULL [13:11:55.866] i <- NULL [13:11:55.866] } [13:11:55.866] ...future.env <- environment() [13:11:55.866] local({ [13:11:55.866] for (name in names(...future.x_jj)) { [13:11:55.866] assign(name, ...future.x_jj[[name]], envir = ...future.env, [13:11:55.866] inherits = FALSE) [13:11:55.866] } [13:11:55.866] }) [13:11:55.866] tryCatch({ [13:11:55.866] dnorm(i, mean = mu, sd = sigma) [13:11:55.866] }, error = identity) [13:11:55.866] }) [13:11:55.866] } [13:11:55.866] - globals: [3] '...future.x_ii', 'mu', 'sigma' [13:11:55.867] List of 3 [13:11:55.867] $ ...future.x_ii: NULL [13:11:55.867] $ mu : num 1 [13:11:55.867] $ sigma : num 2 [13:11:55.867] - attr(*, "where")=List of 3 [13:11:55.867] ..$ ...future.x_ii: [13:11:55.867] ..$ mu : [13:11:55.867] ..$ sigma : [13:11:55.867] - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list" [13:11:55.867] - attr(*, "resolved")= logi FALSE [13:11:55.867] - attr(*, "total_size")= num 112 [13:11:55.871] - packages: [2] 'doFuture', 'stats' [13:11:55.871] - identifying globals and packages ... DONE [13:11:55.874] Number of chunks: 2 [13:11:55.874] Number of futures (= number of chunks): 2 [13:11:55.875] Launching 2 futures (chunks) ... [13:11:55.875] Chunk #1 of 2 ... [13:11:55.875] - Finding globals in 'args_list' chunk #1 ... [13:11:55.875] [13:11:55.875] [13:11:55.876] - Finding globals in 'args_list' for chunk #1 ... DONE [13:11:55.894] Chunk #1 of 2 ... DONE [13:11:55.894] Chunk #2 of 2 ... [13:11:55.895] - Finding globals in 'args_list' chunk #2 ... [13:11:55.895] [13:11:55.895] [13:11:55.895] - Finding globals in 'args_list' for chunk #2 ... DONE [13:11:55.984] Chunk #2 of 2 ... DONE [13:11:55.984] Launching 2 futures (chunks) ... DONE [13:11:55.985] - resolving futures [13:11:55.985] - gathering results & relaying conditions (except errors) [13:11:56.087] - collecting values of futures [13:11:56.087] - accumulating results [13:11:56.088] - processing errors (handler = 'stop') [13:11:56.088] - extracting results [13:11:56.088] 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-20 r85711 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.1 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.60 0.12 2.09