Running ‘DEPRECATED.R’ [1s/1s]
  Running ‘cluster-missing-doFuture-pkg.R’ [1s/3s]
  Running ‘doRNG,dopar.R’ [3s/33s]
  Running ‘doRNG,dorng.R’ [6s/36s]
  Running ‘foreach,errors.R’ [7s/97s]
  Running ‘foreach,globals.R’ [8s/95s]
  Running ‘foreach,nested.R’ [8s/127s]
  Running ‘foreach,nested_dopar.R’ [11s/115s]
  Running ‘foreach.R’ [10s/45s]
  Running ‘future.BatchJobs.R’ [26s/31s]
  Running ‘future.batchtools.R’ [46s/42s]
  Running ‘options.R’ [3s/19s]
  Running ‘registerDoFuture.R’ [2s/32s]
  Running ‘times.R’ [3s/33s]
  Running ‘zzz_opt-in,NMF.R’ [0s/1s]
  Running ‘zzz_opt-in,TSP.R’ [0s/1s]
  Running ‘zzz_opt-in,caret.R’ [0s/1s]
  Running ‘zzz_opt-in,foreach.R’ [0s/1s]
  Running ‘zzz_opt-in,glmnet.R’ [0s/0s]
  Running ‘zzz_opt-in,plyr.R’ [0s/1s]
Running the tests in ‘tests/foreach,nested_dopar.R’ failed.
Complete output:
  > source("incl/start.R")
  Loading required package: globals
  Loading required package: future
  Loading required package: foreach
  Loading required package: iterators
  Loading required package: parallel
  plan(): Setting new future strategy stack:
  List of future strategies:
  1. sequential:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: future::plan(future::sequential)
  
  plan(): nbrOfWorkers() = 1
  > 
  > strategies <- future:::supportedStrategies()
  > strategies <- setdiff(strategies, "multiprocess")
  > 
  > message("*** doFuture - nested %dopar% ...")
  *** doFuture - nested %dopar% ...
  > 
  > registerDoFuture()
  > 
  > message("*** doFuture - nested %dopar%  and tricky globals ...")
  *** doFuture - nested %dopar%  and tricky globals ...
  > 
  > ## This works ...
  > x <- foreach(j = 1) %dopar% { j }
  [20:52:29.481] doFuture() ...
  [20:52:29.484] - dummy globals (as locals): [1] 'j'
  [20:52:29.485] - R expression:
  [20:52:29.486] {
  [20:52:29.486]     doFuture::registerDoFuture()
  [20:52:29.486]     lapply(seq_along(...future.x_ii), FUN = function(jj) {
  [20:52:29.486]         ...future.x_jj <- ...future.x_ii[[jj]]
  [20:52:29.486]         j <- NULL
  [20:52:29.486]         ...future.env <- environment()
  [20:52:29.486]         local({
  [20:52:29.486]             for (name in names(...future.x_jj)) {
  [20:52:29.486]                 assign(name, ...future.x_jj[[name]], envir = ...future.env, 
  [20:52:29.486]                   inherits = FALSE)
  [20:52:29.486]             }
  [20:52:29.486]         })
  [20:52:29.486]         tryCatch({
  [20:52:29.486]             j
  [20:52:29.486]         }, error = identity)
  [20:52:29.486]     })
  [20:52:29.486] }
  [20:52:29.487] - identifying globals and packages ...
  getGlobalsAndPackages() ...
  Searching for globals...
  - globals found: [14] '{', '::', 'lapply', 'seq_along', '...future.x_ii', '<-', '[[', 'environment', 'local', 'for', 'names', 'assign', 'tryCatch', 'identity'
  Searching for globals ... DONE
  Resolving globals: FALSE
  The total size of the 1 globals is 0 bytes (0 bytes)
  - globals: [1] '...future.x_ii'
  
  getGlobalsAndPackages() ... DONE
  [20:52:29.530] List of 1
  [20:52:29.530]  $ ...future.x_ii: NULL
  [20:52:29.530]  - attr(*, "where")=List of 1
  [20:52:29.530]   ..$ ...future.x_ii:<environment: 0x55a47fd2e2a0> 
  [20:52:29.530]  - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list"
  [20:52:29.530]  - attr(*, "resolved")= logi FALSE
  [20:52:29.530]  - attr(*, "total_size")= num 0
  [20:52:29.541]   - R expression:
  [20:52:29.541] {
  [20:52:29.541]     doFuture::registerDoFuture()
  [20:52:29.541]     lapply(seq_along(...future.x_ii), FUN = function(jj) {
  [20:52:29.541]         ...future.x_jj <- ...future.x_ii[[jj]]
  [20:52:29.541]         j <- NULL
  [20:52:29.541]         ...future.env <- environment()
  [20:52:29.541]         local({
  [20:52:29.541]             for (name in names(...future.x_jj)) {
  [20:52:29.541]                 assign(name, ...future.x_jj[[name]], envir = ...future.env, 
  [20:52:29.541]                   inherits = FALSE)
  [20:52:29.541]             }
  [20:52:29.541]         })
  [20:52:29.541]         tryCatch({
  [20:52:29.541]             j
  [20:52:29.541]         }, error = identity)
  [20:52:29.541]     })
  [20:52:29.541] }
  [20:52:29.542]   - globals: [1] '...future.x_ii'
  [20:52:29.542] List of 1
  [20:52:29.542]  $ ...future.x_ii: NULL
  [20:52:29.542]  - attr(*, "where")=List of 1
  [20:52:29.542]   ..$ ...future.x_ii:<environment: 0x55a47fd2e2a0> 
  [20:52:29.542]  - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list"
  [20:52:29.542]  - attr(*, "resolved")= logi FALSE
  [20:52:29.542]  - attr(*, "total_size")= num 0
  [20:52:29.547]   - packages: [1] 'doFuture'
  [20:52:29.548] - identifying globals and packages ... DONE
  [20:52:29.548] Number of chunks: 1
  [20:52:29.549] Number of futures (= number of chunks): 1
  [20:52:29.549] Launching 1 futures (chunks) ...
  [20:52:29.550] Chunk #1 of 1 ...
  [20:52:29.550]  - Finding globals in 'args_list' chunk #1 ...
  getGlobalsAndPackages() ...
  Searching for globals...
  
  Searching for globals ... DONE
  - globals: [0] <none>
  getGlobalsAndPackages() ... DONE
  [20:52:29.552] 
  [20:52:29.552] 
  [20:52:29.553]  - Finding globals in 'args_list' for chunk #1 ... DONE
  getGlobalsAndPackages() ...
  - globals passed as-is: [1] '...future.x_ii'
  Resolving globals: FALSE
  The total size of the 1 globals is 56 bytes (56 bytes)
  - globals: [1] '...future.x_ii'
  
  getGlobalsAndPackages() ... DONE
  Packages needed by future strategies (n = 0): <none>
  Packages needed by the future expression (n = 1): 'doFuture'
  {
      {
          ...future.startTime <- Sys.time()
          ...future.oldOptions <- options(future.startup.loadScript = FALSE, 
              future.globals.onMissing = "ignore", future.globals.maxSize = NULL, 
              future.globals.method = NULL, future.globals.onMissing = NULL, 
              future.globals.onReference = NULL, future.globals.resolve = NULL, 
              future.resolve.recursive = NULL, width = 80L)
          {
              {
                  {
                    has_future <- requireNamespace("future", quietly = TRUE)
                    version <- if (has_future) 
                      packageVersion("future")
                    else NULL
                    if (!has_future || version < "1.8.0") {
                      info <- c(r_version = gsub("R version ", 
                        "", R.version$version.string), platform = sprintf("%s (%s-bit)", 
                        R.version$platform, 8 * .Machine$sizeof.pointer), 
                        os = paste(Sys.info()[c("sysname", "release", 
                          "version")], collapse = " "), hostname = Sys.info()[["nodename"]])
                      info <- sprintf("%s: %s", names(info), info)
                      info <- paste(info, collapse = "; ")
                      if (!has_future) {
                        msg <- sprintf("Package 'future' is not installed on worker (%s)", 
                          info)
                      }
                      else {
                        msg <- sprintf("Package 'future' on worker (%s) must be of version >= 1.8.0: %s", 
                          info, version)
                      }
                      stop(msg)
                    }
                  }
                  local({
                    for (pkg in "doFuture") {
                      loadNamespace(pkg)
                      library(pkg, character.only = TRUE)
                    }
                  })
              }
              future::plan("default", .cleanup = FALSE, .init = FALSE)
          }
      }
      if (is.na(TRUE)) {
      }
      else {
          if (TRUE) {
              ...future.stdout <- rawConnection(raw(0L), open = "w")
          }
          else {
              ...future.stdout <- file(switch(.Platform$OS.type, 
                  windows = "NUL", "/dev/null"), open = "w")
          }
          sink(...future.stdout, type = "output", split = FALSE)
          on.exit(if (!is.null(...future.stdout)) {
              sink(type = "output", split = FALSE)
              close(...future.stdout)
          }, add = TRUE)
      }
      ...future.frame <- sys.nframe()
      ...future.conditions <- list()
      ...future.result <- tryCatch({
          withCallingHandlers({
              ...future.value <- local({
                  doFuture::registerDoFuture()
                  lapply(seq_along(...future.x_ii), FUN = function(jj) {
                    ...future.x_jj <- ...future.x_ii[[jj]]
                    j <- NULL
                    ...future.env <- environment()
                    local({
                      for (name in names(...future.x_jj)) {
                        assign(name, ...future.x_jj[[name]], envir = ...future.env, 
                          inherits = FALSE)
                      }
                    })
                    tryCatch({
                      j
                    }, error = identity)
                  })
              })
              future::FutureResult(value = ...future.value, started = ...future.startTime, 
                  version = "1.8")
          }, condition = local({
              inherits <- base::inherits
              invokeRestart <- base::invokeRestart
              length <- base::length
              seq.int <- base::seq.int
              sys.calls <- base::sys.calls
              `[[` <- base::`[[`
              `+` <- base::`+`
              `<<-` <- base::`<<-`
              sysCalls <- function(calls = sys.calls(), from = 1L) {
                  calls[seq.int(from = from + 12L, to = length(calls) - 
                    3L)]
              }
              function(cond) {
                  if (inherits(cond, "error")) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond, calls = c(sysCalls(from = ...future.frame), 
                      cond$call), timestamp = base::Sys.time())
                    signalCondition(cond)
                  }
                  else if (inherits(cond, c("message", "warning"
                  ))) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond)
                    if (inherits(cond, "message")) {
                      invokeRestart("muffleMessage")
                    }
                    else if (inherits(cond, "warning")) {
                      invokeRestart("muffleWarning")
                    }
                  }
              }
          }))
      }, error = function(ex) {
          structure(list(value = NULL, conditions = ...future.conditions, 
              condition = ex, calls = sys.calls(), version = "1.8"), 
              class = "FutureResult")
      }, finally = {
          {
              NULL
              future::plan(list(function (expr, envir = parent.frame(), 
                  substitute = TRUE, lazy = FALSE, seed = NULL, 
                  globals = TRUE, local = TRUE, earlySignal = FALSE, 
                  label = NULL, ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  local <- as.logical(local)
                  future <- SequentialFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, local = local, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }), .cleanup = FALSE, .init = FALSE)
          }
          options(...future.oldOptions)
      })
      if (is.na(TRUE)) {
      }
      else {
          sink(type = "output", split = FALSE)
          if (TRUE) {
              ...future.result$stdout <- rawToChar(rawConnectionValue(...future.stdout))
          }
          else {
              ...future.result["stdout"] <- list(NULL)
          }
          close(...future.stdout)
          ...future.stdout <- NULL
      }
      ...future.result$conditions <- ...future.conditions
      ...future.result
  }
  plan(): Setting new future strategy stack:
  List of future strategies:
  1. sequential:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: NULL
  
  plan(): nbrOfWorkers() = 1
  plan(): Setting new future strategy stack:
  List of future strategies:
  1. sequential:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: future::plan(future::sequential)
  
  plan(): nbrOfWorkers() = 1
  SequentialFuture started (and completed)
  [20:52:29.572] Chunk #1 of 1 ... DONE
  [20:52:29.572] Launching 1 futures (chunks) ... DONE
  [20:52:29.573] - resolving futures
  resolve() on list ...
   recursive: 0
   length: 1
  
   length: 0 (resolved future 1)
  resolve() on list ... DONE
  [20:52:29.575] - relaying conditions of futures
  [20:52:29.576] - collecting values of futures
  [20:52:29.576] - accumulating results
  [20:52:29.578] - processing errors (handler = 'stop')
  [20:52:29.579] - extracting results
  [20:52:29.579] doFuture() ... DONE
  > str(x)
  List of 1
   $ : num 1
  > rm(list = "x")
  > 
  > ## ... but this would give a "globals-not-found" error in
  > ## doFuture (<= 0.4.0) because 'j' was interpreted as global variable
  > x <- foreach(i = 1, .packages = "foreach") %dopar% {
  +   foreach(j = 1) %dopar% { j }
  + }
  [20:52:29.581] doFuture() ...
  [20:52:29.582] - dummy globals (as locals): [1] 'i'
  [20:52:29.583] - R expression:
  [20:52:29.583] {
  [20:52:29.583]     doFuture::registerDoFuture()
  [20:52:29.583]     lapply(seq_along(...future.x_ii), FUN = function(jj) {
  [20:52:29.583]         ...future.x_jj <- ...future.x_ii[[jj]]
  [20:52:29.583]         i <- NULL
  [20:52:29.583]         ...future.env <- environment()
  [20:52:29.583]         local({
  [20:52:29.583]             for (name in names(...future.x_jj)) {
  [20:52:29.583]                 assign(name, ...future.x_jj[[name]], envir = ...future.env, 
  [20:52:29.583]                   inherits = FALSE)
  [20:52:29.583]             }
  [20:52:29.583]         })
  [20:52:29.583]         tryCatch({
  [20:52:29.583]             foreach(j = 1) %dopar% {
  [20:52:29.583]                 j
  [20:52:29.583]             }
  [20:52:29.583]         }, error = identity)
  [20:52:29.583]     })
  [20:52:29.583] }
  [20:52:29.584] - identifying globals and packages ...
  getGlobalsAndPackages() ...
  Searching for globals...
  - globals found: [17] '{', '::', 'lapply', 'seq_along', '...future.x_ii', '<-', '[[', 'environment', 'local', 'for', 'names', 'assign', 'tryCatch', '%dopar%', 'foreach', 'j', 'identity'
  Searching for globals ... DONE
  Resolving globals: FALSE
  The total size of the 1 globals is 0 bytes (0 bytes)
  - globals: [1] '...future.x_ii'
  - packages: [1] 'foreach'
  getGlobalsAndPackages() ... DONE
  [20:52:29.607] List of 1
  [20:52:29.607]  $ ...future.x_ii: NULL
  [20:52:29.607]  - attr(*, "where")=List of 1
  [20:52:29.607]   ..$ ...future.x_ii:<environment: 0x55a47fce06a8> 
  [20:52:29.607]  - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list"
  [20:52:29.607]  - attr(*, "resolved")= logi FALSE
  [20:52:29.607]  - attr(*, "total_size")= num 0
  [20:52:29.613]   - R expression:
  [20:52:29.613] {
  [20:52:29.613]     doFuture::registerDoFuture()
  [20:52:29.613]     lapply(seq_along(...future.x_ii), FUN = function(jj) {
  [20:52:29.613]         ...future.x_jj <- ...future.x_ii[[jj]]
  [20:52:29.613]         i <- NULL
  [20:52:29.613]         ...future.env <- environment()
  [20:52:29.613]         local({
  [20:52:29.613]             for (name in names(...future.x_jj)) {
  [20:52:29.613]                 assign(name, ...future.x_jj[[name]], envir = ...future.env, 
  [20:52:29.613]                   inherits = FALSE)
  [20:52:29.613]             }
  [20:52:29.613]         })
  [20:52:29.613]         tryCatch({
  [20:52:29.613]             foreach(j = 1) %dopar% {
  [20:52:29.613]                 j
  [20:52:29.613]             }
  [20:52:29.613]         }, error = identity)
  [20:52:29.613]     })
  [20:52:29.613] }
  [20:52:29.614]   - globals: [1] '...future.x_ii'
  [20:52:29.615] List of 1
  [20:52:29.615]  $ ...future.x_ii: NULL
  [20:52:29.615]  - attr(*, "where")=List of 1
  [20:52:29.615]   ..$ ...future.x_ii:<environment: 0x55a47fce06a8> 
  [20:52:29.615]  - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list"
  [20:52:29.615]  - attr(*, "resolved")= logi FALSE
  [20:52:29.615]  - attr(*, "total_size")= num 0
  [20:52:29.620]   - packages: [2] 'doFuture', 'foreach'
  [20:52:29.621] - identifying globals and packages ... DONE
  [20:52:29.621] Number of chunks: 1
  [20:52:29.621] Number of futures (= number of chunks): 1
  [20:52:29.622] Launching 1 futures (chunks) ...
  [20:52:29.622] Chunk #1 of 1 ...
  [20:52:29.622]  - Finding globals in 'args_list' chunk #1 ...
  getGlobalsAndPackages() ...
  Searching for globals...
  
  Searching for globals ... DONE
  - globals: [0] <none>
  getGlobalsAndPackages() ... DONE
  [20:52:29.624] 
  [20:52:29.625] 
  [20:52:29.625]  - Finding globals in 'args_list' for chunk #1 ... DONE
  getGlobalsAndPackages() ...
  - globals passed as-is: [1] '...future.x_ii'
  Resolving globals: FALSE
  The total size of the 1 globals is 56 bytes (56 bytes)
  - globals: [1] '...future.x_ii'
  
  getGlobalsAndPackages() ... DONE
  Packages needed by future strategies (n = 0): <none>
  Packages needed by the future expression (n = 2): 'doFuture', 'foreach'
  {
      {
          ...future.startTime <- Sys.time()
          ...future.oldOptions <- options(future.startup.loadScript = FALSE, 
              future.globals.onMissing = "ignore", future.globals.maxSize = NULL, 
              future.globals.method = NULL, future.globals.onMissing = "ignore", 
              future.globals.onReference = NULL, future.globals.resolve = NULL, 
              future.resolve.recursive = NULL, width = 80L)
          {
              {
                  {
                    has_future <- requireNamespace("future", quietly = TRUE)
                    version <- if (has_future) 
                      packageVersion("future")
                    else NULL
                    if (!has_future || version < "1.8.0") {
                      info <- c(r_version = gsub("R version ", 
                        "", R.version$version.string), platform = sprintf("%s (%s-bit)", 
                        R.version$platform, 8 * .Machine$sizeof.pointer), 
                        os = paste(Sys.info()[c("sysname", "release", 
                          "version")], collapse = " "), hostname = Sys.info()[["nodename"]])
                      info <- sprintf("%s: %s", names(info), info)
                      info <- paste(info, collapse = "; ")
                      if (!has_future) {
                        msg <- sprintf("Package 'future' is not installed on worker (%s)", 
                          info)
                      }
                      else {
                        msg <- sprintf("Package 'future' on worker (%s) must be of version >= 1.8.0: %s", 
                          info, version)
                      }
                      stop(msg)
                    }
                  }
                  local({
                    for (pkg in c("doFuture", "foreach")) {
                      loadNamespace(pkg)
                      library(pkg, character.only = TRUE)
                    }
                  })
              }
              future::plan("default", .cleanup = FALSE, .init = FALSE)
          }
      }
      if (is.na(TRUE)) {
      }
      else {
          if (TRUE) {
              ...future.stdout <- rawConnection(raw(0L), open = "w")
          }
          else {
              ...future.stdout <- file(switch(.Platform$OS.type, 
                  windows = "NUL", "/dev/null"), open = "w")
          }
          sink(...future.stdout, type = "output", split = FALSE)
          on.exit(if (!is.null(...future.stdout)) {
              sink(type = "output", split = FALSE)
              close(...future.stdout)
          }, add = TRUE)
      }
      ...future.frame <- sys.nframe()
      ...future.conditions <- list()
      ...future.result <- tryCatch({
          withCallingHandlers({
              ...future.value <- local({
                  doFuture::registerDoFuture()
                  lapply(seq_along(...future.x_ii), FUN = function(jj) {
                    ...future.x_jj <- ...future.x_ii[[jj]]
                    i <- NULL
                    ...future.env <- environment()
                    local({
                      for (name in names(...future.x_jj)) {
                        assign(name, ...future.x_jj[[name]], envir = ...future.env, 
                          inherits = FALSE)
                      }
                    })
                    tryCatch({
                      foreach(j = 1) %dopar% {
                        j
                      }
                    }, error = identity)
                  })
              })
              future::FutureResult(value = ...future.value, started = ...future.startTime, 
                  version = "1.8")
          }, condition = local({
              inherits <- base::inherits
              invokeRestart <- base::invokeRestart
              length <- base::length
              seq.int <- base::seq.int
              sys.calls <- base::sys.calls
              `[[` <- base::`[[`
              `+` <- base::`+`
              `<<-` <- base::`<<-`
              sysCalls <- function(calls = sys.calls(), from = 1L) {
                  calls[seq.int(from = from + 12L, to = length(calls) - 
                    3L)]
              }
              function(cond) {
                  if (inherits(cond, "error")) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond, calls = c(sysCalls(from = ...future.frame), 
                      cond$call), timestamp = base::Sys.time())
                    signalCondition(cond)
                  }
                  else if (inherits(cond, c("message", "warning"
                  ))) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond)
                    if (inherits(cond, "message")) {
                      invokeRestart("muffleMessage")
                    }
                    else if (inherits(cond, "warning")) {
                      invokeRestart("muffleWarning")
                    }
                  }
              }
          }))
      }, error = function(ex) {
          structure(list(value = NULL, conditions = ...future.conditions, 
              condition = ex, calls = sys.calls(), version = "1.8"), 
              class = "FutureResult")
      }, finally = {
          {
              NULL
              future::plan(list(function (expr, envir = parent.frame(), 
                  substitute = TRUE, lazy = FALSE, seed = NULL, 
                  globals = TRUE, local = TRUE, earlySignal = FALSE, 
                  label = NULL, ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  local <- as.logical(local)
                  future <- SequentialFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, local = local, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }), .cleanup = FALSE, .init = FALSE)
          }
          options(...future.oldOptions)
      })
      if (is.na(TRUE)) {
      }
      else {
          sink(type = "output", split = FALSE)
          if (TRUE) {
              ...future.result$stdout <- rawToChar(rawConnectionValue(...future.stdout))
          }
          else {
              ...future.result["stdout"] <- list(NULL)
          }
          close(...future.stdout)
          ...future.stdout <- NULL
      }
      ...future.result$conditions <- ...future.conditions
      ...future.result
  }
  plan(): Setting new future strategy stack:
  List of future strategies:
  1. sequential:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: NULL
  
  plan(): nbrOfWorkers() = 1
  plan(): Setting new future strategy stack:
  List of future strategies:
  1. sequential:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: future::plan(future::sequential)
  
  plan(): nbrOfWorkers() = 1
  SequentialFuture started (and completed)
  [20:52:29.712] Chunk #1 of 1 ... DONE
  [20:52:29.712] Launching 1 futures (chunks) ... DONE
  [20:52:29.713] - resolving futures
  resolve() on list ...
   recursive: 0
   length: 1
  
   length: 0 (resolved future 1)
  resolve() on list ... DONE
  [20:52:29.714] - relaying conditions of futures
  Future state: 'finished'
  [20:52:29.640] doFuture() ...
  [20:52:29.641] - dummy globals (as locals): [1] 'j'
  [20:52:29.642] - R expression:
  [20:52:29.642] {
  [20:52:29.642]     doFuture::registerDoFuture()
  [20:52:29.642]     lapply(seq_along(...future.x_ii), FUN = function(jj) {
  [20:52:29.642]         ...future.x_jj <- ...future.x_ii[[jj]]
  [20:52:29.642]         j <- NULL
  [20:52:29.642]         ...future.env <- environment()
  [20:52:29.642]         local({
  [20:52:29.642]             for (name in names(...future.x_jj)) {
  [20:52:29.642]                 assign(name, ...future.x_jj[[name]], envir = ...future.env, 
  [20:52:29.642]                   inherits = FALSE)
  [20:52:29.642]             }
  [20:52:29.642]         })
  [20:52:29.642]         tryCatch({
  [20:52:29.642]             j
  [20:52:29.642]         }, error = identity)
  [20:52:29.642]     })
  [20:52:29.642] }
  [20:52:29.643] - identifying globals and packages ...
  getGlobalsAndPackages() ...
  Searching for globals...
  - globals found: [14] '{', '::', 'lapply', 'seq_along', '...future.x_ii', '<-', '[[', 'environment', 'local', 'for', 'names', 'assign', 'tryCatch', 'identity'
  Searching for globals ... DONE
  Resolving globals: FALSE
  The total size of the 1 globals is 0 bytes (0 bytes)
  - globals: [1] '...future.x_ii'
  
  getGlobalsAndPackages() ... DONE
  [20:52:29.661] List of 1
  [20:52:29.661]  $ ...future.x_ii: NULL
  [20:52:29.661]  - attr(*, "where")=List of 1
  [20:52:29.661]   ..$ ...future.x_ii:<environment: 0x55a47f9a78b8> 
  [20:52:29.661]  - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list"
  [20:52:29.661]  - attr(*, "resolved")= logi FALSE
  [20:52:29.661]  - attr(*, "total_size")= num 0
  [20:52:29.671]   - R expression:
  [20:52:29.672] {
  [20:52:29.672]     doFuture::registerDoFuture()
  [20:52:29.672]     lapply(seq_along(...future.x_ii), FUN = function(jj) {
  [20:52:29.672]         ...future.x_jj <- ...future.x_ii[[jj]]
  [20:52:29.672]         j <- NULL
  [20:52:29.672]         ...future.env <- environment()
  [20:52:29.672]         local({
  [20:52:29.672]             for (name in names(...future.x_jj)) {
  [20:52:29.672]                 assign(name, ...future.x_jj[[name]], envir = ...future.env, 
  [20:52:29.672]                   inherits = FALSE)
  [20:52:29.672]             }
  [20:52:29.672]         })
  [20:52:29.672]         tryCatch({
  [20:52:29.672]             j
  [20:52:29.672]         }, error = identity)
  [20:52:29.672]     })
  [20:52:29.672] }
  [20:52:29.672]   - globals: [1] '...future.x_ii'
  [20:52:29.673] List of 1
  [20:52:29.673]  $ ...future.x_ii: NULL
  [20:52:29.673]  - attr(*, "where")=List of 1
  [20:52:29.673]   ..$ ...future.x_ii:<environment: 0x55a47f9a78b8> 
  [20:52:29.673]  - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list"
  [20:52:29.673]  - attr(*, "resolved")= logi FALSE
  [20:52:29.673]  - attr(*, "total_size")= num 0
  [20:52:29.679]   - packages: [1] 'doFuture'
  [20:52:29.679] - identifying globals and packages ... DONE
  [20:52:29.680] Number of chunks: 1
  [20:52:29.680] Number of futures (= number of chunks): 1
  [20:52:29.680] Launching 1 futures (chunks) ...
  [20:52:29.681] Chunk #1 of 1 ...
  [20:52:29.681]  - Finding globals in 'args_list' chunk #1 ...
  getGlobalsAndPackages() ...
  Searching for globals...
  
  Searching for globals ... DONE
  - globals: [0] <none>
  getGlobalsAndPackages() ... DONE
  [20:52:29.684] 
  [20:52:29.684] 
  [20:52:29.684]  - Finding globals in 'args_list' for chunk #1 ... DONE
  getGlobalsAndPackages() ...
  - globals passed as-is: [1] '...future.x_ii'
  Resolving globals: FALSE
  The total size of the 1 globals is 56 bytes (56 bytes)
  - globals: [1] '...future.x_ii'
  
  getGlobalsAndPackages() ... DONE
  Packages needed by future strategies (n = 0): <none>
  Packages needed by the future expression (n = 1): 'doFuture'
  {
      {
          ...future.startTime <- Sys.time()
          ...future.oldOptions <- options(future.startup.loadScript = FALSE, 
              future.globals.onMissing = "ignore", future.globals.maxSize = NULL, 
              future.globals.method = NULL, future.globals.onMissing = "ignore", 
              future.globals.onReference = NULL, future.globals.resolve = NULL, 
              future.resolve.recursive = NULL, width = 80L)
          {
              {
                  {
                    has_future <- requireNamespace("future", quietly = TRUE)
                    version <- if (has_future) 
                      packageVersion("future")
                    else NULL
                    if (!has_future || version < "1.8.0") {
                      info <- c(r_version = gsub("R version ", 
                        "", R.version$version.string), platform = sprintf("%s (%s-bit)", 
                        R.version$platform, 8 * .Machine$sizeof.pointer), 
                        os = paste(Sys.info()[c("sysname", "release", 
                          "version")], collapse = " "), hostname = Sys.info()[["nodename"]])
                      info <- sprintf("%s: %s", names(info), info)
                      info <- paste(info, collapse = "; ")
                      if (!has_future) {
                        msg <- sprintf("Package 'future' is not installed on worker (%s)", 
                          info)
                      }
                      else {
                        msg <- sprintf("Package 'future' on worker (%s) must be of version >= 1.8.0: %s", 
                          info, version)
                      }
                      stop(msg)
                    }
                  }
                  local({
                    for (pkg in "doFuture") {
                      loadNamespace(pkg)
                      library(pkg, character.only = TRUE)
                    }
                  })
              }
              future::plan("default", .cleanup = FALSE, .init = FALSE)
          }
      }
      if (is.na(TRUE)) {
      }
      else {
          if (TRUE) {
              ...future.stdout <- rawConnection(raw(0L), open = "w")
          }
          else {
              ...future.stdout <- file(switch(.Platform$OS.type, 
                  windows = "NUL", "/dev/null"), open = "w")
          }
          sink(...future.stdout, type = "output", split = FALSE)
          on.exit(if (!is.null(...future.stdout)) {
              sink(type = "output", split = FALSE)
              close(...future.stdout)
          }, add = TRUE)
      }
      ...future.frame <- sys.nframe()
      ...future.conditions <- list()
      ...future.result <- tryCatch({
          withCallingHandlers({
              ...future.value <- local({
                  doFuture::registerDoFuture()
                  lapply(seq_along(...future.x_ii), FUN = function(jj) {
                    ...future.x_jj <- ...future.x_ii[[jj]]
                    j <- NULL
                    ...future.env <- environment()
                    local({
                      for (name in names(...future.x_jj)) {
                        assign(name, ...future.x_jj[[name]], envir = ...future.env, 
                          inherits = FALSE)
                      }
                    })
                    tryCatch({
                      j
                    }, error = identity)
                  })
              })
              future::FutureResult(value = ...future.value, started = ...future.startTime, 
                  version = "1.8")
          }, condition = local({
              inherits <- base::inherits
              invokeRestart <- base::invokeRestart
              length <- base::length
              seq.int <- base::seq.int
              sys.calls <- base::sys.calls
              `[[` <- base::`[[`
              `+` <- base::`+`
              `<<-` <- base::`<<-`
              sysCalls <- function(calls = sys.calls(), from = 1L) {
                  calls[seq.int(from = from + 12L, to = length(calls) - 
                    3L)]
              }
              function(cond) {
                  if (inherits(cond, "error")) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond, calls = c(sysCalls(from = ...future.frame), 
                      cond$call), timestamp = base::Sys.time())
                    signalCondition(cond)
                  }
                  else if (inherits(cond, c("message", "warning"
                  ))) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond)
                    if (inherits(cond, "message")) {
                      invokeRestart("muffleMessage")
                    }
                    else if (inherits(cond, "warning")) {
                      invokeRestart("muffleWarning")
                    }
                  }
              }
          }))
      }, error = function(ex) {
          structure(list(value = NULL, conditions = ...future.conditions, 
              condition = ex, calls = sys.calls(), version = "1.8"), 
              class = "FutureResult")
      }, finally = {
          {
              NULL
              future::plan(list(function (expr, envir = parent.frame(), 
                  substitute = TRUE, lazy = FALSE, seed = NULL, 
                  globals = TRUE, local = TRUE, earlySignal = FALSE, 
                  label = NULL, ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  local <- as.logical(local)
                  future <- SequentialFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, local = local, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }), .cleanup = FALSE, .init = FALSE)
          }
          options(...future.oldOptions)
      })
      if (is.na(TRUE)) {
      }
      else {
          sink(type = "output", split = FALSE)
          if (TRUE) {
              ...future.result$stdout <- rawToChar(rawConnectionValue(...future.stdout))
          }
          else {
              ...future.result["stdout"] <- list(NULL)
          }
          close(...future.stdout)
          ...future.stdout <- NULL
      }
      ...future.result$conditions <- ...future.conditions
      ...future.result
  }
  plan(): Setting new future strategy stack:
  List of future strategies:
  1. sequential:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: NULL
  
  plan(): nbrOfWorkers() = 1
  plan(): Setting new future strategy stack:
  List of future strategies:
  1. sequential:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: NULL
  
  plan(): nbrOfWorkers() = 1
  SequentialFuture started (and completed)
  [20:52:29.704] Chunk #1 of 1 ... DONE
  [20:52:29.704] Launching 1 futures (chunks) ... DONE
  [20:52:29.704] - resolving futures
  resolve() on list ...
   recursive: 0
   length: 1
  
   length: 0 (resolved future 1)
  resolve() on list ... DONE
  [20:52:29.707] - relaying conditions of futures
  [20:52:29.707] - collecting values of futures
  [20:52:29.708] - accumulating results
  [20:52:29.709] - processing errors (handler = 'stop')
  [20:52:29.709] - extracting results
  [20:52:29.710] doFuture() ... DONE
  [20:52:29.723] - collecting values of futures
  [20:52:29.723] - accumulating results
  [20:52:29.724] - processing errors (handler = 'stop')
  [20:52:29.724] - extracting results
  [20:52:29.725] doFuture() ... DONE
  > str(x)
  List of 1
   $ :List of 1
    ..$ : num 1
  > rm(list = "x")
  > 
  > message("*** doFuture - nested %dopar%  and tricky globals ... DONE")
  *** doFuture - nested %dopar%  and tricky globals ... DONE
  > 
  > 
  > for (strategy1 in strategies) {
  +   for (strategy2 in strategies) {
  +     message(sprintf("- plan(list('%s', '%s')) ...", strategy1, strategy2))
  +     plan(list(a = strategy1, b = strategy2))
  +     nested <- plan("list")
  + 
  +     as <- 1:2
  +     bs <- 3:1
  + 
  +     stopifnot(!exists("a", inherits = FALSE), !exists("b", inherits = FALSE))
  + 
  +     message("foreach() - level 1 ...")
  +     x <- foreach(a = as, .export = c("bs", "strategy2"),
  +                  .packages = "foreach") %dopar% {
  +       plan_list <- future::plan()
  +       stopifnot(inherits(plan_list, strategy2))
  +       plan_a <- future::plan("list")
  +       str(plan_a)
  +       stopifnot(inherits(plan_a[[1]], strategy2))
  + 
  +       message("foreach() - level 2 ...")
  +       y <- foreach(b = bs, .export = c("a", "plan_a")) %dopar% {
  +         plan_list <- future::plan()
  +         message(capture.output(print(plan_list)))
  +         stopifnot(
  +           inherits(plan_list, "future"),
  +           inherits(plan_list, getOption("future.default", "sequential"))
  +         )
  + 
  +         plan_b <- future::plan("list")
  +         str(plan_b)
  +         stopifnot(
  +           inherits(plan_b[[1]], "future"),
  +           inherits(plan_b[[1]], getOption("future.default", "sequential"))
  +         )
  + 
  +         list(a = a, plan_a = plan_a,
  +              b = b, plan_b = plan_b)
  +       }
  +       message("foreach() - level 2 ... DONE")
  + 
  +       y
  +     }
  +     message("foreach() - level 1 ... DONE")
  + 
  +     local({
  +       stopifnot(length(x) == length(as))
  +       for (aa in seq_along(as)) {
  +         x_aa <- x[[aa]]
  +         stopifnot(length(x_aa) == length(bs))
  +         a <- as[aa]
  +         for (bb in seq_along(bs)) {
  +           x_aa_bb <- x_aa[[bb]]
  +           b <- bs[bb]
  +           stopifnot(
  +             length(x_aa_bb) == 4L,
  +             all(names(x_aa_bb) == c("a", "plan_a", "b", "plan_b")),
  +             x_aa_bb$a == a,
  +             x_aa_bb$b == b,
  +             inherits(x_aa_bb$plan_a[[1]], strategy2),
  +             inherits(x_aa_bb$plan_b[[1]], "future"),
  +             inherits(x_aa_bb$plan_b[[1]],
  +                      getOption("future.default", "sequential"))
  +           )
  +         }
  +       }
  +     })
  + 
  +     ## Cleanup in order make sure none of these variables exist as
  +     ## proxies for missing globals of the name names
  +     rm(list = c("as", "bs", "x"))
  +     message(sprintf("- plan(list('%s', '%s')) ... DONE", strategy1, strategy2))
  +   }
  + }
  - plan(list('sequential', 'sequential')) ...
  plan(): Setting new future strategy stack:
  List of future strategies:
  1. sequential:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: plan(list(a = strategy1, b = strategy2))
  2. sequential:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: plan(list(a = strategy1, b = strategy2))
  
  plan(): nbrOfWorkers() = 1
  foreach() - level 1 ...
  [20:52:29.878] doFuture() ...
  [20:52:29.879] - dummy globals (as locals): [1] 'a'
  [20:52:29.880] - R expression:
  [20:52:29.881] {
  [20:52:29.881]     doFuture::registerDoFuture()
  [20:52:29.881]     lapply(seq_along(...future.x_ii), FUN = function(jj) {
  [20:52:29.881]         ...future.x_jj <- ...future.x_ii[[jj]]
  [20:52:29.881]         a <- NULL
  [20:52:29.881]         ...future.env <- environment()
  [20:52:29.881]         local({
  [20:52:29.881]             for (name in names(...future.x_jj)) {
  [20:52:29.881]                 assign(name, ...future.x_jj[[name]], envir = ...future.env, 
  [20:52:29.881]                   inherits = FALSE)
  [20:52:29.881]             }
  [20:52:29.881]         })
  [20:52:29.881]         tryCatch({
  [20:52:29.881]             plan_list <- future::plan()
  [20:52:29.881]             stopifnot(inherits(plan_list, strategy2))
  [20:52:29.881]             plan_a <- future::plan("list")
  [20:52:29.881]             str(plan_a)
  [20:52:29.881]             stopifnot(inherits(plan_a[[1]], strategy2))
  [20:52:29.881]             message("foreach() - level 2 ...")
  [20:52:29.881]             y <- foreach(b = bs, .export = c("a", "plan_a")) %dopar% 
  [20:52:29.881]                 {
  [20:52:29.881]                   plan_list <- future::plan()
  [20:52:29.881]                   message(capture.output(print(plan_list)))
  [20:52:29.881]                   stopifnot(inherits(plan_list, "future"), inherits(plan_list, 
  [20:52:29.881]                     getOption("future.default", "sequential")))
  [20:52:29.881]                   plan_b <- future::plan("list")
  [20:52:29.881]                   str(plan_b)
  [20:52:29.881]                   stopifnot(inherits(plan_b[[1]], "future"), 
  [20:52:29.881]                     inherits(plan_b[[1]], getOption("future.default", 
  [20:52:29.881]                       "sequential")))
  [20:52:29.881]                   list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
  [20:52:29.881]                 }
  [20:52:29.881]             message("foreach() - level 2 ... DONE")
  [20:52:29.881]             y
  [20:52:29.881]         }, error = identity)
  [20:52:29.881]     })
  [20:52:29.881] }
  [20:52:29.882] - identifying globals and packages ...
  getGlobalsAndPackages() ...
  Searching for globals...
  - globals found: [28] '{', '::', 'lapply', 'seq_along', '...future.x_ii', '<-', '[[', 'environment', 'local', 'for', 'names', 'assign', 'tryCatch', 'stopifnot', 'inherits', 'strategy2', 'str', 'message', '%dopar%', 'foreach', 'bs', 'c', 'capture.output', 'print', 'getOption', 'list', 'b', 'identity'
  Searching for globals ... DONE
  Resolving globals: FALSE
  The total size of the 3 globals is 184 bytes (184 bytes)
  - globals: [3] '...future.x_ii', 'strategy2', 'bs'
  - packages: [2] 'utils', 'foreach'
  getGlobalsAndPackages() ... DONE
  [20:52:29.921] List of 3
  [20:52:29.921]  $ ...future.x_ii: NULL
  [20:52:29.921]  $ strategy2     : chr "sequential"
  [20:52:29.921]  $ bs            : int [1:3] 3 2 1
  [20:52:29.921]  - attr(*, "where")=List of 3
  [20:52:29.921]   ..$ ...future.x_ii:<environment: 0x55a47fe73e30> 
  [20:52:29.921]   ..$ strategy2     :<environment: R_GlobalEnv> 
  [20:52:29.921]   ..$ bs            :<environment: R_GlobalEnv> 
  [20:52:29.921]  - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list"
  [20:52:29.921]  - attr(*, "resolved")= logi FALSE
  [20:52:29.921]  - attr(*, "total_size")= num 184
  [20:52:29.930]   - R expression:
  [20:52:29.931] {
  [20:52:29.931]     doFuture::registerDoFuture()
  [20:52:29.931]     lapply(seq_along(...future.x_ii), FUN = function(jj) {
  [20:52:29.931]         ...future.x_jj <- ...future.x_ii[[jj]]
  [20:52:29.931]         a <- NULL
  [20:52:29.931]         ...future.env <- environment()
  [20:52:29.931]         local({
  [20:52:29.931]             for (name in names(...future.x_jj)) {
  [20:52:29.931]                 assign(name, ...future.x_jj[[name]], envir = ...future.env, 
  [20:52:29.931]                   inherits = FALSE)
  [20:52:29.931]             }
  [20:52:29.931]         })
  [20:52:29.931]         tryCatch({
  [20:52:29.931]             plan_list <- future::plan()
  [20:52:29.931]             stopifnot(inherits(plan_list, strategy2))
  [20:52:29.931]             plan_a <- future::plan("list")
  [20:52:29.931]             str(plan_a)
  [20:52:29.931]             stopifnot(inherits(plan_a[[1]], strategy2))
  [20:52:29.931]             message("foreach() - level 2 ...")
  [20:52:29.931]             y <- foreach(b = bs, .export = c("a", "plan_a")) %dopar% 
  [20:52:29.931]                 {
  [20:52:29.931]                   plan_list <- future::plan()
  [20:52:29.931]                   message(capture.output(print(plan_list)))
  [20:52:29.931]                   stopifnot(inherits(plan_list, "future"), inherits(plan_list, 
  [20:52:29.931]                     getOption("future.default", "sequential")))
  [20:52:29.931]                   plan_b <- future::plan("list")
  [20:52:29.931]                   str(plan_b)
  [20:52:29.931]                   stopifnot(inherits(plan_b[[1]], "future"), 
  [20:52:29.931]                     inherits(plan_b[[1]], getOption("future.default", 
  [20:52:29.931]                       "sequential")))
  [20:52:29.931]                   list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
  [20:52:29.931]                 }
  [20:52:29.931]             message("foreach() - level 2 ... DONE")
  [20:52:29.931]             y
  [20:52:29.931]         }, error = identity)
  [20:52:29.931]     })
  [20:52:29.931] }
  [20:52:29.932]   - globals: [3] '...future.x_ii', 'strategy2', 'bs'
  [20:52:29.932] List of 3
  [20:52:29.932]  $ ...future.x_ii: NULL
  [20:52:29.932]  $ strategy2     : chr "sequential"
  [20:52:29.932]  $ bs            : int [1:3] 3 2 1
  [20:52:29.932]  - attr(*, "where")=List of 3
  [20:52:29.932]   ..$ ...future.x_ii:<environment: 0x55a47fe73e30> 
  [20:52:29.932]   ..$ strategy2     :<environment: R_GlobalEnv> 
  [20:52:29.932]   ..$ bs            :<environment: R_GlobalEnv> 
  [20:52:29.932]  - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list"
  [20:52:29.932]  - attr(*, "resolved")= logi FALSE
  [20:52:29.932]  - attr(*, "total_size")= num 184
  [20:52:29.941]   - packages: [3] 'doFuture', 'utils', 'foreach'
  [20:52:29.941] - identifying globals and packages ... DONE
  [20:52:29.941] Number of chunks: 1
  [20:52:29.942] Number of futures (= number of chunks): 1
  [20:52:29.942] Launching 1 futures (chunks) ...
  [20:52:29.942] Chunk #1 of 1 ...
  [20:52:29.942]  - Finding globals in 'args_list' chunk #1 ...
  getGlobalsAndPackages() ...
  Searching for globals...
  
  Searching for globals ... DONE
  - globals: [0] <none>
  getGlobalsAndPackages() ... DONE
  [20:52:29.945] 
  [20:52:29.945] 
  [20:52:29.945]  - Finding globals in 'args_list' for chunk #1 ... DONE
  getGlobalsAndPackages() ...
  - globals passed as-is: [3] '...future.x_ii', 'strategy2', 'bs'
  Resolving globals: FALSE
  The total size of the 3 globals is 296 bytes (296 bytes)
  - globals: [3] '...future.x_ii', 'strategy2', 'bs'
  
  getGlobalsAndPackages() ... DONE
  Packages needed by future strategies (n = 1): 'future'
  Packages needed by the future expression (n = 3): 'doFuture', 'utils', 'foreach'
  {
      {
          ...future.startTime <- Sys.time()
          ...future.oldOptions <- options(future.startup.loadScript = FALSE, 
              future.globals.onMissing = "ignore", future.globals.maxSize = NULL, 
              future.globals.method = NULL, future.globals.onMissing = "ignore", 
              future.globals.onReference = NULL, future.globals.resolve = NULL, 
              future.resolve.recursive = NULL, width = 80L)
          {
              {
                  {
                    has_future <- requireNamespace("future", quietly = TRUE)
                    version <- if (has_future) 
                      packageVersion("future")
                    else NULL
                    if (!has_future || version < "1.8.0") {
                      info <- c(r_version = gsub("R version ", 
                        "", R.version$version.string), platform = sprintf("%s (%s-bit)", 
                        R.version$platform, 8 * .Machine$sizeof.pointer), 
                        os = paste(Sys.info()[c("sysname", "release", 
                          "version")], collapse = " "), hostname = Sys.info()[["nodename"]])
                      info <- sprintf("%s: %s", names(info), info)
                      info <- paste(info, collapse = "; ")
                      if (!has_future) {
                        msg <- sprintf("Package 'future' is not installed on worker (%s)", 
                          info)
                      }
                      else {
                        msg <- sprintf("Package 'future' on worker (%s) must be of version >= 1.8.0: %s", 
                          info, version)
                      }
                      stop(msg)
                    }
                  }
                  local({
                    for (pkg in c("future", "doFuture", "utils", 
                    "foreach")) {
                      loadNamespace(pkg)
                      library(pkg, character.only = TRUE)
                    }
                  })
              }
              future::plan(list(b = function (expr, envir = parent.frame(), 
                  substitute = TRUE, lazy = FALSE, seed = NULL, 
                  globals = TRUE, local = TRUE, earlySignal = FALSE, 
                  label = NULL, ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  local <- as.logical(local)
                  future <- SequentialFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, local = local, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }), .cleanup = FALSE, .init = FALSE)
          }
      }
      if (is.na(TRUE)) {
      }
      else {
          if (TRUE) {
              ...future.stdout <- rawConnection(raw(0L), open = "w")
          }
          else {
              ...future.stdout <- file(switch(.Platform$OS.type, 
                  windows = "NUL", "/dev/null"), open = "w")
          }
          sink(...future.stdout, type = "output", split = FALSE)
          on.exit(if (!is.null(...future.stdout)) {
              sink(type = "output", split = FALSE)
              close(...future.stdout)
          }, add = TRUE)
      }
      ...future.frame <- sys.nframe()
      ...future.conditions <- list()
      ...future.result <- tryCatch({
          withCallingHandlers({
              ...future.value <- local({
                  doFuture::registerDoFuture()
                  lapply(seq_along(...future.x_ii), FUN = function(jj) {
                    ...future.x_jj <- ...future.x_ii[[jj]]
                    a <- NULL
                    ...future.env <- environment()
                    local({
                      for (name in names(...future.x_jj)) {
                        assign(name, ...future.x_jj[[name]], envir = ...future.env, 
                          inherits = FALSE)
                      }
                    })
                    tryCatch({
                      plan_list <- future::plan()
                      stopifnot(inherits(plan_list, strategy2))
                      plan_a <- future::plan("list")
                      str(plan_a)
                      stopifnot(inherits(plan_a[[1]], strategy2))
                      message("foreach() - level 2 ...")
                      y <- foreach(b = bs, .export = c("a", "plan_a")) %dopar% 
                        {
                          plan_list <- future::plan()
                          message(capture.output(print(plan_list)))
                          stopifnot(inherits(plan_list, "future"), 
                            inherits(plan_list, getOption("future.default", 
                              "sequential")))
                          plan_b <- future::plan("list")
                          str(plan_b)
                          stopifnot(inherits(plan_b[[1]], "future"), 
                            inherits(plan_b[[1]], getOption("future.default", 
                              "sequential")))
                          list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
                        }
                      message("foreach() - level 2 ... DONE")
                      y
                    }, error = identity)
                  })
              })
              future::FutureResult(value = ...future.value, started = ...future.startTime, 
                  version = "1.8")
          }, condition = local({
              inherits <- base::inherits
              invokeRestart <- base::invokeRestart
              length <- base::length
              seq.int <- base::seq.int
              sys.calls <- base::sys.calls
              `[[` <- base::`[[`
              `+` <- base::`+`
              `<<-` <- base::`<<-`
              sysCalls <- function(calls = sys.calls(), from = 1L) {
                  calls[seq.int(from = from + 12L, to = length(calls) - 
                    3L)]
              }
              function(cond) {
                  if (inherits(cond, "error")) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond, calls = c(sysCalls(from = ...future.frame), 
                      cond$call), timestamp = base::Sys.time())
                    signalCondition(cond)
                  }
                  else if (inherits(cond, c("message", "warning"
                  ))) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond)
                    if (inherits(cond, "message")) {
                      invokeRestart("muffleMessage")
                    }
                    else if (inherits(cond, "warning")) {
                      invokeRestart("muffleWarning")
                    }
                  }
              }
          }))
      }, error = function(ex) {
          structure(list(value = NULL, conditions = ...future.conditions, 
              condition = ex, calls = sys.calls(), version = "1.8"), 
              class = "FutureResult")
      }, finally = {
          {
              NULL
              future::plan(list(a = function (expr, envir = parent.frame(), 
                  substitute = TRUE, lazy = FALSE, seed = NULL, 
                  globals = TRUE, local = TRUE, earlySignal = FALSE, 
                  label = NULL, ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  local <- as.logical(local)
                  future <- SequentialFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, local = local, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }, b = function (expr, envir = parent.frame(), substitute = TRUE, 
                  lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, 
                  earlySignal = FALSE, label = NULL, ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  local <- as.logical(local)
                  future <- SequentialFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, local = local, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }), .cleanup = FALSE, .init = FALSE)
          }
          options(...future.oldOptions)
      })
      if (is.na(TRUE)) {
      }
      else {
          sink(type = "output", split = FALSE)
          if (TRUE) {
              ...future.result$stdout <- rawToChar(rawConnectionValue(...future.stdout))
          }
          else {
              ...future.result["stdout"] <- list(NULL)
          }
          close(...future.stdout)
          ...future.stdout <- NULL
      }
      ...future.result$conditions <- ...future.conditions
      ...future.result
  }
  plan(): Setting new future strategy stack:
  List of future strategies:
  1. sequential:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: plan(list(a = strategy1, b = strategy2))
  
  plan(): nbrOfWorkers() = 1
  plan(): Setting new future strategy stack:
  List of future strategies:
  1. sequential:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: plan(list(a = strategy1, b = strategy2))
  2. sequential:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: plan(list(a = strategy1, b = strategy2))
  
  plan(): nbrOfWorkers() = 1
  SequentialFuture started (and completed)
  [20:52:30.290] Chunk #1 of 1 ... DONE
  [20:52:30.290] Launching 1 futures (chunks) ... DONE
  [20:52:30.291] - resolving futures
  resolve() on list ...
   recursive: 0
   length: 1
  
   length: 0 (resolved future 1)
  resolve() on list ... DONE
  [20:52:30.292] - relaying conditions of futures
  List of 1
   $ b:function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
      ...)  
    ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
    ..- attr(*, "call")= language plan(list(a = strategy1, b = strategy2))
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  List of 1
   $ :function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
      ...)  
    ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  List of 1
   $ :function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
      ...)  
    ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  List of 1
   $ :function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
      ...)  
    ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  List of 1
   $ b:function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
      ...)  
    ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
    ..- attr(*, "call")= language plan(list(a = strategy1, b = strategy2))
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  List of 1
   $ :function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
      ...)  
    ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  List of 1
   $ :function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
      ...)  
    ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  List of 1
   $ :function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
      ...)  
    ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  Future state: 'finished'
  foreach() - level 2 ...
  [20:52:29.969] doFuture() ...
  [20:52:29.971] - dummy globals (as locals): [1] 'b'
  [20:52:29.972] - R expression:
  [20:52:29.972] {
  [20:52:29.972]     doFuture::registerDoFuture()
  [20:52:29.972]     lapply(seq_along(...future.x_ii), FUN = function(jj) {
  [20:52:29.972]         ...future.x_jj <- ...future.x_ii[[jj]]
  [20:52:29.972]         b <- NULL
  [20:52:29.972]         ...future.env <- environment()
  [20:52:29.972]         local({
  [20:52:29.972]             for (name in names(...future.x_jj)) {
  [20:52:29.972]                 assign(name, ...future.x_jj[[name]], envir = ...future.env, 
  [20:52:29.972]                   inherits = FALSE)
  [20:52:29.972]             }
  [20:52:29.972]         })
  [20:52:29.972]         tryCatch({
  [20:52:29.972]             plan_list <- future::plan()
  [20:52:29.972]             message(capture.output(print(plan_list)))
  [20:52:29.972]             stopifnot(inherits(plan_list, "future"), inherits(plan_list, 
  [20:52:29.972]                 getOption("future.default", "sequential")))
  [20:52:29.972]             plan_b <- future::plan("list")
  [20:52:29.972]             str(plan_b)
  [20:52:29.972]             stopifnot(inherits(plan_b[[1]], "future"), inherits(plan_b[[1]], 
  [20:52:29.972]                 getOption("future.default", "sequential")))
  [20:52:29.972]             list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
  [20:52:29.972]         }, error = identity)
  [20:52:29.972]     })
  [20:52:29.972] }
  [20:52:29.973] - identifying globals and packages ...
  getGlobalsAndPackages() ...
  Searching for globals...
  - globals found: [24] '{', '::', 'lapply', 'seq_along', '...future.x_ii', '<-', '[[', 'environment', 'local', 'for', 'names', 'assign', 'tryCatch', 'message', 'capture.output', 'print', 'stopifnot', 'inherits', 'getOption', 'str', 'list', 'a', 'plan_a', 'identity'
  Searching for globals ... DONE
  Resolving globals: FALSE
  The total size of the 3 globals is 39.67 KiB (40624 bytes)
  - globals: [3] '...future.x_ii', 'a', 'plan_a'
  - packages: [1] 'utils'
  getGlobalsAndPackages() ... DONE
  [20:52:30.005] List of 3
  [20:52:30.005]  $ ...future.x_ii: NULL
  [20:52:30.005]  $ a             : int 1
  [20:52:30.005]  $ plan_a        :List of 1
  [20:52:30.005]   ..$ b:function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
  [20:52:30.005]     seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
  [20:52:30.005]     ...)  
  [20:52:30.005]   .. ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
  [20:52:30.005]   .. ..- attr(*, "call")= language plan(list(a = strategy1, b = strategy2))
  [20:52:30.005]   ..- attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  [20:52:30.005]  - attr(*, "where")=List of 3
  [20:52:30.005]   ..$ ...future.x_ii:<environment: 0x55a47dec52a0> 
  [20:52:30.005]   ..$ a             :<environment: 0x55a47df296f0> 
  [20:52:30.005]   ..$ plan_a        :<environment: 0x55a47df296f0> 
  [20:52:30.005]  - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list"
  [20:52:30.005]  - attr(*, "resolved")= logi FALSE
  [20:52:30.005]  - attr(*, "total_size")= num 40624
  [20:52:30.022]   - R expression:
  [20:52:30.022] {
  [20:52:30.022]     doFuture::registerDoFuture()
  [20:52:30.022]     lapply(seq_along(...future.x_ii), FUN = function(jj) {
  [20:52:30.022]         ...future.x_jj <- ...future.x_ii[[jj]]
  [20:52:30.022]         b <- NULL
  [20:52:30.022]         ...future.env <- environment()
  [20:52:30.022]         local({
  [20:52:30.022]             for (name in names(...future.x_jj)) {
  [20:52:30.022]                 assign(name, ...future.x_jj[[name]], envir = ...future.env, 
  [20:52:30.022]                   inherits = FALSE)
  [20:52:30.022]             }
  [20:52:30.022]         })
  [20:52:30.022]         tryCatch({
  [20:52:30.022]             plan_list <- future::plan()
  [20:52:30.022]             message(capture.output(print(plan_list)))
  [20:52:30.022]             stopifnot(inherits(plan_list, "future"), inherits(plan_list, 
  [20:52:30.022]                 getOption("future.default", "sequential")))
  [20:52:30.022]             plan_b <- future::plan("list")
  [20:52:30.022]             str(plan_b)
  [20:52:30.022]             stopifnot(inherits(plan_b[[1]], "future"), inherits(plan_b[[1]], 
  [20:52:30.022]                 getOption("future.default", "sequential")))
  [20:52:30.022]             list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
  [20:52:30.022]         }, error = identity)
  [20:52:30.022]     })
  [20:52:30.022] }
  [20:52:30.023]   - globals: [3] '...future.x_ii', 'a', 'plan_a'
  [20:52:30.023] List of 3
  [20:52:30.023]  $ ...future.x_ii: NULL
  [20:52:30.023]  $ a             : int 1
  [20:52:30.023]  $ plan_a        :List of 1
  [20:52:30.023]   ..$ b:function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
  [20:52:30.023]     seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
  [20:52:30.023]     ...)  
  [20:52:30.023]   .. ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
  [20:52:30.023]   .. ..- attr(*, "call")= language plan(list(a = strategy1, b = strategy2))
  [20:52:30.023]   ..- attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  [20:52:30.023]  - attr(*, "where")=List of 3
  [20:52:30.023]   ..$ ...future.x_ii:<environment: 0x55a47dec52a0> 
  [20:52:30.023]   ..$ a             :<environment: 0x55a47df296f0> 
  [20:52:30.023]   ..$ plan_a        :<environment: 0x55a47df296f0> 
  [20:52:30.023]  - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list"
  [20:52:30.023]  - attr(*, "resolved")= logi FALSE
  [20:52:30.023]  - attr(*, "total_size")= num 40624
  [20:52:30.035]   - packages: [2] 'doFuture', 'utils'
  [20:52:30.036] - identifying globals and packages ... DONE
  [20:52:30.036] Number of chunks: 1
  [20:52:30.037] Number of futures (= number of chunks): 1
  [20:52:30.037] Launching 1 futures (chunks) ...
  [20:52:30.037] Chunk #1 of 1 ...
  [20:52:30.038]  - Finding globals in 'args_list' chunk #1 ...
  getGlobalsAndPackages() ...
  Searching for globals...
  
  Searching for globals ... DONE
  - globals: [0] <none>
  getGlobalsAndPackages() ... DONE
  [20:52:30.040] 
  [20:52:30.041] 
  [20:52:30.041]  - Finding globals in 'args_list' for chunk #1 ... DONE
  getGlobalsAndPackages() ...
  - globals passed as-is: [3] '...future.x_ii', 'a', 'plan_a'
  Resolving globals: FALSE
  The total size of the 3 globals is 39.84 KiB (40792 bytes)
  - globals: [3] '...future.x_ii', 'a', 'plan_a'
  
  getGlobalsAndPackages() ... DONE
  Packages needed by future strategies (n = 0): <none>
  Packages needed by the future expression (n = 2): 'doFuture', 'utils'
  {
      {
          ...future.startTime <- Sys.time()
          ...future.oldOptions <- options(future.startup.loadScript = FALSE, 
              future.globals.onMissing = "ignore", future.globals.maxSize = NULL, 
              future.globals.method = NULL, future.globals.onMissing = "ignore", 
              future.globals.onReference = NULL, future.globals.resolve = NULL, 
              future.resolve.recursive = NULL, width = 80L)
          {
              {
                  {
                    has_future <- requireNamespace("future", quietly = TRUE)
                    version <- if (has_future) 
                      packageVersion("future")
                    else NULL
                    if (!has_future || version < "1.8.0") {
                      info <- c(r_version = gsub("R version ", 
                        "", R.version$version.string), platform = sprintf("%s (%s-bit)", 
                        R.version$platform, 8 * .Machine$sizeof.pointer), 
                        os = paste(Sys.info()[c("sysname", "release", 
                          "version")], collapse = " "), hostname = Sys.info()[["nodename"]])
                      info <- sprintf("%s: %s", names(info), info)
                      info <- paste(info, collapse = "; ")
                      if (!has_future) {
                        msg <- sprintf("Package 'future' is not installed on worker (%s)", 
                          info)
                      }
                      else {
                        msg <- sprintf("Package 'future' on worker (%s) must be of version >= 1.8.0: %s", 
                          info, version)
                      }
                      stop(msg)
                    }
                  }
                  local({
                    for (pkg in c("doFuture", "utils")) {
                      loadNamespace(pkg)
                      library(pkg, character.only = TRUE)
                    }
                  })
              }
              future::plan("default", .cleanup = FALSE, .init = FALSE)
          }
      }
      if (is.na(TRUE)) {
      }
      else {
          if (TRUE) {
              ...future.stdout <- rawConnection(raw(0L), open = "w")
          }
          else {
              ...future.stdout <- file(switch(.Platform$OS.type, 
                  windows = "NUL", "/dev/null"), open = "w")
          }
          sink(...future.stdout, type = "output", split = FALSE)
          on.exit(if (!is.null(...future.stdout)) {
              sink(type = "output", split = FALSE)
              close(...future.stdout)
          }, add = TRUE)
      }
      ...future.frame <- sys.nframe()
      ...future.conditions <- list()
      ...future.result <- tryCatch({
          withCallingHandlers({
              ...future.value <- local({
                  doFuture::registerDoFuture()
                  lapply(seq_along(...future.x_ii), FUN = function(jj) {
                    ...future.x_jj <- ...future.x_ii[[jj]]
                    b <- NULL
                    ...future.env <- environment()
                    local({
                      for (name in names(...future.x_jj)) {
                        assign(name, ...future.x_jj[[name]], envir = ...future.env, 
                          inherits = FALSE)
                      }
                    })
                    tryCatch({
                      plan_list <- future::plan()
                      message(capture.output(print(plan_list)))
                      stopifnot(inherits(plan_list, "future"), 
                        inherits(plan_list, getOption("future.default", 
                          "sequential")))
                      plan_b <- future::plan("list")
                      str(plan_b)
                      stopifnot(inherits(plan_b[[1]], "future"), 
                        inherits(plan_b[[1]], getOption("future.default", 
                          "sequential")))
                      list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
                    }, error = identity)
                  })
              })
              future::FutureResult(value = ...future.value, started = ...future.startTime, 
                  version = "1.8")
          }, condition = local({
              inherits <- base::inherits
              invokeRestart <- base::invokeRestart
              length <- base::length
              seq.int <- base::seq.int
              sys.calls <- base::sys.calls
              `[[` <- base::`[[`
              `+` <- base::`+`
              `<<-` <- base::`<<-`
              sysCalls <- function(calls = sys.calls(), from = 1L) {
                  calls[seq.int(from = from + 12L, to = length(calls) - 
                    3L)]
              }
              function(cond) {
                  if (inherits(cond, "error")) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond, calls = c(sysCalls(from = ...future.frame), 
                      cond$call), timestamp = base::Sys.time())
                    signalCondition(cond)
                  }
                  else if (inherits(cond, c("message", "warning"
                  ))) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond)
                    if (inherits(cond, "message")) {
                      invokeRestart("muffleMessage")
                    }
                    else if (inherits(cond, "warning")) {
                      invokeRestart("muffleWarning")
                    }
                  }
              }
          }))
      }, error = function(ex) {
          structure(list(value = NULL, conditions = ...future.conditions, 
              condition = ex, calls = sys.calls(), version = "1.8"), 
              class = "FutureResult")
      }, finally = {
          {
              NULL
              future::plan(list(b = function (expr, envir = parent.frame(), 
                  substitute = TRUE, lazy = FALSE, seed = NULL, 
                  globals = TRUE, local = TRUE, earlySignal = FALSE, 
                  label = NULL, ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  local <- as.logical(local)
                  future <- SequentialFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, local = local, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }), .cleanup = FALSE, .init = FALSE)
          }
          options(...future.oldOptions)
      })
      if (is.na(TRUE)) {
      }
      else {
          sink(type = "output", split = FALSE)
          if (TRUE) {
              ...future.result$stdout <- rawToChar(rawConnectionValue(...future.stdout))
          }
          else {
              ...future.result["stdout"] <- list(NULL)
          }
          close(...future.stdout)
          ...future.stdout <- NULL
      }
      ...future.result$conditions <- ...future.conditions
      ...future.result
  }
  plan(): Setting new future strategy stack:
  List of future strategies:
  1. sequential:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: NULL
  
  plan(): nbrOfWorkers() = 1
  plan(): Setting new future strategy stack:
  List of future strategies:
  1. sequential:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: plan(list(a = strategy1, b = strategy2))
  
  plan(): nbrOfWorkers() = 1
  SequentialFuture started (and completed)
  [20:52:30.113] Chunk #1 of 1 ... DONE
  [20:52:30.114] Launching 1 futures (chunks) ... DONE
  [20:52:30.114] - resolving futures
  resolve() on list ...
   recursive: 0
   length: 1
  
   length: 0 (resolved future 1)
  resolve() on list ... DONE
  [20:52:30.117] - relaying conditions of futures
  Future state: 'finished'
  sequential:- args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)- tweaked: FALSE- call: NULL
  sequential:- args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)- tweaked: FALSE- call: NULL
  sequential:- args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)- tweaked: FALSE- call: NULL
  [20:52:30.118] - collecting values of futures
  [20:52:30.118] - accumulating results
  [20:52:30.119] - processing errors (handler = 'stop')
  [20:52:30.120] - extracting results
  [20:52:30.120] doFuture() ... DONE
  foreach() - level 2 ... DONE
  foreach() - level 2 ...
  [20:52:30.172] doFuture() ...
  [20:52:30.173] - dummy globals (as locals): [1] 'b'
  [20:52:30.174] - R expression:
  [20:52:30.175] {
  [20:52:30.175]     doFuture::registerDoFuture()
  [20:52:30.175]     lapply(seq_along(...future.x_ii), FUN = function(jj) {
  [20:52:30.175]         ...future.x_jj <- ...future.x_ii[[jj]]
  [20:52:30.175]         b <- NULL
  [20:52:30.175]         ...future.env <- environment()
  [20:52:30.175]         local({
  [20:52:30.175]             for (name in names(...future.x_jj)) {
  [20:52:30.175]                 assign(name, ...future.x_jj[[name]], envir = ...future.env, 
  [20:52:30.175]                   inherits = FALSE)
  [20:52:30.175]             }
  [20:52:30.175]         })
  [20:52:30.175]         tryCatch({
  [20:52:30.175]             plan_list <- future::plan()
  [20:52:30.175]             message(capture.output(print(plan_list)))
  [20:52:30.175]             stopifnot(inherits(plan_list, "future"), inherits(plan_list, 
  [20:52:30.175]                 getOption("future.default", "sequential")))
  [20:52:30.175]             plan_b <- future::plan("list")
  [20:52:30.175]             str(plan_b)
  [20:52:30.175]             stopifnot(inherits(plan_b[[1]], "future"), inherits(plan_b[[1]], 
  [20:52:30.175]                 getOption("future.default", "sequential")))
  [20:52:30.175]             list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
  [20:52:30.175]         }, error = identity)
  [20:52:30.175]     })
  [20:52:30.175] }
  [20:52:30.176] - identifying globals and packages ...
  getGlobalsAndPackages() ...
  Searching for globals...
  - globals found: [24] '{', '::', 'lapply', 'seq_along', '...future.x_ii', '<-', '[[', 'environment', 'local', 'for', 'names', 'assign', 'tryCatch', 'message', 'capture.output', 'print', 'stopifnot', 'inherits', 'getOption', 'str', 'list', 'a', 'plan_a', 'identity'
  Searching for globals ... DONE
  Resolving globals: FALSE
  The total size of the 3 globals is 39.67 KiB (40624 bytes)
  - globals: [3] '...future.x_ii', 'a', 'plan_a'
  - packages: [1] 'utils'
  getGlobalsAndPackages() ... DONE
  [20:52:30.206] List of 3
  [20:52:30.206]  $ ...future.x_ii: NULL
  [20:52:30.206]  $ a             : int 2
  [20:52:30.206]  $ plan_a        :List of 1
  [20:52:30.206]   ..$ b:function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
  [20:52:30.206]     seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
  [20:52:30.206]     ...)  
  [20:52:30.206]   .. ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
  [20:52:30.206]   .. ..- attr(*, "call")= language plan(list(a = strategy1, b = strategy2))
  [20:52:30.206]   ..- attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  [20:52:30.206]  - attr(*, "where")=List of 3
  [20:52:30.206]   ..$ ...future.x_ii:<environment: 0x55a47eb26c50> 
  [20:52:30.206]   ..$ a             :<environment: 0x55a47eb99ad8> 
  [20:52:30.206]   ..$ plan_a        :<environment: 0x55a47eb99ad8> 
  [20:52:30.206]  - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list"
  [20:52:30.206]  - attr(*, "resolved")= logi FALSE
  [20:52:30.206]  - attr(*, "total_size")= num 40624
  [20:52:30.224]   - R expression:
  [20:52:30.225] {
  [20:52:30.225]     doFuture::registerDoFuture()
  [20:52:30.225]     lapply(seq_along(...future.x_ii), FUN = function(jj) {
  [20:52:30.225]         ...future.x_jj <- ...future.x_ii[[jj]]
  [20:52:30.225]         b <- NULL
  [20:52:30.225]         ...future.env <- environment()
  [20:52:30.225]         local({
  [20:52:30.225]             for (name in names(...future.x_jj)) {
  [20:52:30.225]                 assign(name, ...future.x_jj[[name]], envir = ...future.env, 
  [20:52:30.225]                   inherits = FALSE)
  [20:52:30.225]             }
  [20:52:30.225]         })
  [20:52:30.225]         tryCatch({
  [20:52:30.225]             plan_list <- future::plan()
  [20:52:30.225]             message(capture.output(print(plan_list)))
  [20:52:30.225]             stopifnot(inherits(plan_list, "future"), inherits(plan_list, 
  [20:52:30.225]                 getOption("future.default", "sequential")))
  [20:52:30.225]             plan_b <- future::plan("list")
  [20:52:30.225]             str(plan_b)
  [20:52:30.225]             stopifnot(inherits(plan_b[[1]], "future"), inherits(plan_b[[1]], 
  [20:52:30.225]                 getOption("future.default", "sequential")))
  [20:52:30.225]             list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
  [20:52:30.225]         }, error = identity)
  [20:52:30.225]     })
  [20:52:30.225] }
  [20:52:30.226]   - globals: [3] '...future.x_ii', 'a', 'plan_a'
  [20:52:30.226] List of 3
  [20:52:30.226]  $ ...future.x_ii: NULL
  [20:52:30.226]  $ a             : int 2
  [20:52:30.226]  $ plan_a        :List of 1
  [20:52:30.226]   ..$ b:function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
  [20:52:30.226]     seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
  [20:52:30.226]     ...)  
  [20:52:30.226]   .. ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
  [20:52:30.226]   .. ..- attr(*, "call")= language plan(list(a = strategy1, b = strategy2))
  [20:52:30.226]   ..- attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  [20:52:30.226]  - attr(*, "where")=List of 3
  [20:52:30.226]   ..$ ...future.x_ii:<environment: 0x55a47eb26c50> 
  [20:52:30.226]   ..$ a             :<environment: 0x55a47eb99ad8> 
  [20:52:30.226]   ..$ plan_a        :<environment: 0x55a47eb99ad8> 
  [20:52:30.226]  - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list"
  [20:52:30.226]  - attr(*, "resolved")= logi FALSE
  [20:52:30.226]  - attr(*, "total_size")= num 40624
  [20:52:30.240]   - packages: [2] 'doFuture', 'utils'
  [20:52:30.240] - identifying globals and packages ... DONE
  [20:52:30.241] Number of chunks: 1
  [20:52:30.241] Number of futures (= number of chunks): 1
  [20:52:30.241] Launching 1 futures (chunks) ...
  [20:52:30.242] Chunk #1 of 1 ...
  [20:52:30.242]  - Finding globals in 'args_list' chunk #1 ...
  getGlobalsAndPackages() ...
  Searching for globals...
  
  Searching for globals ... DONE
  - globals: [0] <none>
  getGlobalsAndPackages() ... DONE
  [20:52:30.245] 
  [20:52:30.245] 
  [20:52:30.246]  - Finding globals in 'args_list' for chunk #1 ... DONE
  getGlobalsAndPackages() ...
  - globals passed as-is: [3] '...future.x_ii', 'a', 'plan_a'
  Resolving globals: FALSE
  The total size of the 3 globals is 39.84 KiB (40792 bytes)
  - globals: [3] '...future.x_ii', 'a', 'plan_a'
  
  getGlobalsAndPackages() ... DONE
  Packages needed by future strategies (n = 0): <none>
  Packages needed by the future expression (n = 2): 'doFuture', 'utils'
  {
      {
          ...future.startTime <- Sys.time()
          ...future.oldOptions <- options(future.startup.loadScript = FALSE, 
              future.globals.onMissing = "ignore", future.globals.maxSize = NULL, 
              future.globals.method = NULL, future.globals.onMissing = "ignore", 
              future.globals.onReference = NULL, future.globals.resolve = NULL, 
              future.resolve.recursive = NULL, width = 80L)
          {
              {
                  {
                    has_future <- requireNamespace("future", quietly = TRUE)
                    version <- if (has_future) 
                      packageVersion("future")
                    else NULL
                    if (!has_future || version < "1.8.0") {
                      info <- c(r_version = gsub("R version ", 
                        "", R.version$version.string), platform = sprintf("%s (%s-bit)", 
                        R.version$platform, 8 * .Machine$sizeof.pointer), 
                        os = paste(Sys.info()[c("sysname", "release", 
                          "version")], collapse = " "), hostname = Sys.info()[["nodename"]])
                      info <- sprintf("%s: %s", names(info), info)
                      info <- paste(info, collapse = "; ")
                      if (!has_future) {
                        msg <- sprintf("Package 'future' is not installed on worker (%s)", 
                          info)
                      }
                      else {
                        msg <- sprintf("Package 'future' on worker (%s) must be of version >= 1.8.0: %s", 
                          info, version)
                      }
                      stop(msg)
                    }
                  }
                  local({
                    for (pkg in c("doFuture", "utils")) {
                      loadNamespace(pkg)
                      library(pkg, character.only = TRUE)
                    }
                  })
              }
              future::plan("default", .cleanup = FALSE, .init = FALSE)
          }
      }
      if (is.na(TRUE)) {
      }
      else {
          if (TRUE) {
              ...future.stdout <- rawConnection(raw(0L), open = "w")
          }
          else {
              ...future.stdout <- file(switch(.Platform$OS.type, 
                  windows = "NUL", "/dev/null"), open = "w")
          }
          sink(...future.stdout, type = "output", split = FALSE)
          on.exit(if (!is.null(...future.stdout)) {
              sink(type = "output", split = FALSE)
              close(...future.stdout)
          }, add = TRUE)
      }
      ...future.frame <- sys.nframe()
      ...future.conditions <- list()
      ...future.result <- tryCatch({
          withCallingHandlers({
              ...future.value <- local({
                  doFuture::registerDoFuture()
                  lapply(seq_along(...future.x_ii), FUN = function(jj) {
                    ...future.x_jj <- ...future.x_ii[[jj]]
                    b <- NULL
                    ...future.env <- environment()
                    local({
                      for (name in names(...future.x_jj)) {
                        assign(name, ...future.x_jj[[name]], envir = ...future.env, 
                          inherits = FALSE)
                      }
                    })
                    tryCatch({
                      plan_list <- future::plan()
                      message(capture.output(print(plan_list)))
                      stopifnot(inherits(plan_list, "future"), 
                        inherits(plan_list, getOption("future.default", 
                          "sequential")))
                      plan_b <- future::plan("list")
                      str(plan_b)
                      stopifnot(inherits(plan_b[[1]], "future"), 
                        inherits(plan_b[[1]], getOption("future.default", 
                          "sequential")))
                      list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
                    }, error = identity)
                  })
              })
              future::FutureResult(value = ...future.value, started = ...future.startTime, 
                  version = "1.8")
          }, condition = local({
              inherits <- base::inherits
              invokeRestart <- base::invokeRestart
              length <- base::length
              seq.int <- base::seq.int
              sys.calls <- base::sys.calls
              `[[` <- base::`[[`
              `+` <- base::`+`
              `<<-` <- base::`<<-`
              sysCalls <- function(calls = sys.calls(), from = 1L) {
                  calls[seq.int(from = from + 12L, to = length(calls) - 
                    3L)]
              }
              function(cond) {
                  if (inherits(cond, "error")) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond, calls = c(sysCalls(from = ...future.frame), 
                      cond$call), timestamp = base::Sys.time())
                    signalCondition(cond)
                  }
                  else if (inherits(cond, c("message", "warning"
                  ))) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond)
                    if (inherits(cond, "message")) {
                      invokeRestart("muffleMessage")
                    }
                    else if (inherits(cond, "warning")) {
                      invokeRestart("muffleWarning")
                    }
                  }
              }
          }))
      }, error = function(ex) {
          structure(list(value = NULL, conditions = ...future.conditions, 
              condition = ex, calls = sys.calls(), version = "1.8"), 
              class = "FutureResult")
      }, finally = {
          {
              NULL
              future::plan(list(b = function (expr, envir = parent.frame(), 
                  substitute = TRUE, lazy = FALSE, seed = NULL, 
                  globals = TRUE, local = TRUE, earlySignal = FALSE, 
                  label = NULL, ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  local <- as.logical(local)
                  future <- SequentialFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, local = local, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }), .cleanup = FALSE, .init = FALSE)
          }
          options(...future.oldOptions)
      })
      if (is.na(TRUE)) {
      }
      else {
          sink(type = "output", split = FALSE)
          if (TRUE) {
              ...future.result$stdout <- rawToChar(rawConnectionValue(...future.stdout))
          }
          else {
              ...future.result["stdout"] <- list(NULL)
          }
          close(...future.stdout)
          ...future.stdout <- NULL
      }
      ...future.result$conditions <- ...future.conditions
      ...future.result
  }
  plan(): Setting new future strategy stack:
  List of future strategies:
  1. sequential:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: NULL
  
  plan(): nbrOfWorkers() = 1
  plan(): Setting new future strategy stack:
  List of future strategies:
  1. sequential:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: plan(list(a = strategy1, b = strategy2))
  
  plan(): nbrOfWorkers() = 1
  SequentialFuture started (and completed)
  [20:52:30.277] Chunk #1 of 1 ... DONE
  [20:52:30.278] Launching 1 futures (chunks) ... DONE
  [20:52:30.278] - resolving futures
  resolve() on list ...
   recursive: 0
   length: 1
  
   length: 0 (resolved future 1)
  resolve() on list ... DONE
  [20:52:30.280] - relaying conditions of futures
  Future state: 'finished'
  sequential:- args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)- tweaked: FALSE- call: NULL
  sequential:- args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)- tweaked: FALSE- call: NULL
  sequential:- args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)- tweaked: FALSE- call: NULL
  [20:52:30.282] - collecting values of futures
  [20:52:30.282] - accumulating results
  [20:52:30.286] - processing errors (handler = 'stop')
  [20:52:30.287] - extracting results
  [20:52:30.287] doFuture() ... DONE
  foreach() - level 2 ... DONE
  [20:52:30.309] - collecting values of futures
  [20:52:30.310] - accumulating results
  [20:52:30.311] - processing errors (handler = 'stop')
  [20:52:30.311] - extracting results
  [20:52:30.311] doFuture() ... DONE
  foreach() - level 1 ... DONE
  - plan(list('sequential', 'sequential')) ... DONE
  - plan(list('sequential', 'multicore')) ...
  plan(): Setting new future strategy stack:
  List of future strategies:
  1. sequential:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: plan(list(a = strategy1, b = strategy2))
  2. multicore:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, workers = availableCores(constraints = "multicore"), earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: plan(list(a = strategy1, b = strategy2))
  
  plan(): nbrOfWorkers() = 1
  foreach() - level 1 ...
  [20:52:30.315] doFuture() ...
  [20:52:30.316] - dummy globals (as locals): [1] 'a'
  [20:52:30.317] - R expression:
  [20:52:30.318] {
  [20:52:30.318]     doFuture::registerDoFuture()
  [20:52:30.318]     lapply(seq_along(...future.x_ii), FUN = function(jj) {
  [20:52:30.318]         ...future.x_jj <- ...future.x_ii[[jj]]
  [20:52:30.318]         a <- NULL
  [20:52:30.318]         ...future.env <- environment()
  [20:52:30.318]         local({
  [20:52:30.318]             for (name in names(...future.x_jj)) {
  [20:52:30.318]                 assign(name, ...future.x_jj[[name]], envir = ...future.env, 
  [20:52:30.318]                   inherits = FALSE)
  [20:52:30.318]             }
  [20:52:30.318]         })
  [20:52:30.318]         tryCatch({
  [20:52:30.318]             plan_list <- future::plan()
  [20:52:30.318]             stopifnot(inherits(plan_list, strategy2))
  [20:52:30.318]             plan_a <- future::plan("list")
  [20:52:30.318]             str(plan_a)
  [20:52:30.318]             stopifnot(inherits(plan_a[[1]], strategy2))
  [20:52:30.318]             message("foreach() - level 2 ...")
  [20:52:30.318]             y <- foreach(b = bs, .export = c("a", "plan_a")) %dopar% 
  [20:52:30.318]                 {
  [20:52:30.318]                   plan_list <- future::plan()
  [20:52:30.318]                   message(capture.output(print(plan_list)))
  [20:52:30.318]                   stopifnot(inherits(plan_list, "future"), inherits(plan_list, 
  [20:52:30.318]                     getOption("future.default", "sequential")))
  [20:52:30.318]                   plan_b <- future::plan("list")
  [20:52:30.318]                   str(plan_b)
  [20:52:30.318]                   stopifnot(inherits(plan_b[[1]], "future"), 
  [20:52:30.318]                     inherits(plan_b[[1]], getOption("future.default", 
  [20:52:30.318]                       "sequential")))
  [20:52:30.318]                   list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
  [20:52:30.318]                 }
  [20:52:30.318]             message("foreach() - level 2 ... DONE")
  [20:52:30.318]             y
  [20:52:30.318]         }, error = identity)
  [20:52:30.318]     })
  [20:52:30.318] }
  [20:52:30.319] - identifying globals and packages ...
  getGlobalsAndPackages() ...
  Searching for globals...
  - globals found: [28] '{', '::', 'lapply', 'seq_along', '...future.x_ii', '<-', '[[', 'environment', 'local', 'for', 'names', 'assign', 'tryCatch', 'stopifnot', 'inherits', 'strategy2', 'str', 'message', '%dopar%', 'foreach', 'bs', 'c', 'capture.output', 'print', 'getOption', 'list', 'b', 'identity'
  Searching for globals ... DONE
  Resolving globals: FALSE
  The total size of the 3 globals is 184 bytes (184 bytes)
  - globals: [3] '...future.x_ii', 'strategy2', 'bs'
  - packages: [2] 'utils', 'foreach'
  getGlobalsAndPackages() ... DONE
  [20:52:30.357] List of 3
  [20:52:30.357]  $ ...future.x_ii: NULL
  [20:52:30.357]  $ strategy2     : chr "multicore"
  [20:52:30.357]  $ bs            : int [1:3] 3 2 1
  [20:52:30.357]  - attr(*, "where")=List of 3
  [20:52:30.357]   ..$ ...future.x_ii:<environment: 0x55a47dda11f8> 
  [20:52:30.357]   ..$ strategy2     :<environment: R_GlobalEnv> 
  [20:52:30.357]   ..$ bs            :<environment: R_GlobalEnv> 
  [20:52:30.357]  - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list"
  [20:52:30.357]  - attr(*, "resolved")= logi FALSE
  [20:52:30.357]  - attr(*, "total_size")= num 184
  [20:52:30.366]   - R expression:
  [20:52:30.367] {
  [20:52:30.367]     doFuture::registerDoFuture()
  [20:52:30.367]     lapply(seq_along(...future.x_ii), FUN = function(jj) {
  [20:52:30.367]         ...future.x_jj <- ...future.x_ii[[jj]]
  [20:52:30.367]         a <- NULL
  [20:52:30.367]         ...future.env <- environment()
  [20:52:30.367]         local({
  [20:52:30.367]             for (name in names(...future.x_jj)) {
  [20:52:30.367]                 assign(name, ...future.x_jj[[name]], envir = ...future.env, 
  [20:52:30.367]                   inherits = FALSE)
  [20:52:30.367]             }
  [20:52:30.367]         })
  [20:52:30.367]         tryCatch({
  [20:52:30.367]             plan_list <- future::plan()
  [20:52:30.367]             stopifnot(inherits(plan_list, strategy2))
  [20:52:30.367]             plan_a <- future::plan("list")
  [20:52:30.367]             str(plan_a)
  [20:52:30.367]             stopifnot(inherits(plan_a[[1]], strategy2))
  [20:52:30.367]             message("foreach() - level 2 ...")
  [20:52:30.367]             y <- foreach(b = bs, .export = c("a", "plan_a")) %dopar% 
  [20:52:30.367]                 {
  [20:52:30.367]                   plan_list <- future::plan()
  [20:52:30.367]                   message(capture.output(print(plan_list)))
  [20:52:30.367]                   stopifnot(inherits(plan_list, "future"), inherits(plan_list, 
  [20:52:30.367]                     getOption("future.default", "sequential")))
  [20:52:30.367]                   plan_b <- future::plan("list")
  [20:52:30.367]                   str(plan_b)
  [20:52:30.367]                   stopifnot(inherits(plan_b[[1]], "future"), 
  [20:52:30.367]                     inherits(plan_b[[1]], getOption("future.default", 
  [20:52:30.367]                       "sequential")))
  [20:52:30.367]                   list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
  [20:52:30.367]                 }
  [20:52:30.367]             message("foreach() - level 2 ... DONE")
  [20:52:30.367]             y
  [20:52:30.367]         }, error = identity)
  [20:52:30.367]     })
  [20:52:30.367] }
  [20:52:30.368]   - globals: [3] '...future.x_ii', 'strategy2', 'bs'
  [20:52:30.368] List of 3
  [20:52:30.368]  $ ...future.x_ii: NULL
  [20:52:30.368]  $ strategy2     : chr "multicore"
  [20:52:30.368]  $ bs            : int [1:3] 3 2 1
  [20:52:30.368]  - attr(*, "where")=List of 3
  [20:52:30.368]   ..$ ...future.x_ii:<environment: 0x55a47dda11f8> 
  [20:52:30.368]   ..$ strategy2     :<environment: R_GlobalEnv> 
  [20:52:30.368]   ..$ bs            :<environment: R_GlobalEnv> 
  [20:52:30.368]  - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list"
  [20:52:30.368]  - attr(*, "resolved")= logi FALSE
  [20:52:30.368]  - attr(*, "total_size")= num 184
  [20:52:30.377]   - packages: [3] 'doFuture', 'utils', 'foreach'
  [20:52:30.377] - identifying globals and packages ... DONE
  [20:52:30.378] Number of chunks: 1
  [20:52:30.378] Number of futures (= number of chunks): 1
  [20:52:30.378] Launching 1 futures (chunks) ...
  [20:52:30.379] Chunk #1 of 1 ...
  [20:52:30.379]  - Finding globals in 'args_list' chunk #1 ...
  getGlobalsAndPackages() ...
  Searching for globals...
  
  Searching for globals ... DONE
  - globals: [0] <none>
  getGlobalsAndPackages() ... DONE
  [20:52:30.385] 
  [20:52:30.385] 
  [20:52:30.386]  - Finding globals in 'args_list' for chunk #1 ... DONE
  getGlobalsAndPackages() ...
  - globals passed as-is: [3] '...future.x_ii', 'strategy2', 'bs'
  Resolving globals: FALSE
  The total size of the 3 globals is 296 bytes (296 bytes)
  - globals: [3] '...future.x_ii', 'strategy2', 'bs'
  
  getGlobalsAndPackages() ... DONE
  Packages needed by future strategies (n = 1): 'future'
  Packages needed by the future expression (n = 3): 'doFuture', 'utils', 'foreach'
  {
      {
          ...future.startTime <- Sys.time()
          ...future.oldOptions <- options(future.startup.loadScript = FALSE, 
              future.globals.onMissing = "ignore", future.globals.maxSize = NULL, 
              future.globals.method = NULL, future.globals.onMissing = "ignore", 
              future.globals.onReference = NULL, future.globals.resolve = NULL, 
              future.resolve.recursive = NULL, width = 80L)
          {
              {
                  {
                    has_future <- requireNamespace("future", quietly = TRUE)
                    version <- if (has_future) 
                      packageVersion("future")
                    else NULL
                    if (!has_future || version < "1.8.0") {
                      info <- c(r_version = gsub("R version ", 
                        "", R.version$version.string), platform = sprintf("%s (%s-bit)", 
                        R.version$platform, 8 * .Machine$sizeof.pointer), 
                        os = paste(Sys.info()[c("sysname", "release", 
                          "version")], collapse = " "), hostname = Sys.info()[["nodename"]])
                      info <- sprintf("%s: %s", names(info), info)
                      info <- paste(info, collapse = "; ")
                      if (!has_future) {
                        msg <- sprintf("Package 'future' is not installed on worker (%s)", 
                          info)
                      }
                      else {
                        msg <- sprintf("Package 'future' on worker (%s) must be of version >= 1.8.0: %s", 
                          info, version)
                      }
                      stop(msg)
                    }
                  }
                  local({
                    for (pkg in c("future", "doFuture", "utils", 
                    "foreach")) {
                      loadNamespace(pkg)
                      library(pkg, character.only = TRUE)
                    }
                  })
              }
              future::plan(list(b = function (expr, envir = parent.frame(), 
                  substitute = TRUE, lazy = FALSE, seed = NULL, 
                  globals = TRUE, workers = availableCores(constraints = "multicore"), 
                  earlySignal = FALSE, label = NULL, ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  if (is.function(workers)) 
                    workers <- workers()
                  workers <- as.integer(workers)
                  stop_if_not(is.finite(workers), workers >= 1L)
                  if (workers == 1L || !supportsMulticore()) {
                    return(sequential(expr, envir = envir, substitute = FALSE, 
                      lazy = lazy, seed = seed, globals = globals, 
                      local = TRUE, label = label, ...))
                  }
                  oopts <- options(mc.cores = workers)
                  on.exit(options(oopts))
                  future <- MulticoreFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, workers = workers, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }), .cleanup = FALSE, .init = FALSE)
          }
      }
      if (is.na(TRUE)) {
      }
      else {
          if (TRUE) {
              ...future.stdout <- rawConnection(raw(0L), open = "w")
          }
          else {
              ...future.stdout <- file(switch(.Platform$OS.type, 
                  windows = "NUL", "/dev/null"), open = "w")
          }
          sink(...future.stdout, type = "output", split = FALSE)
          on.exit(if (!is.null(...future.stdout)) {
              sink(type = "output", split = FALSE)
              close(...future.stdout)
          }, add = TRUE)
      }
      ...future.frame <- sys.nframe()
      ...future.conditions <- list()
      ...future.result <- tryCatch({
          withCallingHandlers({
              ...future.value <- local({
                  doFuture::registerDoFuture()
                  lapply(seq_along(...future.x_ii), FUN = function(jj) {
                    ...future.x_jj <- ...future.x_ii[[jj]]
                    a <- NULL
                    ...future.env <- environment()
                    local({
                      for (name in names(...future.x_jj)) {
                        assign(name, ...future.x_jj[[name]], envir = ...future.env, 
                          inherits = FALSE)
                      }
                    })
                    tryCatch({
                      plan_list <- future::plan()
                      stopifnot(inherits(plan_list, strategy2))
                      plan_a <- future::plan("list")
                      str(plan_a)
                      stopifnot(inherits(plan_a[[1]], strategy2))
                      message("foreach() - level 2 ...")
                      y <- foreach(b = bs, .export = c("a", "plan_a")) %dopar% 
                        {
                          plan_list <- future::plan()
                          message(capture.output(print(plan_list)))
                          stopifnot(inherits(plan_list, "future"), 
                            inherits(plan_list, getOption("future.default", 
                              "sequential")))
                          plan_b <- future::plan("list")
                          str(plan_b)
                          stopifnot(inherits(plan_b[[1]], "future"), 
                            inherits(plan_b[[1]], getOption("future.default", 
                              "sequential")))
                          list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
                        }
                      message("foreach() - level 2 ... DONE")
                      y
                    }, error = identity)
                  })
              })
              future::FutureResult(value = ...future.value, started = ...future.startTime, 
                  version = "1.8")
          }, condition = local({
              inherits <- base::inherits
              invokeRestart <- base::invokeRestart
              length <- base::length
              seq.int <- base::seq.int
              sys.calls <- base::sys.calls
              `[[` <- base::`[[`
              `+` <- base::`+`
              `<<-` <- base::`<<-`
              sysCalls <- function(calls = sys.calls(), from = 1L) {
                  calls[seq.int(from = from + 12L, to = length(calls) - 
                    3L)]
              }
              function(cond) {
                  if (inherits(cond, "error")) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond, calls = c(sysCalls(from = ...future.frame), 
                      cond$call), timestamp = base::Sys.time())
                    signalCondition(cond)
                  }
                  else if (inherits(cond, c("message", "warning"
                  ))) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond)
                    if (inherits(cond, "message")) {
                      invokeRestart("muffleMessage")
                    }
                    else if (inherits(cond, "warning")) {
                      invokeRestart("muffleWarning")
                    }
                  }
              }
          }))
      }, error = function(ex) {
          structure(list(value = NULL, conditions = ...future.conditions, 
              condition = ex, calls = sys.calls(), version = "1.8"), 
              class = "FutureResult")
      }, finally = {
          {
              NULL
              future::plan(list(a = function (expr, envir = parent.frame(), 
                  substitute = TRUE, lazy = FALSE, seed = NULL, 
                  globals = TRUE, local = TRUE, earlySignal = FALSE, 
                  label = NULL, ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  local <- as.logical(local)
                  future <- SequentialFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, local = local, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }, b = function (expr, envir = parent.frame(), substitute = TRUE, 
                  lazy = FALSE, seed = NULL, globals = TRUE, workers = availableCores(constraints = "multicore"), 
                  earlySignal = FALSE, label = NULL, ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  if (is.function(workers)) 
                    workers <- workers()
                  workers <- as.integer(workers)
                  stop_if_not(is.finite(workers), workers >= 1L)
                  if (workers == 1L || !supportsMulticore()) {
                    return(sequential(expr, envir = envir, substitute = FALSE, 
                      lazy = lazy, seed = seed, globals = globals, 
                      local = TRUE, label = label, ...))
                  }
                  oopts <- options(mc.cores = workers)
                  on.exit(options(oopts))
                  future <- MulticoreFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, workers = workers, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }), .cleanup = FALSE, .init = FALSE)
          }
          options(...future.oldOptions)
      })
      if (is.na(TRUE)) {
      }
      else {
          sink(type = "output", split = FALSE)
          if (TRUE) {
              ...future.result$stdout <- rawToChar(rawConnectionValue(...future.stdout))
          }
          else {
              ...future.result["stdout"] <- list(NULL)
          }
          close(...future.stdout)
          ...future.stdout <- NULL
      }
      ...future.result$conditions <- ...future.conditions
      ...future.result
  }
  plan(): Setting new future strategy stack:
  List of future strategies:
  1. multicore:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, workers = availableCores(constraints = "multicore"), earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: plan(list(a = strategy1, b = strategy2))
  
  plan(): nbrOfWorkers() = 2
  plan(): Setting new future strategy stack:
  List of future strategies:
  1. sequential:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: plan(list(a = strategy1, b = strategy2))
  2. multicore:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, workers = availableCores(constraints = "multicore"), earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: plan(list(a = strategy1, b = strategy2))
  
  plan(): nbrOfWorkers() = 1
  SequentialFuture started (and completed)
  [20:52:31.089] Chunk #1 of 1 ... DONE
  [20:52:31.090] Launching 1 futures (chunks) ... DONE
  [20:52:31.090] - resolving futures
  resolve() on list ...
   recursive: 0
   length: 1
  
   length: 0 (resolved future 1)
  resolve() on list ... DONE
  [20:52:31.101] - relaying conditions of futures
  List of 1
   $ b:function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, workers = availableCores(constraints = "multicore"), 
      earlySignal = FALSE, label = NULL, ...)  
    ..- attr(*, "class")= chr [1:4] "multicore" "multiprocess" "future" "function"
    ..- attr(*, "call")= language plan(list(a = strategy1, b = strategy2))
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  List of 1
   $ :function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
      ...)  
    ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  List of 1
   $ :function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
      ...)  
    ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  List of 1
   $ :function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
      ...)  
    ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  List of 1
   $ b:function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, workers = availableCores(constraints = "multicore"), 
      earlySignal = FALSE, label = NULL, ...)  
    ..- attr(*, "class")= chr [1:4] "multicore" "multiprocess" "future" "function"
    ..- attr(*, "call")= language plan(list(a = strategy1, b = strategy2))
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  List of 1
   $ :function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
      ...)  
    ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  List of 1
   $ :function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
      ...)  
    ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  List of 1
   $ :function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
      ...)  
    ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  Future state: 'finished'
  foreach() - level 2 ...
  [20:52:30.435] doFuture() ...
  [20:52:30.437] - dummy globals (as locals): [1] 'b'
  [20:52:30.438] - R expression:
  [20:52:30.439] {
  [20:52:30.439]     doFuture::registerDoFuture()
  [20:52:30.439]     lapply(seq_along(...future.x_ii), FUN = function(jj) {
  [20:52:30.439]         ...future.x_jj <- ...future.x_ii[[jj]]
  [20:52:30.439]         b <- NULL
  [20:52:30.439]         ...future.env <- environment()
  [20:52:30.439]         local({
  [20:52:30.439]             for (name in names(...future.x_jj)) {
  [20:52:30.439]                 assign(name, ...future.x_jj[[name]], envir = ...future.env, 
  [20:52:30.439]                   inherits = FALSE)
  [20:52:30.439]             }
  [20:52:30.439]         })
  [20:52:30.439]         tryCatch({
  [20:52:30.439]             plan_list <- future::plan()
  [20:52:30.439]             message(capture.output(print(plan_list)))
  [20:52:30.439]             stopifnot(inherits(plan_list, "future"), inherits(plan_list, 
  [20:52:30.439]                 getOption("future.default", "sequential")))
  [20:52:30.439]             plan_b <- future::plan("list")
  [20:52:30.439]             str(plan_b)
  [20:52:30.439]             stopifnot(inherits(plan_b[[1]], "future"), inherits(plan_b[[1]], 
  [20:52:30.439]                 getOption("future.default", "sequential")))
  [20:52:30.439]             list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
  [20:52:30.439]         }, error = identity)
  [20:52:30.439]     })
  [20:52:30.439] }
  [20:52:30.440] - identifying globals and packages ...
  getGlobalsAndPackages() ...
  Searching for globals...
  - globals found: [24] '{', '::', 'lapply', 'seq_along', '...future.x_ii', '<-', '[[', 'environment', 'local', 'for', 'names', 'assign', 'tryCatch', 'message', 'capture.output', 'print', 'stopifnot', 'inherits', 'getOption', 'str', 'list', 'a', 'plan_a', 'identity'
  Searching for globals ... DONE
  Resolving globals: FALSE
  The total size of the 3 globals is 74.09 KiB (75872 bytes)
  - globals: [3] '...future.x_ii', 'a', 'plan_a'
  - packages: [1] 'utils'
  getGlobalsAndPackages() ... DONE
  [20:52:30.519] List of 3
  [20:52:30.519]  $ ...future.x_ii: NULL
  [20:52:30.519]  $ a             : int 1
  [20:52:30.519]  $ plan_a        :List of 1
  [20:52:30.519]   ..$ b:function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
  [20:52:30.519]     seed = NULL, globals = TRUE, workers = availableCores(constraints = "multicore"), 
  [20:52:30.519]     earlySignal = FALSE, label = NULL, ...)  
  [20:52:30.519]   .. ..- attr(*, "class")= chr [1:4] "multicore" "multiprocess" "future" "function"
  [20:52:30.519]   .. ..- attr(*, "call")= language plan(list(a = strategy1, b = strategy2))
  [20:52:30.519]   ..- attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  [20:52:30.519]  - attr(*, "where")=List of 3
  [20:52:30.519]   ..$ ...future.x_ii:<environment: 0x55a47fdd11a0> 
  [20:52:30.519]   ..$ a             :<environment: 0x55a47fb1ac80> 
  [20:52:30.519]   ..$ plan_a        :<environment: 0x55a47fb1ac80> 
  [20:52:30.519]  - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list"
  [20:52:30.519]  - attr(*, "resolved")= logi FALSE
  [20:52:30.519]  - attr(*, "total_size")= num 75872
  [20:52:30.544]   - R expression:
  [20:52:30.544] {
  [20:52:30.544]     doFuture::registerDoFuture()
  [20:52:30.544]     lapply(seq_along(...future.x_ii), FUN = function(jj) {
  [20:52:30.544]         ...future.x_jj <- ...future.x_ii[[jj]]
  [20:52:30.544]         b <- NULL
  [20:52:30.544]         ...future.env <- environment()
  [20:52:30.544]         local({
  [20:52:30.544]             for (name in names(...future.x_jj)) {
  [20:52:30.544]                 assign(name, ...future.x_jj[[name]], envir = ...future.env, 
  [20:52:30.544]                   inherits = FALSE)
  [20:52:30.544]             }
  [20:52:30.544]         })
  [20:52:30.544]         tryCatch({
  [20:52:30.544]             plan_list <- future::plan()
  [20:52:30.544]             message(capture.output(print(plan_list)))
  [20:52:30.544]             stopifnot(inherits(plan_list, "future"), inherits(plan_list, 
  [20:52:30.544]                 getOption("future.default", "sequential")))
  [20:52:30.544]             plan_b <- future::plan("list")
  [20:52:30.544]             str(plan_b)
  [20:52:30.544]             stopifnot(inherits(plan_b[[1]], "future"), inherits(plan_b[[1]], 
  [20:52:30.544]                 getOption("future.default", "sequential")))
  [20:52:30.544]             list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
  [20:52:30.544]         }, error = identity)
  [20:52:30.544]     })
  [20:52:30.544] }
  [20:52:30.553]   - globals: [3] '...future.x_ii', 'a', 'plan_a'
  [20:52:30.553] List of 3
  [20:52:30.553]  $ ...future.x_ii: NULL
  [20:52:30.553]  $ a             : int 1
  [20:52:30.553]  $ plan_a        :List of 1
  [20:52:30.553]   ..$ b:function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
  [20:52:30.553]     seed = NULL, globals = TRUE, workers = availableCores(constraints = "multicore"), 
  [20:52:30.553]     earlySignal = FALSE, label = NULL, ...)  
  [20:52:30.553]   .. ..- attr(*, "class")= chr [1:4] "multicore" "multiprocess" "future" "function"
  [20:52:30.553]   .. ..- attr(*, "call")= language plan(list(a = strategy1, b = strategy2))
  [20:52:30.553]   ..- attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  [20:52:30.553]  - attr(*, "where")=List of 3
  [20:52:30.553]   ..$ ...future.x_ii:<environment: 0x55a47fdd11a0> 
  [20:52:30.553]   ..$ a             :<environment: 0x55a47fb1ac80> 
  [20:52:30.553]   ..$ plan_a        :<environment: 0x55a47fb1ac80> 
  [20:52:30.553]  - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list"
  [20:52:30.553]  - attr(*, "resolved")= logi FALSE
  [20:52:30.553]  - attr(*, "total_size")= num 75872
  [20:52:30.588]   - packages: [2] 'doFuture', 'utils'
  [20:52:30.589] - identifying globals and packages ... DONE
  [20:52:30.593] Number of chunks: 2
  [20:52:30.593] Number of futures (= number of chunks): 2
  [20:52:30.597] Launching 2 futures (chunks) ...
  [20:52:30.603] Chunk #1 of 2 ...
  [20:52:30.603]  - Finding globals in 'args_list' chunk #1 ...
  getGlobalsAndPackages() ...
  Searching for globals...
  
  Searching for globals ... DONE
  - globals: [0] <none>
  getGlobalsAndPackages() ... DONE
  [20:52:30.606] 
  [20:52:30.608] 
  [20:52:30.609]  - Finding globals in 'args_list' for chunk #1 ... DONE
  getGlobalsAndPackages() ...
  - globals passed as-is: [3] '...future.x_ii', 'a', 'plan_a'
  Resolving globals: FALSE
  The total size of the 3 globals is 74.15 KiB (75928 bytes)
  - globals: [3] '...future.x_ii', 'a', 'plan_a'
  
  getGlobalsAndPackages() ... DONE
  Packages needed by future strategies (n = 0): <none>
  Packages needed by the future expression (n = 2): 'doFuture', 'utils'
  {
      {
          ...future.startTime <- Sys.time()
          ...future.oldOptions <- options(future.startup.loadScript = FALSE, 
              future.globals.onMissing = "ignore", future.globals.maxSize = NULL, 
              future.globals.method = NULL, future.globals.onMissing = "ignore", 
              future.globals.onReference = NULL, future.globals.resolve = NULL, 
              future.resolve.recursive = NULL, width = 80L)
          {
              {
                  {
                    {
                      has_future <- requireNamespace("future", 
                        quietly = TRUE)
                      version <- if (has_future) 
                        packageVersion("future")
                      else NULL
                      if (!has_future || version < "1.8.0") {
                        info <- c(r_version = gsub("R version ", 
                          "", R.version$version.string), platform = sprintf("%s (%s-bit)", 
                          R.version$platform, 8 * .Machine$sizeof.pointer), 
                          os = paste(Sys.info()[c("sysname", "release", 
                            "version")], collapse = " "), hostname = Sys.info()[["nodename"]])
                        info <- sprintf("%s: %s", names(info), 
                          info)
                        info <- paste(info, collapse = "; ")
                        if (!has_future) {
                          msg <- sprintf("Package 'future' is not installed on worker (%s)", 
                            info)
                        }
                        else {
                          msg <- sprintf("Package 'future' on worker (%s) must be of version >= 1.8.0: %s", 
                            info, version)
                        }
                        stop(msg)
                      }
                    }
                    ...future.mc.cores.old <- getOption("mc.cores")
                    options(mc.cores = 1L)
                  }
                  local({
                    for (pkg in c("doFuture", "utils")) {
                      loadNamespace(pkg)
                      library(pkg, character.only = TRUE)
                    }
                  })
              }
              future::plan("default", .cleanup = FALSE, .init = FALSE)
          }
      }
      if (is.na(TRUE)) {
      }
      else {
          if (TRUE) {
              ...future.stdout <- rawConnection(raw(0L), open = "w")
          }
          else {
              ...future.stdout <- file(switch(.Platform$OS.type, 
                  windows = "NUL", "/dev/null"), open = "w")
          }
          sink(...future.stdout, type = "output", split = FALSE)
          on.exit(if (!is.null(...future.stdout)) {
              sink(type = "output", split = FALSE)
              close(...future.stdout)
          }, add = TRUE)
      }
      ...future.frame <- sys.nframe()
      ...future.conditions <- list()
      ...future.result <- tryCatch({
          withCallingHandlers({
              ...future.value <- local({
                  doFuture::registerDoFuture()
                  lapply(seq_along(...future.x_ii), FUN = function(jj) {
                    ...future.x_jj <- ...future.x_ii[[jj]]
                    b <- NULL
                    ...future.env <- environment()
                    local({
                      for (name in names(...future.x_jj)) {
                        assign(name, ...future.x_jj[[name]], envir = ...future.env, 
                          inherits = FALSE)
                      }
                    })
                    tryCatch({
                      plan_list <- future::plan()
                      message(capture.output(print(plan_list)))
                      stopifnot(inherits(plan_list, "future"), 
                        inherits(plan_list, getOption("future.default", 
                          "sequential")))
                      plan_b <- future::plan("list")
                      str(plan_b)
                      stopifnot(inherits(plan_b[[1]], "future"), 
                        inherits(plan_b[[1]], getOption("future.default", 
                          "sequential")))
                      list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
                    }, error = identity)
                  })
              })
              future::FutureResult(value = ...future.value, started = ...future.startTime, 
                  version = "1.8")
          }, condition = local({
              inherits <- base::inherits
              invokeRestart <- base::invokeRestart
              length <- base::length
              seq.int <- base::seq.int
              sys.calls <- base::sys.calls
              `[[` <- base::`[[`
              `+` <- base::`+`
              `<<-` <- base::`<<-`
              sysCalls <- function(calls = sys.calls(), from = 1L) {
                  calls[seq.int(from = from + 12L, to = length(calls) - 
                    3L)]
              }
              function(cond) {
                  if (inherits(cond, "error")) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond, calls = c(sysCalls(from = ...future.frame), 
                      cond$call), timestamp = base::Sys.time())
                    signalCondition(cond)
                  }
                  else if (inherits(cond, c("message", "warning"
                  ))) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond)
                    if (inherits(cond, "message")) {
                      invokeRestart("muffleMessage")
                    }
                    else if (inherits(cond, "warning")) {
                      invokeRestart("muffleWarning")
                    }
                  }
              }
          }))
      }, error = function(ex) {
          structure(list(value = NULL, conditions = ...future.conditions, 
              condition = ex, calls = sys.calls(), version = "1.8"), 
              class = "FutureResult")
      }, finally = {
          {
              {
                  options(mc.cores = ...future.mc.cores.old)
              }
              future::plan(list(b = function (expr, envir = parent.frame(), 
                  substitute = TRUE, lazy = FALSE, seed = NULL, 
                  globals = TRUE, workers = availableCores(constraints = "multicore"), 
                  earlySignal = FALSE, label = NULL, ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  if (is.function(workers)) 
                    workers <- workers()
                  workers <- as.integer(workers)
                  stop_if_not(is.finite(workers), workers >= 1L)
                  if (workers == 1L || !supportsMulticore()) {
                    return(sequential(expr, envir = envir, substitute = FALSE, 
                      lazy = lazy, seed = seed, globals = globals, 
                      local = TRUE, label = label, ...))
                  }
                  oopts <- options(mc.cores = workers)
                  on.exit(options(oopts))
                  future <- MulticoreFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, workers = workers, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }), .cleanup = FALSE, .init = FALSE)
          }
          options(...future.oldOptions)
      })
      if (is.na(TRUE)) {
      }
      else {
          sink(type = "output", split = FALSE)
          if (TRUE) {
              ...future.result$stdout <- rawToChar(rawConnectionValue(...future.stdout))
          }
          else {
              ...future.result["stdout"] <- list(NULL)
          }
          close(...future.stdout)
          ...future.stdout <- NULL
      }
      ...future.result$conditions <- ...future.conditions
      ...future.result
  }
  requestCore(): workers = 2
  MulticoreFuture started
  [20:52:30.631] Chunk #1 of 2 ... DONE
  [20:52:30.632] Chunk #2 of 2 ...
  [20:52:30.632]  - Finding globals in 'args_list' chunk #2 ...
  getGlobalsAndPackages() ...
  Searching for globals...
  
  Searching for globals ... DONE
  - globals: [0] <none>
  getGlobalsAndPackages() ... DONE
  [20:52:30.636] 
  [20:52:30.637] 
  [20:52:30.637]  - Finding globals in 'args_list' for chunk #2 ... DONE
  getGlobalsAndPackages() ...
  - globals passed as-is: [3] '...future.x_ii', 'a', 'plan_a'
  Resolving globals: FALSE
  The total size of the 3 globals is 74.20 KiB (75984 bytes)
  - globals: [3] '...future.x_ii', 'a', 'plan_a'
  
  getGlobalsAndPackages() ... DONE
  Packages needed by future strategies (n = 0): <none>
  Packages needed by the future expression (n = 2): 'doFuture', 'utils'
  {
      {
          ...future.startTime <- Sys.time()
          ...future.oldOptions <- options(future.startup.loadScript = FALSE, 
              future.globals.onMissing = "ignore", future.globals.maxSize = NULL, 
              future.globals.method = NULL, future.globals.onMissing = "ignore", 
              future.globals.onReference = NULL, future.globals.resolve = NULL, 
              future.resolve.recursive = NULL, width = 80L)
          {
              {
                  {
                    {
                      has_future <- requireNamespace("future", 
                        quietly = TRUE)
                      version <- if (has_future) 
                        packageVersion("future")
                      else NULL
                      if (!has_future || version < "1.8.0") {
                        info <- c(r_version = gsub("R version ", 
                          "", R.version$version.string), platform = sprintf("%s (%s-bit)", 
                          R.version$platform, 8 * .Machine$sizeof.pointer), 
                          os = paste(Sys.info()[c("sysname", "release", 
                            "version")], collapse = " "), hostname = Sys.info()[["nodename"]])
                        info <- sprintf("%s: %s", names(info), 
                          info)
                        info <- paste(info, collapse = "; ")
                        if (!has_future) {
                          msg <- sprintf("Package 'future' is not installed on worker (%s)", 
                            info)
                        }
                        else {
                          msg <- sprintf("Package 'future' on worker (%s) must be of version >= 1.8.0: %s", 
                            info, version)
                        }
                        stop(msg)
                      }
                    }
                    ...future.mc.cores.old <- getOption("mc.cores")
                    options(mc.cores = 1L)
                  }
                  local({
                    for (pkg in c("doFuture", "utils")) {
                      loadNamespace(pkg)
                      library(pkg, character.only = TRUE)
                    }
                  })
              }
              future::plan("default", .cleanup = FALSE, .init = FALSE)
          }
      }
      if (is.na(TRUE)) {
      }
      else {
          if (TRUE) {
              ...future.stdout <- rawConnection(raw(0L), open = "w")
          }
          else {
              ...future.stdout <- file(switch(.Platform$OS.type, 
                  windows = "NUL", "/dev/null"), open = "w")
          }
          sink(...future.stdout, type = "output", split = FALSE)
          on.exit(if (!is.null(...future.stdout)) {
              sink(type = "output", split = FALSE)
              close(...future.stdout)
          }, add = TRUE)
      }
      ...future.frame <- sys.nframe()
      ...future.conditions <- list()
      ...future.result <- tryCatch({
          withCallingHandlers({
              ...future.value <- local({
                  doFuture::registerDoFuture()
                  lapply(seq_along(...future.x_ii), FUN = function(jj) {
                    ...future.x_jj <- ...future.x_ii[[jj]]
                    b <- NULL
                    ...future.env <- environment()
                    local({
                      for (name in names(...future.x_jj)) {
                        assign(name, ...future.x_jj[[name]], envir = ...future.env, 
                          inherits = FALSE)
                      }
                    })
                    tryCatch({
                      plan_list <- future::plan()
                      message(capture.output(print(plan_list)))
                      stopifnot(inherits(plan_list, "future"), 
                        inherits(plan_list, getOption("future.default", 
                          "sequential")))
                      plan_b <- future::plan("list")
                      str(plan_b)
                      stopifnot(inherits(plan_b[[1]], "future"), 
                        inherits(plan_b[[1]], getOption("future.default", 
                          "sequential")))
                      list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
                    }, error = identity)
                  })
              })
              future::FutureResult(value = ...future.value, started = ...future.startTime, 
                  version = "1.8")
          }, condition = local({
              inherits <- base::inherits
              invokeRestart <- base::invokeRestart
              length <- base::length
              seq.int <- base::seq.int
              sys.calls <- base::sys.calls
              `[[` <- base::`[[`
              `+` <- base::`+`
              `<<-` <- base::`<<-`
              sysCalls <- function(calls = sys.calls(), from = 1L) {
                  calls[seq.int(from = from + 12L, to = length(calls) - 
                    3L)]
              }
              function(cond) {
                  if (inherits(cond, "error")) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond, calls = c(sysCalls(from = ...future.frame), 
                      cond$call), timestamp = base::Sys.time())
                    signalCondition(cond)
                  }
                  else if (inherits(cond, c("message", "warning"
                  ))) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond)
                    if (inherits(cond, "message")) {
                      invokeRestart("muffleMessage")
                    }
                    else if (inherits(cond, "warning")) {
                      invokeRestart("muffleWarning")
                    }
                  }
              }
          }))
      }, error = function(ex) {
          structure(list(value = NULL, conditions = ...future.conditions, 
              condition = ex, calls = sys.calls(), version = "1.8"), 
              class = "FutureResult")
      }, finally = {
          {
              {
                  options(mc.cores = ...future.mc.cores.old)
              }
              future::plan(list(b = function (expr, envir = parent.frame(), 
                  substitute = TRUE, lazy = FALSE, seed = NULL, 
                  globals = TRUE, workers = availableCores(constraints = "multicore"), 
                  earlySignal = FALSE, label = NULL, ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  if (is.function(workers)) 
                    workers <- workers()
                  workers <- as.integer(workers)
                  stop_if_not(is.finite(workers), workers >= 1L)
                  if (workers == 1L || !supportsMulticore()) {
                    return(sequential(expr, envir = envir, substitute = FALSE, 
                      lazy = lazy, seed = seed, globals = globals, 
                      local = TRUE, label = label, ...))
                  }
                  oopts <- options(mc.cores = workers)
                  on.exit(options(oopts))
                  future <- MulticoreFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, workers = workers, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }), .cleanup = FALSE, .init = FALSE)
          }
          options(...future.oldOptions)
      })
      if (is.na(TRUE)) {
      }
      else {
          sink(type = "output", split = FALSE)
          if (TRUE) {
              ...future.result$stdout <- rawToChar(rawConnectionValue(...future.stdout))
          }
          else {
              ...future.result["stdout"] <- list(NULL)
          }
          close(...future.stdout)
          ...future.stdout <- NULL
      }
      ...future.result$conditions <- ...future.conditions
      ...future.result
  }
  requestCore(): workers = 2
  MulticoreFuture started
  [20:52:30.671] Chunk #2 of 2 ... DONE
  [20:52:30.671] Launching 2 futures (chunks) ... DONE
  [20:52:30.672] - resolving futures
  resolve() on list ...
   recursive: 0
   length: 2
  
   length: 1 (resolved future 1)
   length: 0 (resolved future 2)
  resolve() on list ... DONE
  [20:52:30.738] - relaying conditions of futures
  Future state: 'finished'
  sequential:- args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)- tweaked: FALSE- call: NULL
  Future state: 'finished'
  sequential:- args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)- tweaked: FALSE- call: NULL
  sequential:- args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)- tweaked: FALSE- call: NULL
  [20:52:30.746] - collecting values of futures
  [20:52:30.747] - accumulating results
  [20:52:30.748] - processing errors (handler = 'stop')
  [20:52:30.749] - extracting results
  [20:52:30.749] doFuture() ... DONE
  foreach() - level 2 ... DONE
  foreach() - level 2 ...
  [20:52:30.755] doFuture() ...
  [20:52:30.756] - dummy globals (as locals): [1] 'b'
  [20:52:30.772] - R expression:
  [20:52:30.773] {
  [20:52:30.773]     doFuture::registerDoFuture()
  [20:52:30.773]     lapply(seq_along(...future.x_ii), FUN = function(jj) {
  [20:52:30.773]         ...future.x_jj <- ...future.x_ii[[jj]]
  [20:52:30.773]         b <- NULL
  [20:52:30.773]         ...future.env <- environment()
  [20:52:30.773]         local({
  [20:52:30.773]             for (name in names(...future.x_jj)) {
  [20:52:30.773]                 assign(name, ...future.x_jj[[name]], envir = ...future.env, 
  [20:52:30.773]                   inherits = FALSE)
  [20:52:30.773]             }
  [20:52:30.773]         })
  [20:52:30.773]         tryCatch({
  [20:52:30.773]             plan_list <- future::plan()
  [20:52:30.773]             message(capture.output(print(plan_list)))
  [20:52:30.773]             stopifnot(inherits(plan_list, "future"), inherits(plan_list, 
  [20:52:30.773]                 getOption("future.default", "sequential")))
  [20:52:30.773]             plan_b <- future::plan("list")
  [20:52:30.773]             str(plan_b)
  [20:52:30.773]             stopifnot(inherits(plan_b[[1]], "future"), inherits(plan_b[[1]], 
  [20:52:30.773]                 getOption("future.default", "sequential")))
  [20:52:30.773]             list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
  [20:52:30.773]         }, error = identity)
  [20:52:30.773]     })
  [20:52:30.773] }
  [20:52:30.774] - identifying globals and packages ...
  getGlobalsAndPackages() ...
  Searching for globals...
  - globals found: [24] '{', '::', 'lapply', 'seq_along', '...future.x_ii', '<-', '[[', 'environment', 'local', 'for', 'names', 'assign', 'tryCatch', 'message', 'capture.output', 'print', 'stopifnot', 'inherits', 'getOption', 'str', 'list', 'a', 'plan_a', 'identity'
  Searching for globals ... DONE
  Resolving globals: FALSE
  The total size of the 3 globals is 74.09 KiB (75872 bytes)
  - globals: [3] '...future.x_ii', 'a', 'plan_a'
  - packages: [1] 'utils'
  getGlobalsAndPackages() ... DONE
  [20:52:30.843] List of 3
  [20:52:30.843]  $ ...future.x_ii: NULL
  [20:52:30.843]  $ a             : int 2
  [20:52:30.843]  $ plan_a        :List of 1
  [20:52:30.843]   ..$ b:function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
  [20:52:30.843]     seed = NULL, globals = TRUE, workers = availableCores(constraints = "multicore"), 
  [20:52:30.843]     earlySignal = FALSE, label = NULL, ...)  
  [20:52:30.843]   .. ..- attr(*, "class")= chr [1:4] "multicore" "multiprocess" "future" "function"
  [20:52:30.843]   .. ..- attr(*, "call")= language plan(list(a = strategy1, b = strategy2))
  [20:52:30.843]   ..- attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  [20:52:30.843]  - attr(*, "where")=List of 3
  [20:52:30.843]   ..$ ...future.x_ii:<environment: 0x55a47e855cd8> 
  [20:52:30.843]   ..$ a             :<environment: 0x55a47fbaae18> 
  [20:52:30.843]   ..$ plan_a        :<environment: 0x55a47fbaae18> 
  [20:52:30.843]  - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list"
  [20:52:30.843]  - attr(*, "resolved")= logi FALSE
  [20:52:30.843]  - attr(*, "total_size")= num 75872
  [20:52:30.867]   - R expression:
  [20:52:30.878] {
  [20:52:30.878]     doFuture::registerDoFuture()
  [20:52:30.878]     lapply(seq_along(...future.x_ii), FUN = function(jj) {
  [20:52:30.878]         ...future.x_jj <- ...future.x_ii[[jj]]
  [20:52:30.878]         b <- NULL
  [20:52:30.878]         ...future.env <- environment()
  [20:52:30.878]         local({
  [20:52:30.878]             for (name in names(...future.x_jj)) {
  [20:52:30.878]                 assign(name, ...future.x_jj[[name]], envir = ...future.env, 
  [20:52:30.878]                   inherits = FALSE)
  [20:52:30.878]             }
  [20:52:30.878]         })
  [20:52:30.878]         tryCatch({
  [20:52:30.878]             plan_list <- future::plan()
  [20:52:30.878]             message(capture.output(print(plan_list)))
  [20:52:30.878]             stopifnot(inherits(plan_list, "future"), inherits(plan_list, 
  [20:52:30.878]                 getOption("future.default", "sequential")))
  [20:52:30.878]             plan_b <- future::plan("list")
  [20:52:30.878]             str(plan_b)
  [20:52:30.878]             stopifnot(inherits(plan_b[[1]], "future"), inherits(plan_b[[1]], 
  [20:52:30.878]                 getOption("future.default", "sequential")))
  [20:52:30.878]             list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
  [20:52:30.878]         }, error = identity)
  [20:52:30.878]     })
  [20:52:30.878] }
  [20:52:30.879]   - globals: [3] '...future.x_ii', 'a', 'plan_a'
  [20:52:30.879] List of 3
  [20:52:30.879]  $ ...future.x_ii: NULL
  [20:52:30.879]  $ a             : int 2
  [20:52:30.879]  $ plan_a        :List of 1
  [20:52:30.879]   ..$ b:function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
  [20:52:30.879]     seed = NULL, globals = TRUE, workers = availableCores(constraints = "multicore"), 
  [20:52:30.879]     earlySignal = FALSE, label = NULL, ...)  
  [20:52:30.879]   .. ..- attr(*, "class")= chr [1:4] "multicore" "multiprocess" "future" "function"
  [20:52:30.879]   .. ..- attr(*, "call")= language plan(list(a = strategy1, b = strategy2))
  [20:52:30.879]   ..- attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  [20:52:30.879]  - attr(*, "where")=List of 3
  [20:52:30.879]   ..$ ...future.x_ii:<environment: 0x55a47e855cd8> 
  [20:52:30.879]   ..$ a             :<environment: 0x55a47fbaae18> 
  [20:52:30.879]   ..$ plan_a        :<environment: 0x55a47fbaae18> 
  [20:52:30.879]  - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list"
  [20:52:30.879]  - attr(*, "resolved")= logi FALSE
  [20:52:30.879]  - attr(*, "total_size")= num 75872
  [20:52:30.905]   - packages: [2] 'doFuture', 'utils'
  [20:52:30.906] - identifying globals and packages ... DONE
  [20:52:30.907] Number of chunks: 2
  [20:52:30.907] Number of futures (= number of chunks): 2
  [20:52:30.918] Launching 2 futures (chunks) ...
  [20:52:30.918] Chunk #1 of 2 ...
  [20:52:30.919]  - Finding globals in 'args_list' chunk #1 ...
  getGlobalsAndPackages() ...
  Searching for globals...
  
  Searching for globals ... DONE
  - globals: [0] <none>
  getGlobalsAndPackages() ... DONE
  [20:52:30.921] 
  [20:52:30.922] 
  [20:52:30.922]  - Finding globals in 'args_list' for chunk #1 ... DONE
  getGlobalsAndPackages() ...
  - globals passed as-is: [3] '...future.x_ii', 'a', 'plan_a'
  Resolving globals: FALSE
  The total size of the 3 globals is 74.15 KiB (75928 bytes)
  - globals: [3] '...future.x_ii', 'a', 'plan_a'
  
  getGlobalsAndPackages() ... DONE
  Packages needed by future strategies (n = 0): <none>
  Packages needed by the future expression (n = 2): 'doFuture', 'utils'
  {
      {
          ...future.startTime <- Sys.time()
          ...future.oldOptions <- options(future.startup.loadScript = FALSE, 
              future.globals.onMissing = "ignore", future.globals.maxSize = NULL, 
              future.globals.method = NULL, future.globals.onMissing = "ignore", 
              future.globals.onReference = NULL, future.globals.resolve = NULL, 
              future.resolve.recursive = NULL, width = 80L)
          {
              {
                  {
                    {
                      has_future <- requireNamespace("future", 
                        quietly = TRUE)
                      version <- if (has_future) 
                        packageVersion("future")
                      else NULL
                      if (!has_future || version < "1.8.0") {
                        info <- c(r_version = gsub("R version ", 
                          "", R.version$version.string), platform = sprintf("%s (%s-bit)", 
                          R.version$platform, 8 * .Machine$sizeof.pointer), 
                          os = paste(Sys.info()[c("sysname", "release", 
                            "version")], collapse = " "), hostname = Sys.info()[["nodename"]])
                        info <- sprintf("%s: %s", names(info), 
                          info)
                        info <- paste(info, collapse = "; ")
                        if (!has_future) {
                          msg <- sprintf("Package 'future' is not installed on worker (%s)", 
                            info)
                        }
                        else {
                          msg <- sprintf("Package 'future' on worker (%s) must be of version >= 1.8.0: %s", 
                            info, version)
                        }
                        stop(msg)
                      }
                    }
                    ...future.mc.cores.old <- getOption("mc.cores")
                    options(mc.cores = 1L)
                  }
                  local({
                    for (pkg in c("doFuture", "utils")) {
                      loadNamespace(pkg)
                      library(pkg, character.only = TRUE)
                    }
                  })
              }
              future::plan("default", .cleanup = FALSE, .init = FALSE)
          }
      }
      if (is.na(TRUE)) {
      }
      else {
          if (TRUE) {
              ...future.stdout <- rawConnection(raw(0L), open = "w")
          }
          else {
              ...future.stdout <- file(switch(.Platform$OS.type, 
                  windows = "NUL", "/dev/null"), open = "w")
          }
          sink(...future.stdout, type = "output", split = FALSE)
          on.exit(if (!is.null(...future.stdout)) {
              sink(type = "output", split = FALSE)
              close(...future.stdout)
          }, add = TRUE)
      }
      ...future.frame <- sys.nframe()
      ...future.conditions <- list()
      ...future.result <- tryCatch({
          withCallingHandlers({
              ...future.value <- local({
                  doFuture::registerDoFuture()
                  lapply(seq_along(...future.x_ii), FUN = function(jj) {
                    ...future.x_jj <- ...future.x_ii[[jj]]
                    b <- NULL
                    ...future.env <- environment()
                    local({
                      for (name in names(...future.x_jj)) {
                        assign(name, ...future.x_jj[[name]], envir = ...future.env, 
                          inherits = FALSE)
                      }
                    })
                    tryCatch({
                      plan_list <- future::plan()
                      message(capture.output(print(plan_list)))
                      stopifnot(inherits(plan_list, "future"), 
                        inherits(plan_list, getOption("future.default", 
                          "sequential")))
                      plan_b <- future::plan("list")
                      str(plan_b)
                      stopifnot(inherits(plan_b[[1]], "future"), 
                        inherits(plan_b[[1]], getOption("future.default", 
                          "sequential")))
                      list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
                    }, error = identity)
                  })
              })
              future::FutureResult(value = ...future.value, started = ...future.startTime, 
                  version = "1.8")
          }, condition = local({
              inherits <- base::inherits
              invokeRestart <- base::invokeRestart
              length <- base::length
              seq.int <- base::seq.int
              sys.calls <- base::sys.calls
              `[[` <- base::`[[`
              `+` <- base::`+`
              `<<-` <- base::`<<-`
              sysCalls <- function(calls = sys.calls(), from = 1L) {
                  calls[seq.int(from = from + 12L, to = length(calls) - 
                    3L)]
              }
              function(cond) {
                  if (inherits(cond, "error")) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond, calls = c(sysCalls(from = ...future.frame), 
                      cond$call), timestamp = base::Sys.time())
                    signalCondition(cond)
                  }
                  else if (inherits(cond, c("message", "warning"
                  ))) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond)
                    if (inherits(cond, "message")) {
                      invokeRestart("muffleMessage")
                    }
                    else if (inherits(cond, "warning")) {
                      invokeRestart("muffleWarning")
                    }
                  }
              }
          }))
      }, error = function(ex) {
          structure(list(value = NULL, conditions = ...future.conditions, 
              condition = ex, calls = sys.calls(), version = "1.8"), 
              class = "FutureResult")
      }, finally = {
          {
              {
                  options(mc.cores = ...future.mc.cores.old)
              }
              future::plan(list(b = function (expr, envir = parent.frame(), 
                  substitute = TRUE, lazy = FALSE, seed = NULL, 
                  globals = TRUE, workers = availableCores(constraints = "multicore"), 
                  earlySignal = FALSE, label = NULL, ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  if (is.function(workers)) 
                    workers <- workers()
                  workers <- as.integer(workers)
                  stop_if_not(is.finite(workers), workers >= 1L)
                  if (workers == 1L || !supportsMulticore()) {
                    return(sequential(expr, envir = envir, substitute = FALSE, 
                      lazy = lazy, seed = seed, globals = globals, 
                      local = TRUE, label = label, ...))
                  }
                  oopts <- options(mc.cores = workers)
                  on.exit(options(oopts))
                  future <- MulticoreFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, workers = workers, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }), .cleanup = FALSE, .init = FALSE)
          }
          options(...future.oldOptions)
      })
      if (is.na(TRUE)) {
      }
      else {
          sink(type = "output", split = FALSE)
          if (TRUE) {
              ...future.result$stdout <- rawToChar(rawConnectionValue(...future.stdout))
          }
          else {
              ...future.result["stdout"] <- list(NULL)
          }
          close(...future.stdout)
          ...future.stdout <- NULL
      }
      ...future.result$conditions <- ...future.conditions
      ...future.result
  }
  requestCore(): workers = 2
  MulticoreFuture started
  [20:52:30.961] Chunk #1 of 2 ... DONE
  [20:52:30.961] Chunk #2 of 2 ...
  [20:52:30.962]  - Finding globals in 'args_list' chunk #2 ...
  getGlobalsAndPackages() ...
  Searching for globals...
  
  Searching for globals ... DONE
  - globals: [0] <none>
  getGlobalsAndPackages() ... DONE
  [20:52:30.966] 
  [20:52:30.966] 
  [20:52:30.967]  - Finding globals in 'args_list' for chunk #2 ... DONE
  getGlobalsAndPackages() ...
  - globals passed as-is: [3] '...future.x_ii', 'a', 'plan_a'
  Resolving globals: FALSE
  The total size of the 3 globals is 74.20 KiB (75984 bytes)
  - globals: [3] '...future.x_ii', 'a', 'plan_a'
  
  getGlobalsAndPackages() ... DONE
  Packages needed by future strategies (n = 0): <none>
  Packages needed by the future expression (n = 2): 'doFuture', 'utils'
  {
      {
          ...future.startTime <- Sys.time()
          ...future.oldOptions <- options(future.startup.loadScript = FALSE, 
              future.globals.onMissing = "ignore", future.globals.maxSize = NULL, 
              future.globals.method = NULL, future.globals.onMissing = "ignore", 
              future.globals.onReference = NULL, future.globals.resolve = NULL, 
              future.resolve.recursive = NULL, width = 80L)
          {
              {
                  {
                    {
                      has_future <- requireNamespace("future", 
                        quietly = TRUE)
                      version <- if (has_future) 
                        packageVersion("future")
                      else NULL
                      if (!has_future || version < "1.8.0") {
                        info <- c(r_version = gsub("R version ", 
                          "", R.version$version.string), platform = sprintf("%s (%s-bit)", 
                          R.version$platform, 8 * .Machine$sizeof.pointer), 
                          os = paste(Sys.info()[c("sysname", "release", 
                            "version")], collapse = " "), hostname = Sys.info()[["nodename"]])
                        info <- sprintf("%s: %s", names(info), 
                          info)
                        info <- paste(info, collapse = "; ")
                        if (!has_future) {
                          msg <- sprintf("Package 'future' is not installed on worker (%s)", 
                            info)
                        }
                        else {
                          msg <- sprintf("Package 'future' on worker (%s) must be of version >= 1.8.0: %s", 
                            info, version)
                        }
                        stop(msg)
                      }
                    }
                    ...future.mc.cores.old <- getOption("mc.cores")
                    options(mc.cores = 1L)
                  }
                  local({
                    for (pkg in c("doFuture", "utils")) {
                      loadNamespace(pkg)
                      library(pkg, character.only = TRUE)
                    }
                  })
              }
              future::plan("default", .cleanup = FALSE, .init = FALSE)
          }
      }
      if (is.na(TRUE)) {
      }
      else {
          if (TRUE) {
              ...future.stdout <- rawConnection(raw(0L), open = "w")
          }
          else {
              ...future.stdout <- file(switch(.Platform$OS.type, 
                  windows = "NUL", "/dev/null"), open = "w")
          }
          sink(...future.stdout, type = "output", split = FALSE)
          on.exit(if (!is.null(...future.stdout)) {
              sink(type = "output", split = FALSE)
              close(...future.stdout)
          }, add = TRUE)
      }
      ...future.frame <- sys.nframe()
      ...future.conditions <- list()
      ...future.result <- tryCatch({
          withCallingHandlers({
              ...future.value <- local({
                  doFuture::registerDoFuture()
                  lapply(seq_along(...future.x_ii), FUN = function(jj) {
                    ...future.x_jj <- ...future.x_ii[[jj]]
                    b <- NULL
                    ...future.env <- environment()
                    local({
                      for (name in names(...future.x_jj)) {
                        assign(name, ...future.x_jj[[name]], envir = ...future.env, 
                          inherits = FALSE)
                      }
                    })
                    tryCatch({
                      plan_list <- future::plan()
                      message(capture.output(print(plan_list)))
                      stopifnot(inherits(plan_list, "future"), 
                        inherits(plan_list, getOption("future.default", 
                          "sequential")))
                      plan_b <- future::plan("list")
                      str(plan_b)
                      stopifnot(inherits(plan_b[[1]], "future"), 
                        inherits(plan_b[[1]], getOption("future.default", 
                          "sequential")))
                      list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
                    }, error = identity)
                  })
              })
              future::FutureResult(value = ...future.value, started = ...future.startTime, 
                  version = "1.8")
          }, condition = local({
              inherits <- base::inherits
              invokeRestart <- base::invokeRestart
              length <- base::length
              seq.int <- base::seq.int
              sys.calls <- base::sys.calls
              `[[` <- base::`[[`
              `+` <- base::`+`
              `<<-` <- base::`<<-`
              sysCalls <- function(calls = sys.calls(), from = 1L) {
                  calls[seq.int(from = from + 12L, to = length(calls) - 
                    3L)]
              }
              function(cond) {
                  if (inherits(cond, "error")) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond, calls = c(sysCalls(from = ...future.frame), 
                      cond$call), timestamp = base::Sys.time())
                    signalCondition(cond)
                  }
                  else if (inherits(cond, c("message", "warning"
                  ))) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond)
                    if (inherits(cond, "message")) {
                      invokeRestart("muffleMessage")
                    }
                    else if (inherits(cond, "warning")) {
                      invokeRestart("muffleWarning")
                    }
                  }
              }
          }))
      }, error = function(ex) {
          structure(list(value = NULL, conditions = ...future.conditions, 
              condition = ex, calls = sys.calls(), version = "1.8"), 
              class = "FutureResult")
      }, finally = {
          {
              {
                  options(mc.cores = ...future.mc.cores.old)
              }
              future::plan(list(b = function (expr, envir = parent.frame(), 
                  substitute = TRUE, lazy = FALSE, seed = NULL, 
                  globals = TRUE, workers = availableCores(constraints = "multicore"), 
                  earlySignal = FALSE, label = NULL, ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  if (is.function(workers)) 
                    workers <- workers()
                  workers <- as.integer(workers)
                  stop_if_not(is.finite(workers), workers >= 1L)
                  if (workers == 1L || !supportsMulticore()) {
                    return(sequential(expr, envir = envir, substitute = FALSE, 
                      lazy = lazy, seed = seed, globals = globals, 
                      local = TRUE, label = label, ...))
                  }
                  oopts <- options(mc.cores = workers)
                  on.exit(options(oopts))
                  future <- MulticoreFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, workers = workers, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }), .cleanup = FALSE, .init = FALSE)
          }
          options(...future.oldOptions)
      })
      if (is.na(TRUE)) {
      }
      else {
          sink(type = "output", split = FALSE)
          if (TRUE) {
              ...future.result$stdout <- rawToChar(rawConnectionValue(...future.stdout))
          }
          else {
              ...future.result["stdout"] <- list(NULL)
          }
          close(...future.stdout)
          ...future.stdout <- NULL
      }
      ...future.result$conditions <- ...future.conditions
      ...future.result
  }
  requestCore(): workers = 2
  MulticoreFuture started
  [20:52:31.021] Chunk #2 of 2 ... DONE
  [20:52:31.022] Launching 2 futures (chunks) ... DONE
  [20:52:31.022] - resolving futures
  resolve() on list ...
   recursive: 0
   length: 2
  
   length: 1 (resolved future 1)
   length: 0 (resolved future 2)
  resolve() on list ... DONE
  [20:52:31.076] - relaying conditions of futures
  Future state: 'finished'
  sequential:- args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)- tweaked: FALSE- call: NULL
  Future state: 'finished'
  sequential:- args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)- tweaked: FALSE- call: NULL
  sequential:- args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)- tweaked: FALSE- call: NULL
  [20:52:31.082] - collecting values of futures
  [20:52:31.083] - accumulating results
  [20:52:31.084] - processing errors (handler = 'stop')
  [20:52:31.085] - extracting results
  [20:52:31.085] doFuture() ... DONE
  foreach() - level 2 ... DONE
  [20:52:31.147] - collecting values of futures
  [20:52:31.147] - accumulating results
  [20:52:31.148] - processing errors (handler = 'stop')
  [20:52:31.149] - extracting results
  [20:52:31.149] doFuture() ... DONE
  foreach() - level 1 ... DONE
  - plan(list('sequential', 'multicore')) ... DONE
  - plan(list('sequential', 'multisession')) ...
  plan(): Setting new future strategy stack:
  List of future strategies:
  1. sequential:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: plan(list(a = strategy1, b = strategy2))
  2. multisession:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, persistent = FALSE, workers = availableCores(), gc = FALSE, earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: plan(list(a = strategy1, b = strategy2))
  
  plan(): nbrOfWorkers() = 1
  foreach() - level 1 ...
  [20:52:31.153] doFuture() ...
  [20:52:31.155] - dummy globals (as locals): [1] 'a'
  [20:52:31.156] - R expression:
  [20:52:31.156] {
  [20:52:31.156]     doFuture::registerDoFuture()
  [20:52:31.156]     lapply(seq_along(...future.x_ii), FUN = function(jj) {
  [20:52:31.156]         ...future.x_jj <- ...future.x_ii[[jj]]
  [20:52:31.156]         a <- NULL
  [20:52:31.156]         ...future.env <- environment()
  [20:52:31.156]         local({
  [20:52:31.156]             for (name in names(...future.x_jj)) {
  [20:52:31.156]                 assign(name, ...future.x_jj[[name]], envir = ...future.env, 
  [20:52:31.156]                   inherits = FALSE)
  [20:52:31.156]             }
  [20:52:31.156]         })
  [20:52:31.156]         tryCatch({
  [20:52:31.156]             plan_list <- future::plan()
  [20:52:31.156]             stopifnot(inherits(plan_list, strategy2))
  [20:52:31.156]             plan_a <- future::plan("list")
  [20:52:31.156]             str(plan_a)
  [20:52:31.156]             stopifnot(inherits(plan_a[[1]], strategy2))
  [20:52:31.156]             message("foreach() - level 2 ...")
  [20:52:31.156]             y <- foreach(b = bs, .export = c("a", "plan_a")) %dopar% 
  [20:52:31.156]                 {
  [20:52:31.156]                   plan_list <- future::plan()
  [20:52:31.156]                   message(capture.output(print(plan_list)))
  [20:52:31.156]                   stopifnot(inherits(plan_list, "future"), inherits(plan_list, 
  [20:52:31.156]                     getOption("future.default", "sequential")))
  [20:52:31.156]                   plan_b <- future::plan("list")
  [20:52:31.156]                   str(plan_b)
  [20:52:31.156]                   stopifnot(inherits(plan_b[[1]], "future"), 
  [20:52:31.156]                     inherits(plan_b[[1]], getOption("future.default", 
  [20:52:31.156]                       "sequential")))
  [20:52:31.156]                   list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
  [20:52:31.156]                 }
  [20:52:31.156]             message("foreach() - level 2 ... DONE")
  [20:52:31.156]             y
  [20:52:31.156]         }, error = identity)
  [20:52:31.156]     })
  [20:52:31.156] }
  [20:52:31.157] - identifying globals and packages ...
  getGlobalsAndPackages() ...
  Searching for globals...
  - globals found: [28] '{', '::', 'lapply', 'seq_along', '...future.x_ii', '<-', '[[', 'environment', 'local', 'for', 'names', 'assign', 'tryCatch', 'stopifnot', 'inherits', 'strategy2', 'str', 'message', '%dopar%', 'foreach', 'bs', 'c', 'capture.output', 'print', 'getOption', 'list', 'b', 'identity'
  Searching for globals ... DONE
  Resolving globals: FALSE
  The total size of the 3 globals is 184 bytes (184 bytes)
  - globals: [3] '...future.x_ii', 'strategy2', 'bs'
  - packages: [2] 'utils', 'foreach'
  getGlobalsAndPackages() ... DONE
  [20:52:31.201] List of 3
  [20:52:31.201]  $ ...future.x_ii: NULL
  [20:52:31.201]  $ strategy2     : chr "multisession"
  [20:52:31.201]  $ bs            : int [1:3] 3 2 1
  [20:52:31.201]  - attr(*, "where")=List of 3
  [20:52:31.201]   ..$ ...future.x_ii:<environment: 0x55a47ed348d0> 
  [20:52:31.201]   ..$ strategy2     :<environment: R_GlobalEnv> 
  [20:52:31.201]   ..$ bs            :<environment: R_GlobalEnv> 
  [20:52:31.201]  - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list"
  [20:52:31.201]  - attr(*, "resolved")= logi FALSE
  [20:52:31.201]  - attr(*, "total_size")= num 184
  [20:52:31.211]   - R expression:
  [20:52:31.211] {
  [20:52:31.211]     doFuture::registerDoFuture()
  [20:52:31.211]     lapply(seq_along(...future.x_ii), FUN = function(jj) {
  [20:52:31.211]         ...future.x_jj <- ...future.x_ii[[jj]]
  [20:52:31.211]         a <- NULL
  [20:52:31.211]         ...future.env <- environment()
  [20:52:31.211]         local({
  [20:52:31.211]             for (name in names(...future.x_jj)) {
  [20:52:31.211]                 assign(name, ...future.x_jj[[name]], envir = ...future.env, 
  [20:52:31.211]                   inherits = FALSE)
  [20:52:31.211]             }
  [20:52:31.211]         })
  [20:52:31.211]         tryCatch({
  [20:52:31.211]             plan_list <- future::plan()
  [20:52:31.211]             stopifnot(inherits(plan_list, strategy2))
  [20:52:31.211]             plan_a <- future::plan("list")
  [20:52:31.211]             str(plan_a)
  [20:52:31.211]             stopifnot(inherits(plan_a[[1]], strategy2))
  [20:52:31.211]             message("foreach() - level 2 ...")
  [20:52:31.211]             y <- foreach(b = bs, .export = c("a", "plan_a")) %dopar% 
  [20:52:31.211]                 {
  [20:52:31.211]                   plan_list <- future::plan()
  [20:52:31.211]                   message(capture.output(print(plan_list)))
  [20:52:31.211]                   stopifnot(inherits(plan_list, "future"), inherits(plan_list, 
  [20:52:31.211]                     getOption("future.default", "sequential")))
  [20:52:31.211]                   plan_b <- future::plan("list")
  [20:52:31.211]                   str(plan_b)
  [20:52:31.211]                   stopifnot(inherits(plan_b[[1]], "future"), 
  [20:52:31.211]                     inherits(plan_b[[1]], getOption("future.default", 
  [20:52:31.211]                       "sequential")))
  [20:52:31.211]                   list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
  [20:52:31.211]                 }
  [20:52:31.211]             message("foreach() - level 2 ... DONE")
  [20:52:31.211]             y
  [20:52:31.211]         }, error = identity)
  [20:52:31.211]     })
  [20:52:31.211] }
  [20:52:31.212]   - globals: [3] '...future.x_ii', 'strategy2', 'bs'
  [20:52:31.213] List of 3
  [20:52:31.213]  $ ...future.x_ii: NULL
  [20:52:31.213]  $ strategy2     : chr "multisession"
  [20:52:31.213]  $ bs            : int [1:3] 3 2 1
  [20:52:31.213]  - attr(*, "where")=List of 3
  [20:52:31.213]   ..$ ...future.x_ii:<environment: 0x55a47ed348d0> 
  [20:52:31.213]   ..$ strategy2     :<environment: R_GlobalEnv> 
  [20:52:31.213]   ..$ bs            :<environment: R_GlobalEnv> 
  [20:52:31.213]  - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list"
  [20:52:31.213]  - attr(*, "resolved")= logi FALSE
  [20:52:31.213]  - attr(*, "total_size")= num 184
  [20:52:31.222]   - packages: [3] 'doFuture', 'utils', 'foreach'
  [20:52:31.222] - identifying globals and packages ... DONE
  [20:52:31.223] Number of chunks: 1
  [20:52:31.223] Number of futures (= number of chunks): 1
  [20:52:31.223] Launching 1 futures (chunks) ...
  [20:52:31.224] Chunk #1 of 1 ...
  [20:52:31.224]  - Finding globals in 'args_list' chunk #1 ...
  getGlobalsAndPackages() ...
  Searching for globals...
  
  Searching for globals ... DONE
  - globals: [0] <none>
  getGlobalsAndPackages() ... DONE
  [20:52:31.226] 
  [20:52:31.227] 
  [20:52:31.227]  - Finding globals in 'args_list' for chunk #1 ... DONE
  getGlobalsAndPackages() ...
  - globals passed as-is: [3] '...future.x_ii', 'strategy2', 'bs'
  Resolving globals: FALSE
  The total size of the 3 globals is 296 bytes (296 bytes)
  - globals: [3] '...future.x_ii', 'strategy2', 'bs'
  
  getGlobalsAndPackages() ... DONE
  Packages needed by future strategies (n = 1): 'future'
  Packages needed by the future expression (n = 3): 'doFuture', 'utils', 'foreach'
  {
      {
          ...future.startTime <- Sys.time()
          ...future.oldOptions <- options(future.startup.loadScript = FALSE, 
              future.globals.onMissing = "ignore", future.globals.maxSize = NULL, 
              future.globals.method = NULL, future.globals.onMissing = "ignore", 
              future.globals.onReference = NULL, future.globals.resolve = NULL, 
              future.resolve.recursive = NULL, width = 80L)
          {
              {
                  {
                    has_future <- requireNamespace("future", quietly = TRUE)
                    version <- if (has_future) 
                      packageVersion("future")
                    else NULL
                    if (!has_future || version < "1.8.0") {
                      info <- c(r_version = gsub("R version ", 
                        "", R.version$version.string), platform = sprintf("%s (%s-bit)", 
                        R.version$platform, 8 * .Machine$sizeof.pointer), 
                        os = paste(Sys.info()[c("sysname", "release", 
                          "version")], collapse = " "), hostname = Sys.info()[["nodename"]])
                      info <- sprintf("%s: %s", names(info), info)
                      info <- paste(info, collapse = "; ")
                      if (!has_future) {
                        msg <- sprintf("Package 'future' is not installed on worker (%s)", 
                          info)
                      }
                      else {
                        msg <- sprintf("Package 'future' on worker (%s) must be of version >= 1.8.0: %s", 
                          info, version)
                      }
                      stop(msg)
                    }
                  }
                  local({
                    for (pkg in c("future", "doFuture", "utils", 
                    "foreach")) {
                      loadNamespace(pkg)
                      library(pkg, character.only = TRUE)
                    }
                  })
              }
              future::plan(list(b = function (expr, envir = parent.frame(), 
                  substitute = TRUE, lazy = FALSE, seed = NULL, 
                  globals = TRUE, persistent = FALSE, workers = availableCores(), 
                  gc = FALSE, earlySignal = FALSE, label = NULL, 
                  ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  if (is.function(workers)) 
                    workers <- workers()
                  workers <- as.integer(workers)
                  stop_if_not(length(workers) == 1, is.finite(workers), 
                    workers >= 1)
                  if (workers == 1L) {
                    return(sequential(expr, envir = envir, substitute = FALSE, 
                      lazy = TRUE, seed = seed, globals = globals, 
                      local = TRUE, label = label, ...))
                  }
                  workers <- ClusterRegistry("start", workers = workers)
                  future <- MultisessionFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, persistent = persistent, 
                    workers = workers, gc = gc, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }), .cleanup = FALSE, .init = FALSE)
          }
      }
      if (is.na(TRUE)) {
      }
      else {
          if (TRUE) {
              ...future.stdout <- rawConnection(raw(0L), open = "w")
          }
          else {
              ...future.stdout <- file(switch(.Platform$OS.type, 
                  windows = "NUL", "/dev/null"), open = "w")
          }
          sink(...future.stdout, type = "output", split = FALSE)
          on.exit(if (!is.null(...future.stdout)) {
              sink(type = "output", split = FALSE)
              close(...future.stdout)
          }, add = TRUE)
      }
      ...future.frame <- sys.nframe()
      ...future.conditions <- list()
      ...future.result <- tryCatch({
          withCallingHandlers({
              ...future.value <- local({
                  doFuture::registerDoFuture()
                  lapply(seq_along(...future.x_ii), FUN = function(jj) {
                    ...future.x_jj <- ...future.x_ii[[jj]]
                    a <- NULL
                    ...future.env <- environment()
                    local({
                      for (name in names(...future.x_jj)) {
                        assign(name, ...future.x_jj[[name]], envir = ...future.env, 
                          inherits = FALSE)
                      }
                    })
                    tryCatch({
                      plan_list <- future::plan()
                      stopifnot(inherits(plan_list, strategy2))
                      plan_a <- future::plan("list")
                      str(plan_a)
                      stopifnot(inherits(plan_a[[1]], strategy2))
                      message("foreach() - level 2 ...")
                      y <- foreach(b = bs, .export = c("a", "plan_a")) %dopar% 
                        {
                          plan_list <- future::plan()
                          message(capture.output(print(plan_list)))
                          stopifnot(inherits(plan_list, "future"), 
                            inherits(plan_list, getOption("future.default", 
                              "sequential")))
                          plan_b <- future::plan("list")
                          str(plan_b)
                          stopifnot(inherits(plan_b[[1]], "future"), 
                            inherits(plan_b[[1]], getOption("future.default", 
                              "sequential")))
                          list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
                        }
                      message("foreach() - level 2 ... DONE")
                      y
                    }, error = identity)
                  })
              })
              future::FutureResult(value = ...future.value, started = ...future.startTime, 
                  version = "1.8")
          }, condition = local({
              inherits <- base::inherits
              invokeRestart <- base::invokeRestart
              length <- base::length
              seq.int <- base::seq.int
              sys.calls <- base::sys.calls
              `[[` <- base::`[[`
              `+` <- base::`+`
              `<<-` <- base::`<<-`
              sysCalls <- function(calls = sys.calls(), from = 1L) {
                  calls[seq.int(from = from + 12L, to = length(calls) - 
                    3L)]
              }
              function(cond) {
                  if (inherits(cond, "error")) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond, calls = c(sysCalls(from = ...future.frame), 
                      cond$call), timestamp = base::Sys.time())
                    signalCondition(cond)
                  }
                  else if (inherits(cond, c("message", "warning"
                  ))) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond)
                    if (inherits(cond, "message")) {
                      invokeRestart("muffleMessage")
                    }
                    else if (inherits(cond, "warning")) {
                      invokeRestart("muffleWarning")
                    }
                  }
              }
          }))
      }, error = function(ex) {
          structure(list(value = NULL, conditions = ...future.conditions, 
              condition = ex, calls = sys.calls(), version = "1.8"), 
              class = "FutureResult")
      }, finally = {
          {
              NULL
              future::plan(list(a = function (expr, envir = parent.frame(), 
                  substitute = TRUE, lazy = FALSE, seed = NULL, 
                  globals = TRUE, local = TRUE, earlySignal = FALSE, 
                  label = NULL, ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  local <- as.logical(local)
                  future <- SequentialFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, local = local, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }, b = function (expr, envir = parent.frame(), substitute = TRUE, 
                  lazy = FALSE, seed = NULL, globals = TRUE, persistent = FALSE, 
                  workers = availableCores(), gc = FALSE, earlySignal = FALSE, 
                  label = NULL, ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  if (is.function(workers)) 
                    workers <- workers()
                  workers <- as.integer(workers)
                  stop_if_not(length(workers) == 1, is.finite(workers), 
                    workers >= 1)
                  if (workers == 1L) {
                    return(sequential(expr, envir = envir, substitute = FALSE, 
                      lazy = TRUE, seed = seed, globals = globals, 
                      local = TRUE, label = label, ...))
                  }
                  workers <- ClusterRegistry("start", workers = workers)
                  future <- MultisessionFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, persistent = persistent, 
                    workers = workers, gc = gc, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }), .cleanup = FALSE, .init = FALSE)
          }
          options(...future.oldOptions)
      })
      if (is.na(TRUE)) {
      }
      else {
          sink(type = "output", split = FALSE)
          if (TRUE) {
              ...future.result$stdout <- rawToChar(rawConnectionValue(...future.stdout))
          }
          else {
              ...future.result["stdout"] <- list(NULL)
          }
          close(...future.stdout)
          ...future.stdout <- NULL
      }
      ...future.result$conditions <- ...future.conditions
      ...future.result
  }
  plan(): Setting new future strategy stack:
  List of future strategies:
  1. multisession:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, persistent = FALSE, workers = availableCores(), gc = FALSE, earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: plan(list(a = strategy1, b = strategy2))
  
  plan(): nbrOfWorkers() = 2
  plan(): Setting new future strategy stack:
  List of future strategies:
  1. sequential:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: plan(list(a = strategy1, b = strategy2))
  2. multisession:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, persistent = FALSE, workers = availableCores(), gc = FALSE, earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: plan(list(a = strategy1, b = strategy2))
  
  plan(): nbrOfWorkers() = 1
  SequentialFuture started (and completed)
  [20:52:46.745] Chunk #1 of 1 ... DONE
  [20:52:46.745] Launching 1 futures (chunks) ... DONE
  [20:52:46.746] - resolving futures
  resolve() on list ...
   recursive: 0
   length: 1
  
   length: 0 (resolved future 1)
  resolve() on list ... DONE
  [20:52:46.747] - relaying conditions of futures
  List of 1
   $ b:function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, persistent = FALSE, workers = availableCores(), 
      gc = FALSE, earlySignal = FALSE, label = NULL, ...)  
    ..- attr(*, "class")= chr [1:5] "multisession" "cluster" "multiprocess" "future" ...
    ..- attr(*, "init")= logi TRUE
    ..- attr(*, "call")= language plan(list(a = strategy1, b = strategy2))
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  List of 1
   $ :function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
      ...)  
    ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  List of 1
   $ :function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
      ...)  
    ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  List of 1
   $ :function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
      ...)  
    ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  List of 1
   $ b:function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, persistent = FALSE, workers = availableCores(), 
      gc = FALSE, earlySignal = FALSE, label = NULL, ...)  
    ..- attr(*, "class")= chr [1:5] "multisession" "cluster" "multiprocess" "future" ...
    ..- attr(*, "init")= logi TRUE
    ..- attr(*, "call")= language plan(list(a = strategy1, b = strategy2))
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  List of 1
   $ :function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
      ...)  
    ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  List of 1
   $ :function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
      ...)  
    ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  List of 1
   $ :function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
      ...)  
    ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  Future state: 'finished'
  foreach() - level 2 ...
  [20:52:31.303] doFuture() ...
  [20:52:31.304] - dummy globals (as locals): [1] 'b'
  [20:52:31.306] - R expression:
  [20:52:31.306] {
  [20:52:31.306]     doFuture::registerDoFuture()
  [20:52:31.306]     lapply(seq_along(...future.x_ii), FUN = function(jj) {
  [20:52:31.306]         ...future.x_jj <- ...future.x_ii[[jj]]
  [20:52:31.306]         b <- NULL
  [20:52:31.306]         ...future.env <- environment()
  [20:52:31.306]         local({
  [20:52:31.306]             for (name in names(...future.x_jj)) {
  [20:52:31.306]                 assign(name, ...future.x_jj[[name]], envir = ...future.env, 
  [20:52:31.306]                   inherits = FALSE)
  [20:52:31.306]             }
  [20:52:31.306]         })
  [20:52:31.306]         tryCatch({
  [20:52:31.306]             plan_list <- future::plan()
  [20:52:31.306]             message(capture.output(print(plan_list)))
  [20:52:31.306]             stopifnot(inherits(plan_list, "future"), inherits(plan_list, 
  [20:52:31.306]                 getOption("future.default", "sequential")))
  [20:52:31.306]             plan_b <- future::plan("list")
  [20:52:31.306]             str(plan_b)
  [20:52:31.306]             stopifnot(inherits(plan_b[[1]], "future"), inherits(plan_b[[1]], 
  [20:52:31.306]                 getOption("future.default", "sequential")))
  [20:52:31.306]             list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
  [20:52:31.306]         }, error = identity)
  [20:52:31.306]     })
  [20:52:31.306] }
  [20:52:31.307] - identifying globals and packages ...
  getGlobalsAndPackages() ...
  Searching for globals...
  - globals found: [24] '{', '::', 'lapply', 'seq_along', '...future.x_ii', '<-', '[[', 'environment', 'local', 'for', 'names', 'assign', 'tryCatch', 'message', 'capture.output', 'print', 'stopifnot', 'inherits', 'getOption', 'str', 'list', 'a', 'plan_a', 'identity'
  Searching for globals ... DONE
  Resolving globals: FALSE
  The total size of the 3 globals is 81.59 KiB (83544 bytes)
  - globals: [3] '...future.x_ii', 'a', 'plan_a'
  - packages: [1] 'utils'
  getGlobalsAndPackages() ... DONE
  [20:52:31.337] List of 3
  [20:52:31.337]  $ ...future.x_ii: NULL
  [20:52:31.337]  $ a             : int 1
  [20:52:31.337]  $ plan_a        :List of 1
  [20:52:31.337]   ..$ b:function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
  [20:52:31.337]     seed = NULL, globals = TRUE, persistent = FALSE, workers = availableCores(), 
  [20:52:31.337]     gc = FALSE, earlySignal = FALSE, label = NULL, ...)  
  [20:52:31.337]   .. ..- attr(*, "class")= chr [1:5] "multisession" "cluster" "multiprocess" "future" ...
  [20:52:31.337]   .. ..- attr(*, "init")= logi TRUE
  [20:52:31.337]   .. ..- attr(*, "call")= language plan(list(a = strategy1, b = strategy2))
  [20:52:31.337]   ..- attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  [20:52:31.337]  - attr(*, "where")=List of 3
  [20:52:31.337]   ..$ ...future.x_ii:<environment: 0x55a47eb69c88> 
  [20:52:31.337]   ..$ a             :<environment: 0x55a47fe35298> 
  [20:52:31.337]   ..$ plan_a        :<environment: 0x55a47fe35298> 
  [20:52:31.337]  - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list"
  [20:52:31.337]  - attr(*, "resolved")= logi FALSE
  [20:52:31.337]  - attr(*, "total_size")= num 83544
  [20:52:31.351]   - R expression:
  [20:52:31.351] {
  [20:52:31.351]     doFuture::registerDoFuture()
  [20:52:31.351]     lapply(seq_along(...future.x_ii), FUN = function(jj) {
  [20:52:31.351]         ...future.x_jj <- ...future.x_ii[[jj]]
  [20:52:31.351]         b <- NULL
  [20:52:31.351]         ...future.env <- environment()
  [20:52:31.351]         local({
  [20:52:31.351]             for (name in names(...future.x_jj)) {
  [20:52:31.351]                 assign(name, ...future.x_jj[[name]], envir = ...future.env, 
  [20:52:31.351]                   inherits = FALSE)
  [20:52:31.351]             }
  [20:52:31.351]         })
  [20:52:31.351]         tryCatch({
  [20:52:31.351]             plan_list <- future::plan()
  [20:52:31.351]             message(capture.output(print(plan_list)))
  [20:52:31.351]             stopifnot(inherits(plan_list, "future"), inherits(plan_list, 
  [20:52:31.351]                 getOption("future.default", "sequential")))
  [20:52:31.351]             plan_b <- future::plan("list")
  [20:52:31.351]             str(plan_b)
  [20:52:31.351]             stopifnot(inherits(plan_b[[1]], "future"), inherits(plan_b[[1]], 
  [20:52:31.351]                 getOption("future.default", "sequential")))
  [20:52:31.351]             list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
  [20:52:31.351]         }, error = identity)
  [20:52:31.351]     })
  [20:52:31.351] }
  [20:52:31.352]   - globals: [3] '...future.x_ii', 'a', 'plan_a'
  [20:52:31.353] List of 3
  [20:52:31.353]  $ ...future.x_ii: NULL
  [20:52:31.353]  $ a             : int 1
  [20:52:31.353]  $ plan_a        :List of 1
  [20:52:31.353]   ..$ b:function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
  [20:52:31.353]     seed = NULL, globals = TRUE, persistent = FALSE, workers = availableCores(), 
  [20:52:31.353]     gc = FALSE, earlySignal = FALSE, label = NULL, ...)  
  [20:52:31.353]   .. ..- attr(*, "class")= chr [1:5] "multisession" "cluster" "multiprocess" "future" ...
  [20:52:31.353]   .. ..- attr(*, "init")= logi TRUE
  [20:52:31.353]   .. ..- attr(*, "call")= language plan(list(a = strategy1, b = strategy2))
  [20:52:31.353]   ..- attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  [20:52:31.353]  - attr(*, "where")=List of 3
  [20:52:31.353]   ..$ ...future.x_ii:<environment: 0x55a47eb69c88> 
  [20:52:31.353]   ..$ a             :<environment: 0x55a47fe35298> 
  [20:52:31.353]   ..$ plan_a        :<environment: 0x55a47fe35298> 
  [20:52:31.353]  - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list"
  [20:52:31.353]  - attr(*, "resolved")= logi FALSE
  [20:52:31.353]  - attr(*, "total_size")= num 83544
  [20:52:31.371]   - packages: [2] 'doFuture', 'utils'
  [20:52:31.371] - identifying globals and packages ... DONE
  [20:52:31.373] Number of chunks: 2
  [20:52:31.373] Number of futures (= number of chunks): 2
  [20:52:31.373] Launching 2 futures (chunks) ...
  [20:52:31.374] Chunk #1 of 2 ...
  [20:52:31.374]  - Finding globals in 'args_list' chunk #1 ...
  getGlobalsAndPackages() ...
  Searching for globals...
  
  Searching for globals ... DONE
  - globals: [0] <none>
  getGlobalsAndPackages() ... DONE
  [20:52:31.377] 
  [20:52:31.377] 
  [20:52:31.377]  - Finding globals in 'args_list' for chunk #1 ... DONE
  [local output] Workers: [n = 2] 'localhost', 'localhost'
  [local output] Base port: 11544
  [local output] Creating node 1 of 2 ...
  [local output] - setting up node
  Testing if worker's PID can be inferred: '/home/hornik/tmp/R.check/r-patched-gcc/Work/build/bin/Rscript -e 'try(cat(Sys.getpid(),file="/tmp/RtmpmhL62P/future.parent=10097.2771508c03e9.pid"), silent = TRUE)' -e "file.exists('/tmp/RtmpmhL62P/future.parent=10097.2771508c03e9.pid')"'
  - Possible to infer worker's PID: TRUE
  [local output] Starting worker #1 on 'localhost': '/home/hornik/tmp/R.check/r-patched-gcc/Work/build/bin/Rscript' --default-packages=datasets,utils,grDevices,graphics,stats,methods -e '#label=foreach,nested_dopar.R:10097:gimli:hornik' -e 'try(cat(Sys.getpid(),file="/tmp/RtmpmhL62P/future.parent=10097.2771508c03e9.pid"), silent = TRUE)' -e 'parallel:::.slaveRSOCK()' MASTER=localhost PORT=11544 OUT=/dev/null TIMEOUT=120 XDR=TRUE
  [local output] - Exit code of system() call: 0
  [local output] Waiting for worker #1 on 'localhost' to connect back
  [local output] Connection with worker #1 on 'localhost' established
  [local output] - collecting session information
  [local output] Creating node 1 of 2 ... done
  [local output] Creating node 2 of 2 ...
  [local output] - setting up node
  Testing if worker's PID can be inferred: '/home/hornik/tmp/R.check/r-patched-gcc/Work/build/bin/Rscript -e 'try(cat(Sys.getpid(),file="/tmp/RtmpmhL62P/future.parent=10097.2771d5cfd0f.pid"), silent = TRUE)' -e "file.exists('/tmp/RtmpmhL62P/future.parent=10097.2771d5cfd0f.pid')"'
  - Possible to infer worker's PID: TRUE
  [local output] Starting worker #2 on 'localhost': '/home/hornik/tmp/R.check/r-patched-gcc/Work/build/bin/Rscript' --default-packages=datasets,utils,grDevices,graphics,stats,methods -e '#label=foreach,nested_dopar.R:10097:gimli:hornik' -e 'try(cat(Sys.getpid(),file="/tmp/RtmpmhL62P/future.parent=10097.2771d5cfd0f.pid"), silent = TRUE)' -e 'parallel:::.slaveRSOCK()' MASTER=localhost PORT=11544 OUT=/dev/null TIMEOUT=120 XDR=TRUE
  [local output] - Exit code of system() call: 0
  [local output] Waiting for worker #2 on 'localhost' to connect back
  [local output] Connection with worker #2 on 'localhost' established
  [local output] - collecting session information
  [local output] Creating node 2 of 2 ... done
  getGlobalsAndPackages() ...
  - globals passed as-is: [3] '...future.x_ii', 'a', 'plan_a'
  Resolving globals: FALSE
  The total size of the 3 globals is 81.64 KiB (83600 bytes)
  - globals: [3] '...future.x_ii', 'a', 'plan_a'
  
  getGlobalsAndPackages() ... DONE
  Packages needed by future strategies (n = 0): <none>
  Packages needed by the future expression (n = 2): 'doFuture', 'utils'
  {
      {
          ...future.startTime <- Sys.time()
          ...future.oldOptions <- options(future.startup.loadScript = FALSE, 
              future.globals.onMissing = "ignore", future.globals.maxSize = NULL, 
              future.globals.method = NULL, future.globals.onMissing = "ignore", 
              future.globals.onReference = NULL, future.globals.resolve = NULL, 
              future.resolve.recursive = NULL, width = 80L)
          {
              {
                  {
                    {
                      has_future <- requireNamespace("future", 
                        quietly = TRUE)
                      version <- if (has_future) 
                        packageVersion("future")
                      else NULL
                      if (!has_future || version < "1.8.0") {
                        info <- c(r_version = gsub("R version ", 
                          "", R.version$version.string), platform = sprintf("%s (%s-bit)", 
                          R.version$platform, 8 * .Machine$sizeof.pointer), 
                          os = paste(Sys.info()[c("sysname", "release", 
                            "version")], collapse = " "), hostname = Sys.info()[["nodename"]])
                        info <- sprintf("%s: %s", names(info), 
                          info)
                        info <- paste(info, collapse = "; ")
                        if (!has_future) {
                          msg <- sprintf("Package 'future' is not installed on worker (%s)", 
                            info)
                        }
                        else {
                          msg <- sprintf("Package 'future' on worker (%s) must be of version >= 1.8.0: %s", 
                            info, version)
                        }
                        stop(msg)
                      }
                    }
                    ...future.mc.cores.old <- getOption("mc.cores")
                    options(mc.cores = 1L)
                  }
                  local({
                    for (pkg in c("doFuture", "utils")) {
                      loadNamespace(pkg)
                      library(pkg, character.only = TRUE)
                    }
                  })
              }
              future::plan("default", .cleanup = FALSE, .init = FALSE)
          }
      }
      if (is.na(TRUE)) {
      }
      else {
          if (TRUE) {
              ...future.stdout <- rawConnection(raw(0L), open = "w")
          }
          else {
              ...future.stdout <- file(switch(.Platform$OS.type, 
                  windows = "NUL", "/dev/null"), open = "w")
          }
          sink(...future.stdout, type = "output", split = FALSE)
          on.exit(if (!is.null(...future.stdout)) {
              sink(type = "output", split = FALSE)
              close(...future.stdout)
          }, add = TRUE)
      }
      ...future.frame <- sys.nframe()
      ...future.conditions <- list()
      ...future.result <- tryCatch({
          withCallingHandlers({
              ...future.value <- local({
                  doFuture::registerDoFuture()
                  lapply(seq_along(...future.x_ii), FUN = function(jj) {
                    ...future.x_jj <- ...future.x_ii[[jj]]
                    b <- NULL
                    ...future.env <- environment()
                    local({
                      for (name in names(...future.x_jj)) {
                        assign(name, ...future.x_jj[[name]], envir = ...future.env, 
                          inherits = FALSE)
                      }
                    })
                    tryCatch({
                      plan_list <- future::plan()
                      message(capture.output(print(plan_list)))
                      stopifnot(inherits(plan_list, "future"), 
                        inherits(plan_list, getOption("future.default", 
                          "sequential")))
                      plan_b <- future::plan("list")
                      str(plan_b)
                      stopifnot(inherits(plan_b[[1]], "future"), 
                        inherits(plan_b[[1]], getOption("future.default", 
                          "sequential")))
                      list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
                    }, error = identity)
                  })
              })
              future::FutureResult(value = ...future.value, started = ...future.startTime, 
                  version = "1.8")
          }, condition = local({
              inherits <- base::inherits
              invokeRestart <- base::invokeRestart
              length <- base::length
              seq.int <- base::seq.int
              sys.calls <- base::sys.calls
              `[[` <- base::`[[`
              `+` <- base::`+`
              `<<-` <- base::`<<-`
              sysCalls <- function(calls = sys.calls(), from = 1L) {
                  calls[seq.int(from = from + 12L, to = length(calls) - 
                    3L)]
              }
              function(cond) {
                  if (inherits(cond, "error")) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond, calls = c(sysCalls(from = ...future.frame), 
                      cond$call), timestamp = base::Sys.time())
                    signalCondition(cond)
                  }
                  else if (inherits(cond, c("message", "warning"
                  ))) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond)
                    if (inherits(cond, "message")) {
                      invokeRestart("muffleMessage")
                    }
                    else if (inherits(cond, "warning")) {
                      invokeRestart("muffleWarning")
                    }
                  }
              }
          }))
      }, error = function(ex) {
          structure(list(value = NULL, conditions = ...future.conditions, 
              condition = ex, calls = sys.calls(), version = "1.8"), 
              class = "FutureResult")
      }, finally = {
          {
              {
                  options(mc.cores = ...future.mc.cores.old)
              }
              future::plan(list(b = function (expr, envir = parent.frame(), 
                  substitute = TRUE, lazy = FALSE, seed = NULL, 
                  globals = TRUE, persistent = FALSE, workers = availableCores(), 
                  gc = FALSE, earlySignal = FALSE, label = NULL, 
                  ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  if (is.function(workers)) 
                    workers <- workers()
                  workers <- as.integer(workers)
                  stop_if_not(length(workers) == 1, is.finite(workers), 
                    workers >= 1)
                  if (workers == 1L) {
                    return(sequential(expr, envir = envir, substitute = FALSE, 
                      lazy = TRUE, seed = seed, globals = globals, 
                      local = TRUE, label = label, ...))
                  }
                  workers <- ClusterRegistry("start", workers = workers)
                  future <- MultisessionFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, persistent = persistent, 
                    workers = workers, gc = gc, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }), .cleanup = FALSE, .init = FALSE)
          }
          options(...future.oldOptions)
      })
      if (is.na(TRUE)) {
      }
      else {
          sink(type = "output", split = FALSE)
          if (TRUE) {
              ...future.result$stdout <- rawToChar(rawConnectionValue(...future.stdout))
          }
          else {
              ...future.result["stdout"] <- list(NULL)
          }
          close(...future.stdout)
          ...future.stdout <- NULL
      }
      ...future.result$conditions <- ...future.conditions
      ...future.result
  }
  Exporting 3 global objects (81.64 KiB) to cluster node #1 ...
  Exporting '...future.x_ii' (56 bytes) to cluster node #1 ...
  Exporting '...future.x_ii' (56 bytes) to cluster node #1 ... DONE
  Exporting 'a' (56 bytes) to cluster node #1 ...
  Exporting 'a' (56 bytes) to cluster node #1 ... DONE
  Exporting 'plan_a' (81.53 KiB) to cluster node #1 ...
  Exporting 'plan_a' (81.53 KiB) to cluster node #1 ... DONE
  Exporting 3 global objects (81.64 KiB) to cluster node #1 ... DONE
  MultisessionFuture started
  [20:52:45.657] Chunk #1 of 2 ... DONE
  [20:52:45.658] Chunk #2 of 2 ...
  [20:52:45.658]  - Finding globals in 'args_list' chunk #2 ...
  getGlobalsAndPackages() ...
  Searching for globals...
  
  Searching for globals ... DONE
  - globals: [0] <none>
  getGlobalsAndPackages() ... DONE
  [20:52:45.662] 
  [20:52:45.662] 
  [20:52:45.663]  - Finding globals in 'args_list' for chunk #2 ... DONE
  getGlobalsAndPackages() ...
  - globals passed as-is: [3] '...future.x_ii', 'a', 'plan_a'
  Resolving globals: FALSE
  The total size of the 3 globals is 81.70 KiB (83656 bytes)
  - globals: [3] '...future.x_ii', 'a', 'plan_a'
  
  getGlobalsAndPackages() ... DONE
  Packages needed by future strategies (n = 0): <none>
  Packages needed by the future expression (n = 2): 'doFuture', 'utils'
  {
      {
          ...future.startTime <- Sys.time()
          ...future.oldOptions <- options(future.startup.loadScript = FALSE, 
              future.globals.onMissing = "ignore", future.globals.maxSize = NULL, 
              future.globals.method = NULL, future.globals.onMissing = "ignore", 
              future.globals.onReference = NULL, future.globals.resolve = NULL, 
              future.resolve.recursive = NULL, width = 80L)
          {
              {
                  {
                    {
                      has_future <- requireNamespace("future", 
                        quietly = TRUE)
                      version <- if (has_future) 
                        packageVersion("future")
                      else NULL
                      if (!has_future || version < "1.8.0") {
                        info <- c(r_version = gsub("R version ", 
                          "", R.version$version.string), platform = sprintf("%s (%s-bit)", 
                          R.version$platform, 8 * .Machine$sizeof.pointer), 
                          os = paste(Sys.info()[c("sysname", "release", 
                            "version")], collapse = " "), hostname = Sys.info()[["nodename"]])
                        info <- sprintf("%s: %s", names(info), 
                          info)
                        info <- paste(info, collapse = "; ")
                        if (!has_future) {
                          msg <- sprintf("Package 'future' is not installed on worker (%s)", 
                            info)
                        }
                        else {
                          msg <- sprintf("Package 'future' on worker (%s) must be of version >= 1.8.0: %s", 
                            info, version)
                        }
                        stop(msg)
                      }
                    }
                    ...future.mc.cores.old <- getOption("mc.cores")
                    options(mc.cores = 1L)
                  }
                  local({
                    for (pkg in c("doFuture", "utils")) {
                      loadNamespace(pkg)
                      library(pkg, character.only = TRUE)
                    }
                  })
              }
              future::plan("default", .cleanup = FALSE, .init = FALSE)
          }
      }
      if (is.na(TRUE)) {
      }
      else {
          if (TRUE) {
              ...future.stdout <- rawConnection(raw(0L), open = "w")
          }
          else {
              ...future.stdout <- file(switch(.Platform$OS.type, 
                  windows = "NUL", "/dev/null"), open = "w")
          }
          sink(...future.stdout, type = "output", split = FALSE)
          on.exit(if (!is.null(...future.stdout)) {
              sink(type = "output", split = FALSE)
              close(...future.stdout)
          }, add = TRUE)
      }
      ...future.frame <- sys.nframe()
      ...future.conditions <- list()
      ...future.result <- tryCatch({
          withCallingHandlers({
              ...future.value <- local({
                  doFuture::registerDoFuture()
                  lapply(seq_along(...future.x_ii), FUN = function(jj) {
                    ...future.x_jj <- ...future.x_ii[[jj]]
                    b <- NULL
                    ...future.env <- environment()
                    local({
                      for (name in names(...future.x_jj)) {
                        assign(name, ...future.x_jj[[name]], envir = ...future.env, 
                          inherits = FALSE)
                      }
                    })
                    tryCatch({
                      plan_list <- future::plan()
                      message(capture.output(print(plan_list)))
                      stopifnot(inherits(plan_list, "future"), 
                        inherits(plan_list, getOption("future.default", 
                          "sequential")))
                      plan_b <- future::plan("list")
                      str(plan_b)
                      stopifnot(inherits(plan_b[[1]], "future"), 
                        inherits(plan_b[[1]], getOption("future.default", 
                          "sequential")))
                      list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
                    }, error = identity)
                  })
              })
              future::FutureResult(value = ...future.value, started = ...future.startTime, 
                  version = "1.8")
          }, condition = local({
              inherits <- base::inherits
              invokeRestart <- base::invokeRestart
              length <- base::length
              seq.int <- base::seq.int
              sys.calls <- base::sys.calls
              `[[` <- base::`[[`
              `+` <- base::`+`
              `<<-` <- base::`<<-`
              sysCalls <- function(calls = sys.calls(), from = 1L) {
                  calls[seq.int(from = from + 12L, to = length(calls) - 
                    3L)]
              }
              function(cond) {
                  if (inherits(cond, "error")) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond, calls = c(sysCalls(from = ...future.frame), 
                      cond$call), timestamp = base::Sys.time())
                    signalCondition(cond)
                  }
                  else if (inherits(cond, c("message", "warning"
                  ))) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond)
                    if (inherits(cond, "message")) {
                      invokeRestart("muffleMessage")
                    }
                    else if (inherits(cond, "warning")) {
                      invokeRestart("muffleWarning")
                    }
                  }
              }
          }))
      }, error = function(ex) {
          structure(list(value = NULL, conditions = ...future.conditions, 
              condition = ex, calls = sys.calls(), version = "1.8"), 
              class = "FutureResult")
      }, finally = {
          {
              {
                  options(mc.cores = ...future.mc.cores.old)
              }
              future::plan(list(b = function (expr, envir = parent.frame(), 
                  substitute = TRUE, lazy = FALSE, seed = NULL, 
                  globals = TRUE, persistent = FALSE, workers = availableCores(), 
                  gc = FALSE, earlySignal = FALSE, label = NULL, 
                  ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  if (is.function(workers)) 
                    workers <- workers()
                  workers <- as.integer(workers)
                  stop_if_not(length(workers) == 1, is.finite(workers), 
                    workers >= 1)
                  if (workers == 1L) {
                    return(sequential(expr, envir = envir, substitute = FALSE, 
                      lazy = TRUE, seed = seed, globals = globals, 
                      local = TRUE, label = label, ...))
                  }
                  workers <- ClusterRegistry("start", workers = workers)
                  future <- MultisessionFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, persistent = persistent, 
                    workers = workers, gc = gc, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }), .cleanup = FALSE, .init = FALSE)
          }
          options(...future.oldOptions)
      })
      if (is.na(TRUE)) {
      }
      else {
          sink(type = "output", split = FALSE)
          if (TRUE) {
              ...future.result$stdout <- rawToChar(rawConnectionValue(...future.stdout))
          }
          else {
              ...future.result["stdout"] <- list(NULL)
          }
          close(...future.stdout)
          ...future.stdout <- NULL
      }
      ...future.result$conditions <- ...future.conditions
      ...future.result
  }
  Exporting 3 global objects (81.70 KiB) to cluster node #2 ...
  Exporting '...future.x_ii' (112 bytes) to cluster node #2 ...
  Exporting '...future.x_ii' (112 bytes) to cluster node #2 ... DONE
  Exporting 'a' (56 bytes) to cluster node #2 ...
  Exporting 'a' (56 bytes) to cluster node #2 ... DONE
  Exporting 'plan_a' (81.53 KiB) to cluster node #2 ...
  Exporting 'plan_a' (81.53 KiB) to cluster node #2 ... DONE
  Exporting 3 global objects (81.70 KiB) to cluster node #2 ... DONE
  MultisessionFuture started
  [20:52:45.777] Chunk #2 of 2 ... DONE
  [20:52:45.778] Launching 2 futures (chunks) ... DONE
  [20:52:45.778] - resolving futures
  resolve() on list ...
   recursive: 0
   length: 2
  
   length: 1 (resolved future 2)
   length: 0 (resolved future 1)
  resolve() on list ... DONE
  [20:52:46.240] - relaying conditions of futures
  result() for ClusterFuture ...
  - Validating connection of MultisessionFuture
  - class(result): FutureResult
  Future state: 'finished'
  result() for ClusterFuture ...
  - result already collected: FutureResult
  result() for ClusterFuture ... done
  sequential:- args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)- tweaked: FALSE- call: NULL
  result() for ClusterFuture ...
  - Validating connection of MultisessionFuture
  - class(result): FutureResult
  Future state: 'finished'
  result() for ClusterFuture ...
  - result already collected: FutureResult
  result() for ClusterFuture ... done
  sequential:- args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)- tweaked: FALSE- call: NULL
  sequential:- args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)- tweaked: FALSE- call: NULL
  [20:52:46.264] - collecting values of futures
  result() for ClusterFuture ...
  - result already collected: FutureResult
  result() for ClusterFuture ... done
  result() for ClusterFuture ...
  - result already collected: FutureResult
  result() for ClusterFuture ... done
  [20:52:46.267] - accumulating results
  [20:52:46.268] - processing errors (handler = 'stop')
  [20:52:46.269] - extracting results
  [20:52:46.269] doFuture() ... DONE
  foreach() - level 2 ... DONE
  foreach() - level 2 ...
  [20:52:46.276] doFuture() ...
  [20:52:46.277] - dummy globals (as locals): [1] 'b'
  [20:52:46.278] - R expression:
  [20:52:46.295] {
  [20:52:46.295]     doFuture::registerDoFuture()
  [20:52:46.295]     lapply(seq_along(...future.x_ii), FUN = function(jj) {
  [20:52:46.295]         ...future.x_jj <- ...future.x_ii[[jj]]
  [20:52:46.295]         b <- NULL
  [20:52:46.295]         ...future.env <- environment()
  [20:52:46.295]         local({
  [20:52:46.295]             for (name in names(...future.x_jj)) {
  [20:52:46.295]                 assign(name, ...future.x_jj[[name]], envir = ...future.env, 
  [20:52:46.295]                   inherits = FALSE)
  [20:52:46.295]             }
  [20:52:46.295]         })
  [20:52:46.295]         tryCatch({
  [20:52:46.295]             plan_list <- future::plan()
  [20:52:46.295]             message(capture.output(print(plan_list)))
  [20:52:46.295]             stopifnot(inherits(plan_list, "future"), inherits(plan_list, 
  [20:52:46.295]                 getOption("future.default", "sequential")))
  [20:52:46.295]             plan_b <- future::plan("list")
  [20:52:46.295]             str(plan_b)
  [20:52:46.295]             stopifnot(inherits(plan_b[[1]], "future"), inherits(plan_b[[1]], 
  [20:52:46.295]                 getOption("future.default", "sequential")))
  [20:52:46.295]             list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
  [20:52:46.295]         }, error = identity)
  [20:52:46.295]     })
  [20:52:46.295] }
  [20:52:46.296] - identifying globals and packages ...
  getGlobalsAndPackages() ...
  Searching for globals...
  - globals found: [24] '{', '::', 'lapply', 'seq_along', '...future.x_ii', '<-', '[[', 'environment', 'local', 'for', 'names', 'assign', 'tryCatch', 'message', 'capture.output', 'print', 'stopifnot', 'inherits', 'getOption', 'str', 'list', 'a', 'plan_a', 'identity'
  Searching for globals ... DONE
  Resolving globals: FALSE
  The total size of the 3 globals is 81.59 KiB (83544 bytes)
  - globals: [3] '...future.x_ii', 'a', 'plan_a'
  - packages: [1] 'utils'
  getGlobalsAndPackages() ... DONE
  [20:52:46.359] List of 3
  [20:52:46.359]  $ ...future.x_ii: NULL
  [20:52:46.359]  $ a             : int 2
  [20:52:46.359]  $ plan_a        :List of 1
  [20:52:46.359]   ..$ b:function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
  [20:52:46.359]     seed = NULL, globals = TRUE, persistent = FALSE, workers = availableCores(), 
  [20:52:46.359]     gc = FALSE, earlySignal = FALSE, label = NULL, ...)  
  [20:52:46.359]   .. ..- attr(*, "class")= chr [1:5] "multisession" "cluster" "multiprocess" "future" ...
  [20:52:46.359]   .. ..- attr(*, "init")= logi TRUE
  [20:52:46.359]   .. ..- attr(*, "call")= language plan(list(a = strategy1, b = strategy2))
  [20:52:46.359]   ..- attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  [20:52:46.359]  - attr(*, "where")=List of 3
  [20:52:46.359]   ..$ ...future.x_ii:<environment: 0x55a47eaf2000> 
  [20:52:46.359]   ..$ a             :<environment: 0x55a47da95278> 
  [20:52:46.359]   ..$ plan_a        :<environment: 0x55a47da95278> 
  [20:52:46.359]  - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list"
  [20:52:46.359]  - attr(*, "resolved")= logi FALSE
  [20:52:46.359]  - attr(*, "total_size")= num 83544
  [20:52:46.392]   - R expression:
  [20:52:46.392] {
  [20:52:46.392]     doFuture::registerDoFuture()
  [20:52:46.392]     lapply(seq_along(...future.x_ii), FUN = function(jj) {
  [20:52:46.392]         ...future.x_jj <- ...future.x_ii[[jj]]
  [20:52:46.392]         b <- NULL
  [20:52:46.392]         ...future.env <- environment()
  [20:52:46.392]         local({
  [20:52:46.392]             for (name in names(...future.x_jj)) {
  [20:52:46.392]                 assign(name, ...future.x_jj[[name]], envir = ...future.env, 
  [20:52:46.392]                   inherits = FALSE)
  [20:52:46.392]             }
  [20:52:46.392]         })
  [20:52:46.392]         tryCatch({
  [20:52:46.392]             plan_list <- future::plan()
  [20:52:46.392]             message(capture.output(print(plan_list)))
  [20:52:46.392]             stopifnot(inherits(plan_list, "future"), inherits(plan_list, 
  [20:52:46.392]                 getOption("future.default", "sequential")))
  [20:52:46.392]             plan_b <- future::plan("list")
  [20:52:46.392]             str(plan_b)
  [20:52:46.392]             stopifnot(inherits(plan_b[[1]], "future"), inherits(plan_b[[1]], 
  [20:52:46.392]                 getOption("future.default", "sequential")))
  [20:52:46.392]             list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
  [20:52:46.392]         }, error = identity)
  [20:52:46.392]     })
  [20:52:46.392] }
  [20:52:46.393]   - globals: [3] '...future.x_ii', 'a', 'plan_a'
  [20:52:46.394] List of 3
  [20:52:46.394]  $ ...future.x_ii: NULL
  [20:52:46.394]  $ a             : int 2
  [20:52:46.394]  $ plan_a        :List of 1
  [20:52:46.394]   ..$ b:function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
  [20:52:46.394]     seed = NULL, globals = TRUE, persistent = FALSE, workers = availableCores(), 
  [20:52:46.394]     gc = FALSE, earlySignal = FALSE, label = NULL, ...)  
  [20:52:46.394]   .. ..- attr(*, "class")= chr [1:5] "multisession" "cluster" "multiprocess" "future" ...
  [20:52:46.394]   .. ..- attr(*, "init")= logi TRUE
  [20:52:46.394]   .. ..- attr(*, "call")= language plan(list(a = strategy1, b = strategy2))
  [20:52:46.394]   ..- attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  [20:52:46.394]  - attr(*, "where")=List of 3
  [20:52:46.394]   ..$ ...future.x_ii:<environment: 0x55a47eaf2000> 
  [20:52:46.394]   ..$ a             :<environment: 0x55a47da95278> 
  [20:52:46.394]   ..$ plan_a        :<environment: 0x55a47da95278> 
  [20:52:46.394]  - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list"
  [20:52:46.394]  - attr(*, "resolved")= logi FALSE
  [20:52:46.394]  - attr(*, "total_size")= num 83544
  [20:52:46.423]   - packages: [2] 'doFuture', 'utils'
  [20:52:46.424] - identifying globals and packages ... DONE
  [20:52:46.425] Number of chunks: 2
  [20:52:46.426] Number of futures (= number of chunks): 2
  [20:52:46.426] Launching 2 futures (chunks) ...
  [20:52:46.439] Chunk #1 of 2 ...
  [20:52:46.439]  - Finding globals in 'args_list' chunk #1 ...
  getGlobalsAndPackages() ...
  Searching for globals...
  
  Searching for globals ... DONE
  - globals: [0] <none>
  getGlobalsAndPackages() ... DONE
  [20:52:46.442] 
  [20:52:46.443] 
  [20:52:46.443]  - Finding globals in 'args_list' for chunk #1 ... DONE
  getGlobalsAndPackages() ...
  - globals passed as-is: [3] '...future.x_ii', 'a', 'plan_a'
  Resolving globals: FALSE
  The total size of the 3 globals is 81.64 KiB (83600 bytes)
  - globals: [3] '...future.x_ii', 'a', 'plan_a'
  
  getGlobalsAndPackages() ... DONE
  Packages needed by future strategies (n = 0): <none>
  Packages needed by the future expression (n = 2): 'doFuture', 'utils'
  {
      {
          ...future.startTime <- Sys.time()
          ...future.oldOptions <- options(future.startup.loadScript = FALSE, 
              future.globals.onMissing = "ignore", future.globals.maxSize = NULL, 
              future.globals.method = NULL, future.globals.onMissing = "ignore", 
              future.globals.onReference = NULL, future.globals.resolve = NULL, 
              future.resolve.recursive = NULL, width = 80L)
          {
              {
                  {
                    {
                      has_future <- requireNamespace("future", 
                        quietly = TRUE)
                      version <- if (has_future) 
                        packageVersion("future")
                      else NULL
                      if (!has_future || version < "1.8.0") {
                        info <- c(r_version = gsub("R version ", 
                          "", R.version$version.string), platform = sprintf("%s (%s-bit)", 
                          R.version$platform, 8 * .Machine$sizeof.pointer), 
                          os = paste(Sys.info()[c("sysname", "release", 
                            "version")], collapse = " "), hostname = Sys.info()[["nodename"]])
                        info <- sprintf("%s: %s", names(info), 
                          info)
                        info <- paste(info, collapse = "; ")
                        if (!has_future) {
                          msg <- sprintf("Package 'future' is not installed on worker (%s)", 
                            info)
                        }
                        else {
                          msg <- sprintf("Package 'future' on worker (%s) must be of version >= 1.8.0: %s", 
                            info, version)
                        }
                        stop(msg)
                      }
                    }
                    ...future.mc.cores.old <- getOption("mc.cores")
                    options(mc.cores = 1L)
                  }
                  local({
                    for (pkg in c("doFuture", "utils")) {
                      loadNamespace(pkg)
                      library(pkg, character.only = TRUE)
                    }
                  })
              }
              future::plan("default", .cleanup = FALSE, .init = FALSE)
          }
      }
      if (is.na(TRUE)) {
      }
      else {
          if (TRUE) {
              ...future.stdout <- rawConnection(raw(0L), open = "w")
          }
          else {
              ...future.stdout <- file(switch(.Platform$OS.type, 
                  windows = "NUL", "/dev/null"), open = "w")
          }
          sink(...future.stdout, type = "output", split = FALSE)
          on.exit(if (!is.null(...future.stdout)) {
              sink(type = "output", split = FALSE)
              close(...future.stdout)
          }, add = TRUE)
      }
      ...future.frame <- sys.nframe()
      ...future.conditions <- list()
      ...future.result <- tryCatch({
          withCallingHandlers({
              ...future.value <- local({
                  doFuture::registerDoFuture()
                  lapply(seq_along(...future.x_ii), FUN = function(jj) {
                    ...future.x_jj <- ...future.x_ii[[jj]]
                    b <- NULL
                    ...future.env <- environment()
                    local({
                      for (name in names(...future.x_jj)) {
                        assign(name, ...future.x_jj[[name]], envir = ...future.env, 
                          inherits = FALSE)
                      }
                    })
                    tryCatch({
                      plan_list <- future::plan()
                      message(capture.output(print(plan_list)))
                      stopifnot(inherits(plan_list, "future"), 
                        inherits(plan_list, getOption("future.default", 
                          "sequential")))
                      plan_b <- future::plan("list")
                      str(plan_b)
                      stopifnot(inherits(plan_b[[1]], "future"), 
                        inherits(plan_b[[1]], getOption("future.default", 
                          "sequential")))
                      list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
                    }, error = identity)
                  })
              })
              future::FutureResult(value = ...future.value, started = ...future.startTime, 
                  version = "1.8")
          }, condition = local({
              inherits <- base::inherits
              invokeRestart <- base::invokeRestart
              length <- base::length
              seq.int <- base::seq.int
              sys.calls <- base::sys.calls
              `[[` <- base::`[[`
              `+` <- base::`+`
              `<<-` <- base::`<<-`
              sysCalls <- function(calls = sys.calls(), from = 1L) {
                  calls[seq.int(from = from + 12L, to = length(calls) - 
                    3L)]
              }
              function(cond) {
                  if (inherits(cond, "error")) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond, calls = c(sysCalls(from = ...future.frame), 
                      cond$call), timestamp = base::Sys.time())
                    signalCondition(cond)
                  }
                  else if (inherits(cond, c("message", "warning"
                  ))) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond)
                    if (inherits(cond, "message")) {
                      invokeRestart("muffleMessage")
                    }
                    else if (inherits(cond, "warning")) {
                      invokeRestart("muffleWarning")
                    }
                  }
              }
          }))
      }, error = function(ex) {
          structure(list(value = NULL, conditions = ...future.conditions, 
              condition = ex, calls = sys.calls(), version = "1.8"), 
              class = "FutureResult")
      }, finally = {
          {
              {
                  options(mc.cores = ...future.mc.cores.old)
              }
              future::plan(list(b = function (expr, envir = parent.frame(), 
                  substitute = TRUE, lazy = FALSE, seed = NULL, 
                  globals = TRUE, persistent = FALSE, workers = availableCores(), 
                  gc = FALSE, earlySignal = FALSE, label = NULL, 
                  ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  if (is.function(workers)) 
                    workers <- workers()
                  workers <- as.integer(workers)
                  stop_if_not(length(workers) == 1, is.finite(workers), 
                    workers >= 1)
                  if (workers == 1L) {
                    return(sequential(expr, envir = envir, substitute = FALSE, 
                      lazy = TRUE, seed = seed, globals = globals, 
                      local = TRUE, label = label, ...))
                  }
                  workers <- ClusterRegistry("start", workers = workers)
                  future <- MultisessionFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, persistent = persistent, 
                    workers = workers, gc = gc, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }), .cleanup = FALSE, .init = FALSE)
          }
          options(...future.oldOptions)
      })
      if (is.na(TRUE)) {
      }
      else {
          sink(type = "output", split = FALSE)
          if (TRUE) {
              ...future.result$stdout <- rawToChar(rawConnectionValue(...future.stdout))
          }
          else {
              ...future.result["stdout"] <- list(NULL)
          }
          close(...future.stdout)
          ...future.stdout <- NULL
      }
      ...future.result$conditions <- ...future.conditions
      ...future.result
  }
  Exporting 3 global objects (81.64 KiB) to cluster node #1 ...
  Exporting '...future.x_ii' (56 bytes) to cluster node #1 ...
  Exporting '...future.x_ii' (56 bytes) to cluster node #1 ... DONE
  Exporting 'a' (56 bytes) to cluster node #1 ...
  Exporting 'a' (56 bytes) to cluster node #1 ... DONE
  Exporting 'plan_a' (81.53 KiB) to cluster node #1 ...
  Exporting 'plan_a' (81.53 KiB) to cluster node #1 ... DONE
  Exporting 3 global objects (81.64 KiB) to cluster node #1 ... DONE
  MultisessionFuture started
  [20:52:46.521] Chunk #1 of 2 ... DONE
  [20:52:46.522] Chunk #2 of 2 ...
  [20:52:46.522]  - Finding globals in 'args_list' chunk #2 ...
  getGlobalsAndPackages() ...
  Searching for globals...
  
  Searching for globals ... DONE
  - globals: [0] <none>
  getGlobalsAndPackages() ... DONE
  [20:52:46.525] 
  [20:52:46.526] 
  [20:52:46.526]  - Finding globals in 'args_list' for chunk #2 ... DONE
  getGlobalsAndPackages() ...
  - globals passed as-is: [3] '...future.x_ii', 'a', 'plan_a'
  Resolving globals: FALSE
  The total size of the 3 globals is 81.70 KiB (83656 bytes)
  - globals: [3] '...future.x_ii', 'a', 'plan_a'
  
  getGlobalsAndPackages() ... DONE
  Packages needed by future strategies (n = 0): <none>
  Packages needed by the future expression (n = 2): 'doFuture', 'utils'
  {
      {
          ...future.startTime <- Sys.time()
          ...future.oldOptions <- options(future.startup.loadScript = FALSE, 
              future.globals.onMissing = "ignore", future.globals.maxSize = NULL, 
              future.globals.method = NULL, future.globals.onMissing = "ignore", 
              future.globals.onReference = NULL, future.globals.resolve = NULL, 
              future.resolve.recursive = NULL, width = 80L)
          {
              {
                  {
                    {
                      has_future <- requireNamespace("future", 
                        quietly = TRUE)
                      version <- if (has_future) 
                        packageVersion("future")
                      else NULL
                      if (!has_future || version < "1.8.0") {
                        info <- c(r_version = gsub("R version ", 
                          "", R.version$version.string), platform = sprintf("%s (%s-bit)", 
                          R.version$platform, 8 * .Machine$sizeof.pointer), 
                          os = paste(Sys.info()[c("sysname", "release", 
                            "version")], collapse = " "), hostname = Sys.info()[["nodename"]])
                        info <- sprintf("%s: %s", names(info), 
                          info)
                        info <- paste(info, collapse = "; ")
                        if (!has_future) {
                          msg <- sprintf("Package 'future' is not installed on worker (%s)", 
                            info)
                        }
                        else {
                          msg <- sprintf("Package 'future' on worker (%s) must be of version >= 1.8.0: %s", 
                            info, version)
                        }
                        stop(msg)
                      }
                    }
                    ...future.mc.cores.old <- getOption("mc.cores")
                    options(mc.cores = 1L)
                  }
                  local({
                    for (pkg in c("doFuture", "utils")) {
                      loadNamespace(pkg)
                      library(pkg, character.only = TRUE)
                    }
                  })
              }
              future::plan("default", .cleanup = FALSE, .init = FALSE)
          }
      }
      if (is.na(TRUE)) {
      }
      else {
          if (TRUE) {
              ...future.stdout <- rawConnection(raw(0L), open = "w")
          }
          else {
              ...future.stdout <- file(switch(.Platform$OS.type, 
                  windows = "NUL", "/dev/null"), open = "w")
          }
          sink(...future.stdout, type = "output", split = FALSE)
          on.exit(if (!is.null(...future.stdout)) {
              sink(type = "output", split = FALSE)
              close(...future.stdout)
          }, add = TRUE)
      }
      ...future.frame <- sys.nframe()
      ...future.conditions <- list()
      ...future.result <- tryCatch({
          withCallingHandlers({
              ...future.value <- local({
                  doFuture::registerDoFuture()
                  lapply(seq_along(...future.x_ii), FUN = function(jj) {
                    ...future.x_jj <- ...future.x_ii[[jj]]
                    b <- NULL
                    ...future.env <- environment()
                    local({
                      for (name in names(...future.x_jj)) {
                        assign(name, ...future.x_jj[[name]], envir = ...future.env, 
                          inherits = FALSE)
                      }
                    })
                    tryCatch({
                      plan_list <- future::plan()
                      message(capture.output(print(plan_list)))
                      stopifnot(inherits(plan_list, "future"), 
                        inherits(plan_list, getOption("future.default", 
                          "sequential")))
                      plan_b <- future::plan("list")
                      str(plan_b)
                      stopifnot(inherits(plan_b[[1]], "future"), 
                        inherits(plan_b[[1]], getOption("future.default", 
                          "sequential")))
                      list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
                    }, error = identity)
                  })
              })
              future::FutureResult(value = ...future.value, started = ...future.startTime, 
                  version = "1.8")
          }, condition = local({
              inherits <- base::inherits
              invokeRestart <- base::invokeRestart
              length <- base::length
              seq.int <- base::seq.int
              sys.calls <- base::sys.calls
              `[[` <- base::`[[`
              `+` <- base::`+`
              `<<-` <- base::`<<-`
              sysCalls <- function(calls = sys.calls(), from = 1L) {
                  calls[seq.int(from = from + 12L, to = length(calls) - 
                    3L)]
              }
              function(cond) {
                  if (inherits(cond, "error")) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond, calls = c(sysCalls(from = ...future.frame), 
                      cond$call), timestamp = base::Sys.time())
                    signalCondition(cond)
                  }
                  else if (inherits(cond, c("message", "warning"
                  ))) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond)
                    if (inherits(cond, "message")) {
                      invokeRestart("muffleMessage")
                    }
                    else if (inherits(cond, "warning")) {
                      invokeRestart("muffleWarning")
                    }
                  }
              }
          }))
      }, error = function(ex) {
          structure(list(value = NULL, conditions = ...future.conditions, 
              condition = ex, calls = sys.calls(), version = "1.8"), 
              class = "FutureResult")
      }, finally = {
          {
              {
                  options(mc.cores = ...future.mc.cores.old)
              }
              future::plan(list(b = function (expr, envir = parent.frame(), 
                  substitute = TRUE, lazy = FALSE, seed = NULL, 
                  globals = TRUE, persistent = FALSE, workers = availableCores(), 
                  gc = FALSE, earlySignal = FALSE, label = NULL, 
                  ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  if (is.function(workers)) 
                    workers <- workers()
                  workers <- as.integer(workers)
                  stop_if_not(length(workers) == 1, is.finite(workers), 
                    workers >= 1)
                  if (workers == 1L) {
                    return(sequential(expr, envir = envir, substitute = FALSE, 
                      lazy = TRUE, seed = seed, globals = globals, 
                      local = TRUE, label = label, ...))
                  }
                  workers <- ClusterRegistry("start", workers = workers)
                  future <- MultisessionFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, persistent = persistent, 
                    workers = workers, gc = gc, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }), .cleanup = FALSE, .init = FALSE)
          }
          options(...future.oldOptions)
      })
      if (is.na(TRUE)) {
      }
      else {
          sink(type = "output", split = FALSE)
          if (TRUE) {
              ...future.result$stdout <- rawToChar(rawConnectionValue(...future.stdout))
          }
          else {
              ...future.result["stdout"] <- list(NULL)
          }
          close(...future.stdout)
          ...future.stdout <- NULL
      }
      ...future.result$conditions <- ...future.conditions
      ...future.result
  }
  Exporting 3 global objects (81.70 KiB) to cluster node #2 ...
  Exporting '...future.x_ii' (112 bytes) to cluster node #2 ...
  Exporting '...future.x_ii' (112 bytes) to cluster node #2 ... DONE
  Exporting 'a' (56 bytes) to cluster node #2 ...
  Exporting 'a' (56 bytes) to cluster node #2 ... DONE
  Exporting 'plan_a' (81.53 KiB) to cluster node #2 ...
  Exporting 'plan_a' (81.53 KiB) to cluster node #2 ... DONE
  Exporting 3 global objects (81.70 KiB) to cluster node #2 ... DONE
  MultisessionFuture started
  [20:52:46.637] Chunk #2 of 2 ... DONE
  [20:52:46.637] Launching 2 futures (chunks) ... DONE
  [20:52:46.638] - resolving futures
  resolve() on list ...
   recursive: 0
   length: 2
  
   length: 1 (resolved future 1)
   length: 0 (resolved future 2)
  resolve() on list ... DONE
  [20:52:46.694] - relaying conditions of futures
  result() for ClusterFuture ...
  - Validating connection of MultisessionFuture
  - class(result): FutureResult
  Future state: 'finished'
  result() for ClusterFuture ...
  - result already collected: FutureResult
  result() for ClusterFuture ... done
  sequential:- args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)- tweaked: FALSE- call: NULL
  result() for ClusterFuture ...
  - Validating connection of MultisessionFuture
  - class(result): FutureResult
  Future state: 'finished'
  result() for ClusterFuture ...
  - result already collected: FutureResult
  result() for ClusterFuture ... done
  sequential:- args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)- tweaked: FALSE- call: NULL
  sequential:- args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)- tweaked: FALSE- call: NULL
  [20:52:46.737] - collecting values of futures
  result() for ClusterFuture ...
  - result already collected: FutureResult
  result() for ClusterFuture ... done
  result() for ClusterFuture ...
  - result already collected: FutureResult
  result() for ClusterFuture ... done
  [20:52:46.740] - accumulating results
  [20:52:46.741] - processing errors (handler = 'stop')
  [20:52:46.741] - extracting results
  [20:52:46.742] doFuture() ... DONE
  foreach() - level 2 ... DONE
  [20:52:46.801] - collecting values of futures
  [20:52:46.801] - accumulating results
  [20:52:46.808] - processing errors (handler = 'stop')
  [20:52:46.809] - extracting results
  [20:52:46.809] doFuture() ... DONE
  foreach() - level 1 ... DONE
  - plan(list('sequential', 'multisession')) ... DONE
  - plan(list('sequential', 'cluster')) ...
  plan(): Setting new future strategy stack:
  List of future strategies:
  1. sequential:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: plan(list(a = strategy1, b = strategy2))
  2. cluster:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, persistent = FALSE, workers = availableWorkers(), user = NULL, revtunnel = TRUE, homogeneous = TRUE, gc = FALSE, earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: plan(list(a = strategy1, b = strategy2))
  
  plan(): nbrOfWorkers() = 1
  foreach() - level 1 ...
  [20:52:46.821] doFuture() ...
  [20:52:46.823] - dummy globals (as locals): [1] 'a'
  [20:52:46.824] - R expression:
  [20:52:46.824] {
  [20:52:46.824]     doFuture::registerDoFuture()
  [20:52:46.824]     lapply(seq_along(...future.x_ii), FUN = function(jj) {
  [20:52:46.824]         ...future.x_jj <- ...future.x_ii[[jj]]
  [20:52:46.824]         a <- NULL
  [20:52:46.824]         ...future.env <- environment()
  [20:52:46.824]         local({
  [20:52:46.824]             for (name in names(...future.x_jj)) {
  [20:52:46.824]                 assign(name, ...future.x_jj[[name]], envir = ...future.env, 
  [20:52:46.824]                   inherits = FALSE)
  [20:52:46.824]             }
  [20:52:46.824]         })
  [20:52:46.824]         tryCatch({
  [20:52:46.824]             plan_list <- future::plan()
  [20:52:46.824]             stopifnot(inherits(plan_list, strategy2))
  [20:52:46.824]             plan_a <- future::plan("list")
  [20:52:46.824]             str(plan_a)
  [20:52:46.824]             stopifnot(inherits(plan_a[[1]], strategy2))
  [20:52:46.824]             message("foreach() - level 2 ...")
  [20:52:46.824]             y <- foreach(b = bs, .export = c("a", "plan_a")) %dopar% 
  [20:52:46.824]                 {
  [20:52:46.824]                   plan_list <- future::plan()
  [20:52:46.824]                   message(capture.output(print(plan_list)))
  [20:52:46.824]                   stopifnot(inherits(plan_list, "future"), inherits(plan_list, 
  [20:52:46.824]                     getOption("future.default", "sequential")))
  [20:52:46.824]                   plan_b <- future::plan("list")
  [20:52:46.824]                   str(plan_b)
  [20:52:46.824]                   stopifnot(inherits(plan_b[[1]], "future"), 
  [20:52:46.824]                     inherits(plan_b[[1]], getOption("future.default", 
  [20:52:46.824]                       "sequential")))
  [20:52:46.824]                   list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
  [20:52:46.824]                 }
  [20:52:46.824]             message("foreach() - level 2 ... DONE")
  [20:52:46.824]             y
  [20:52:46.824]         }, error = identity)
  [20:52:46.824]     })
  [20:52:46.824] }
  [20:52:46.825] - identifying globals and packages ...
  getGlobalsAndPackages() ...
  Searching for globals...
  - globals found: [28] '{', '::', 'lapply', 'seq_along', '...future.x_ii', '<-', '[[', 'environment', 'local', 'for', 'names', 'assign', 'tryCatch', 'stopifnot', 'inherits', 'strategy2', 'str', 'message', '%dopar%', 'foreach', 'bs', 'c', 'capture.output', 'print', 'getOption', 'list', 'b', 'identity'
  Searching for globals ... DONE
  Resolving globals: FALSE
  The total size of the 3 globals is 176 bytes (176 bytes)
  - globals: [3] '...future.x_ii', 'strategy2', 'bs'
  - packages: [2] 'utils', 'foreach'
  getGlobalsAndPackages() ... DONE
  [20:52:46.889] List of 3
  [20:52:46.889]  $ ...future.x_ii: NULL
  [20:52:46.889]  $ strategy2     : chr "cluster"
  [20:52:46.889]  $ bs            : int [1:3] 3 2 1
  [20:52:46.889]  - attr(*, "where")=List of 3
  [20:52:46.889]   ..$ ...future.x_ii:<environment: 0x55a47eba24f8> 
  [20:52:46.889]   ..$ strategy2     :<environment: R_GlobalEnv> 
  [20:52:46.889]   ..$ bs            :<environment: R_GlobalEnv> 
  [20:52:46.889]  - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list"
  [20:52:46.889]  - attr(*, "resolved")= logi FALSE
  [20:52:46.889]  - attr(*, "total_size")= num 176
  [20:52:46.899]   - R expression:
  [20:52:46.899] {
  [20:52:46.899]     doFuture::registerDoFuture()
  [20:52:46.899]     lapply(seq_along(...future.x_ii), FUN = function(jj) {
  [20:52:46.899]         ...future.x_jj <- ...future.x_ii[[jj]]
  [20:52:46.899]         a <- NULL
  [20:52:46.899]         ...future.env <- environment()
  [20:52:46.899]         local({
  [20:52:46.899]             for (name in names(...future.x_jj)) {
  [20:52:46.899]                 assign(name, ...future.x_jj[[name]], envir = ...future.env, 
  [20:52:46.899]                   inherits = FALSE)
  [20:52:46.899]             }
  [20:52:46.899]         })
  [20:52:46.899]         tryCatch({
  [20:52:46.899]             plan_list <- future::plan()
  [20:52:46.899]             stopifnot(inherits(plan_list, strategy2))
  [20:52:46.899]             plan_a <- future::plan("list")
  [20:52:46.899]             str(plan_a)
  [20:52:46.899]             stopifnot(inherits(plan_a[[1]], strategy2))
  [20:52:46.899]             message("foreach() - level 2 ...")
  [20:52:46.899]             y <- foreach(b = bs, .export = c("a", "plan_a")) %dopar% 
  [20:52:46.899]                 {
  [20:52:46.899]                   plan_list <- future::plan()
  [20:52:46.899]                   message(capture.output(print(plan_list)))
  [20:52:46.899]                   stopifnot(inherits(plan_list, "future"), inherits(plan_list, 
  [20:52:46.899]                     getOption("future.default", "sequential")))
  [20:52:46.899]                   plan_b <- future::plan("list")
  [20:52:46.899]                   str(plan_b)
  [20:52:46.899]                   stopifnot(inherits(plan_b[[1]], "future"), 
  [20:52:46.899]                     inherits(plan_b[[1]], getOption("future.default", 
  [20:52:46.899]                       "sequential")))
  [20:52:46.899]                   list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
  [20:52:46.899]                 }
  [20:52:46.899]             message("foreach() - level 2 ... DONE")
  [20:52:46.899]             y
  [20:52:46.899]         }, error = identity)
  [20:52:46.899]     })
  [20:52:46.899] }
  [20:52:46.901]   - globals: [3] '...future.x_ii', 'strategy2', 'bs'
  [20:52:46.901] List of 3
  [20:52:46.901]  $ ...future.x_ii: NULL
  [20:52:46.901]  $ strategy2     : chr "cluster"
  [20:52:46.901]  $ bs            : int [1:3] 3 2 1
  [20:52:46.901]  - attr(*, "where")=List of 3
  [20:52:46.901]   ..$ ...future.x_ii:<environment: 0x55a47eba24f8> 
  [20:52:46.901]   ..$ strategy2     :<environment: R_GlobalEnv> 
  [20:52:46.901]   ..$ bs            :<environment: R_GlobalEnv> 
  [20:52:46.901]  - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list"
  [20:52:46.901]  - attr(*, "resolved")= logi FALSE
  [20:52:46.901]  - attr(*, "total_size")= num 176
  [20:52:46.910]   - packages: [3] 'doFuture', 'utils', 'foreach'
  [20:52:46.910] - identifying globals and packages ... DONE
  [20:52:46.911] Number of chunks: 1
  [20:52:46.911] Number of futures (= number of chunks): 1
  [20:52:46.911] Launching 1 futures (chunks) ...
  [20:52:46.912] Chunk #1 of 1 ...
  [20:52:46.912]  - Finding globals in 'args_list' chunk #1 ...
  getGlobalsAndPackages() ...
  Searching for globals...
  
  Searching for globals ... DONE
  - globals: [0] <none>
  getGlobalsAndPackages() ... DONE
  [20:52:46.914] 
  [20:52:46.914] 
  [20:52:46.915]  - Finding globals in 'args_list' for chunk #1 ... DONE
  getGlobalsAndPackages() ...
  - globals passed as-is: [3] '...future.x_ii', 'strategy2', 'bs'
  Resolving globals: FALSE
  The total size of the 3 globals is 288 bytes (288 bytes)
  - globals: [3] '...future.x_ii', 'strategy2', 'bs'
  
  getGlobalsAndPackages() ... DONE
  Packages needed by future strategies (n = 1): 'future'
  Packages needed by the future expression (n = 3): 'doFuture', 'utils', 'foreach'
  {
      {
          ...future.startTime <- Sys.time()
          ...future.oldOptions <- options(future.startup.loadScript = FALSE, 
              future.globals.onMissing = "ignore", future.globals.maxSize = NULL, 
              future.globals.method = NULL, future.globals.onMissing = "ignore", 
              future.globals.onReference = NULL, future.globals.resolve = NULL, 
              future.resolve.recursive = NULL, width = 80L)
          {
              {
                  {
                    has_future <- requireNamespace("future", quietly = TRUE)
                    version <- if (has_future) 
                      packageVersion("future")
                    else NULL
                    if (!has_future || version < "1.8.0") {
                      info <- c(r_version = gsub("R version ", 
                        "", R.version$version.string), platform = sprintf("%s (%s-bit)", 
                        R.version$platform, 8 * .Machine$sizeof.pointer), 
                        os = paste(Sys.info()[c("sysname", "release", 
                          "version")], collapse = " "), hostname = Sys.info()[["nodename"]])
                      info <- sprintf("%s: %s", names(info), info)
                      info <- paste(info, collapse = "; ")
                      if (!has_future) {
                        msg <- sprintf("Package 'future' is not installed on worker (%s)", 
                          info)
                      }
                      else {
                        msg <- sprintf("Package 'future' on worker (%s) must be of version >= 1.8.0: %s", 
                          info, version)
                      }
                      stop(msg)
                    }
                  }
                  local({
                    for (pkg in c("future", "doFuture", "utils", 
                    "foreach")) {
                      loadNamespace(pkg)
                      library(pkg, character.only = TRUE)
                    }
                  })
              }
              future::plan(list(b = function (expr, envir = parent.frame(), 
                  substitute = TRUE, lazy = FALSE, seed = NULL, 
                  globals = TRUE, persistent = FALSE, workers = availableWorkers(), 
                  user = NULL, revtunnel = TRUE, homogeneous = TRUE, 
                  gc = FALSE, earlySignal = FALSE, label = NULL, 
                  ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  future <- ClusterFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, persistent = persistent, 
                    workers = workers, user = user, revtunnel = revtunnel, 
                    homogeneous = homogeneous, gc = gc, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }), .cleanup = FALSE, .init = FALSE)
          }
      }
      if (is.na(TRUE)) {
      }
      else {
          if (TRUE) {
              ...future.stdout <- rawConnection(raw(0L), open = "w")
          }
          else {
              ...future.stdout <- file(switch(.Platform$OS.type, 
                  windows = "NUL", "/dev/null"), open = "w")
          }
          sink(...future.stdout, type = "output", split = FALSE)
          on.exit(if (!is.null(...future.stdout)) {
              sink(type = "output", split = FALSE)
              close(...future.stdout)
          }, add = TRUE)
      }
      ...future.frame <- sys.nframe()
      ...future.conditions <- list()
      ...future.result <- tryCatch({
          withCallingHandlers({
              ...future.value <- local({
                  doFuture::registerDoFuture()
                  lapply(seq_along(...future.x_ii), FUN = function(jj) {
                    ...future.x_jj <- ...future.x_ii[[jj]]
                    a <- NULL
                    ...future.env <- environment()
                    local({
                      for (name in names(...future.x_jj)) {
                        assign(name, ...future.x_jj[[name]], envir = ...future.env, 
                          inherits = FALSE)
                      }
                    })
                    tryCatch({
                      plan_list <- future::plan()
                      stopifnot(inherits(plan_list, strategy2))
                      plan_a <- future::plan("list")
                      str(plan_a)
                      stopifnot(inherits(plan_a[[1]], strategy2))
                      message("foreach() - level 2 ...")
                      y <- foreach(b = bs, .export = c("a", "plan_a")) %dopar% 
                        {
                          plan_list <- future::plan()
                          message(capture.output(print(plan_list)))
                          stopifnot(inherits(plan_list, "future"), 
                            inherits(plan_list, getOption("future.default", 
                              "sequential")))
                          plan_b <- future::plan("list")
                          str(plan_b)
                          stopifnot(inherits(plan_b[[1]], "future"), 
                            inherits(plan_b[[1]], getOption("future.default", 
                              "sequential")))
                          list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
                        }
                      message("foreach() - level 2 ... DONE")
                      y
                    }, error = identity)
                  })
              })
              future::FutureResult(value = ...future.value, started = ...future.startTime, 
                  version = "1.8")
          }, condition = local({
              inherits <- base::inherits
              invokeRestart <- base::invokeRestart
              length <- base::length
              seq.int <- base::seq.int
              sys.calls <- base::sys.calls
              `[[` <- base::`[[`
              `+` <- base::`+`
              `<<-` <- base::`<<-`
              sysCalls <- function(calls = sys.calls(), from = 1L) {
                  calls[seq.int(from = from + 12L, to = length(calls) - 
                    3L)]
              }
              function(cond) {
                  if (inherits(cond, "error")) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond, calls = c(sysCalls(from = ...future.frame), 
                      cond$call), timestamp = base::Sys.time())
                    signalCondition(cond)
                  }
                  else if (inherits(cond, c("message", "warning"
                  ))) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond)
                    if (inherits(cond, "message")) {
                      invokeRestart("muffleMessage")
                    }
                    else if (inherits(cond, "warning")) {
                      invokeRestart("muffleWarning")
                    }
                  }
              }
          }))
      }, error = function(ex) {
          structure(list(value = NULL, conditions = ...future.conditions, 
              condition = ex, calls = sys.calls(), version = "1.8"), 
              class = "FutureResult")
      }, finally = {
          {
              NULL
              future::plan(list(a = function (expr, envir = parent.frame(), 
                  substitute = TRUE, lazy = FALSE, seed = NULL, 
                  globals = TRUE, local = TRUE, earlySignal = FALSE, 
                  label = NULL, ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  local <- as.logical(local)
                  future <- SequentialFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, local = local, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }, b = function (expr, envir = parent.frame(), substitute = TRUE, 
                  lazy = FALSE, seed = NULL, globals = TRUE, persistent = FALSE, 
                  workers = availableWorkers(), user = NULL, revtunnel = TRUE, 
                  homogeneous = TRUE, gc = FALSE, earlySignal = FALSE, 
                  label = NULL, ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  future <- ClusterFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, persistent = persistent, 
                    workers = workers, user = user, revtunnel = revtunnel, 
                    homogeneous = homogeneous, gc = gc, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }), .cleanup = FALSE, .init = FALSE)
          }
          options(...future.oldOptions)
      })
      if (is.na(TRUE)) {
      }
      else {
          sink(type = "output", split = FALSE)
          if (TRUE) {
              ...future.result$stdout <- rawToChar(rawConnectionValue(...future.stdout))
          }
          else {
              ...future.result["stdout"] <- list(NULL)
          }
          close(...future.stdout)
          ...future.stdout <- NULL
      }
      ...future.result$conditions <- ...future.conditions
      ...future.result
  }
  plan(): Setting new future strategy stack:
  List of future strategies:
  1. cluster:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, persistent = FALSE, workers = availableWorkers(), user = NULL, revtunnel = TRUE, homogeneous = TRUE, gc = FALSE, earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: plan(list(a = strategy1, b = strategy2))
  
  plan(): nbrOfWorkers() = 2
  plan(): Setting new future strategy stack:
  List of future strategies:
  1. sequential:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: plan(list(a = strategy1, b = strategy2))
  2. cluster:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, persistent = FALSE, workers = availableWorkers(), user = NULL, revtunnel = TRUE, homogeneous = TRUE, gc = FALSE, earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: plan(list(a = strategy1, b = strategy2))
  
  plan(): nbrOfWorkers() = 1
  SequentialFuture started (and completed)
  [20:53:02.213] Chunk #1 of 1 ... DONE
  [20:53:02.214] Launching 1 futures (chunks) ... DONE
  [20:53:02.214] - resolving futures
  resolve() on list ...
   recursive: 0
   length: 1
  
   length: 0 (resolved future 1)
  resolve() on list ... DONE
  [20:53:02.216] - relaying conditions of futures
  List of 1
   $ b:function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, persistent = FALSE, workers = availableWorkers(), 
      user = NULL, revtunnel = TRUE, homogeneous = TRUE, gc = FALSE, earlySignal = FALSE, 
      label = NULL, ...)  
    ..- attr(*, "class")= chr [1:4] "cluster" "multiprocess" "future" "function"
    ..- attr(*, "init")= logi TRUE
    ..- attr(*, "call")= language plan(list(a = strategy1, b = strategy2))
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  List of 1
   $ :function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
      ...)  
    ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  List of 1
   $ :function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
      ...)  
    ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  List of 1
   $ :function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
      ...)  
    ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  List of 1
   $ b:function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, persistent = FALSE, workers = availableWorkers(), 
      user = NULL, revtunnel = TRUE, homogeneous = TRUE, gc = FALSE, earlySignal = FALSE, 
      label = NULL, ...)  
    ..- attr(*, "class")= chr [1:4] "cluster" "multiprocess" "future" "function"
    ..- attr(*, "init")= logi TRUE
    ..- attr(*, "call")= language plan(list(a = strategy1, b = strategy2))
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  List of 1
   $ :function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
      ...)  
    ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  List of 1
   $ :function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
      ...)  
    ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  List of 1
   $ :function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
      ...)  
    ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  Future state: 'finished'
  foreach() - level 2 ...
  [20:52:46.945] doFuture() ...
  [20:52:46.946] - dummy globals (as locals): [1] 'b'
  [20:52:46.947] - R expression:
  [20:52:46.948] {
  [20:52:46.948]     doFuture::registerDoFuture()
  [20:52:46.948]     lapply(seq_along(...future.x_ii), FUN = function(jj) {
  [20:52:46.948]         ...future.x_jj <- ...future.x_ii[[jj]]
  [20:52:46.948]         b <- NULL
  [20:52:46.948]         ...future.env <- environment()
  [20:52:46.948]         local({
  [20:52:46.948]             for (name in names(...future.x_jj)) {
  [20:52:46.948]                 assign(name, ...future.x_jj[[name]], envir = ...future.env, 
  [20:52:46.948]                   inherits = FALSE)
  [20:52:46.948]             }
  [20:52:46.948]         })
  [20:52:46.948]         tryCatch({
  [20:52:46.948]             plan_list <- future::plan()
  [20:52:46.948]             message(capture.output(print(plan_list)))
  [20:52:46.948]             stopifnot(inherits(plan_list, "future"), inherits(plan_list, 
  [20:52:46.948]                 getOption("future.default", "sequential")))
  [20:52:46.948]             plan_b <- future::plan("list")
  [20:52:46.948]             str(plan_b)
  [20:52:46.948]             stopifnot(inherits(plan_b[[1]], "future"), inherits(plan_b[[1]], 
  [20:52:46.948]                 getOption("future.default", "sequential")))
  [20:52:46.948]             list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
  [20:52:46.948]         }, error = identity)
  [20:52:46.948]     })
  [20:52:46.948] }
  [20:52:46.949] - identifying globals and packages ...
  getGlobalsAndPackages() ...
  Searching for globals...
  - globals found: [24] '{', '::', 'lapply', 'seq_along', '...future.x_ii', '<-', '[[', 'environment', 'local', 'for', 'names', 'assign', 'tryCatch', 'message', 'capture.output', 'print', 'stopifnot', 'inherits', 'getOption', 'str', 'list', 'a', 'plan_a', 'identity'
  Searching for globals ... DONE
  Resolving globals: FALSE
  The total size of the 3 globals is 64.51 KiB (66056 bytes)
  - globals: [3] '...future.x_ii', 'a', 'plan_a'
  - packages: [1] 'utils'
  getGlobalsAndPackages() ... DONE
  [20:52:46.988] List of 3
  [20:52:46.988]  $ ...future.x_ii: NULL
  [20:52:46.988]  $ a             : int 1
  [20:52:46.988]  $ plan_a        :List of 1
  [20:52:46.988]   ..$ b:function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
  [20:52:46.988]     seed = NULL, globals = TRUE, persistent = FALSE, workers = availableWorkers(), 
  [20:52:46.988]     user = NULL, revtunnel = TRUE, homogeneous = TRUE, gc = FALSE, earlySignal = FALSE, 
  [20:52:46.988]     label = NULL, ...)  
  [20:52:46.988]   .. ..- attr(*, "class")= chr [1:4] "cluster" "multiprocess" "future" "function"
  [20:52:46.988]   .. ..- attr(*, "init")= logi TRUE
  [20:52:46.988]   .. ..- attr(*, "call")= language plan(list(a = strategy1, b = strategy2))
  [20:52:46.988]   ..- attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  [20:52:46.988]  - attr(*, "where")=List of 3
  [20:52:46.988]   ..$ ...future.x_ii:<environment: 0x55a47da57600> 
  [20:52:46.988]   ..$ a             :<environment: 0x55a47e689cf0> 
  [20:52:46.988]   ..$ plan_a        :<environment: 0x55a47e689cf0> 
  [20:52:46.988]  - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list"
  [20:52:46.988]  - attr(*, "resolved")= logi FALSE
  [20:52:46.988]  - attr(*, "total_size")= num 66056
  [20:52:47.004]   - R expression:
  [20:52:47.004] {
  [20:52:47.004]     doFuture::registerDoFuture()
  [20:52:47.004]     lapply(seq_along(...future.x_ii), FUN = function(jj) {
  [20:52:47.004]         ...future.x_jj <- ...future.x_ii[[jj]]
  [20:52:47.004]         b <- NULL
  [20:52:47.004]         ...future.env <- environment()
  [20:52:47.004]         local({
  [20:52:47.004]             for (name in names(...future.x_jj)) {
  [20:52:47.004]                 assign(name, ...future.x_jj[[name]], envir = ...future.env, 
  [20:52:47.004]                   inherits = FALSE)
  [20:52:47.004]             }
  [20:52:47.004]         })
  [20:52:47.004]         tryCatch({
  [20:52:47.004]             plan_list <- future::plan()
  [20:52:47.004]             message(capture.output(print(plan_list)))
  [20:52:47.004]             stopifnot(inherits(plan_list, "future"), inherits(plan_list, 
  [20:52:47.004]                 getOption("future.default", "sequential")))
  [20:52:47.004]             plan_b <- future::plan("list")
  [20:52:47.004]             str(plan_b)
  [20:52:47.004]             stopifnot(inherits(plan_b[[1]], "future"), inherits(plan_b[[1]], 
  [20:52:47.004]                 getOption("future.default", "sequential")))
  [20:52:47.004]             list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
  [20:52:47.004]         }, error = identity)
  [20:52:47.004]     })
  [20:52:47.004] }
  [20:52:47.005]   - globals: [3] '...future.x_ii', 'a', 'plan_a'
  [20:52:47.006] List of 3
  [20:52:47.006]  $ ...future.x_ii: NULL
  [20:52:47.006]  $ a             : int 1
  [20:52:47.006]  $ plan_a        :List of 1
  [20:52:47.006]   ..$ b:function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
  [20:52:47.006]     seed = NULL, globals = TRUE, persistent = FALSE, workers = availableWorkers(), 
  [20:52:47.006]     user = NULL, revtunnel = TRUE, homogeneous = TRUE, gc = FALSE, earlySignal = FALSE, 
  [20:52:47.006]     label = NULL, ...)  
  [20:52:47.006]   .. ..- attr(*, "class")= chr [1:4] "cluster" "multiprocess" "future" "function"
  [20:52:47.006]   .. ..- attr(*, "init")= logi TRUE
  [20:52:47.006]   .. ..- attr(*, "call")= language plan(list(a = strategy1, b = strategy2))
  [20:52:47.006]   ..- attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  [20:52:47.006]  - attr(*, "where")=List of 3
  [20:52:47.006]   ..$ ...future.x_ii:<environment: 0x55a47da57600> 
  [20:52:47.006]   ..$ a             :<environment: 0x55a47e689cf0> 
  [20:52:47.006]   ..$ plan_a        :<environment: 0x55a47e689cf0> 
  [20:52:47.006]  - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list"
  [20:52:47.006]  - attr(*, "resolved")= logi FALSE
  [20:52:47.006]  - attr(*, "total_size")= num 66056
  [20:52:47.020]   - packages: [2] 'doFuture', 'utils'
  [20:52:47.020] - identifying globals and packages ... DONE
  [20:52:47.022] Number of chunks: 2
  [20:52:47.022] Number of futures (= number of chunks): 2
  [20:52:47.023] Launching 2 futures (chunks) ...
  [20:52:47.023] Chunk #1 of 2 ...
  [20:52:47.023]  - Finding globals in 'args_list' chunk #1 ...
  getGlobalsAndPackages() ...
  Searching for globals...
  
  Searching for globals ... DONE
  - globals: [0] <none>
  getGlobalsAndPackages() ... DONE
  [20:52:47.026] 
  [20:52:47.026] 
  [20:52:47.027]  - Finding globals in 'args_list' for chunk #1 ... DONE
  [local output] Workers: [n = 2] 'localhost', 'localhost'
  [local output] Base port: 11544
  [local output] Creating node 1 of 2 ...
  [local output] - setting up node
  Testing if worker's PID can be inferred: '/home/hornik/tmp/R.check/r-patched-gcc/Work/build/bin/Rscript -e 'try(cat(Sys.getpid(),file="/tmp/RtmpmhL62P/future.parent=10097.277154bc61fe.pid"), silent = TRUE)' -e "file.exists('/tmp/RtmpmhL62P/future.parent=10097.277154bc61fe.pid')"'
  - Possible to infer worker's PID: TRUE
  [local output] Starting worker #1 on 'localhost': '/home/hornik/tmp/R.check/r-patched-gcc/Work/build/bin/Rscript' --default-packages=datasets,utils,grDevices,graphics,stats,methods -e '#label=foreach,nested_dopar.R:10097:gimli:hornik' -e 'try(cat(Sys.getpid(),file="/tmp/RtmpmhL62P/future.parent=10097.277154bc61fe.pid"), silent = TRUE)' -e 'parallel:::.slaveRSOCK()' MASTER=localhost PORT=11544 OUT=/dev/null TIMEOUT=120 XDR=TRUE
  [local output] - Exit code of system() call: 0
  [local output] Waiting for worker #1 on 'localhost' to connect back
  [local output] Connection with worker #1 on 'localhost' established
  [local output] - collecting session information
  [local output] Creating node 1 of 2 ... done
  [local output] Creating node 2 of 2 ...
  [local output] - setting up node
  Testing if worker's PID can be inferred: '/home/hornik/tmp/R.check/r-patched-gcc/Work/build/bin/Rscript -e 'try(cat(Sys.getpid(),file="/tmp/RtmpmhL62P/future.parent=10097.27714bd08b73.pid"), silent = TRUE)' -e "file.exists('/tmp/RtmpmhL62P/future.parent=10097.27714bd08b73.pid')"'
  - Possible to infer worker's PID: TRUE
  [local output] Starting worker #2 on 'localhost': '/home/hornik/tmp/R.check/r-patched-gcc/Work/build/bin/Rscript' --default-packages=datasets,utils,grDevices,graphics,stats,methods -e '#label=foreach,nested_dopar.R:10097:gimli:hornik' -e 'try(cat(Sys.getpid(),file="/tmp/RtmpmhL62P/future.parent=10097.27714bd08b73.pid"), silent = TRUE)' -e 'parallel:::.slaveRSOCK()' MASTER=localhost PORT=11544 OUT=/dev/null TIMEOUT=120 XDR=TRUE
  [local output] - Exit code of system() call: 0
  [local output] Waiting for worker #2 on 'localhost' to connect back
  [local output] Connection with worker #2 on 'localhost' established
  [local output] - collecting session information
  [local output] Creating node 2 of 2 ... done
  getGlobalsAndPackages() ...
  - globals passed as-is: [3] '...future.x_ii', 'a', 'plan_a'
  Resolving globals: FALSE
  The total size of the 3 globals is 64.56 KiB (66112 bytes)
  - globals: [3] '...future.x_ii', 'a', 'plan_a'
  
  getGlobalsAndPackages() ... DONE
  Packages needed by future strategies (n = 0): <none>
  Packages needed by the future expression (n = 2): 'doFuture', 'utils'
  {
      {
          ...future.startTime <- Sys.time()
          ...future.oldOptions <- options(future.startup.loadScript = FALSE, 
              future.globals.onMissing = "ignore", future.globals.maxSize = NULL, 
              future.globals.method = NULL, future.globals.onMissing = "ignore", 
              future.globals.onReference = NULL, future.globals.resolve = NULL, 
              future.resolve.recursive = NULL, width = 80L)
          {
              {
                  {
                    has_future <- requireNamespace("future", quietly = TRUE)
                    version <- if (has_future) 
                      packageVersion("future")
                    else NULL
                    if (!has_future || version < "1.8.0") {
                      info <- c(r_version = gsub("R version ", 
                        "", R.version$version.string), platform = sprintf("%s (%s-bit)", 
                        R.version$platform, 8 * .Machine$sizeof.pointer), 
                        os = paste(Sys.info()[c("sysname", "release", 
                          "version")], collapse = " "), hostname = Sys.info()[["nodename"]])
                      info <- sprintf("%s: %s", names(info), info)
                      info <- paste(info, collapse = "; ")
                      if (!has_future) {
                        msg <- sprintf("Package 'future' is not installed on worker (%s)", 
                          info)
                      }
                      else {
                        msg <- sprintf("Package 'future' on worker (%s) must be of version >= 1.8.0: %s", 
                          info, version)
                      }
                      stop(msg)
                    }
                  }
                  local({
                    for (pkg in c("doFuture", "utils")) {
                      loadNamespace(pkg)
                      library(pkg, character.only = TRUE)
                    }
                  })
              }
              future::plan("default", .cleanup = FALSE, .init = FALSE)
          }
      }
      if (is.na(TRUE)) {
      }
      else {
          if (TRUE) {
              ...future.stdout <- rawConnection(raw(0L), open = "w")
          }
          else {
              ...future.stdout <- file(switch(.Platform$OS.type, 
                  windows = "NUL", "/dev/null"), open = "w")
          }
          sink(...future.stdout, type = "output", split = FALSE)
          on.exit(if (!is.null(...future.stdout)) {
              sink(type = "output", split = FALSE)
              close(...future.stdout)
          }, add = TRUE)
      }
      ...future.frame <- sys.nframe()
      ...future.conditions <- list()
      ...future.result <- tryCatch({
          withCallingHandlers({
              ...future.value <- local({
                  doFuture::registerDoFuture()
                  lapply(seq_along(...future.x_ii), FUN = function(jj) {
                    ...future.x_jj <- ...future.x_ii[[jj]]
                    b <- NULL
                    ...future.env <- environment()
                    local({
                      for (name in names(...future.x_jj)) {
                        assign(name, ...future.x_jj[[name]], envir = ...future.env, 
                          inherits = FALSE)
                      }
                    })
                    tryCatch({
                      plan_list <- future::plan()
                      message(capture.output(print(plan_list)))
                      stopifnot(inherits(plan_list, "future"), 
                        inherits(plan_list, getOption("future.default", 
                          "sequential")))
                      plan_b <- future::plan("list")
                      str(plan_b)
                      stopifnot(inherits(plan_b[[1]], "future"), 
                        inherits(plan_b[[1]], getOption("future.default", 
                          "sequential")))
                      list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
                    }, error = identity)
                  })
              })
              future::FutureResult(value = ...future.value, started = ...future.startTime, 
                  version = "1.8")
          }, condition = local({
              inherits <- base::inherits
              invokeRestart <- base::invokeRestart
              length <- base::length
              seq.int <- base::seq.int
              sys.calls <- base::sys.calls
              `[[` <- base::`[[`
              `+` <- base::`+`
              `<<-` <- base::`<<-`
              sysCalls <- function(calls = sys.calls(), from = 1L) {
                  calls[seq.int(from = from + 12L, to = length(calls) - 
                    3L)]
              }
              function(cond) {
                  if (inherits(cond, "error")) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond, calls = c(sysCalls(from = ...future.frame), 
                      cond$call), timestamp = base::Sys.time())
                    signalCondition(cond)
                  }
                  else if (inherits(cond, c("message", "warning"
                  ))) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond)
                    if (inherits(cond, "message")) {
                      invokeRestart("muffleMessage")
                    }
                    else if (inherits(cond, "warning")) {
                      invokeRestart("muffleWarning")
                    }
                  }
              }
          }))
      }, error = function(ex) {
          structure(list(value = NULL, conditions = ...future.conditions, 
              condition = ex, calls = sys.calls(), version = "1.8"), 
              class = "FutureResult")
      }, finally = {
          {
              NULL
              future::plan(list(b = function (expr, envir = parent.frame(), 
                  substitute = TRUE, lazy = FALSE, seed = NULL, 
                  globals = TRUE, persistent = FALSE, workers = availableWorkers(), 
                  user = NULL, revtunnel = TRUE, homogeneous = TRUE, 
                  gc = FALSE, earlySignal = FALSE, label = NULL, 
                  ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  future <- ClusterFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, persistent = persistent, 
                    workers = workers, user = user, revtunnel = revtunnel, 
                    homogeneous = homogeneous, gc = gc, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }), .cleanup = FALSE, .init = FALSE)
          }
          options(...future.oldOptions)
      })
      if (is.na(TRUE)) {
      }
      else {
          sink(type = "output", split = FALSE)
          if (TRUE) {
              ...future.result$stdout <- rawToChar(rawConnectionValue(...future.stdout))
          }
          else {
              ...future.result["stdout"] <- list(NULL)
          }
          close(...future.stdout)
          ...future.stdout <- NULL
      }
      ...future.result$conditions <- ...future.conditions
      ...future.result
  }
  Exporting 3 global objects (64.56 KiB) to cluster node #1 ...
  Exporting '...future.x_ii' (56 bytes) to cluster node #1 ...
  Exporting '...future.x_ii' (56 bytes) to cluster node #1 ... DONE
  Exporting 'a' (56 bytes) to cluster node #1 ...
  Exporting 'a' (56 bytes) to cluster node #1 ... DONE
  Exporting 'plan_a' (64.45 KiB) to cluster node #1 ...
  Exporting 'plan_a' (64.45 KiB) to cluster node #1 ... DONE
  Exporting 3 global objects (64.56 KiB) to cluster node #1 ... DONE
  ClusterFuture started
  [20:53:01.077] Chunk #1 of 2 ... DONE
  [20:53:01.078] Chunk #2 of 2 ...
  [20:53:01.078]  - Finding globals in 'args_list' chunk #2 ...
  getGlobalsAndPackages() ...
  Searching for globals...
  
  Searching for globals ... DONE
  - globals: [0] <none>
  getGlobalsAndPackages() ... DONE
  [20:53:01.081] 
  [20:53:01.082] 
  [20:53:01.083]  - Finding globals in 'args_list' for chunk #2 ... DONE
  getGlobalsAndPackages() ...
  - globals passed as-is: [3] '...future.x_ii', 'a', 'plan_a'
  Resolving globals: FALSE
  The total size of the 3 globals is 64.62 KiB (66168 bytes)
  - globals: [3] '...future.x_ii', 'a', 'plan_a'
  
  getGlobalsAndPackages() ... DONE
  Packages needed by future strategies (n = 0): <none>
  Packages needed by the future expression (n = 2): 'doFuture', 'utils'
  {
      {
          ...future.startTime <- Sys.time()
          ...future.oldOptions <- options(future.startup.loadScript = FALSE, 
              future.globals.onMissing = "ignore", future.globals.maxSize = NULL, 
              future.globals.method = NULL, future.globals.onMissing = "ignore", 
              future.globals.onReference = NULL, future.globals.resolve = NULL, 
              future.resolve.recursive = NULL, width = 80L)
          {
              {
                  {
                    has_future <- requireNamespace("future", quietly = TRUE)
                    version <- if (has_future) 
                      packageVersion("future")
                    else NULL
                    if (!has_future || version < "1.8.0") {
                      info <- c(r_version = gsub("R version ", 
                        "", R.version$version.string), platform = sprintf("%s (%s-bit)", 
                        R.version$platform, 8 * .Machine$sizeof.pointer), 
                        os = paste(Sys.info()[c("sysname", "release", 
                          "version")], collapse = " "), hostname = Sys.info()[["nodename"]])
                      info <- sprintf("%s: %s", names(info), info)
                      info <- paste(info, collapse = "; ")
                      if (!has_future) {
                        msg <- sprintf("Package 'future' is not installed on worker (%s)", 
                          info)
                      }
                      else {
                        msg <- sprintf("Package 'future' on worker (%s) must be of version >= 1.8.0: %s", 
                          info, version)
                      }
                      stop(msg)
                    }
                  }
                  local({
                    for (pkg in c("doFuture", "utils")) {
                      loadNamespace(pkg)
                      library(pkg, character.only = TRUE)
                    }
                  })
              }
              future::plan("default", .cleanup = FALSE, .init = FALSE)
          }
      }
      if (is.na(TRUE)) {
      }
      else {
          if (TRUE) {
              ...future.stdout <- rawConnection(raw(0L), open = "w")
          }
          else {
              ...future.stdout <- file(switch(.Platform$OS.type, 
                  windows = "NUL", "/dev/null"), open = "w")
          }
          sink(...future.stdout, type = "output", split = FALSE)
          on.exit(if (!is.null(...future.stdout)) {
              sink(type = "output", split = FALSE)
              close(...future.stdout)
          }, add = TRUE)
      }
      ...future.frame <- sys.nframe()
      ...future.conditions <- list()
      ...future.result <- tryCatch({
          withCallingHandlers({
              ...future.value <- local({
                  doFuture::registerDoFuture()
                  lapply(seq_along(...future.x_ii), FUN = function(jj) {
                    ...future.x_jj <- ...future.x_ii[[jj]]
                    b <- NULL
                    ...future.env <- environment()
                    local({
                      for (name in names(...future.x_jj)) {
                        assign(name, ...future.x_jj[[name]], envir = ...future.env, 
                          inherits = FALSE)
                      }
                    })
                    tryCatch({
                      plan_list <- future::plan()
                      message(capture.output(print(plan_list)))
                      stopifnot(inherits(plan_list, "future"), 
                        inherits(plan_list, getOption("future.default", 
                          "sequential")))
                      plan_b <- future::plan("list")
                      str(plan_b)
                      stopifnot(inherits(plan_b[[1]], "future"), 
                        inherits(plan_b[[1]], getOption("future.default", 
                          "sequential")))
                      list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
                    }, error = identity)
                  })
              })
              future::FutureResult(value = ...future.value, started = ...future.startTime, 
                  version = "1.8")
          }, condition = local({
              inherits <- base::inherits
              invokeRestart <- base::invokeRestart
              length <- base::length
              seq.int <- base::seq.int
              sys.calls <- base::sys.calls
              `[[` <- base::`[[`
              `+` <- base::`+`
              `<<-` <- base::`<<-`
              sysCalls <- function(calls = sys.calls(), from = 1L) {
                  calls[seq.int(from = from + 12L, to = length(calls) - 
                    3L)]
              }
              function(cond) {
                  if (inherits(cond, "error")) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond, calls = c(sysCalls(from = ...future.frame), 
                      cond$call), timestamp = base::Sys.time())
                    signalCondition(cond)
                  }
                  else if (inherits(cond, c("message", "warning"
                  ))) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond)
                    if (inherits(cond, "message")) {
                      invokeRestart("muffleMessage")
                    }
                    else if (inherits(cond, "warning")) {
                      invokeRestart("muffleWarning")
                    }
                  }
              }
          }))
      }, error = function(ex) {
          structure(list(value = NULL, conditions = ...future.conditions, 
              condition = ex, calls = sys.calls(), version = "1.8"), 
              class = "FutureResult")
      }, finally = {
          {
              NULL
              future::plan(list(b = function (expr, envir = parent.frame(), 
                  substitute = TRUE, lazy = FALSE, seed = NULL, 
                  globals = TRUE, persistent = FALSE, workers = availableWorkers(), 
                  user = NULL, revtunnel = TRUE, homogeneous = TRUE, 
                  gc = FALSE, earlySignal = FALSE, label = NULL, 
                  ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  future <- ClusterFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, persistent = persistent, 
                    workers = workers, user = user, revtunnel = revtunnel, 
                    homogeneous = homogeneous, gc = gc, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }), .cleanup = FALSE, .init = FALSE)
          }
          options(...future.oldOptions)
      })
      if (is.na(TRUE)) {
      }
      else {
          sink(type = "output", split = FALSE)
          if (TRUE) {
              ...future.result$stdout <- rawToChar(rawConnectionValue(...future.stdout))
          }
          else {
              ...future.result["stdout"] <- list(NULL)
          }
          close(...future.stdout)
          ...future.stdout <- NULL
      }
      ...future.result$conditions <- ...future.conditions
      ...future.result
  }
  Exporting 3 global objects (64.62 KiB) to cluster node #2 ...
  Exporting '...future.x_ii' (112 bytes) to cluster node #2 ...
  Exporting '...future.x_ii' (112 bytes) to cluster node #2 ... DONE
  Exporting 'a' (56 bytes) to cluster node #2 ...
  Exporting 'a' (56 bytes) to cluster node #2 ... DONE
  Exporting 'plan_a' (64.45 KiB) to cluster node #2 ...
  Exporting 'plan_a' (64.45 KiB) to cluster node #2 ... DONE
  Exporting 3 global objects (64.62 KiB) to cluster node #2 ... DONE
  ClusterFuture started
  [20:53:01.221] Chunk #2 of 2 ... DONE
  [20:53:01.222] Launching 2 futures (chunks) ... DONE
  [20:53:01.222] - resolving futures
  resolve() on list ...
   recursive: 0
   length: 2
  
   length: 1 (resolved future 1)
   length: 0 (resolved future 2)
  resolve() on list ... DONE
  [20:53:01.733] - relaying conditions of futures
  result() for ClusterFuture ...
  - Validating connection of ClusterFuture
  - class(result): FutureResult
  Future state: 'finished'
  result() for ClusterFuture ...
  - result already collected: FutureResult
  result() for ClusterFuture ... done
  sequential:- args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)- tweaked: FALSE- call: NULL
  result() for ClusterFuture ...
  - Validating connection of ClusterFuture
  - class(result): FutureResult
  Future state: 'finished'
  result() for ClusterFuture ...
  - result already collected: FutureResult
  result() for ClusterFuture ... done
  sequential:- args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)- tweaked: FALSE- call: NULL
  sequential:- args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)- tweaked: FALSE- call: NULL
  [20:53:01.742] - collecting values of futures
  result() for ClusterFuture ...
  - result already collected: FutureResult
  result() for ClusterFuture ... done
  result() for ClusterFuture ...
  - result already collected: FutureResult
  result() for ClusterFuture ... done
  [20:53:01.761] - accumulating results
  [20:53:01.763] - processing errors (handler = 'stop')
  [20:53:01.763] - extracting results
  [20:53:01.764] doFuture() ... DONE
  foreach() - level 2 ... DONE
  foreach() - level 2 ...
  [20:53:01.784] doFuture() ...
  [20:53:01.787] - dummy globals (as locals): [1] 'b'
  [20:53:01.788] - R expression:
  [20:53:01.789] {
  [20:53:01.789]     doFuture::registerDoFuture()
  [20:53:01.789]     lapply(seq_along(...future.x_ii), FUN = function(jj) {
  [20:53:01.789]         ...future.x_jj <- ...future.x_ii[[jj]]
  [20:53:01.789]         b <- NULL
  [20:53:01.789]         ...future.env <- environment()
  [20:53:01.789]         local({
  [20:53:01.789]             for (name in names(...future.x_jj)) {
  [20:53:01.789]                 assign(name, ...future.x_jj[[name]], envir = ...future.env, 
  [20:53:01.789]                   inherits = FALSE)
  [20:53:01.789]             }
  [20:53:01.789]         })
  [20:53:01.789]         tryCatch({
  [20:53:01.789]             plan_list <- future::plan()
  [20:53:01.789]             message(capture.output(print(plan_list)))
  [20:53:01.789]             stopifnot(inherits(plan_list, "future"), inherits(plan_list, 
  [20:53:01.789]                 getOption("future.default", "sequential")))
  [20:53:01.789]             plan_b <- future::plan("list")
  [20:53:01.789]             str(plan_b)
  [20:53:01.789]             stopifnot(inherits(plan_b[[1]], "future"), inherits(plan_b[[1]], 
  [20:53:01.789]                 getOption("future.default", "sequential")))
  [20:53:01.789]             list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
  [20:53:01.789]         }, error = identity)
  [20:53:01.789]     })
  [20:53:01.789] }
  [20:53:01.792] - identifying globals and packages ...
  getGlobalsAndPackages() ...
  Searching for globals...
  - globals found: [24] '{', '::', 'lapply', 'seq_along', '...future.x_ii', '<-', '[[', 'environment', 'local', 'for', 'names', 'assign', 'tryCatch', 'message', 'capture.output', 'print', 'stopifnot', 'inherits', 'getOption', 'str', 'list', 'a', 'plan_a', 'identity'
  Searching for globals ... DONE
  Resolving globals: FALSE
  The total size of the 3 globals is 64.51 KiB (66056 bytes)
  - globals: [3] '...future.x_ii', 'a', 'plan_a'
  - packages: [1] 'utils'
  getGlobalsAndPackages() ... DONE
  [20:53:01.830] List of 3
  [20:53:01.830]  $ ...future.x_ii: NULL
  [20:53:01.830]  $ a             : int 2
  [20:53:01.830]  $ plan_a        :List of 1
  [20:53:01.830]   ..$ b:function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
  [20:53:01.830]     seed = NULL, globals = TRUE, persistent = FALSE, workers = availableWorkers(), 
  [20:53:01.830]     user = NULL, revtunnel = TRUE, homogeneous = TRUE, gc = FALSE, earlySignal = FALSE, 
  [20:53:01.830]     label = NULL, ...)  
  [20:53:01.830]   .. ..- attr(*, "class")= chr [1:4] "cluster" "multiprocess" "future" "function"
  [20:53:01.830]   .. ..- attr(*, "init")= logi TRUE
  [20:53:01.830]   .. ..- attr(*, "call")= language plan(list(a = strategy1, b = strategy2))
  [20:53:01.830]   ..- attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  [20:53:01.830]  - attr(*, "where")=List of 3
  [20:53:01.830]   ..$ ...future.x_ii:<environment: 0x55a47fa73a78> 
  [20:53:01.830]   ..$ a             :<environment: 0x55a47fa77908> 
  [20:53:01.830]   ..$ plan_a        :<environment: 0x55a47fa77908> 
  [20:53:01.830]  - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list"
  [20:53:01.830]  - attr(*, "resolved")= logi FALSE
  [20:53:01.830]  - attr(*, "total_size")= num 66056
  [20:53:01.854]   - R expression:
  [20:53:01.855] {
  [20:53:01.855]     doFuture::registerDoFuture()
  [20:53:01.855]     lapply(seq_along(...future.x_ii), FUN = function(jj) {
  [20:53:01.855]         ...future.x_jj <- ...future.x_ii[[jj]]
  [20:53:01.855]         b <- NULL
  [20:53:01.855]         ...future.env <- environment()
  [20:53:01.855]         local({
  [20:53:01.855]             for (name in names(...future.x_jj)) {
  [20:53:01.855]                 assign(name, ...future.x_jj[[name]], envir = ...future.env, 
  [20:53:01.855]                   inherits = FALSE)
  [20:53:01.855]             }
  [20:53:01.855]         })
  [20:53:01.855]         tryCatch({
  [20:53:01.855]             plan_list <- future::plan()
  [20:53:01.855]             message(capture.output(print(plan_list)))
  [20:53:01.855]             stopifnot(inherits(plan_list, "future"), inherits(plan_list, 
  [20:53:01.855]                 getOption("future.default", "sequential")))
  [20:53:01.855]             plan_b <- future::plan("list")
  [20:53:01.855]             str(plan_b)
  [20:53:01.855]             stopifnot(inherits(plan_b[[1]], "future"), inherits(plan_b[[1]], 
  [20:53:01.855]                 getOption("future.default", "sequential")))
  [20:53:01.855]             list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
  [20:53:01.855]         }, error = identity)
  [20:53:01.855]     })
  [20:53:01.855] }
  [20:53:01.856]   - globals: [3] '...future.x_ii', 'a', 'plan_a'
  [20:53:01.857] List of 3
  [20:53:01.857]  $ ...future.x_ii: NULL
  [20:53:01.857]  $ a             : int 2
  [20:53:01.857]  $ plan_a        :List of 1
  [20:53:01.857]   ..$ b:function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
  [20:53:01.857]     seed = NULL, globals = TRUE, persistent = FALSE, workers = availableWorkers(), 
  [20:53:01.857]     user = NULL, revtunnel = TRUE, homogeneous = TRUE, gc = FALSE, earlySignal = FALSE, 
  [20:53:01.857]     label = NULL, ...)  
  [20:53:01.857]   .. ..- attr(*, "class")= chr [1:4] "cluster" "multiprocess" "future" "function"
  [20:53:01.857]   .. ..- attr(*, "init")= logi TRUE
  [20:53:01.857]   .. ..- attr(*, "call")= language plan(list(a = strategy1, b = strategy2))
  [20:53:01.857]   ..- attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  [20:53:01.857]  - attr(*, "where")=List of 3
  [20:53:01.857]   ..$ ...future.x_ii:<environment: 0x55a47fa73a78> 
  [20:53:01.857]   ..$ a             :<environment: 0x55a47fa77908> 
  [20:53:01.857]   ..$ plan_a        :<environment: 0x55a47fa77908> 
  [20:53:01.857]  - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list"
  [20:53:01.857]  - attr(*, "resolved")= logi FALSE
  [20:53:01.857]  - attr(*, "total_size")= num 66056
  [20:53:01.874]   - packages: [2] 'doFuture', 'utils'
  [20:53:01.874] - identifying globals and packages ... DONE
  [20:53:01.876] Number of chunks: 2
  [20:53:01.877] Number of futures (= number of chunks): 2
  [20:53:01.877] Launching 2 futures (chunks) ...
  [20:53:01.878] Chunk #1 of 2 ...
  [20:53:01.878]  - Finding globals in 'args_list' chunk #1 ...
  getGlobalsAndPackages() ...
  Searching for globals...
  
  Searching for globals ... DONE
  - globals: [0] <none>
  getGlobalsAndPackages() ... DONE
  [20:53:01.881] 
  [20:53:01.882] 
  [20:53:01.882]  - Finding globals in 'args_list' for chunk #1 ... DONE
  getGlobalsAndPackages() ...
  - globals passed as-is: [3] '...future.x_ii', 'a', 'plan_a'
  Resolving globals: FALSE
  The total size of the 3 globals is 64.56 KiB (66112 bytes)
  - globals: [3] '...future.x_ii', 'a', 'plan_a'
  
  getGlobalsAndPackages() ... DONE
  Packages needed by future strategies (n = 0): <none>
  Packages needed by the future expression (n = 2): 'doFuture', 'utils'
  {
      {
          ...future.startTime <- Sys.time()
          ...future.oldOptions <- options(future.startup.loadScript = FALSE, 
              future.globals.onMissing = "ignore", future.globals.maxSize = NULL, 
              future.globals.method = NULL, future.globals.onMissing = "ignore", 
              future.globals.onReference = NULL, future.globals.resolve = NULL, 
              future.resolve.recursive = NULL, width = 80L)
          {
              {
                  {
                    has_future <- requireNamespace("future", quietly = TRUE)
                    version <- if (has_future) 
                      packageVersion("future")
                    else NULL
                    if (!has_future || version < "1.8.0") {
                      info <- c(r_version = gsub("R version ", 
                        "", R.version$version.string), platform = sprintf("%s (%s-bit)", 
                        R.version$platform, 8 * .Machine$sizeof.pointer), 
                        os = paste(Sys.info()[c("sysname", "release", 
                          "version")], collapse = " "), hostname = Sys.info()[["nodename"]])
                      info <- sprintf("%s: %s", names(info), info)
                      info <- paste(info, collapse = "; ")
                      if (!has_future) {
                        msg <- sprintf("Package 'future' is not installed on worker (%s)", 
                          info)
                      }
                      else {
                        msg <- sprintf("Package 'future' on worker (%s) must be of version >= 1.8.0: %s", 
                          info, version)
                      }
                      stop(msg)
                    }
                  }
                  local({
                    for (pkg in c("doFuture", "utils")) {
                      loadNamespace(pkg)
                      library(pkg, character.only = TRUE)
                    }
                  })
              }
              future::plan("default", .cleanup = FALSE, .init = FALSE)
          }
      }
      if (is.na(TRUE)) {
      }
      else {
          if (TRUE) {
              ...future.stdout <- rawConnection(raw(0L), open = "w")
          }
          else {
              ...future.stdout <- file(switch(.Platform$OS.type, 
                  windows = "NUL", "/dev/null"), open = "w")
          }
          sink(...future.stdout, type = "output", split = FALSE)
          on.exit(if (!is.null(...future.stdout)) {
              sink(type = "output", split = FALSE)
              close(...future.stdout)
          }, add = TRUE)
      }
      ...future.frame <- sys.nframe()
      ...future.conditions <- list()
      ...future.result <- tryCatch({
          withCallingHandlers({
              ...future.value <- local({
                  doFuture::registerDoFuture()
                  lapply(seq_along(...future.x_ii), FUN = function(jj) {
                    ...future.x_jj <- ...future.x_ii[[jj]]
                    b <- NULL
                    ...future.env <- environment()
                    local({
                      for (name in names(...future.x_jj)) {
                        assign(name, ...future.x_jj[[name]], envir = ...future.env, 
                          inherits = FALSE)
                      }
                    })
                    tryCatch({
                      plan_list <- future::plan()
                      message(capture.output(print(plan_list)))
                      stopifnot(inherits(plan_list, "future"), 
                        inherits(plan_list, getOption("future.default", 
                          "sequential")))
                      plan_b <- future::plan("list")
                      str(plan_b)
                      stopifnot(inherits(plan_b[[1]], "future"), 
                        inherits(plan_b[[1]], getOption("future.default", 
                          "sequential")))
                      list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
                    }, error = identity)
                  })
              })
              future::FutureResult(value = ...future.value, started = ...future.startTime, 
                  version = "1.8")
          }, condition = local({
              inherits <- base::inherits
              invokeRestart <- base::invokeRestart
              length <- base::length
              seq.int <- base::seq.int
              sys.calls <- base::sys.calls
              `[[` <- base::`[[`
              `+` <- base::`+`
              `<<-` <- base::`<<-`
              sysCalls <- function(calls = sys.calls(), from = 1L) {
                  calls[seq.int(from = from + 12L, to = length(calls) - 
                    3L)]
              }
              function(cond) {
                  if (inherits(cond, "error")) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond, calls = c(sysCalls(from = ...future.frame), 
                      cond$call), timestamp = base::Sys.time())
                    signalCondition(cond)
                  }
                  else if (inherits(cond, c("message", "warning"
                  ))) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond)
                    if (inherits(cond, "message")) {
                      invokeRestart("muffleMessage")
                    }
                    else if (inherits(cond, "warning")) {
                      invokeRestart("muffleWarning")
                    }
                  }
              }
          }))
      }, error = function(ex) {
          structure(list(value = NULL, conditions = ...future.conditions, 
              condition = ex, calls = sys.calls(), version = "1.8"), 
              class = "FutureResult")
      }, finally = {
          {
              NULL
              future::plan(list(b = function (expr, envir = parent.frame(), 
                  substitute = TRUE, lazy = FALSE, seed = NULL, 
                  globals = TRUE, persistent = FALSE, workers = availableWorkers(), 
                  user = NULL, revtunnel = TRUE, homogeneous = TRUE, 
                  gc = FALSE, earlySignal = FALSE, label = NULL, 
                  ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  future <- ClusterFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, persistent = persistent, 
                    workers = workers, user = user, revtunnel = revtunnel, 
                    homogeneous = homogeneous, gc = gc, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }), .cleanup = FALSE, .init = FALSE)
          }
          options(...future.oldOptions)
      })
      if (is.na(TRUE)) {
      }
      else {
          sink(type = "output", split = FALSE)
          if (TRUE) {
              ...future.result$stdout <- rawToChar(rawConnectionValue(...future.stdout))
          }
          else {
              ...future.result["stdout"] <- list(NULL)
          }
          close(...future.stdout)
          ...future.stdout <- NULL
      }
      ...future.result$conditions <- ...future.conditions
      ...future.result
  }
  Exporting 3 global objects (64.56 KiB) to cluster node #1 ...
  Exporting '...future.x_ii' (56 bytes) to cluster node #1 ...
  Exporting '...future.x_ii' (56 bytes) to cluster node #1 ... DONE
  Exporting 'a' (56 bytes) to cluster node #1 ...
  Exporting 'a' (56 bytes) to cluster node #1 ... DONE
  Exporting 'plan_a' (64.45 KiB) to cluster node #1 ...
  Exporting 'plan_a' (64.45 KiB) to cluster node #1 ... DONE
  Exporting 3 global objects (64.56 KiB) to cluster node #1 ... DONE
  ClusterFuture started
  [20:53:01.969] Chunk #1 of 2 ... DONE
  [20:53:01.970] Chunk #2 of 2 ...
  [20:53:01.970]  - Finding globals in 'args_list' chunk #2 ...
  getGlobalsAndPackages() ...
  Searching for globals...
  
  Searching for globals ... DONE
  - globals: [0] <none>
  getGlobalsAndPackages() ... DONE
  [20:53:01.974] 
  [20:53:01.974] 
  [20:53:01.975]  - Finding globals in 'args_list' for chunk #2 ... DONE
  getGlobalsAndPackages() ...
  - globals passed as-is: [3] '...future.x_ii', 'a', 'plan_a'
  Resolving globals: FALSE
  The total size of the 3 globals is 64.62 KiB (66168 bytes)
  - globals: [3] '...future.x_ii', 'a', 'plan_a'
  
  getGlobalsAndPackages() ... DONE
  Packages needed by future strategies (n = 0): <none>
  Packages needed by the future expression (n = 2): 'doFuture', 'utils'
  {
      {
          ...future.startTime <- Sys.time()
          ...future.oldOptions <- options(future.startup.loadScript = FALSE, 
              future.globals.onMissing = "ignore", future.globals.maxSize = NULL, 
              future.globals.method = NULL, future.globals.onMissing = "ignore", 
              future.globals.onReference = NULL, future.globals.resolve = NULL, 
              future.resolve.recursive = NULL, width = 80L)
          {
              {
                  {
                    has_future <- requireNamespace("future", quietly = TRUE)
                    version <- if (has_future) 
                      packageVersion("future")
                    else NULL
                    if (!has_future || version < "1.8.0") {
                      info <- c(r_version = gsub("R version ", 
                        "", R.version$version.string), platform = sprintf("%s (%s-bit)", 
                        R.version$platform, 8 * .Machine$sizeof.pointer), 
                        os = paste(Sys.info()[c("sysname", "release", 
                          "version")], collapse = " "), hostname = Sys.info()[["nodename"]])
                      info <- sprintf("%s: %s", names(info), info)
                      info <- paste(info, collapse = "; ")
                      if (!has_future) {
                        msg <- sprintf("Package 'future' is not installed on worker (%s)", 
                          info)
                      }
                      else {
                        msg <- sprintf("Package 'future' on worker (%s) must be of version >= 1.8.0: %s", 
                          info, version)
                      }
                      stop(msg)
                    }
                  }
                  local({
                    for (pkg in c("doFuture", "utils")) {
                      loadNamespace(pkg)
                      library(pkg, character.only = TRUE)
                    }
                  })
              }
              future::plan("default", .cleanup = FALSE, .init = FALSE)
          }
      }
      if (is.na(TRUE)) {
      }
      else {
          if (TRUE) {
              ...future.stdout <- rawConnection(raw(0L), open = "w")
          }
          else {
              ...future.stdout <- file(switch(.Platform$OS.type, 
                  windows = "NUL", "/dev/null"), open = "w")
          }
          sink(...future.stdout, type = "output", split = FALSE)
          on.exit(if (!is.null(...future.stdout)) {
              sink(type = "output", split = FALSE)
              close(...future.stdout)
          }, add = TRUE)
      }
      ...future.frame <- sys.nframe()
      ...future.conditions <- list()
      ...future.result <- tryCatch({
          withCallingHandlers({
              ...future.value <- local({
                  doFuture::registerDoFuture()
                  lapply(seq_along(...future.x_ii), FUN = function(jj) {
                    ...future.x_jj <- ...future.x_ii[[jj]]
                    b <- NULL
                    ...future.env <- environment()
                    local({
                      for (name in names(...future.x_jj)) {
                        assign(name, ...future.x_jj[[name]], envir = ...future.env, 
                          inherits = FALSE)
                      }
                    })
                    tryCatch({
                      plan_list <- future::plan()
                      message(capture.output(print(plan_list)))
                      stopifnot(inherits(plan_list, "future"), 
                        inherits(plan_list, getOption("future.default", 
                          "sequential")))
                      plan_b <- future::plan("list")
                      str(plan_b)
                      stopifnot(inherits(plan_b[[1]], "future"), 
                        inherits(plan_b[[1]], getOption("future.default", 
                          "sequential")))
                      list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
                    }, error = identity)
                  })
              })
              future::FutureResult(value = ...future.value, started = ...future.startTime, 
                  version = "1.8")
          }, condition = local({
              inherits <- base::inherits
              invokeRestart <- base::invokeRestart
              length <- base::length
              seq.int <- base::seq.int
              sys.calls <- base::sys.calls
              `[[` <- base::`[[`
              `+` <- base::`+`
              `<<-` <- base::`<<-`
              sysCalls <- function(calls = sys.calls(), from = 1L) {
                  calls[seq.int(from = from + 12L, to = length(calls) - 
                    3L)]
              }
              function(cond) {
                  if (inherits(cond, "error")) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond, calls = c(sysCalls(from = ...future.frame), 
                      cond$call), timestamp = base::Sys.time())
                    signalCondition(cond)
                  }
                  else if (inherits(cond, c("message", "warning"
                  ))) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond)
                    if (inherits(cond, "message")) {
                      invokeRestart("muffleMessage")
                    }
                    else if (inherits(cond, "warning")) {
                      invokeRestart("muffleWarning")
                    }
                  }
              }
          }))
      }, error = function(ex) {
          structure(list(value = NULL, conditions = ...future.conditions, 
              condition = ex, calls = sys.calls(), version = "1.8"), 
              class = "FutureResult")
      }, finally = {
          {
              NULL
              future::plan(list(b = function (expr, envir = parent.frame(), 
                  substitute = TRUE, lazy = FALSE, seed = NULL, 
                  globals = TRUE, persistent = FALSE, workers = availableWorkers(), 
                  user = NULL, revtunnel = TRUE, homogeneous = TRUE, 
                  gc = FALSE, earlySignal = FALSE, label = NULL, 
                  ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  future <- ClusterFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, persistent = persistent, 
                    workers = workers, user = user, revtunnel = revtunnel, 
                    homogeneous = homogeneous, gc = gc, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }), .cleanup = FALSE, .init = FALSE)
          }
          options(...future.oldOptions)
      })
      if (is.na(TRUE)) {
      }
      else {
          sink(type = "output", split = FALSE)
          if (TRUE) {
              ...future.result$stdout <- rawToChar(rawConnectionValue(...future.stdout))
          }
          else {
              ...future.result["stdout"] <- list(NULL)
          }
          close(...future.stdout)
          ...future.stdout <- NULL
      }
      ...future.result$conditions <- ...future.conditions
      ...future.result
  }
  Exporting 3 global objects (64.62 KiB) to cluster node #2 ...
  Exporting '...future.x_ii' (112 bytes) to cluster node #2 ...
  Exporting '...future.x_ii' (112 bytes) to cluster node #2 ... DONE
  Exporting 'a' (56 bytes) to cluster node #2 ...
  Exporting 'a' (56 bytes) to cluster node #2 ... DONE
  Exporting 'plan_a' (64.45 KiB) to cluster node #2 ...
  Exporting 'plan_a' (64.45 KiB) to cluster node #2 ... DONE
  Exporting 3 global objects (64.62 KiB) to cluster node #2 ... DONE
  ClusterFuture started
  [20:53:02.101] Chunk #2 of 2 ... DONE
  [20:53:02.102] Launching 2 futures (chunks) ... DONE
  [20:53:02.102] - resolving futures
  resolve() on list ...
   recursive: 0
   length: 2
  
   length: 1 (resolved future 1)
   length: 0 (resolved future 2)
  resolve() on list ... DONE
  [20:53:02.158] - relaying conditions of futures
  result() for ClusterFuture ...
  - Validating connection of ClusterFuture
  - class(result): FutureResult
  Future state: 'finished'
  result() for ClusterFuture ...
  - result already collected: FutureResult
  result() for ClusterFuture ... done
  sequential:- args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)- tweaked: FALSE- call: NULL
  result() for ClusterFuture ...
  - Validating connection of ClusterFuture
  - class(result): FutureResult
  Future state: 'finished'
  result() for ClusterFuture ...
  - result already collected: FutureResult
  result() for ClusterFuture ... done
  sequential:- args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)- tweaked: FALSE- call: NULL
  sequential:- args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)- tweaked: FALSE- call: NULL
  [20:53:02.202] - collecting values of futures
  result() for ClusterFuture ...
  - result already collected: FutureResult
  result() for ClusterFuture ... done
  result() for ClusterFuture ...
  - result already collected: FutureResult
  result() for ClusterFuture ... done
  [20:53:02.204] - accumulating results
  [20:53:02.206] - processing errors (handler = 'stop')
  [20:53:02.206] - extracting results
  [20:53:02.206] doFuture() ... DONE
  foreach() - level 2 ... DONE
  [20:53:02.258] - collecting values of futures
  [20:53:02.259] - accumulating results
  [20:53:02.260] - processing errors (handler = 'stop')
  [20:53:02.260] - extracting results
  [20:53:02.261] doFuture() ... DONE
  foreach() - level 1 ... DONE
  - plan(list('sequential', 'cluster')) ... DONE
  - plan(list('multicore', 'sequential')) ...
  plan(): Setting new future strategy stack:
  List of future strategies:
  1. multicore:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, workers = availableCores(constraints = "multicore"), earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: plan(list(a = strategy1, b = strategy2))
  2. sequential:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: plan(list(a = strategy1, b = strategy2))
  
  plan(): nbrOfWorkers() = 2
  foreach() - level 1 ...
  [20:53:02.274] doFuture() ...
  [20:53:02.275] - dummy globals (as locals): [1] 'a'
  [20:53:02.277] - R expression:
  [20:53:02.277] {
  [20:53:02.277]     doFuture::registerDoFuture()
  [20:53:02.277]     lapply(seq_along(...future.x_ii), FUN = function(jj) {
  [20:53:02.277]         ...future.x_jj <- ...future.x_ii[[jj]]
  [20:53:02.277]         a <- NULL
  [20:53:02.277]         ...future.env <- environment()
  [20:53:02.277]         local({
  [20:53:02.277]             for (name in names(...future.x_jj)) {
  [20:53:02.277]                 assign(name, ...future.x_jj[[name]], envir = ...future.env, 
  [20:53:02.277]                   inherits = FALSE)
  [20:53:02.277]             }
  [20:53:02.277]         })
  [20:53:02.277]         tryCatch({
  [20:53:02.277]             plan_list <- future::plan()
  [20:53:02.277]             stopifnot(inherits(plan_list, strategy2))
  [20:53:02.277]             plan_a <- future::plan("list")
  [20:53:02.277]             str(plan_a)
  [20:53:02.277]             stopifnot(inherits(plan_a[[1]], strategy2))
  [20:53:02.277]             message("foreach() - level 2 ...")
  [20:53:02.277]             y <- foreach(b = bs, .export = c("a", "plan_a")) %dopar% 
  [20:53:02.277]                 {
  [20:53:02.277]                   plan_list <- future::plan()
  [20:53:02.277]                   message(capture.output(print(plan_list)))
  [20:53:02.277]                   stopifnot(inherits(plan_list, "future"), inherits(plan_list, 
  [20:53:02.277]                     getOption("future.default", "sequential")))
  [20:53:02.277]                   plan_b <- future::plan("list")
  [20:53:02.277]                   str(plan_b)
  [20:53:02.277]                   stopifnot(inherits(plan_b[[1]], "future"), 
  [20:53:02.277]                     inherits(plan_b[[1]], getOption("future.default", 
  [20:53:02.277]                       "sequential")))
  [20:53:02.277]                   list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
  [20:53:02.277]                 }
  [20:53:02.277]             message("foreach() - level 2 ... DONE")
  [20:53:02.277]             y
  [20:53:02.277]         }, error = identity)
  [20:53:02.277]     })
  [20:53:02.277] }
  [20:53:02.278] - identifying globals and packages ...
  getGlobalsAndPackages() ...
  Searching for globals...
  - globals found: [28] '{', '::', 'lapply', 'seq_along', '...future.x_ii', '<-', '[[', 'environment', 'local', 'for', 'names', 'assign', 'tryCatch', 'stopifnot', 'inherits', 'strategy2', 'str', 'message', '%dopar%', 'foreach', 'bs', 'c', 'capture.output', 'print', 'getOption', 'list', 'b', 'identity'
  Searching for globals ... DONE
  Resolving globals: FALSE
  The total size of the 3 globals is 184 bytes (184 bytes)
  - globals: [3] '...future.x_ii', 'strategy2', 'bs'
  - packages: [2] 'utils', 'foreach'
  getGlobalsAndPackages() ... DONE
  [20:53:02.351] List of 3
  [20:53:02.351]  $ ...future.x_ii: NULL
  [20:53:02.351]  $ strategy2     : chr "sequential"
  [20:53:02.351]  $ bs            : int [1:3] 3 2 1
  [20:53:02.351]  - attr(*, "where")=List of 3
  [20:53:02.351]   ..$ ...future.x_ii:<environment: 0x55a47e035d50> 
  [20:53:02.351]   ..$ strategy2     :<environment: R_GlobalEnv> 
  [20:53:02.351]   ..$ bs            :<environment: R_GlobalEnv> 
  [20:53:02.351]  - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list"
  [20:53:02.351]  - attr(*, "resolved")= logi FALSE
  [20:53:02.351]  - attr(*, "total_size")= num 184
  [20:53:02.363]   - R expression:
  [20:53:02.363] {
  [20:53:02.363]     doFuture::registerDoFuture()
  [20:53:02.363]     lapply(seq_along(...future.x_ii), FUN = function(jj) {
  [20:53:02.363]         ...future.x_jj <- ...future.x_ii[[jj]]
  [20:53:02.363]         a <- NULL
  [20:53:02.363]         ...future.env <- environment()
  [20:53:02.363]         local({
  [20:53:02.363]             for (name in names(...future.x_jj)) {
  [20:53:02.363]                 assign(name, ...future.x_jj[[name]], envir = ...future.env, 
  [20:53:02.363]                   inherits = FALSE)
  [20:53:02.363]             }
  [20:53:02.363]         })
  [20:53:02.363]         tryCatch({
  [20:53:02.363]             plan_list <- future::plan()
  [20:53:02.363]             stopifnot(inherits(plan_list, strategy2))
  [20:53:02.363]             plan_a <- future::plan("list")
  [20:53:02.363]             str(plan_a)
  [20:53:02.363]             stopifnot(inherits(plan_a[[1]], strategy2))
  [20:53:02.363]             message("foreach() - level 2 ...")
  [20:53:02.363]             y <- foreach(b = bs, .export = c("a", "plan_a")) %dopar% 
  [20:53:02.363]                 {
  [20:53:02.363]                   plan_list <- future::plan()
  [20:53:02.363]                   message(capture.output(print(plan_list)))
  [20:53:02.363]                   stopifnot(inherits(plan_list, "future"), inherits(plan_list, 
  [20:53:02.363]                     getOption("future.default", "sequential")))
  [20:53:02.363]                   plan_b <- future::plan("list")
  [20:53:02.363]                   str(plan_b)
  [20:53:02.363]                   stopifnot(inherits(plan_b[[1]], "future"), 
  [20:53:02.363]                     inherits(plan_b[[1]], getOption("future.default", 
  [20:53:02.363]                       "sequential")))
  [20:53:02.363]                   list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
  [20:53:02.363]                 }
  [20:53:02.363]             message("foreach() - level 2 ... DONE")
  [20:53:02.363]             y
  [20:53:02.363]         }, error = identity)
  [20:53:02.363]     })
  [20:53:02.363] }
  [20:53:02.364]   - globals: [3] '...future.x_ii', 'strategy2', 'bs'
  [20:53:02.365] List of 3
  [20:53:02.365]  $ ...future.x_ii: NULL
  [20:53:02.365]  $ strategy2     : chr "sequential"
  [20:53:02.365]  $ bs            : int [1:3] 3 2 1
  [20:53:02.365]  - attr(*, "where")=List of 3
  [20:53:02.365]   ..$ ...future.x_ii:<environment: 0x55a47e035d50> 
  [20:53:02.365]   ..$ strategy2     :<environment: R_GlobalEnv> 
  [20:53:02.365]   ..$ bs            :<environment: R_GlobalEnv> 
  [20:53:02.365]  - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list"
  [20:53:02.365]  - attr(*, "resolved")= logi FALSE
  [20:53:02.365]  - attr(*, "total_size")= num 184
  [20:53:02.376]   - packages: [3] 'doFuture', 'utils', 'foreach'
  [20:53:02.376] - identifying globals and packages ... DONE
  [20:53:02.378] Number of chunks: 2
  [20:53:02.378] Number of futures (= number of chunks): 2
  [20:53:02.378] Launching 2 futures (chunks) ...
  [20:53:02.379] Chunk #1 of 2 ...
  [20:53:02.379]  - Finding globals in 'args_list' chunk #1 ...
  getGlobalsAndPackages() ...
  Searching for globals...
  
  Searching for globals ... DONE
  - globals: [0] <none>
  getGlobalsAndPackages() ... DONE
  [20:53:02.382] 
  [20:53:02.382] 
  [20:53:02.383]  - Finding globals in 'args_list' for chunk #1 ... DONE
  getGlobalsAndPackages() ...
  - globals passed as-is: [3] '...future.x_ii', 'strategy2', 'bs'
  Resolving globals: FALSE
  The total size of the 3 globals is 240 bytes (240 bytes)
  - globals: [3] '...future.x_ii', 'strategy2', 'bs'
  
  getGlobalsAndPackages() ... DONE
  Packages needed by future strategies (n = 1): 'future'
  Packages needed by the future expression (n = 3): 'doFuture', 'utils', 'foreach'
  {
      {
          ...future.startTime <- Sys.time()
          ...future.oldOptions <- options(future.startup.loadScript = FALSE, 
              future.globals.onMissing = "ignore", future.globals.maxSize = NULL, 
              future.globals.method = NULL, future.globals.onMissing = "ignore", 
              future.globals.onReference = NULL, future.globals.resolve = NULL, 
              future.resolve.recursive = NULL, width = 80L)
          {
              {
                  {
                    {
                      has_future <- requireNamespace("future", 
                        quietly = TRUE)
                      version <- if (has_future) 
                        packageVersion("future")
                      else NULL
                      if (!has_future || version < "1.8.0") {
                        info <- c(r_version = gsub("R version ", 
                          "", R.version$version.string), platform = sprintf("%s (%s-bit)", 
                          R.version$platform, 8 * .Machine$sizeof.pointer), 
                          os = paste(Sys.info()[c("sysname", "release", 
                            "version")], collapse = " "), hostname = Sys.info()[["nodename"]])
                        info <- sprintf("%s: %s", names(info), 
                          info)
                        info <- paste(info, collapse = "; ")
                        if (!has_future) {
                          msg <- sprintf("Package 'future' is not installed on worker (%s)", 
                            info)
                        }
                        else {
                          msg <- sprintf("Package 'future' on worker (%s) must be of version >= 1.8.0: %s", 
                            info, version)
                        }
                        stop(msg)
                      }
                    }
                    ...future.mc.cores.old <- getOption("mc.cores")
                    options(mc.cores = 1L)
                  }
                  local({
                    for (pkg in c("future", "doFuture", "utils", 
                    "foreach")) {
                      loadNamespace(pkg)
                      library(pkg, character.only = TRUE)
                    }
                  })
              }
              future::plan(list(b = function (expr, envir = parent.frame(), 
                  substitute = TRUE, lazy = FALSE, seed = NULL, 
                  globals = TRUE, local = TRUE, earlySignal = FALSE, 
                  label = NULL, ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  local <- as.logical(local)
                  future <- SequentialFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, local = local, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }), .cleanup = FALSE, .init = FALSE)
          }
      }
      if (is.na(TRUE)) {
      }
      else {
          if (TRUE) {
              ...future.stdout <- rawConnection(raw(0L), open = "w")
          }
          else {
              ...future.stdout <- file(switch(.Platform$OS.type, 
                  windows = "NUL", "/dev/null"), open = "w")
          }
          sink(...future.stdout, type = "output", split = FALSE)
          on.exit(if (!is.null(...future.stdout)) {
              sink(type = "output", split = FALSE)
              close(...future.stdout)
          }, add = TRUE)
      }
      ...future.frame <- sys.nframe()
      ...future.conditions <- list()
      ...future.result <- tryCatch({
          withCallingHandlers({
              ...future.value <- local({
                  doFuture::registerDoFuture()
                  lapply(seq_along(...future.x_ii), FUN = function(jj) {
                    ...future.x_jj <- ...future.x_ii[[jj]]
                    a <- NULL
                    ...future.env <- environment()
                    local({
                      for (name in names(...future.x_jj)) {
                        assign(name, ...future.x_jj[[name]], envir = ...future.env, 
                          inherits = FALSE)
                      }
                    })
                    tryCatch({
                      plan_list <- future::plan()
                      stopifnot(inherits(plan_list, strategy2))
                      plan_a <- future::plan("list")
                      str(plan_a)
                      stopifnot(inherits(plan_a[[1]], strategy2))
                      message("foreach() - level 2 ...")
                      y <- foreach(b = bs, .export = c("a", "plan_a")) %dopar% 
                        {
                          plan_list <- future::plan()
                          message(capture.output(print(plan_list)))
                          stopifnot(inherits(plan_list, "future"), 
                            inherits(plan_list, getOption("future.default", 
                              "sequential")))
                          plan_b <- future::plan("list")
                          str(plan_b)
                          stopifnot(inherits(plan_b[[1]], "future"), 
                            inherits(plan_b[[1]], getOption("future.default", 
                              "sequential")))
                          list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
                        }
                      message("foreach() - level 2 ... DONE")
                      y
                    }, error = identity)
                  })
              })
              future::FutureResult(value = ...future.value, started = ...future.startTime, 
                  version = "1.8")
          }, condition = local({
              inherits <- base::inherits
              invokeRestart <- base::invokeRestart
              length <- base::length
              seq.int <- base::seq.int
              sys.calls <- base::sys.calls
              `[[` <- base::`[[`
              `+` <- base::`+`
              `<<-` <- base::`<<-`
              sysCalls <- function(calls = sys.calls(), from = 1L) {
                  calls[seq.int(from = from + 12L, to = length(calls) - 
                    3L)]
              }
              function(cond) {
                  if (inherits(cond, "error")) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond, calls = c(sysCalls(from = ...future.frame), 
                      cond$call), timestamp = base::Sys.time())
                    signalCondition(cond)
                  }
                  else if (inherits(cond, c("message", "warning"
                  ))) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond)
                    if (inherits(cond, "message")) {
                      invokeRestart("muffleMessage")
                    }
                    else if (inherits(cond, "warning")) {
                      invokeRestart("muffleWarning")
                    }
                  }
              }
          }))
      }, error = function(ex) {
          structure(list(value = NULL, conditions = ...future.conditions, 
              condition = ex, calls = sys.calls(), version = "1.8"), 
              class = "FutureResult")
      }, finally = {
          {
              {
                  options(mc.cores = ...future.mc.cores.old)
              }
              future::plan(list(a = function (expr, envir = parent.frame(), 
                  substitute = TRUE, lazy = FALSE, seed = NULL, 
                  globals = TRUE, workers = availableCores(constraints = "multicore"), 
                  earlySignal = FALSE, label = NULL, ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  if (is.function(workers)) 
                    workers <- workers()
                  workers <- as.integer(workers)
                  stop_if_not(is.finite(workers), workers >= 1L)
                  if (workers == 1L || !supportsMulticore()) {
                    return(sequential(expr, envir = envir, substitute = FALSE, 
                      lazy = lazy, seed = seed, globals = globals, 
                      local = TRUE, label = label, ...))
                  }
                  oopts <- options(mc.cores = workers)
                  on.exit(options(oopts))
                  future <- MulticoreFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, workers = workers, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }, b = function (expr, envir = parent.frame(), substitute = TRUE, 
                  lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, 
                  earlySignal = FALSE, label = NULL, ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  local <- as.logical(local)
                  future <- SequentialFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, local = local, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }), .cleanup = FALSE, .init = FALSE)
          }
          options(...future.oldOptions)
      })
      if (is.na(TRUE)) {
      }
      else {
          sink(type = "output", split = FALSE)
          if (TRUE) {
              ...future.result$stdout <- rawToChar(rawConnectionValue(...future.stdout))
          }
          else {
              ...future.result["stdout"] <- list(NULL)
          }
          close(...future.stdout)
          ...future.stdout <- NULL
      }
      ...future.result$conditions <- ...future.conditions
      ...future.result
  }
  requestCore(): workers = 2
  MulticoreFuture started
  [20:53:02.413] Chunk #1 of 2 ... DONE
  [20:53:02.414] Chunk #2 of 2 ...
  [20:53:02.414]  - Finding globals in 'args_list' chunk #2 ...
  getGlobalsAndPackages() ...
  Searching for globals...
  
  Searching for globals ... DONE
  - globals: [0] <none>
  getGlobalsAndPackages() ... DONE
  [20:53:02.418] 
  [20:53:02.419] 
  [20:53:02.419]  - Finding globals in 'args_list' for chunk #2 ... DONE
  getGlobalsAndPackages() ...
  - globals passed as-is: [3] '...future.x_ii', 'strategy2', 'bs'
  Resolving globals: FALSE
  plan(): Setting new future strategy stack:
  List of future strategies:
  1. sequential:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: plan(list(a = strategy1, b = strategy2))
  
  The total size of the 3 globals is 240 bytes (240 bytes)
  plan(): nbrOfWorkers() = 1
  - globals: [3] '...future.x_ii', 'strategy2', 'bs'
  
  getGlobalsAndPackages() ... DONE
  Packages needed by future strategies (n = 1): 'future'
  Packages needed by the future expression (n = 3): 'doFuture', 'utils', 'foreach'
  {
      {
          ...future.startTime <- Sys.time()
          ...future.oldOptions <- options(future.startup.loadScript = FALSE, 
              future.globals.onMissing = "ignore", future.globals.maxSize = NULL, 
              future.globals.method = NULL, future.globals.onMissing = "ignore", 
              future.globals.onReference = NULL, future.globals.resolve = NULL, 
              future.resolve.recursive = NULL, width = 80L)
          {
              {
                  {
                    {
                      has_future <- requireNamespace("future", 
                        quietly = TRUE)
                      version <- if (has_future) 
                        packageVersion("future")
                      else NULL
                      if (!has_future || version < "1.8.0") {
                        info <- c(r_version = gsub("R version ", 
                          "", R.version$version.string), platform = sprintf("%s (%s-bit)", 
                          R.version$platform, 8 * .Machine$sizeof.pointer), 
                          os = paste(Sys.info()[c("sysname", "release", 
                            "version")], collapse = " "), hostname = Sys.info()[["nodename"]])
                        info <- sprintf("%s: %s", names(info), 
                          info)
                        info <- paste(info, collapse = "; ")
                        if (!has_future) {
                          msg <- sprintf("Package 'future' is not installed on worker (%s)", 
                            info)
                        }
                        else {
                          msg <- sprintf("Package 'future' on worker (%s) must be of version >= 1.8.0: %s", 
                            info, version)
                        }
                        stop(msg)
                      }
                    }
                    ...future.mc.cores.old <- getOption("mc.cores")
                    options(mc.cores = 1L)
                  }
                  local({
                    for (pkg in c("future", "doFuture", "utils", 
                    "foreach")) {
                      loadNamespace(pkg)
                      library(pkg, character.only = TRUE)
                    }
                  })
              }
              future::plan(list(b = function (expr, envir = parent.frame(), 
                  substitute = TRUE, lazy = FALSE, seed = NULL, 
                  globals = TRUE, local = TRUE, earlySignal = FALSE, 
                  label = NULL, ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  local <- as.logical(local)
                  future <- SequentialFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, local = local, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }), .cleanup = FALSE, .init = FALSE)
          }
      }
      if (is.na(TRUE)) {
      }
      else {
          if (TRUE) {
              ...future.stdout <- rawConnection(raw(0L), open = "w")
          }
          else {
              ...future.stdout <- file(switch(.Platform$OS.type, 
                  windows = "NUL", "/dev/null"), open = "w")
          }
          sink(...future.stdout, type = "output", split = FALSE)
          on.exit(if (!is.null(...future.stdout)) {
              sink(type = "output", split = FALSE)
              close(...future.stdout)
          }, add = TRUE)
      }
      ...future.frame <- sys.nframe()
      ...future.conditions <- list()
      ...future.result <- tryCatch({
          withCallingHandlers({
              ...future.value <- local({
                  doFuture::registerDoFuture()
                  lapply(seq_along(...future.x_ii), FUN = function(jj) {
                    ...future.x_jj <- ...future.x_ii[[jj]]
                    a <- NULL
                    ...future.env <- environment()
                    local({
                      for (name in names(...future.x_jj)) {
                        assign(name, ...future.x_jj[[name]], envir = ...future.env, 
                          inherits = FALSE)
                      }
                    })
                    tryCatch({
                      plan_list <- future::plan()
                      stopifnot(inherits(plan_list, strategy2))
                      plan_a <- future::plan("list")
                      str(plan_a)
                      stopifnot(inherits(plan_a[[1]], strategy2))
                      message("foreach() - level 2 ...")
                      y <- foreach(b = bs, .export = c("a", "plan_a")) %dopar% 
                        {
                          plan_list <- future::plan()
                          message(capture.output(print(plan_list)))
                          stopifnot(inherits(plan_list, "future"), 
                            inherits(plan_list, getOption("future.default", 
                              "sequential")))
                          plan_b <- future::plan("list")
                          str(plan_b)
                          stopifnot(inherits(plan_b[[1]], "future"), 
                            inherits(plan_b[[1]], getOption("future.default", 
                              "sequential")))
                          list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
                        }
                      message("foreach() - level 2 ... DONE")
                      y
                    }, error = identity)
                  })
              })
              future::FutureResult(value = ...future.value, started = ...future.startTime, 
                  version = "1.8")
          }, condition = local({
              inherits <- base::inherits
              invokeRestart <- base::invokeRestart
              length <- base::length
              seq.int <- base::seq.int
              sys.calls <- base::sys.calls
              `[[` <- base::`[[`
              `+` <- base::`+`
              `<<-` <- base::`<<-`
              sysCalls <- function(calls = sys.calls(), from = 1L) {
                  calls[seq.int(from = from + 12L, to = length(calls) - 
                    3L)]
              }
              function(cond) {
                  if (inherits(cond, "error")) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond, calls = c(sysCalls(from = ...future.frame), 
                      cond$call), timestamp = base::Sys.time())
                    signalCondition(cond)
                  }
                  else if (inherits(cond, c("message", "warning"
                  ))) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond)
                    if (inherits(cond, "message")) {
                      invokeRestart("muffleMessage")
                    }
                    else if (inherits(cond, "warning")) {
                      invokeRestart("muffleWarning")
                    }
                  }
              }
          }))
      }, error = function(ex) {
          structure(list(value = NULL, conditions = ...future.conditions, 
              condition = ex, calls = sys.calls(), version = "1.8"), 
              class = "FutureResult")
      }, finally = {
          {
              {
                  options(mc.cores = ...future.mc.cores.old)
              }
              future::plan(list(a = function (expr, envir = parent.frame(), 
                  substitute = TRUE, lazy = FALSE, seed = NULL, 
                  globals = TRUE, workers = availableCores(constraints = "multicore"), 
                  earlySignal = FALSE, label = NULL, ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  if (is.function(workers)) 
                    workers <- workers()
                  workers <- as.integer(workers)
                  stop_if_not(is.finite(workers), workers >= 1L)
                  if (workers == 1L || !supportsMulticore()) {
                    return(sequential(expr, envir = envir, substitute = FALSE, 
                      lazy = lazy, seed = seed, globals = globals, 
                      local = TRUE, label = label, ...))
                  }
                  oopts <- options(mc.cores = workers)
                  on.exit(options(oopts))
                  future <- MulticoreFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, workers = workers, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }, b = function (expr, envir = parent.frame(), substitute = TRUE, 
                  lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, 
                  earlySignal = FALSE, label = NULL, ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  local <- as.logical(local)
                  future <- SequentialFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, local = local, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }), .cleanup = FALSE, .init = FALSE)
          }
          options(...future.oldOptions)
      })
      if (is.na(TRUE)) {
      }
      else {
          sink(type = "output", split = FALSE)
          if (TRUE) {
              ...future.result$stdout <- rawToChar(rawConnectionValue(...future.stdout))
          }
          else {
              ...future.result["stdout"] <- list(NULL)
          }
          close(...future.stdout)
          ...future.stdout <- NULL
      }
      ...future.result$conditions <- ...future.conditions
      ...future.result
  }
  requestCore(): workers = 2
  MulticoreFuture started
  [20:53:02.445] Chunk #2 of 2 ... DONE
  [20:53:02.446] Launching 2 futures (chunks) ... DONE
  [20:53:02.446] - resolving futures
  resolve() on list ...
   recursive: 0
   length: 2
  
  plan(): Setting new future strategy stack:
  List of future strategies:
  1. sequential:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: plan(list(a = strategy1, b = strategy2))
  
  plan(): nbrOfWorkers() = 1
  plan(): Setting new future strategy stack:
  List of future strategies:
  1. multicore:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, workers = availableCores(constraints = "multicore"), earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: plan(list(a = strategy1, b = strategy2))
  2. sequential:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: plan(list(a = strategy1, b = strategy2))
  
  plan(): nbrOfWorkers() = 2
   length: 1 (resolved future 1)
  plan(): Setting new future strategy stack:
  List of future strategies:
  1. multicore:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, workers = availableCores(constraints = "multicore"), earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: plan(list(a = strategy1, b = strategy2))
  2. sequential:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: plan(list(a = strategy1, b = strategy2))
  
  plan(): nbrOfWorkers() = 2
   length: 0 (resolved future 2)
  resolve() on list ... DONE
  [20:53:02.707] - relaying conditions of futures
  List of 1
   $ b:function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
      ...)  
    ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
    ..- attr(*, "call")= language plan(list(a = strategy1, b = strategy2))
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  List of 1
   $ :function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
      ...)  
    ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  List of 1
   $ :function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
      ...)  
    ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  List of 1
   $ :function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
      ...)  
    ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  Future state: 'finished'
  foreach() - level 2 ...
  [20:53:02.431] doFuture() ...
  [20:53:02.434] - dummy globals (as locals): [1] 'b'
  [20:53:02.435] - R expression:
  [20:53:02.436] {
  [20:53:02.436]     doFuture::registerDoFuture()
  [20:53:02.436]     lapply(seq_along(...future.x_ii), FUN = function(jj) {
  [20:53:02.436]         ...future.x_jj <- ...future.x_ii[[jj]]
  [20:53:02.436]         b <- NULL
  [20:53:02.436]         ...future.env <- environment()
  [20:53:02.436]         local({
  [20:53:02.436]             for (name in names(...future.x_jj)) {
  [20:53:02.436]                 assign(name, ...future.x_jj[[name]], envir = ...future.env, 
  [20:53:02.436]                   inherits = FALSE)
  [20:53:02.436]             }
  [20:53:02.436]         })
  [20:53:02.436]         tryCatch({
  [20:53:02.436]             plan_list <- future::plan()
  [20:53:02.436]             message(capture.output(print(plan_list)))
  [20:53:02.436]             stopifnot(inherits(plan_list, "future"), inherits(plan_list, 
  [20:53:02.436]                 getOption("future.default", "sequential")))
  [20:53:02.436]             plan_b <- future::plan("list")
  [20:53:02.436]             str(plan_b)
  [20:53:02.436]             stopifnot(inherits(plan_b[[1]], "future"), inherits(plan_b[[1]], 
  [20:53:02.436]                 getOption("future.default", "sequential")))
  [20:53:02.436]             list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
  [20:53:02.436]         }, error = identity)
  [20:53:02.436]     })
  [20:53:02.436] }
  [20:53:02.437] - identifying globals and packages ...
  getGlobalsAndPackages() ...
  Searching for globals...
  - globals found: [24] '{', '::', 'lapply', 'seq_along', '...future.x_ii', '<-', '[[', 'environment', 'local', 'for', 'names', 'assign', 'tryCatch', 'message', 'capture.output', 'print', 'stopifnot', 'inherits', 'getOption', 'str', 'list', 'a', 'plan_a', 'identity'
  Searching for globals ... DONE
  Resolving globals: FALSE
  The total size of the 3 globals is 39.67 KiB (40624 bytes)
  - globals: [3] '...future.x_ii', 'a', 'plan_a'
  - packages: [1] 'utils'
  getGlobalsAndPackages() ... DONE
  [20:53:02.497] List of 3
  [20:53:02.497]  $ ...future.x_ii: NULL
  [20:53:02.497]  $ a             : int 1
  [20:53:02.497]  $ plan_a        :List of 1
  [20:53:02.497]   ..$ b:function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
  [20:53:02.497]     seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
  [20:53:02.497]     ...)  
  [20:53:02.497]   .. ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
  [20:53:02.497]   .. ..- attr(*, "call")= language plan(list(a = strategy1, b = strategy2))
  [20:53:02.497]   ..- attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  [20:53:02.497]  - attr(*, "where")=List of 3
  [20:53:02.497]   ..$ ...future.x_ii:<environment: 0x55a47eb73cf8> 
  [20:53:02.497]   ..$ a             :<environment: 0x55a47e0b8b18> 
  [20:53:02.497]   ..$ plan_a        :<environment: 0x55a47e0b8b18> 
  [20:53:02.497]  - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list"
  [20:53:02.497]  - attr(*, "resolved")= logi FALSE
  [20:53:02.497]  - attr(*, "total_size")= num 40624
  [20:53:02.512]   - R expression:
  [20:53:02.512] {
  [20:53:02.512]     doFuture::registerDoFuture()
  [20:53:02.512]     lapply(seq_along(...future.x_ii), FUN = function(jj) {
  [20:53:02.512]         ...future.x_jj <- ...future.x_ii[[jj]]
  [20:53:02.512]         b <- NULL
  [20:53:02.512]         ...future.env <- environment()
  [20:53:02.512]         local({
  [20:53:02.512]             for (name in names(...future.x_jj)) {
  [20:53:02.512]                 assign(name, ...future.x_jj[[name]], envir = ...future.env, 
  [20:53:02.512]                   inherits = FALSE)
  [20:53:02.512]             }
  [20:53:02.512]         })
  [20:53:02.512]         tryCatch({
  [20:53:02.512]             plan_list <- future::plan()
  [20:53:02.512]             message(capture.output(print(plan_list)))
  [20:53:02.512]             stopifnot(inherits(plan_list, "future"), inherits(plan_list, 
  [20:53:02.512]                 getOption("future.default", "sequential")))
  [20:53:02.512]             plan_b <- future::plan("list")
  [20:53:02.512]             str(plan_b)
  [20:53:02.512]             stopifnot(inherits(plan_b[[1]], "future"), inherits(plan_b[[1]], 
  [20:53:02.512]                 getOption("future.default", "sequential")))
  [20:53:02.512]             list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
  [20:53:02.512]         }, error = identity)
  [20:53:02.512]     })
  [20:53:02.512] }
  [20:53:02.513]   - globals: [3] '...future.x_ii', 'a', 'plan_a'
  [20:53:02.514] List of 3
  [20:53:02.514]  $ ...future.x_ii: NULL
  [20:53:02.514]  $ a             : int 1
  [20:53:02.514]  $ plan_a        :List of 1
  [20:53:02.514]   ..$ b:function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
  [20:53:02.514]     seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
  [20:53:02.514]     ...)  
  [20:53:02.514]   .. ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
  [20:53:02.514]   .. ..- attr(*, "call")= language plan(list(a = strategy1, b = strategy2))
  [20:53:02.514]   ..- attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  [20:53:02.514]  - attr(*, "where")=List of 3
  [20:53:02.514]   ..$ ...future.x_ii:<environment: 0x55a47eb73cf8> 
  [20:53:02.514]   ..$ a             :<environment: 0x55a47e0b8b18> 
  [20:53:02.514]   ..$ plan_a        :<environment: 0x55a47e0b8b18> 
  [20:53:02.514]  - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list"
  [20:53:02.514]  - attr(*, "resolved")= logi FALSE
  [20:53:02.514]  - attr(*, "total_size")= num 40624
  [20:53:02.528]   - packages: [2] 'doFuture', 'utils'
  [20:53:02.529] - identifying globals and packages ... DONE
  [20:53:02.529] Number of chunks: 1
  [20:53:02.530] Number of futures (= number of chunks): 1
  [20:53:02.530] Launching 1 futures (chunks) ...
  [20:53:02.531] Chunk #1 of 1 ...
  [20:53:02.531]  - Finding globals in 'args_list' chunk #1 ...
  getGlobalsAndPackages() ...
  Searching for globals...
  
  Searching for globals ... DONE
  - globals: [0] <none>
  getGlobalsAndPackages() ... DONE
  [20:53:02.534] 
  [20:53:02.535] 
  [20:53:02.535]  - Finding globals in 'args_list' for chunk #1 ... DONE
  getGlobalsAndPackages() ...
  - globals passed as-is: [3] '...future.x_ii', 'a', 'plan_a'
  Resolving globals: FALSE
  The total size of the 3 globals is 39.84 KiB (40792 bytes)
  - globals: [3] '...future.x_ii', 'a', 'plan_a'
  
  getGlobalsAndPackages() ... DONE
  Packages needed by future strategies (n = 0): <none>
  Packages needed by the future expression (n = 2): 'doFuture', 'utils'
  {
      {
          ...future.startTime <- Sys.time()
          ...future.oldOptions <- options(future.startup.loadScript = FALSE, 
              future.globals.onMissing = "ignore", future.globals.maxSize = NULL, 
              future.globals.method = NULL, future.globals.onMissing = "ignore", 
              future.globals.onReference = NULL, future.globals.resolve = NULL, 
              future.resolve.recursive = NULL, width = 80L)
          {
              {
                  {
                    has_future <- requireNamespace("future", quietly = TRUE)
                    version <- if (has_future) 
                      packageVersion("future")
                    else NULL
                    if (!has_future || version < "1.8.0") {
                      info <- c(r_version = gsub("R version ", 
                        "", R.version$version.string), platform = sprintf("%s (%s-bit)", 
                        R.version$platform, 8 * .Machine$sizeof.pointer), 
                        os = paste(Sys.info()[c("sysname", "release", 
                          "version")], collapse = " "), hostname = Sys.info()[["nodename"]])
                      info <- sprintf("%s: %s", names(info), info)
                      info <- paste(info, collapse = "; ")
                      if (!has_future) {
                        msg <- sprintf("Package 'future' is not installed on worker (%s)", 
                          info)
                      }
                      else {
                        msg <- sprintf("Package 'future' on worker (%s) must be of version >= 1.8.0: %s", 
                          info, version)
                      }
                      stop(msg)
                    }
                  }
                  local({
                    for (pkg in c("doFuture", "utils")) {
                      loadNamespace(pkg)
                      library(pkg, character.only = TRUE)
                    }
                  })
              }
              future::plan("default", .cleanup = FALSE, .init = FALSE)
          }
      }
      if (is.na(TRUE)) {
      }
      else {
          if (TRUE) {
              ...future.stdout <- rawConnection(raw(0L), open = "w")
          }
          else {
              ...future.stdout <- file(switch(.Platform$OS.type, 
                  windows = "NUL", "/dev/null"), open = "w")
          }
          sink(...future.stdout, type = "output", split = FALSE)
          on.exit(if (!is.null(...future.stdout)) {
              sink(type = "output", split = FALSE)
              close(...future.stdout)
          }, add = TRUE)
      }
      ...future.frame <- sys.nframe()
      ...future.conditions <- list()
      ...future.result <- tryCatch({
          withCallingHandlers({
              ...future.value <- local({
                  doFuture::registerDoFuture()
                  lapply(seq_along(...future.x_ii), FUN = function(jj) {
                    ...future.x_jj <- ...future.x_ii[[jj]]
                    b <- NULL
                    ...future.env <- environment()
                    local({
                      for (name in names(...future.x_jj)) {
                        assign(name, ...future.x_jj[[name]], envir = ...future.env, 
                          inherits = FALSE)
                      }
                    })
                    tryCatch({
                      plan_list <- future::plan()
                      message(capture.output(print(plan_list)))
                      stopifnot(inherits(plan_list, "future"), 
                        inherits(plan_list, getOption("future.default", 
                          "sequential")))
                      plan_b <- future::plan("list")
                      str(plan_b)
                      stopifnot(inherits(plan_b[[1]], "future"), 
                        inherits(plan_b[[1]], getOption("future.default", 
                          "sequential")))
                      list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
                    }, error = identity)
                  })
              })
              future::FutureResult(value = ...future.value, started = ...future.startTime, 
                  version = "1.8")
          }, condition = local({
              inherits <- base::inherits
              invokeRestart <- base::invokeRestart
              length <- base::length
              seq.int <- base::seq.int
              sys.calls <- base::sys.calls
              `[[` <- base::`[[`
              `+` <- base::`+`
              `<<-` <- base::`<<-`
              sysCalls <- function(calls = sys.calls(), from = 1L) {
                  calls[seq.int(from = from + 12L, to = length(calls) - 
                    3L)]
              }
              function(cond) {
                  if (inherits(cond, "error")) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond, calls = c(sysCalls(from = ...future.frame), 
                      cond$call), timestamp = base::Sys.time())
                    signalCondition(cond)
                  }
                  else if (inherits(cond, c("message", "warning"
                  ))) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond)
                    if (inherits(cond, "message")) {
                      invokeRestart("muffleMessage")
                    }
                    else if (inherits(cond, "warning")) {
                      invokeRestart("muffleWarning")
                    }
                  }
              }
          }))
      }, error = function(ex) {
          structure(list(value = NULL, conditions = ...future.conditions, 
              condition = ex, calls = sys.calls(), version = "1.8"), 
              class = "FutureResult")
      }, finally = {
          {
              NULL
              future::plan(list(b = function (expr, envir = parent.frame(), 
                  substitute = TRUE, lazy = FALSE, seed = NULL, 
                  globals = TRUE, local = TRUE, earlySignal = FALSE, 
                  label = NULL, ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  local <- as.logical(local)
                  future <- SequentialFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, local = local, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }), .cleanup = FALSE, .init = FALSE)
          }
          options(...future.oldOptions)
      })
      if (is.na(TRUE)) {
      }
      else {
          sink(type = "output", split = FALSE)
          if (TRUE) {
              ...future.result$stdout <- rawToChar(rawConnectionValue(...future.stdout))
          }
          else {
              ...future.result["stdout"] <- list(NULL)
          }
          close(...future.stdout)
          ...future.stdout <- NULL
      }
      ...future.result$conditions <- ...future.conditions
      ...future.result
  }
  plan(): Setting new future strategy stack:
  List of future strategies:
  1. sequential:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: NULL
  
  plan(): nbrOfWorkers() = 1
  plan(): Setting new future strategy stack:
  List of future strategies:
  1. sequential:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: plan(list(a = strategy1, b = strategy2))
  
  plan(): nbrOfWorkers() = 1
  SequentialFuture started (and completed)
  [20:53:02.599] Chunk #1 of 1 ... DONE
  [20:53:02.599] Launching 1 futures (chunks) ... DONE
  [20:53:02.600] - resolving futures
  resolve() on list ...
   recursive: 0
   length: 1
  
   length: 0 (resolved future 1)
  resolve() on list ... DONE
  [20:53:02.603] - relaying conditions of futures
  Future state: 'finished'
  sequential:- args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)- tweaked: FALSE- call: NULL
  sequential:- args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)- tweaked: FALSE- call: NULL
  sequential:- args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)- tweaked: FALSE- call: NULL
  [20:53:02.604] - collecting values of futures
  [20:53:02.605] - accumulating results
  [20:53:02.606] - processing errors (handler = 'stop')
  [20:53:02.612] - extracting results
  [20:53:02.612] doFuture() ... DONE
  foreach() - level 2 ... DONE
  List of 1
   $ b:function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
      ...)  
    ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
    ..- attr(*, "call")= language plan(list(a = strategy1, b = strategy2))
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  List of 1
   $ :function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
      ...)  
    ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  List of 1
   $ :function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
      ...)  
    ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  List of 1
   $ :function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
      ...)  
    ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  Future state: 'finished'
  foreach() - level 2 ...
  [20:53:02.475] doFuture() ...
  [20:53:02.477] - dummy globals (as locals): [1] 'b'
  [20:53:02.504] - R expression:
  [20:53:02.504] {
  [20:53:02.504]     doFuture::registerDoFuture()
  [20:53:02.504]     lapply(seq_along(...future.x_ii), FUN = function(jj) {
  [20:53:02.504]         ...future.x_jj <- ...future.x_ii[[jj]]
  [20:53:02.504]         b <- NULL
  [20:53:02.504]         ...future.env <- environment()
  [20:53:02.504]         local({
  [20:53:02.504]             for (name in names(...future.x_jj)) {
  [20:53:02.504]                 assign(name, ...future.x_jj[[name]], envir = ...future.env, 
  [20:53:02.504]                   inherits = FALSE)
  [20:53:02.504]             }
  [20:53:02.504]         })
  [20:53:02.504]         tryCatch({
  [20:53:02.504]             plan_list <- future::plan()
  [20:53:02.504]             message(capture.output(print(plan_list)))
  [20:53:02.504]             stopifnot(inherits(plan_list, "future"), inherits(plan_list, 
  [20:53:02.504]                 getOption("future.default", "sequential")))
  [20:53:02.504]             plan_b <- future::plan("list")
  [20:53:02.504]             str(plan_b)
  [20:53:02.504]             stopifnot(inherits(plan_b[[1]], "future"), inherits(plan_b[[1]], 
  [20:53:02.504]                 getOption("future.default", "sequential")))
  [20:53:02.504]             list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
  [20:53:02.504]         }, error = identity)
  [20:53:02.504]     })
  [20:53:02.504] }
  [20:53:02.506] - identifying globals and packages ...
  getGlobalsAndPackages() ...
  Searching for globals...
  - globals found: [24] '{', '::', 'lapply', 'seq_along', '...future.x_ii', '<-', '[[', 'environment', 'local', 'for', 'names', 'assign', 'tryCatch', 'message', 'capture.output', 'print', 'stopifnot', 'inherits', 'getOption', 'str', 'list', 'a', 'plan_a', 'identity'
  Searching for globals ... DONE
  Resolving globals: FALSE
  The total size of the 3 globals is 39.67 KiB (40624 bytes)
  - globals: [3] '...future.x_ii', 'a', 'plan_a'
  - packages: [1] 'utils'
  getGlobalsAndPackages() ... DONE
  [20:53:02.609] List of 3
  [20:53:02.609]  $ ...future.x_ii: NULL
  [20:53:02.609]  $ a             : int 2
  [20:53:02.609]  $ plan_a        :List of 1
  [20:53:02.609]   ..$ b:function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
  [20:53:02.609]     seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
  [20:53:02.609]     ...)  
  [20:53:02.609]   .. ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
  [20:53:02.609]   .. ..- attr(*, "call")= language plan(list(a = strategy1, b = strategy2))
  [20:53:02.609]   ..- attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  [20:53:02.609]  - attr(*, "where")=List of 3
  [20:53:02.609]   ..$ ...future.x_ii:<environment: 0x55a47f7fc1c8> 
  [20:53:02.609]   ..$ a             :<environment: 0x55a47e9897a8> 
  [20:53:02.609]   ..$ plan_a        :<environment: 0x55a47e9897a8> 
  [20:53:02.609]  - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list"
  [20:53:02.609]  - attr(*, "resolved")= logi FALSE
  [20:53:02.609]  - attr(*, "total_size")= num 40624
  [20:53:02.623]   - R expression:
  [20:53:02.624] {
  [20:53:02.624]     doFuture::registerDoFuture()
  [20:53:02.624]     lapply(seq_along(...future.x_ii), FUN = function(jj) {
  [20:53:02.624]         ...future.x_jj <- ...future.x_ii[[jj]]
  [20:53:02.624]         b <- NULL
  [20:53:02.624]         ...future.env <- environment()
  [20:53:02.624]         local({
  [20:53:02.624]             for (name in names(...future.x_jj)) {
  [20:53:02.624]                 assign(name, ...future.x_jj[[name]], envir = ...future.env, 
  [20:53:02.624]                   inherits = FALSE)
  [20:53:02.624]             }
  [20:53:02.624]         })
  [20:53:02.624]         tryCatch({
  [20:53:02.624]             plan_list <- future::plan()
  [20:53:02.624]             message(capture.output(print(plan_list)))
  [20:53:02.624]             stopifnot(inherits(plan_list, "future"), inherits(plan_list, 
  [20:53:02.624]                 getOption("future.default", "sequential")))
  [20:53:02.624]             plan_b <- future::plan("list")
  [20:53:02.624]             str(plan_b)
  [20:53:02.624]             stopifnot(inherits(plan_b[[1]], "future"), inherits(plan_b[[1]], 
  [20:53:02.624]                 getOption("future.default", "sequential")))
  [20:53:02.624]             list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
  [20:53:02.624]         }, error = identity)
  [20:53:02.624]     })
  [20:53:02.624] }
  [20:53:02.625]   - globals: [3] '...future.x_ii', 'a', 'plan_a'
  [20:53:02.626] List of 3
  [20:53:02.626]  $ ...future.x_ii: NULL
  [20:53:02.626]  $ a             : int 2
  [20:53:02.626]  $ plan_a        :List of 1
  [20:53:02.626]   ..$ b:function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
  [20:53:02.626]     seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
  [20:53:02.626]     ...)  
  [20:53:02.626]   .. ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
  [20:53:02.626]   .. ..- attr(*, "call")= language plan(list(a = strategy1, b = strategy2))
  [20:53:02.626]   ..- attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  [20:53:02.626]  - attr(*, "where")=List of 3
  [20:53:02.626]   ..$ ...future.x_ii:<environment: 0x55a47f7fc1c8> 
  [20:53:02.626]   ..$ a             :<environment: 0x55a47e9897a8> 
  [20:53:02.626]   ..$ plan_a        :<environment: 0x55a47e9897a8> 
  [20:53:02.626]  - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list"
  [20:53:02.626]  - attr(*, "resolved")= logi FALSE
  [20:53:02.626]  - attr(*, "total_size")= num 40624
  [20:53:02.645]   - packages: [2] 'doFuture', 'utils'
  [20:53:02.646] - identifying globals and packages ... DONE
  [20:53:02.646] Number of chunks: 1
  [20:53:02.647] Number of futures (= number of chunks): 1
  [20:53:02.647] Launching 1 futures (chunks) ...
  [20:53:02.648] Chunk #1 of 1 ...
  [20:53:02.648]  - Finding globals in 'args_list' chunk #1 ...
  getGlobalsAndPackages() ...
  Searching for globals...
  
  Searching for globals ... DONE
  - globals: [0] <none>
  getGlobalsAndPackages() ... DONE
  [20:53:02.651] 
  [20:53:02.652] 
  [20:53:02.652]  - Finding globals in 'args_list' for chunk #1 ... DONE
  getGlobalsAndPackages() ...
  - globals passed as-is: [3] '...future.x_ii', 'a', 'plan_a'
  Resolving globals: FALSE
  The total size of the 3 globals is 39.84 KiB (40792 bytes)
  - globals: [3] '...future.x_ii', 'a', 'plan_a'
  
  getGlobalsAndPackages() ... DONE
  Packages needed by future strategies (n = 0): <none>
  Packages needed by the future expression (n = 2): 'doFuture', 'utils'
  {
      {
          ...future.startTime <- Sys.time()
          ...future.oldOptions <- options(future.startup.loadScript = FALSE, 
              future.globals.onMissing = "ignore", future.globals.maxSize = NULL, 
              future.globals.method = NULL, future.globals.onMissing = "ignore", 
              future.globals.onReference = NULL, future.globals.resolve = NULL, 
              future.resolve.recursive = NULL, width = 80L)
          {
              {
                  {
                    has_future <- requireNamespace("future", quietly = TRUE)
                    version <- if (has_future) 
                      packageVersion("future")
                    else NULL
                    if (!has_future || version < "1.8.0") {
                      info <- c(r_version = gsub("R version ", 
                        "", R.version$version.string), platform = sprintf("%s (%s-bit)", 
                        R.version$platform, 8 * .Machine$sizeof.pointer), 
                        os = paste(Sys.info()[c("sysname", "release", 
                          "version")], collapse = " "), hostname = Sys.info()[["nodename"]])
                      info <- sprintf("%s: %s", names(info), info)
                      info <- paste(info, collapse = "; ")
                      if (!has_future) {
                        msg <- sprintf("Package 'future' is not installed on worker (%s)", 
                          info)
                      }
                      else {
                        msg <- sprintf("Package 'future' on worker (%s) must be of version >= 1.8.0: %s", 
                          info, version)
                      }
                      stop(msg)
                    }
                  }
                  local({
                    for (pkg in c("doFuture", "utils")) {
                      loadNamespace(pkg)
                      library(pkg, character.only = TRUE)
                    }
                  })
              }
              future::plan("default", .cleanup = FALSE, .init = FALSE)
          }
      }
      if (is.na(TRUE)) {
      }
      else {
          if (TRUE) {
              ...future.stdout <- rawConnection(raw(0L), open = "w")
          }
          else {
              ...future.stdout <- file(switch(.Platform$OS.type, 
                  windows = "NUL", "/dev/null"), open = "w")
          }
          sink(...future.stdout, type = "output", split = FALSE)
          on.exit(if (!is.null(...future.stdout)) {
              sink(type = "output", split = FALSE)
              close(...future.stdout)
          }, add = TRUE)
      }
      ...future.frame <- sys.nframe()
      ...future.conditions <- list()
      ...future.result <- tryCatch({
          withCallingHandlers({
              ...future.value <- local({
                  doFuture::registerDoFuture()
                  lapply(seq_along(...future.x_ii), FUN = function(jj) {
                    ...future.x_jj <- ...future.x_ii[[jj]]
                    b <- NULL
                    ...future.env <- environment()
                    local({
                      for (name in names(...future.x_jj)) {
                        assign(name, ...future.x_jj[[name]], envir = ...future.env, 
                          inherits = FALSE)
                      }
                    })
                    tryCatch({
                      plan_list <- future::plan()
                      message(capture.output(print(plan_list)))
                      stopifnot(inherits(plan_list, "future"), 
                        inherits(plan_list, getOption("future.default", 
                          "sequential")))
                      plan_b <- future::plan("list")
                      str(plan_b)
                      stopifnot(inherits(plan_b[[1]], "future"), 
                        inherits(plan_b[[1]], getOption("future.default", 
                          "sequential")))
                      list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
                    }, error = identity)
                  })
              })
              future::FutureResult(value = ...future.value, started = ...future.startTime, 
                  version = "1.8")
          }, condition = local({
              inherits <- base::inherits
              invokeRestart <- base::invokeRestart
              length <- base::length
              seq.int <- base::seq.int
              sys.calls <- base::sys.calls
              `[[` <- base::`[[`
              `+` <- base::`+`
              `<<-` <- base::`<<-`
              sysCalls <- function(calls = sys.calls(), from = 1L) {
                  calls[seq.int(from = from + 12L, to = length(calls) - 
                    3L)]
              }
              function(cond) {
                  if (inherits(cond, "error")) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond, calls = c(sysCalls(from = ...future.frame), 
                      cond$call), timestamp = base::Sys.time())
                    signalCondition(cond)
                  }
                  else if (inherits(cond, c("message", "warning"
                  ))) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond)
                    if (inherits(cond, "message")) {
                      invokeRestart("muffleMessage")
                    }
                    else if (inherits(cond, "warning")) {
                      invokeRestart("muffleWarning")
                    }
                  }
              }
          }))
      }, error = function(ex) {
          structure(list(value = NULL, conditions = ...future.conditions, 
              condition = ex, calls = sys.calls(), version = "1.8"), 
              class = "FutureResult")
      }, finally = {
          {
              NULL
              future::plan(list(b = function (expr, envir = parent.frame(), 
                  substitute = TRUE, lazy = FALSE, seed = NULL, 
                  globals = TRUE, local = TRUE, earlySignal = FALSE, 
                  label = NULL, ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  local <- as.logical(local)
                  future <- SequentialFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, local = local, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }), .cleanup = FALSE, .init = FALSE)
          }
          options(...future.oldOptions)
      })
      if (is.na(TRUE)) {
      }
      else {
          sink(type = "output", split = FALSE)
          if (TRUE) {
              ...future.result$stdout <- rawToChar(rawConnectionValue(...future.stdout))
          }
          else {
              ...future.result["stdout"] <- list(NULL)
          }
          close(...future.stdout)
          ...future.stdout <- NULL
      }
      ...future.result$conditions <- ...future.conditions
      ...future.result
  }
  plan(): Setting new future strategy stack:
  List of future strategies:
  1. sequential:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: NULL
  
  plan(): nbrOfWorkers() = 1
  plan(): Setting new future strategy stack:
  List of future strategies:
  1. sequential:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: plan(list(a = strategy1, b = strategy2))
  
  plan(): nbrOfWorkers() = 1
  SequentialFuture started (and completed)
  [20:53:02.688] Chunk #1 of 1 ... DONE
  [20:53:02.689] Launching 1 futures (chunks) ... DONE
  [20:53:02.689] - resolving futures
  resolve() on list ...
   recursive: 0
   length: 1
  
   length: 0 (resolved future 1)
  resolve() on list ... DONE
  [20:53:02.692] - relaying conditions of futures
  Future state: 'finished'
  sequential:- args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)- tweaked: FALSE- call: NULL
  sequential:- args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)- tweaked: FALSE- call: NULL
  sequential:- args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)- tweaked: FALSE- call: NULL
  [20:53:02.694] - collecting values of futures
  [20:53:02.694] - accumulating results
  [20:53:02.696] - processing errors (handler = 'stop')
  [20:53:02.696] - extracting results
  [20:53:02.697] doFuture() ... DONE
  foreach() - level 2 ... DONE
  [20:53:02.742] - collecting values of futures
  [20:53:02.753] - accumulating results
  [20:53:02.754] - processing errors (handler = 'stop')
  [20:53:02.755] - extracting results
  [20:53:02.755] doFuture() ... DONE
  foreach() - level 1 ... DONE
  - plan(list('multicore', 'sequential')) ... DONE
  - plan(list('multicore', 'multicore')) ...
  plan(): Setting new future strategy stack:
  List of future strategies:
  1. multicore:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, workers = availableCores(constraints = "multicore"), earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: plan(list(a = strategy1, b = strategy2))
  2. multicore:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, workers = availableCores(constraints = "multicore"), earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: plan(list(a = strategy1, b = strategy2))
  
  plan(): nbrOfWorkers() = 2
  foreach() - level 1 ...
  [20:53:02.761] doFuture() ...
  [20:53:02.767] - dummy globals (as locals): [1] 'a'
  [20:53:02.768] - R expression:
  [20:53:02.768] {
  [20:53:02.768]     doFuture::registerDoFuture()
  [20:53:02.768]     lapply(seq_along(...future.x_ii), FUN = function(jj) {
  [20:53:02.768]         ...future.x_jj <- ...future.x_ii[[jj]]
  [20:53:02.768]         a <- NULL
  [20:53:02.768]         ...future.env <- environment()
  [20:53:02.768]         local({
  [20:53:02.768]             for (name in names(...future.x_jj)) {
  [20:53:02.768]                 assign(name, ...future.x_jj[[name]], envir = ...future.env, 
  [20:53:02.768]                   inherits = FALSE)
  [20:53:02.768]             }
  [20:53:02.768]         })
  [20:53:02.768]         tryCatch({
  [20:53:02.768]             plan_list <- future::plan()
  [20:53:02.768]             stopifnot(inherits(plan_list, strategy2))
  [20:53:02.768]             plan_a <- future::plan("list")
  [20:53:02.768]             str(plan_a)
  [20:53:02.768]             stopifnot(inherits(plan_a[[1]], strategy2))
  [20:53:02.768]             message("foreach() - level 2 ...")
  [20:53:02.768]             y <- foreach(b = bs, .export = c("a", "plan_a")) %dopar% 
  [20:53:02.768]                 {
  [20:53:02.768]                   plan_list <- future::plan()
  [20:53:02.768]                   message(capture.output(print(plan_list)))
  [20:53:02.768]                   stopifnot(inherits(plan_list, "future"), inherits(plan_list, 
  [20:53:02.768]                     getOption("future.default", "sequential")))
  [20:53:02.768]                   plan_b <- future::plan("list")
  [20:53:02.768]                   str(plan_b)
  [20:53:02.768]                   stopifnot(inherits(plan_b[[1]], "future"), 
  [20:53:02.768]                     inherits(plan_b[[1]], getOption("future.default", 
  [20:53:02.768]                       "sequential")))
  [20:53:02.768]                   list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
  [20:53:02.768]                 }
  [20:53:02.768]             message("foreach() - level 2 ... DONE")
  [20:53:02.768]             y
  [20:53:02.768]         }, error = identity)
  [20:53:02.768]     })
  [20:53:02.768] }
  [20:53:02.770] - identifying globals and packages ...
  getGlobalsAndPackages() ...
  Searching for globals...
  - globals found: [28] '{', '::', 'lapply', 'seq_along', '...future.x_ii', '<-', '[[', 'environment', 'local', 'for', 'names', 'assign', 'tryCatch', 'stopifnot', 'inherits', 'strategy2', 'str', 'message', '%dopar%', 'foreach', 'bs', 'c', 'capture.output', 'print', 'getOption', 'list', 'b', 'identity'
  Searching for globals ... DONE
  Resolving globals: FALSE
  The total size of the 3 globals is 184 bytes (184 bytes)
  - globals: [3] '...future.x_ii', 'strategy2', 'bs'
  - packages: [2] 'utils', 'foreach'
  getGlobalsAndPackages() ... DONE
  [20:53:02.813] List of 3
  [20:53:02.813]  $ ...future.x_ii: NULL
  [20:53:02.813]  $ strategy2     : chr "multicore"
  [20:53:02.813]  $ bs            : int [1:3] 3 2 1
  [20:53:02.813]  - attr(*, "where")=List of 3
  [20:53:02.813]   ..$ ...future.x_ii:<environment: 0x55a47e66c450> 
  [20:53:02.813]   ..$ strategy2     :<environment: R_GlobalEnv> 
  [20:53:02.813]   ..$ bs            :<environment: R_GlobalEnv> 
  [20:53:02.813]  - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list"
  [20:53:02.813]  - attr(*, "resolved")= logi FALSE
  [20:53:02.813]  - attr(*, "total_size")= num 184
  [20:53:02.827]   - R expression:
  [20:53:02.827] {
  [20:53:02.827]     doFuture::registerDoFuture()
  [20:53:02.827]     lapply(seq_along(...future.x_ii), FUN = function(jj) {
  [20:53:02.827]         ...future.x_jj <- ...future.x_ii[[jj]]
  [20:53:02.827]         a <- NULL
  [20:53:02.827]         ...future.env <- environment()
  [20:53:02.827]         local({
  [20:53:02.827]             for (name in names(...future.x_jj)) {
  [20:53:02.827]                 assign(name, ...future.x_jj[[name]], envir = ...future.env, 
  [20:53:02.827]                   inherits = FALSE)
  [20:53:02.827]             }
  [20:53:02.827]         })
  [20:53:02.827]         tryCatch({
  [20:53:02.827]             plan_list <- future::plan()
  [20:53:02.827]             stopifnot(inherits(plan_list, strategy2))
  [20:53:02.827]             plan_a <- future::plan("list")
  [20:53:02.827]             str(plan_a)
  [20:53:02.827]             stopifnot(inherits(plan_a[[1]], strategy2))
  [20:53:02.827]             message("foreach() - level 2 ...")
  [20:53:02.827]             y <- foreach(b = bs, .export = c("a", "plan_a")) %dopar% 
  [20:53:02.827]                 {
  [20:53:02.827]                   plan_list <- future::plan()
  [20:53:02.827]                   message(capture.output(print(plan_list)))
  [20:53:02.827]                   stopifnot(inherits(plan_list, "future"), inherits(plan_list, 
  [20:53:02.827]                     getOption("future.default", "sequential")))
  [20:53:02.827]                   plan_b <- future::plan("list")
  [20:53:02.827]                   str(plan_b)
  [20:53:02.827]                   stopifnot(inherits(plan_b[[1]], "future"), 
  [20:53:02.827]                     inherits(plan_b[[1]], getOption("future.default", 
  [20:53:02.827]                       "sequential")))
  [20:53:02.827]                   list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
  [20:53:02.827]                 }
  [20:53:02.827]             message("foreach() - level 2 ... DONE")
  [20:53:02.827]             y
  [20:53:02.827]         }, error = identity)
  [20:53:02.827]     })
  [20:53:02.827] }
  [20:53:02.829]   - globals: [3] '...future.x_ii', 'strategy2', 'bs'
  [20:53:02.829] List of 3
  [20:53:02.829]  $ ...future.x_ii: NULL
  [20:53:02.829]  $ strategy2     : chr "multicore"
  [20:53:02.829]  $ bs            : int [1:3] 3 2 1
  [20:53:02.829]  - attr(*, "where")=List of 3
  [20:53:02.829]   ..$ ...future.x_ii:<environment: 0x55a47e66c450> 
  [20:53:02.829]   ..$ strategy2     :<environment: R_GlobalEnv> 
  [20:53:02.829]   ..$ bs            :<environment: R_GlobalEnv> 
  [20:53:02.829]  - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list"
  [20:53:02.829]  - attr(*, "resolved")= logi FALSE
  [20:53:02.829]  - attr(*, "total_size")= num 184
  [20:53:02.840]   - packages: [3] 'doFuture', 'utils', 'foreach'
  [20:53:02.840] - identifying globals and packages ... DONE
  [20:53:02.841] Number of chunks: 2
  [20:53:02.842] Number of futures (= number of chunks): 2
  [20:53:02.842] Launching 2 futures (chunks) ...
  [20:53:02.842] Chunk #1 of 2 ...
  [20:53:02.843]  - Finding globals in 'args_list' chunk #1 ...
  getGlobalsAndPackages() ...
  Searching for globals...
  
  Searching for globals ... DONE
  - globals: [0] <none>
  getGlobalsAndPackages() ... DONE
  [20:53:02.845] 
  [20:53:02.845] 
  [20:53:02.846]  - Finding globals in 'args_list' for chunk #1 ... DONE
  getGlobalsAndPackages() ...
  - globals passed as-is: [3] '...future.x_ii', 'strategy2', 'bs'
  Resolving globals: FALSE
  The total size of the 3 globals is 240 bytes (240 bytes)
  - globals: [3] '...future.x_ii', 'strategy2', 'bs'
  
  getGlobalsAndPackages() ... DONE
  Packages needed by future strategies (n = 1): 'future'
  Packages needed by the future expression (n = 3): 'doFuture', 'utils', 'foreach'
  {
      {
          ...future.startTime <- Sys.time()
          ...future.oldOptions <- options(future.startup.loadScript = FALSE, 
              future.globals.onMissing = "ignore", future.globals.maxSize = NULL, 
              future.globals.method = NULL, future.globals.onMissing = "ignore", 
              future.globals.onReference = NULL, future.globals.resolve = NULL, 
              future.resolve.recursive = NULL, width = 80L)
          {
              {
                  {
                    {
                      has_future <- requireNamespace("future", 
                        quietly = TRUE)
                      version <- if (has_future) 
                        packageVersion("future")
                      else NULL
                      if (!has_future || version < "1.8.0") {
                        info <- c(r_version = gsub("R version ", 
                          "", R.version$version.string), platform = sprintf("%s (%s-bit)", 
                          R.version$platform, 8 * .Machine$sizeof.pointer), 
                          os = paste(Sys.info()[c("sysname", "release", 
                            "version")], collapse = " "), hostname = Sys.info()[["nodename"]])
                        info <- sprintf("%s: %s", names(info), 
                          info)
                        info <- paste(info, collapse = "; ")
                        if (!has_future) {
                          msg <- sprintf("Package 'future' is not installed on worker (%s)", 
                            info)
                        }
                        else {
                          msg <- sprintf("Package 'future' on worker (%s) must be of version >= 1.8.0: %s", 
                            info, version)
                        }
                        stop(msg)
                      }
                    }
                    ...future.mc.cores.old <- getOption("mc.cores")
                    options(mc.cores = 1L)
                  }
                  local({
                    for (pkg in c("future", "doFuture", "utils", 
                    "foreach")) {
                      loadNamespace(pkg)
                      library(pkg, character.only = TRUE)
                    }
                  })
              }
              future::plan(list(b = function (expr, envir = parent.frame(), 
                  substitute = TRUE, lazy = FALSE, seed = NULL, 
                  globals = TRUE, workers = availableCores(constraints = "multicore"), 
                  earlySignal = FALSE, label = NULL, ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  if (is.function(workers)) 
                    workers <- workers()
                  workers <- as.integer(workers)
                  stop_if_not(is.finite(workers), workers >= 1L)
                  if (workers == 1L || !supportsMulticore()) {
                    return(sequential(expr, envir = envir, substitute = FALSE, 
                      lazy = lazy, seed = seed, globals = globals, 
                      local = TRUE, label = label, ...))
                  }
                  oopts <- options(mc.cores = workers)
                  on.exit(options(oopts))
                  future <- MulticoreFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, workers = workers, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }), .cleanup = FALSE, .init = FALSE)
          }
      }
      if (is.na(TRUE)) {
      }
      else {
          if (TRUE) {
              ...future.stdout <- rawConnection(raw(0L), open = "w")
          }
          else {
              ...future.stdout <- file(switch(.Platform$OS.type, 
                  windows = "NUL", "/dev/null"), open = "w")
          }
          sink(...future.stdout, type = "output", split = FALSE)
          on.exit(if (!is.null(...future.stdout)) {
              sink(type = "output", split = FALSE)
              close(...future.stdout)
          }, add = TRUE)
      }
      ...future.frame <- sys.nframe()
      ...future.conditions <- list()
      ...future.result <- tryCatch({
          withCallingHandlers({
              ...future.value <- local({
                  doFuture::registerDoFuture()
                  lapply(seq_along(...future.x_ii), FUN = function(jj) {
                    ...future.x_jj <- ...future.x_ii[[jj]]
                    a <- NULL
                    ...future.env <- environment()
                    local({
                      for (name in names(...future.x_jj)) {
                        assign(name, ...future.x_jj[[name]], envir = ...future.env, 
                          inherits = FALSE)
                      }
                    })
                    tryCatch({
                      plan_list <- future::plan()
                      stopifnot(inherits(plan_list, strategy2))
                      plan_a <- future::plan("list")
                      str(plan_a)
                      stopifnot(inherits(plan_a[[1]], strategy2))
                      message("foreach() - level 2 ...")
                      y <- foreach(b = bs, .export = c("a", "plan_a")) %dopar% 
                        {
                          plan_list <- future::plan()
                          message(capture.output(print(plan_list)))
                          stopifnot(inherits(plan_list, "future"), 
                            inherits(plan_list, getOption("future.default", 
                              "sequential")))
                          plan_b <- future::plan("list")
                          str(plan_b)
                          stopifnot(inherits(plan_b[[1]], "future"), 
                            inherits(plan_b[[1]], getOption("future.default", 
                              "sequential")))
                          list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
                        }
                      message("foreach() - level 2 ... DONE")
                      y
                    }, error = identity)
                  })
              })
              future::FutureResult(value = ...future.value, started = ...future.startTime, 
                  version = "1.8")
          }, condition = local({
              inherits <- base::inherits
              invokeRestart <- base::invokeRestart
              length <- base::length
              seq.int <- base::seq.int
              sys.calls <- base::sys.calls
              `[[` <- base::`[[`
              `+` <- base::`+`
              `<<-` <- base::`<<-`
              sysCalls <- function(calls = sys.calls(), from = 1L) {
                  calls[seq.int(from = from + 12L, to = length(calls) - 
                    3L)]
              }
              function(cond) {
                  if (inherits(cond, "error")) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond, calls = c(sysCalls(from = ...future.frame), 
                      cond$call), timestamp = base::Sys.time())
                    signalCondition(cond)
                  }
                  else if (inherits(cond, c("message", "warning"
                  ))) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond)
                    if (inherits(cond, "message")) {
                      invokeRestart("muffleMessage")
                    }
                    else if (inherits(cond, "warning")) {
                      invokeRestart("muffleWarning")
                    }
                  }
              }
          }))
      }, error = function(ex) {
          structure(list(value = NULL, conditions = ...future.conditions, 
              condition = ex, calls = sys.calls(), version = "1.8"), 
              class = "FutureResult")
      }, finally = {
          {
              {
                  options(mc.cores = ...future.mc.cores.old)
              }
              future::plan(list(a = function (expr, envir = parent.frame(), 
                  substitute = TRUE, lazy = FALSE, seed = NULL, 
                  globals = TRUE, workers = availableCores(constraints = "multicore"), 
                  earlySignal = FALSE, label = NULL, ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  if (is.function(workers)) 
                    workers <- workers()
                  workers <- as.integer(workers)
                  stop_if_not(is.finite(workers), workers >= 1L)
                  if (workers == 1L || !supportsMulticore()) {
                    return(sequential(expr, envir = envir, substitute = FALSE, 
                      lazy = lazy, seed = seed, globals = globals, 
                      local = TRUE, label = label, ...))
                  }
                  oopts <- options(mc.cores = workers)
                  on.exit(options(oopts))
                  future <- MulticoreFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, workers = workers, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }, b = function (expr, envir = parent.frame(), substitute = TRUE, 
                  lazy = FALSE, seed = NULL, globals = TRUE, workers = availableCores(constraints = "multicore"), 
                  earlySignal = FALSE, label = NULL, ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  if (is.function(workers)) 
                    workers <- workers()
                  workers <- as.integer(workers)
                  stop_if_not(is.finite(workers), workers >= 1L)
                  if (workers == 1L || !supportsMulticore()) {
                    return(sequential(expr, envir = envir, substitute = FALSE, 
                      lazy = lazy, seed = seed, globals = globals, 
                      local = TRUE, label = label, ...))
                  }
                  oopts <- options(mc.cores = workers)
                  on.exit(options(oopts))
                  future <- MulticoreFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, workers = workers, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }), .cleanup = FALSE, .init = FALSE)
          }
          options(...future.oldOptions)
      })
      if (is.na(TRUE)) {
      }
      else {
          sink(type = "output", split = FALSE)
          if (TRUE) {
              ...future.result$stdout <- rawToChar(rawConnectionValue(...future.stdout))
          }
          else {
              ...future.result["stdout"] <- list(NULL)
          }
          close(...future.stdout)
          ...future.stdout <- NULL
      }
      ...future.result$conditions <- ...future.conditions
      ...future.result
  }
  requestCore(): workers = 2
  MulticoreFuture started
  [20:53:02.865] Chunk #1 of 2 ... DONE
  [20:53:02.865] Chunk #2 of 2 ...
  [20:53:02.866]  - Finding globals in 'args_list' chunk #2 ...
  getGlobalsAndPackages() ...
  Searching for globals...
  
  Searching for globals ... DONE
  - globals: [0] <none>
  getGlobalsAndPackages() ... DONE
  [20:53:02.869] 
  [20:53:02.869] 
  [20:53:02.870]  - Finding globals in 'args_list' for chunk #2 ... DONE
  plan(): Setting new future strategy stack:
  List of future strategies:
  1. multicore:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, workers = availableCores(constraints = "multicore"), earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: plan(list(a = strategy1, b = strategy2))
  
  plan(): nbrOfWorkers() = 1
  getGlobalsAndPackages() ...
  - globals passed as-is: [3] '...future.x_ii', 'strategy2', 'bs'
  Resolving globals: FALSE
  The total size of the 3 globals is 240 bytes (240 bytes)
  - globals: [3] '...future.x_ii', 'strategy2', 'bs'
  
  getGlobalsAndPackages() ... DONE
  Packages needed by future strategies (n = 1): 'future'
  Packages needed by the future expression (n = 3): 'doFuture', 'utils', 'foreach'
  {
      {
          ...future.startTime <- Sys.time()
          ...future.oldOptions <- options(future.startup.loadScript = FALSE, 
              future.globals.onMissing = "ignore", future.globals.maxSize = NULL, 
              future.globals.method = NULL, future.globals.onMissing = "ignore", 
              future.globals.onReference = NULL, future.globals.resolve = NULL, 
              future.resolve.recursive = NULL, width = 80L)
          {
              {
                  {
                    {
                      has_future <- requireNamespace("future", 
                        quietly = TRUE)
                      version <- if (has_future) 
                        packageVersion("future")
                      else NULL
                      if (!has_future || version < "1.8.0") {
                        info <- c(r_version = gsub("R version ", 
                          "", R.version$version.string), platform = sprintf("%s (%s-bit)", 
                          R.version$platform, 8 * .Machine$sizeof.pointer), 
                          os = paste(Sys.info()[c("sysname", "release", 
                            "version")], collapse = " "), hostname = Sys.info()[["nodename"]])
                        info <- sprintf("%s: %s", names(info), 
                          info)
                        info <- paste(info, collapse = "; ")
                        if (!has_future) {
                          msg <- sprintf("Package 'future' is not installed on worker (%s)", 
                            info)
                        }
                        else {
                          msg <- sprintf("Package 'future' on worker (%s) must be of version >= 1.8.0: %s", 
                            info, version)
                        }
                        stop(msg)
                      }
                    }
                    ...future.mc.cores.old <- getOption("mc.cores")
                    options(mc.cores = 1L)
                  }
                  local({
                    for (pkg in c("future", "doFuture", "utils", 
                    "foreach")) {
                      loadNamespace(pkg)
                      library(pkg, character.only = TRUE)
                    }
                  })
              }
              future::plan(list(b = function (expr, envir = parent.frame(), 
                  substitute = TRUE, lazy = FALSE, seed = NULL, 
                  globals = TRUE, workers = availableCores(constraints = "multicore"), 
                  earlySignal = FALSE, label = NULL, ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  if (is.function(workers)) 
                    workers <- workers()
                  workers <- as.integer(workers)
                  stop_if_not(is.finite(workers), workers >= 1L)
                  if (workers == 1L || !supportsMulticore()) {
                    return(sequential(expr, envir = envir, substitute = FALSE, 
                      lazy = lazy, seed = seed, globals = globals, 
                      local = TRUE, label = label, ...))
                  }
                  oopts <- options(mc.cores = workers)
                  on.exit(options(oopts))
                  future <- MulticoreFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, workers = workers, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }), .cleanup = FALSE, .init = FALSE)
          }
      }
      if (is.na(TRUE)) {
      }
      else {
          if (TRUE) {
              ...future.stdout <- rawConnection(raw(0L), open = "w")
          }
          else {
              ...future.stdout <- file(switch(.Platform$OS.type, 
                  windows = "NUL", "/dev/null"), open = "w")
          }
          sink(...future.stdout, type = "output", split = FALSE)
          on.exit(if (!is.null(...future.stdout)) {
              sink(type = "output", split = FALSE)
              close(...future.stdout)
          }, add = TRUE)
      }
      ...future.frame <- sys.nframe()
      ...future.conditions <- list()
      ...future.result <- tryCatch({
          withCallingHandlers({
              ...future.value <- local({
                  doFuture::registerDoFuture()
                  lapply(seq_along(...future.x_ii), FUN = function(jj) {
                    ...future.x_jj <- ...future.x_ii[[jj]]
                    a <- NULL
                    ...future.env <- environment()
                    local({
                      for (name in names(...future.x_jj)) {
                        assign(name, ...future.x_jj[[name]], envir = ...future.env, 
                          inherits = FALSE)
                      }
                    })
                    tryCatch({
                      plan_list <- future::plan()
                      stopifnot(inherits(plan_list, strategy2))
                      plan_a <- future::plan("list")
                      str(plan_a)
                      stopifnot(inherits(plan_a[[1]], strategy2))
                      message("foreach() - level 2 ...")
                      y <- foreach(b = bs, .export = c("a", "plan_a")) %dopar% 
                        {
                          plan_list <- future::plan()
                          message(capture.output(print(plan_list)))
                          stopifnot(inherits(plan_list, "future"), 
                            inherits(plan_list, getOption("future.default", 
                              "sequential")))
                          plan_b <- future::plan("list")
                          str(plan_b)
                          stopifnot(inherits(plan_b[[1]], "future"), 
                            inherits(plan_b[[1]], getOption("future.default", 
                              "sequential")))
                          list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
                        }
                      message("foreach() - level 2 ... DONE")
                      y
                    }, error = identity)
                  })
              })
              future::FutureResult(value = ...future.value, started = ...future.startTime, 
                  version = "1.8")
          }, condition = local({
              inherits <- base::inherits
              invokeRestart <- base::invokeRestart
              length <- base::length
              seq.int <- base::seq.int
              sys.calls <- base::sys.calls
              `[[` <- base::`[[`
              `+` <- base::`+`
              `<<-` <- base::`<<-`
              sysCalls <- function(calls = sys.calls(), from = 1L) {
                  calls[seq.int(from = from + 12L, to = length(calls) - 
                    3L)]
              }
              function(cond) {
                  if (inherits(cond, "error")) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond, calls = c(sysCalls(from = ...future.frame), 
                      cond$call), timestamp = base::Sys.time())
                    signalCondition(cond)
                  }
                  else if (inherits(cond, c("message", "warning"
                  ))) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond)
                    if (inherits(cond, "message")) {
                      invokeRestart("muffleMessage")
                    }
                    else if (inherits(cond, "warning")) {
                      invokeRestart("muffleWarning")
                    }
                  }
              }
          }))
      }, error = function(ex) {
          structure(list(value = NULL, conditions = ...future.conditions, 
              condition = ex, calls = sys.calls(), version = "1.8"), 
              class = "FutureResult")
      }, finally = {
          {
              {
                  options(mc.cores = ...future.mc.cores.old)
              }
              future::plan(list(a = function (expr, envir = parent.frame(), 
                  substitute = TRUE, lazy = FALSE, seed = NULL, 
                  globals = TRUE, workers = availableCores(constraints = "multicore"), 
                  earlySignal = FALSE, label = NULL, ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  if (is.function(workers)) 
                    workers <- workers()
                  workers <- as.integer(workers)
                  stop_if_not(is.finite(workers), workers >= 1L)
                  if (workers == 1L || !supportsMulticore()) {
                    return(sequential(expr, envir = envir, substitute = FALSE, 
                      lazy = lazy, seed = seed, globals = globals, 
                      local = TRUE, label = label, ...))
                  }
                  oopts <- options(mc.cores = workers)
                  on.exit(options(oopts))
                  future <- MulticoreFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, workers = workers, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }, b = function (expr, envir = parent.frame(), substitute = TRUE, 
                  lazy = FALSE, seed = NULL, globals = TRUE, workers = availableCores(constraints = "multicore"), 
                  earlySignal = FALSE, label = NULL, ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  if (is.function(workers)) 
                    workers <- workers()
                  workers <- as.integer(workers)
                  stop_if_not(is.finite(workers), workers >= 1L)
                  if (workers == 1L || !supportsMulticore()) {
                    return(sequential(expr, envir = envir, substitute = FALSE, 
                      lazy = lazy, seed = seed, globals = globals, 
                      local = TRUE, label = label, ...))
                  }
                  oopts <- options(mc.cores = workers)
                  on.exit(options(oopts))
                  future <- MulticoreFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, workers = workers, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }), .cleanup = FALSE, .init = FALSE)
          }
          options(...future.oldOptions)
      })
      if (is.na(TRUE)) {
      }
      else {
          sink(type = "output", split = FALSE)
          if (TRUE) {
              ...future.result$stdout <- rawToChar(rawConnectionValue(...future.stdout))
          }
          else {
              ...future.result["stdout"] <- list(NULL)
          }
          close(...future.stdout)
          ...future.stdout <- NULL
      }
      ...future.result$conditions <- ...future.conditions
      ...future.result
  }
  requestCore(): workers = 2
  MulticoreFuture started
  [20:53:02.955] Chunk #2 of 2 ... DONE
  [20:53:02.955] Launching 2 futures (chunks) ... DONE
  [20:53:02.956] - resolving futures
  resolve() on list ...
   recursive: 0
   length: 2
  
  plan(): Setting new future strategy stack:
  List of future strategies:
  1. multicore:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, workers = availableCores(constraints = "multicore"), earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: plan(list(a = strategy1, b = strategy2))
  
  plan(): nbrOfWorkers() = 1
  plan(): Setting new future strategy stack:
  List of future strategies:
  1. multicore:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, workers = availableCores(constraints = "multicore"), earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: plan(list(a = strategy1, b = strategy2))
  2. multicore:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, workers = availableCores(constraints = "multicore"), earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: plan(list(a = strategy1, b = strategy2))
  
  plan(): nbrOfWorkers() = 2
   length: 1 (resolved future 1)
  plan(): Setting new future strategy stack:
  List of future strategies:
  1. multicore:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, workers = availableCores(constraints = "multicore"), earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: plan(list(a = strategy1, b = strategy2))
  2. multicore:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, workers = availableCores(constraints = "multicore"), earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: plan(list(a = strategy1, b = strategy2))
  
  plan(): nbrOfWorkers() = 2
   length: 0 (resolved future 2)
  resolve() on list ... DONE
  [20:53:03.301] - relaying conditions of futures
  List of 1
   $ b:function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, workers = availableCores(constraints = "multicore"), 
      earlySignal = FALSE, label = NULL, ...)  
    ..- attr(*, "class")= chr [1:4] "multicore" "multiprocess" "future" "function"
    ..- attr(*, "call")= language plan(list(a = strategy1, b = strategy2))
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  List of 1
   $ :function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
      ...)  
    ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  List of 1
   $ :function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
      ...)  
    ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  List of 1
   $ :function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
      ...)  
    ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  Future state: 'finished'
  foreach() - level 2 ...
  [20:53:02.926] doFuture() ...
  [20:53:02.928] - dummy globals (as locals): [1] 'b'
  [20:53:02.930] - R expression:
  [20:53:02.931] {
  [20:53:02.931]     doFuture::registerDoFuture()
  [20:53:02.931]     lapply(seq_along(...future.x_ii), FUN = function(jj) {
  [20:53:02.931]         ...future.x_jj <- ...future.x_ii[[jj]]
  [20:53:02.931]         b <- NULL
  [20:53:02.931]         ...future.env <- environment()
  [20:53:02.931]         local({
  [20:53:02.931]             for (name in names(...future.x_jj)) {
  [20:53:02.931]                 assign(name, ...future.x_jj[[name]], envir = ...future.env, 
  [20:53:02.931]                   inherits = FALSE)
  [20:53:02.931]             }
  [20:53:02.931]         })
  [20:53:02.931]         tryCatch({
  [20:53:02.931]             plan_list <- future::plan()
  [20:53:02.931]             message(capture.output(print(plan_list)))
  [20:53:02.931]             stopifnot(inherits(plan_list, "future"), inherits(plan_list, 
  [20:53:02.931]                 getOption("future.default", "sequential")))
  [20:53:02.931]             plan_b <- future::plan("list")
  [20:53:02.931]             str(plan_b)
  [20:53:02.931]             stopifnot(inherits(plan_b[[1]], "future"), inherits(plan_b[[1]], 
  [20:53:02.931]                 getOption("future.default", "sequential")))
  [20:53:02.931]             list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
  [20:53:02.931]         }, error = identity)
  [20:53:02.931]     })
  [20:53:02.931] }
  [20:53:02.932] - identifying globals and packages ...
  getGlobalsAndPackages() ...
  Searching for globals...
  - globals found: [24] '{', '::', 'lapply', 'seq_along', '...future.x_ii', '<-', '[[', 'environment', 'local', 'for', 'names', 'assign', 'tryCatch', 'message', 'capture.output', 'print', 'stopifnot', 'inherits', 'getOption', 'str', 'list', 'a', 'plan_a', 'identity'
  Searching for globals ... DONE
  Resolving globals: FALSE
  The total size of the 3 globals is 74.09 KiB (75872 bytes)
  - globals: [3] '...future.x_ii', 'a', 'plan_a'
  - packages: [1] 'utils'
  getGlobalsAndPackages() ... DONE
  [20:53:02.991] List of 3
  [20:53:02.991]  $ ...future.x_ii: NULL
  [20:53:02.991]  $ a             : int 1
  [20:53:02.991]  $ plan_a        :List of 1
  [20:53:02.991]   ..$ b:function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
  [20:53:02.991]     seed = NULL, globals = TRUE, workers = availableCores(constraints = "multicore"), 
  [20:53:02.991]     earlySignal = FALSE, label = NULL, ...)  
  [20:53:02.991]   .. ..- attr(*, "class")= chr [1:4] "multicore" "multiprocess" "future" "function"
  [20:53:02.991]   .. ..- attr(*, "call")= language plan(list(a = strategy1, b = strategy2))
  [20:53:02.991]   ..- attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  [20:53:02.991]  - attr(*, "where")=List of 3
  [20:53:02.991]   ..$ ...future.x_ii:<environment: 0x55a47e9098f0> 
  [20:53:02.991]   ..$ a             :<environment: 0x55a47fb76da8> 
  [20:53:02.991]   ..$ plan_a        :<environment: 0x55a47fb76da8> 
  [20:53:02.991]  - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list"
  [20:53:02.991]  - attr(*, "resolved")= logi FALSE
  [20:53:02.991]  - attr(*, "total_size")= num 75872
  [20:53:03.028]   - R expression:
  [20:53:03.029] {
  [20:53:03.029]     doFuture::registerDoFuture()
  [20:53:03.029]     lapply(seq_along(...future.x_ii), FUN = function(jj) {
  [20:53:03.029]         ...future.x_jj <- ...future.x_ii[[jj]]
  [20:53:03.029]         b <- NULL
  [20:53:03.029]         ...future.env <- environment()
  [20:53:03.029]         local({
  [20:53:03.029]             for (name in names(...future.x_jj)) {
  [20:53:03.029]                 assign(name, ...future.x_jj[[name]], envir = ...future.env, 
  [20:53:03.029]                   inherits = FALSE)
  [20:53:03.029]             }
  [20:53:03.029]         })
  [20:53:03.029]         tryCatch({
  [20:53:03.029]             plan_list <- future::plan()
  [20:53:03.029]             message(capture.output(print(plan_list)))
  [20:53:03.029]             stopifnot(inherits(plan_list, "future"), inherits(plan_list, 
  [20:53:03.029]                 getOption("future.default", "sequential")))
  [20:53:03.029]             plan_b <- future::plan("list")
  [20:53:03.029]             str(plan_b)
  [20:53:03.029]             stopifnot(inherits(plan_b[[1]], "future"), inherits(plan_b[[1]], 
  [20:53:03.029]                 getOption("future.default", "sequential")))
  [20:53:03.029]             list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
  [20:53:03.029]         }, error = identity)
  [20:53:03.029]     })
  [20:53:03.029] }
  [20:53:03.030]   - globals: [3] '...future.x_ii', 'a', 'plan_a'
  [20:53:03.031] List of 3
  [20:53:03.031]  $ ...future.x_ii: NULL
  [20:53:03.031]  $ a             : int 1
  [20:53:03.031]  $ plan_a        :List of 1
  [20:53:03.031]   ..$ b:function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
  [20:53:03.031]     seed = NULL, globals = TRUE, workers = availableCores(constraints = "multicore"), 
  [20:53:03.031]     earlySignal = FALSE, label = NULL, ...)  
  [20:53:03.031]   .. ..- attr(*, "class")= chr [1:4] "multicore" "multiprocess" "future" "function"
  [20:53:03.031]   .. ..- attr(*, "call")= language plan(list(a = strategy1, b = strategy2))
  [20:53:03.031]   ..- attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  [20:53:03.031]  - attr(*, "where")=List of 3
  [20:53:03.031]   ..$ ...future.x_ii:<environment: 0x55a47e9098f0> 
  [20:53:03.031]   ..$ a             :<environment: 0x55a47fb76da8> 
  [20:53:03.031]   ..$ plan_a        :<environment: 0x55a47fb76da8> 
  [20:53:03.031]  - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list"
  [20:53:03.031]  - attr(*, "resolved")= logi FALSE
  [20:53:03.031]  - attr(*, "total_size")= num 75872
  [20:53:03.048]   - packages: [2] 'doFuture', 'utils'
  [20:53:03.053] - identifying globals and packages ... DONE
  [20:53:03.054] Number of chunks: 1
  [20:53:03.054] Number of futures (= number of chunks): 1
  [20:53:03.055] Launching 1 futures (chunks) ...
  [20:53:03.055] Chunk #1 of 1 ...
  [20:53:03.056]  - Finding globals in 'args_list' chunk #1 ...
  getGlobalsAndPackages() ...
  Searching for globals...
  
  Searching for globals ... DONE
  - globals: [0] <none>
  getGlobalsAndPackages() ... DONE
  [20:53:03.059] 
  [20:53:03.059] 
  [20:53:03.060]  - Finding globals in 'args_list' for chunk #1 ... DONE
  getGlobalsAndPackages() ...
  - globals passed as-is: [3] '...future.x_ii', 'a', 'plan_a'
  Resolving globals: FALSE
  The total size of the 3 globals is 74.26 KiB (76040 bytes)
  - globals: [3] '...future.x_ii', 'a', 'plan_a'
  
  getGlobalsAndPackages() ... DONE
  Packages needed by future strategies (n = 0): <none>
  Packages needed by the future expression (n = 2): 'doFuture', 'utils'
  {
      {
          ...future.startTime <- Sys.time()
          ...future.oldOptions <- options(future.startup.loadScript = FALSE, 
              future.globals.onMissing = "ignore", future.globals.maxSize = NULL, 
              future.globals.method = NULL, future.globals.onMissing = "ignore", 
              future.globals.onReference = NULL, future.globals.resolve = NULL, 
              future.resolve.recursive = NULL, width = 80L)
          {
              {
                  {
                    has_future <- requireNamespace("future", quietly = TRUE)
                    version <- if (has_future) 
                      packageVersion("future")
                    else NULL
                    if (!has_future || version < "1.8.0") {
                      info <- c(r_version = gsub("R version ", 
                        "", R.version$version.string), platform = sprintf("%s (%s-bit)", 
                        R.version$platform, 8 * .Machine$sizeof.pointer), 
                        os = paste(Sys.info()[c("sysname", "release", 
                          "version")], collapse = " "), hostname = Sys.info()[["nodename"]])
                      info <- sprintf("%s: %s", names(info), info)
                      info <- paste(info, collapse = "; ")
                      if (!has_future) {
                        msg <- sprintf("Package 'future' is not installed on worker (%s)", 
                          info)
                      }
                      else {
                        msg <- sprintf("Package 'future' on worker (%s) must be of version >= 1.8.0: %s", 
                          info, version)
                      }
                      stop(msg)
                    }
                  }
                  local({
                    for (pkg in c("doFuture", "utils")) {
                      loadNamespace(pkg)
                      library(pkg, character.only = TRUE)
                    }
                  })
              }
              future::plan("default", .cleanup = FALSE, .init = FALSE)
          }
      }
      if (is.na(TRUE)) {
      }
      else {
          if (TRUE) {
              ...future.stdout <- rawConnection(raw(0L), open = "w")
          }
          else {
              ...future.stdout <- file(switch(.Platform$OS.type, 
                  windows = "NUL", "/dev/null"), open = "w")
          }
          sink(...future.stdout, type = "output", split = FALSE)
          on.exit(if (!is.null(...future.stdout)) {
              sink(type = "output", split = FALSE)
              close(...future.stdout)
          }, add = TRUE)
      }
      ...future.frame <- sys.nframe()
      ...future.conditions <- list()
      ...future.result <- tryCatch({
          withCallingHandlers({
              ...future.value <- local({
                  doFuture::registerDoFuture()
                  lapply(seq_along(...future.x_ii), FUN = function(jj) {
                    ...future.x_jj <- ...future.x_ii[[jj]]
                    b <- NULL
                    ...future.env <- environment()
                    local({
                      for (name in names(...future.x_jj)) {
                        assign(name, ...future.x_jj[[name]], envir = ...future.env, 
                          inherits = FALSE)
                      }
                    })
                    tryCatch({
                      plan_list <- future::plan()
                      message(capture.output(print(plan_list)))
                      stopifnot(inherits(plan_list, "future"), 
                        inherits(plan_list, getOption("future.default", 
                          "sequential")))
                      plan_b <- future::plan("list")
                      str(plan_b)
                      stopifnot(inherits(plan_b[[1]], "future"), 
                        inherits(plan_b[[1]], getOption("future.default", 
                          "sequential")))
                      list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
                    }, error = identity)
                  })
              })
              future::FutureResult(value = ...future.value, started = ...future.startTime, 
                  version = "1.8")
          }, condition = local({
              inherits <- base::inherits
              invokeRestart <- base::invokeRestart
              length <- base::length
              seq.int <- base::seq.int
              sys.calls <- base::sys.calls
              `[[` <- base::`[[`
              `+` <- base::`+`
              `<<-` <- base::`<<-`
              sysCalls <- function(calls = sys.calls(), from = 1L) {
                  calls[seq.int(from = from + 12L, to = length(calls) - 
                    3L)]
              }
              function(cond) {
                  if (inherits(cond, "error")) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond, calls = c(sysCalls(from = ...future.frame), 
                      cond$call), timestamp = base::Sys.time())
                    signalCondition(cond)
                  }
                  else if (inherits(cond, c("message", "warning"
                  ))) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond)
                    if (inherits(cond, "message")) {
                      invokeRestart("muffleMessage")
                    }
                    else if (inherits(cond, "warning")) {
                      invokeRestart("muffleWarning")
                    }
                  }
              }
          }))
      }, error = function(ex) {
          structure(list(value = NULL, conditions = ...future.conditions, 
              condition = ex, calls = sys.calls(), version = "1.8"), 
              class = "FutureResult")
      }, finally = {
          {
              NULL
              future::plan(list(b = function (expr, envir = parent.frame(), 
                  substitute = TRUE, lazy = FALSE, seed = NULL, 
                  globals = TRUE, workers = availableCores(constraints = "multicore"), 
                  earlySignal = FALSE, label = NULL, ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  if (is.function(workers)) 
                    workers <- workers()
                  workers <- as.integer(workers)
                  stop_if_not(is.finite(workers), workers >= 1L)
                  if (workers == 1L || !supportsMulticore()) {
                    return(sequential(expr, envir = envir, substitute = FALSE, 
                      lazy = lazy, seed = seed, globals = globals, 
                      local = TRUE, label = label, ...))
                  }
                  oopts <- options(mc.cores = workers)
                  on.exit(options(oopts))
                  future <- MulticoreFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, workers = workers, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }), .cleanup = FALSE, .init = FALSE)
          }
          options(...future.oldOptions)
      })
      if (is.na(TRUE)) {
      }
      else {
          sink(type = "output", split = FALSE)
          if (TRUE) {
              ...future.result$stdout <- rawToChar(rawConnectionValue(...future.stdout))
          }
          else {
              ...future.result["stdout"] <- list(NULL)
          }
          close(...future.stdout)
          ...future.stdout <- NULL
      }
      ...future.result$conditions <- ...future.conditions
      ...future.result
  }
  plan(): Setting new future strategy stack:
  List of future strategies:
  1. sequential:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: NULL
  
  plan(): nbrOfWorkers() = 1
  plan(): Setting new future strategy stack:
  List of future strategies:
  1. multicore:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, workers = availableCores(constraints = "multicore"), earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: plan(list(a = strategy1, b = strategy2))
  
  plan(): nbrOfWorkers() = 1
  SequentialFuture started (and completed)
  [20:53:03.106] Chunk #1 of 1 ... DONE
  [20:53:03.107] Launching 1 futures (chunks) ... DONE
  [20:53:03.107] - resolving futures
  resolve() on list ...
   recursive: 0
   length: 1
  
   length: 0 (resolved future 1)
  resolve() on list ... DONE
  [20:53:03.110] - relaying conditions of futures
  Future state: 'finished'
  sequential:- args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)- tweaked: FALSE- call: NULL
  sequential:- args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)- tweaked: FALSE- call: NULL
  sequential:- args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)- tweaked: FALSE- call: NULL
  [20:53:03.111] - collecting values of futures
  [20:53:03.112] - accumulating results
  [20:53:03.113] - processing errors (handler = 'stop')
  [20:53:03.114] - extracting results
  [20:53:03.114] doFuture() ... DONE
  foreach() - level 2 ... DONE
  List of 1
   $ b:function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, workers = availableCores(constraints = "multicore"), 
      earlySignal = FALSE, label = NULL, ...)  
    ..- attr(*, "class")= chr [1:4] "multicore" "multiprocess" "future" "function"
    ..- attr(*, "call")= language plan(list(a = strategy1, b = strategy2))
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  List of 1
   $ :function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
      ...)  
    ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  List of 1
   $ :function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
      ...)  
    ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  List of 1
   $ :function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
      ...)  
    ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  Future state: 'finished'
  foreach() - level 2 ...
  [20:53:03.004] doFuture() ...
  [20:53:03.007] - dummy globals (as locals): [1] 'b'
  [20:53:03.009] - R expression:
  [20:53:03.009] {
  [20:53:03.009]     doFuture::registerDoFuture()
  [20:53:03.009]     lapply(seq_along(...future.x_ii), FUN = function(jj) {
  [20:53:03.009]         ...future.x_jj <- ...future.x_ii[[jj]]
  [20:53:03.009]         b <- NULL
  [20:53:03.009]         ...future.env <- environment()
  [20:53:03.009]         local({
  [20:53:03.009]             for (name in names(...future.x_jj)) {
  [20:53:03.009]                 assign(name, ...future.x_jj[[name]], envir = ...future.env, 
  [20:53:03.009]                   inherits = FALSE)
  [20:53:03.009]             }
  [20:53:03.009]         })
  [20:53:03.009]         tryCatch({
  [20:53:03.009]             plan_list <- future::plan()
  [20:53:03.009]             message(capture.output(print(plan_list)))
  [20:53:03.009]             stopifnot(inherits(plan_list, "future"), inherits(plan_list, 
  [20:53:03.009]                 getOption("future.default", "sequential")))
  [20:53:03.009]             plan_b <- future::plan("list")
  [20:53:03.009]             str(plan_b)
  [20:53:03.009]             stopifnot(inherits(plan_b[[1]], "future"), inherits(plan_b[[1]], 
  [20:53:03.009]                 getOption("future.default", "sequential")))
  [20:53:03.009]             list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
  [20:53:03.009]         }, error = identity)
  [20:53:03.009]     })
  [20:53:03.009] }
  [20:53:03.011] - identifying globals and packages ...
  getGlobalsAndPackages() ...
  Searching for globals...
  - globals found: [24] '{', '::', 'lapply', 'seq_along', '...future.x_ii', '<-', '[[', 'environment', 'local', 'for', 'names', 'assign', 'tryCatch', 'message', 'capture.output', 'print', 'stopifnot', 'inherits', 'getOption', 'str', 'list', 'a', 'plan_a', 'identity'
  Searching for globals ... DONE
  Resolving globals: FALSE
  The total size of the 3 globals is 74.09 KiB (75872 bytes)
  - globals: [3] '...future.x_ii', 'a', 'plan_a'
  - packages: [1] 'utils'
  getGlobalsAndPackages() ... DONE
  [20:53:03.108] List of 3
  [20:53:03.108]  $ ...future.x_ii: NULL
  [20:53:03.108]  $ a             : int 2
  [20:53:03.108]  $ plan_a        :List of 1
  [20:53:03.108]   ..$ b:function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
  [20:53:03.108]     seed = NULL, globals = TRUE, workers = availableCores(constraints = "multicore"), 
  [20:53:03.108]     earlySignal = FALSE, label = NULL, ...)  
  [20:53:03.108]   .. ..- attr(*, "class")= chr [1:4] "multicore" "multiprocess" "future" "function"
  [20:53:03.108]   .. ..- attr(*, "call")= language plan(list(a = strategy1, b = strategy2))
  [20:53:03.108]   ..- attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  [20:53:03.108]  - attr(*, "where")=List of 3
  [20:53:03.108]   ..$ ...future.x_ii:<environment: 0x55a47e0069f0> 
  [20:53:03.108]   ..$ a             :<environment: 0x55a47df0e020> 
  [20:53:03.108]   ..$ plan_a        :<environment: 0x55a47df0e020> 
  [20:53:03.108]  - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list"
  [20:53:03.108]  - attr(*, "resolved")= logi FALSE
  [20:53:03.108]  - attr(*, "total_size")= num 75872
  [20:53:03.140]   - R expression:
  [20:53:03.141] {
  [20:53:03.141]     doFuture::registerDoFuture()
  [20:53:03.141]     lapply(seq_along(...future.x_ii), FUN = function(jj) {
  [20:53:03.141]         ...future.x_jj <- ...future.x_ii[[jj]]
  [20:53:03.141]         b <- NULL
  [20:53:03.141]         ...future.env <- environment()
  [20:53:03.141]         local({
  [20:53:03.141]             for (name in names(...future.x_jj)) {
  [20:53:03.141]                 assign(name, ...future.x_jj[[name]], envir = ...future.env, 
  [20:53:03.141]                   inherits = FALSE)
  [20:53:03.141]             }
  [20:53:03.141]         })
  [20:53:03.141]         tryCatch({
  [20:53:03.141]             plan_list <- future::plan()
  [20:53:03.141]             message(capture.output(print(plan_list)))
  [20:53:03.141]             stopifnot(inherits(plan_list, "future"), inherits(plan_list, 
  [20:53:03.141]                 getOption("future.default", "sequential")))
  [20:53:03.141]             plan_b <- future::plan("list")
  [20:53:03.141]             str(plan_b)
  [20:53:03.141]             stopifnot(inherits(plan_b[[1]], "future"), inherits(plan_b[[1]], 
  [20:53:03.141]                 getOption("future.default", "sequential")))
  [20:53:03.141]             list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
  [20:53:03.141]         }, error = identity)
  [20:53:03.141]     })
  [20:53:03.141] }
  [20:53:03.142]   - globals: [3] '...future.x_ii', 'a', 'plan_a'
  [20:53:03.159] List of 3
  [20:53:03.159]  $ ...future.x_ii: NULL
  [20:53:03.159]  $ a             : int 2
  [20:53:03.159]  $ plan_a        :List of 1
  [20:53:03.159]   ..$ b:function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
  [20:53:03.159]     seed = NULL, globals = TRUE, workers = availableCores(constraints = "multicore"), 
  [20:53:03.159]     earlySignal = FALSE, label = NULL, ...)  
  [20:53:03.159]   .. ..- attr(*, "class")= chr [1:4] "multicore" "multiprocess" "future" "function"
  [20:53:03.159]   .. ..- attr(*, "call")= language plan(list(a = strategy1, b = strategy2))
  [20:53:03.159]   ..- attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  [20:53:03.159]  - attr(*, "where")=List of 3
  [20:53:03.159]   ..$ ...future.x_ii:<environment: 0x55a47e0069f0> 
  [20:53:03.159]   ..$ a             :<environment: 0x55a47df0e020> 
  [20:53:03.159]   ..$ plan_a        :<environment: 0x55a47df0e020> 
  [20:53:03.159]  - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list"
  [20:53:03.159]  - attr(*, "resolved")= logi FALSE
  [20:53:03.159]  - attr(*, "total_size")= num 75872
  [20:53:03.173]   - packages: [2] 'doFuture', 'utils'
  [20:53:03.173] - identifying globals and packages ... DONE
  [20:53:03.174] Number of chunks: 1
  [20:53:03.191] Number of futures (= number of chunks): 1
  [20:53:03.191] Launching 1 futures (chunks) ...
  [20:53:03.192] Chunk #1 of 1 ...
  [20:53:03.192]  - Finding globals in 'args_list' chunk #1 ...
  getGlobalsAndPackages() ...
  Searching for globals...
  
  Searching for globals ... DONE
  - globals: [0] <none>
  getGlobalsAndPackages() ... DONE
  [20:53:03.196] 
  [20:53:03.196] 
  [20:53:03.197]  - Finding globals in 'args_list' for chunk #1 ... DONE
  getGlobalsAndPackages() ...
  - globals passed as-is: [3] '...future.x_ii', 'a', 'plan_a'
  Resolving globals: FALSE
  The total size of the 3 globals is 74.26 KiB (76040 bytes)
  - globals: [3] '...future.x_ii', 'a', 'plan_a'
  
  getGlobalsAndPackages() ... DONE
  Packages needed by future strategies (n = 0): <none>
  Packages needed by the future expression (n = 2): 'doFuture', 'utils'
  {
      {
          ...future.startTime <- Sys.time()
          ...future.oldOptions <- options(future.startup.loadScript = FALSE, 
              future.globals.onMissing = "ignore", future.globals.maxSize = NULL, 
              future.globals.method = NULL, future.globals.onMissing = "ignore", 
              future.globals.onReference = NULL, future.globals.resolve = NULL, 
              future.resolve.recursive = NULL, width = 80L)
          {
              {
                  {
                    has_future <- requireNamespace("future", quietly = TRUE)
                    version <- if (has_future) 
                      packageVersion("future")
                    else NULL
                    if (!has_future || version < "1.8.0") {
                      info <- c(r_version = gsub("R version ", 
                        "", R.version$version.string), platform = sprintf("%s (%s-bit)", 
                        R.version$platform, 8 * .Machine$sizeof.pointer), 
                        os = paste(Sys.info()[c("sysname", "release", 
                          "version")], collapse = " "), hostname = Sys.info()[["nodename"]])
                      info <- sprintf("%s: %s", names(info), info)
                      info <- paste(info, collapse = "; ")
                      if (!has_future) {
                        msg <- sprintf("Package 'future' is not installed on worker (%s)", 
                          info)
                      }
                      else {
                        msg <- sprintf("Package 'future' on worker (%s) must be of version >= 1.8.0: %s", 
                          info, version)
                      }
                      stop(msg)
                    }
                  }
                  local({
                    for (pkg in c("doFuture", "utils")) {
                      loadNamespace(pkg)
                      library(pkg, character.only = TRUE)
                    }
                  })
              }
              future::plan("default", .cleanup = FALSE, .init = FALSE)
          }
      }
      if (is.na(TRUE)) {
      }
      else {
          if (TRUE) {
              ...future.stdout <- rawConnection(raw(0L), open = "w")
          }
          else {
              ...future.stdout <- file(switch(.Platform$OS.type, 
                  windows = "NUL", "/dev/null"), open = "w")
          }
          sink(...future.stdout, type = "output", split = FALSE)
          on.exit(if (!is.null(...future.stdout)) {
              sink(type = "output", split = FALSE)
              close(...future.stdout)
          }, add = TRUE)
      }
      ...future.frame <- sys.nframe()
      ...future.conditions <- list()
      ...future.result <- tryCatch({
          withCallingHandlers({
              ...future.value <- local({
                  doFuture::registerDoFuture()
                  lapply(seq_along(...future.x_ii), FUN = function(jj) {
                    ...future.x_jj <- ...future.x_ii[[jj]]
                    b <- NULL
                    ...future.env <- environment()
                    local({
                      for (name in names(...future.x_jj)) {
                        assign(name, ...future.x_jj[[name]], envir = ...future.env, 
                          inherits = FALSE)
                      }
                    })
                    tryCatch({
                      plan_list <- future::plan()
                      message(capture.output(print(plan_list)))
                      stopifnot(inherits(plan_list, "future"), 
                        inherits(plan_list, getOption("future.default", 
                          "sequential")))
                      plan_b <- future::plan("list")
                      str(plan_b)
                      stopifnot(inherits(plan_b[[1]], "future"), 
                        inherits(plan_b[[1]], getOption("future.default", 
                          "sequential")))
                      list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
                    }, error = identity)
                  })
              })
              future::FutureResult(value = ...future.value, started = ...future.startTime, 
                  version = "1.8")
          }, condition = local({
              inherits <- base::inherits
              invokeRestart <- base::invokeRestart
              length <- base::length
              seq.int <- base::seq.int
              sys.calls <- base::sys.calls
              `[[` <- base::`[[`
              `+` <- base::`+`
              `<<-` <- base::`<<-`
              sysCalls <- function(calls = sys.calls(), from = 1L) {
                  calls[seq.int(from = from + 12L, to = length(calls) - 
                    3L)]
              }
              function(cond) {
                  if (inherits(cond, "error")) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond, calls = c(sysCalls(from = ...future.frame), 
                      cond$call), timestamp = base::Sys.time())
                    signalCondition(cond)
                  }
                  else if (inherits(cond, c("message", "warning"
                  ))) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond)
                    if (inherits(cond, "message")) {
                      invokeRestart("muffleMessage")
                    }
                    else if (inherits(cond, "warning")) {
                      invokeRestart("muffleWarning")
                    }
                  }
              }
          }))
      }, error = function(ex) {
          structure(list(value = NULL, conditions = ...future.conditions, 
              condition = ex, calls = sys.calls(), version = "1.8"), 
              class = "FutureResult")
      }, finally = {
          {
              NULL
              future::plan(list(b = function (expr, envir = parent.frame(), 
                  substitute = TRUE, lazy = FALSE, seed = NULL, 
                  globals = TRUE, workers = availableCores(constraints = "multicore"), 
                  earlySignal = FALSE, label = NULL, ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  if (is.function(workers)) 
                    workers <- workers()
                  workers <- as.integer(workers)
                  stop_if_not(is.finite(workers), workers >= 1L)
                  if (workers == 1L || !supportsMulticore()) {
                    return(sequential(expr, envir = envir, substitute = FALSE, 
                      lazy = lazy, seed = seed, globals = globals, 
                      local = TRUE, label = label, ...))
                  }
                  oopts <- options(mc.cores = workers)
                  on.exit(options(oopts))
                  future <- MulticoreFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, workers = workers, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }), .cleanup = FALSE, .init = FALSE)
          }
          options(...future.oldOptions)
      })
      if (is.na(TRUE)) {
      }
      else {
          sink(type = "output", split = FALSE)
          if (TRUE) {
              ...future.result$stdout <- rawToChar(rawConnectionValue(...future.stdout))
          }
          else {
              ...future.result["stdout"] <- list(NULL)
          }
          close(...future.stdout)
          ...future.stdout <- NULL
      }
      ...future.result$conditions <- ...future.conditions
      ...future.result
  }
  plan(): Setting new future strategy stack:
  List of future strategies:
  1. sequential:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: NULL
  
  plan(): nbrOfWorkers() = 1
  plan(): Setting new future strategy stack:
  List of future strategies:
  1. multicore:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, workers = availableCores(constraints = "multicore"), earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: plan(list(a = strategy1, b = strategy2))
  
  plan(): nbrOfWorkers() = 1
  SequentialFuture started (and completed)
  [20:53:03.288] Chunk #1 of 1 ... DONE
  [20:53:03.288] Launching 1 futures (chunks) ... DONE
  [20:53:03.289] - resolving futures
  resolve() on list ...
   recursive: 0
   length: 1
  
   length: 0 (resolved future 1)
  resolve() on list ... DONE
  [20:53:03.291] - relaying conditions of futures
  Future state: 'finished'
  sequential:- args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)- tweaked: FALSE- call: NULL
  sequential:- args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)- tweaked: FALSE- call: NULL
  sequential:- args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)- tweaked: FALSE- call: NULL
  [20:53:03.293] - collecting values of futures
  [20:53:03.294] - accumulating results
  [20:53:03.295] - processing errors (handler = 'stop')
  [20:53:03.296] - extracting results
  [20:53:03.296] doFuture() ... DONE
  foreach() - level 2 ... DONE
  [20:53:03.337] - collecting values of futures
  [20:53:03.338] - accumulating results
  [20:53:03.339] - processing errors (handler = 'stop')
  [20:53:03.339] - extracting results
  [20:53:03.340] doFuture() ... DONE
  foreach() - level 1 ... DONE
  - plan(list('multicore', 'multicore')) ... DONE
  - plan(list('multicore', 'multisession')) ...
  plan(): Setting new future strategy stack:
  List of future strategies:
  1. multicore:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, workers = availableCores(constraints = "multicore"), earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: plan(list(a = strategy1, b = strategy2))
  2. multisession:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, persistent = FALSE, workers = availableCores(), gc = FALSE, earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: plan(list(a = strategy1, b = strategy2))
  
  plan(): nbrOfWorkers() = 2
  foreach() - level 1 ...
  [20:53:03.349] doFuture() ...
  [20:53:03.351] - dummy globals (as locals): [1] 'a'
  [20:53:03.352] - R expression:
  [20:53:03.352] {
  [20:53:03.352]     doFuture::registerDoFuture()
  [20:53:03.352]     lapply(seq_along(...future.x_ii), FUN = function(jj) {
  [20:53:03.352]         ...future.x_jj <- ...future.x_ii[[jj]]
  [20:53:03.352]         a <- NULL
  [20:53:03.352]         ...future.env <- environment()
  [20:53:03.352]         local({
  [20:53:03.352]             for (name in names(...future.x_jj)) {
  [20:53:03.352]                 assign(name, ...future.x_jj[[name]], envir = ...future.env, 
  [20:53:03.352]                   inherits = FALSE)
  [20:53:03.352]             }
  [20:53:03.352]         })
  [20:53:03.352]         tryCatch({
  [20:53:03.352]             plan_list <- future::plan()
  [20:53:03.352]             stopifnot(inherits(plan_list, strategy2))
  [20:53:03.352]             plan_a <- future::plan("list")
  [20:53:03.352]             str(plan_a)
  [20:53:03.352]             stopifnot(inherits(plan_a[[1]], strategy2))
  [20:53:03.352]             message("foreach() - level 2 ...")
  [20:53:03.352]             y <- foreach(b = bs, .export = c("a", "plan_a")) %dopar% 
  [20:53:03.352]                 {
  [20:53:03.352]                   plan_list <- future::plan()
  [20:53:03.352]                   message(capture.output(print(plan_list)))
  [20:53:03.352]                   stopifnot(inherits(plan_list, "future"), inherits(plan_list, 
  [20:53:03.352]                     getOption("future.default", "sequential")))
  [20:53:03.352]                   plan_b <- future::plan("list")
  [20:53:03.352]                   str(plan_b)
  [20:53:03.352]                   stopifnot(inherits(plan_b[[1]], "future"), 
  [20:53:03.352]                     inherits(plan_b[[1]], getOption("future.default", 
  [20:53:03.352]                       "sequential")))
  [20:53:03.352]                   list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
  [20:53:03.352]                 }
  [20:53:03.352]             message("foreach() - level 2 ... DONE")
  [20:53:03.352]             y
  [20:53:03.352]         }, error = identity)
  [20:53:03.352]     })
  [20:53:03.352] }
  [20:53:03.354] - identifying globals and packages ...
  getGlobalsAndPackages() ...
  Searching for globals...
  - globals found: [28] '{', '::', 'lapply', 'seq_along', '...future.x_ii', '<-', '[[', 'environment', 'local', 'for', 'names', 'assign', 'tryCatch', 'stopifnot', 'inherits', 'strategy2', 'str', 'message', '%dopar%', 'foreach', 'bs', 'c', 'capture.output', 'print', 'getOption', 'list', 'b', 'identity'
  Searching for globals ... DONE
  Resolving globals: FALSE
  The total size of the 3 globals is 184 bytes (184 bytes)
  - globals: [3] '...future.x_ii', 'strategy2', 'bs'
  - packages: [2] 'utils', 'foreach'
  getGlobalsAndPackages() ... DONE
  [20:53:03.408] List of 3
  [20:53:03.408]  $ ...future.x_ii: NULL
  [20:53:03.408]  $ strategy2     : chr "multisession"
  [20:53:03.408]  $ bs            : int [1:3] 3 2 1
  [20:53:03.408]  - attr(*, "where")=List of 3
  [20:53:03.408]   ..$ ...future.x_ii:<environment: 0x55a47f9c1e08> 
  [20:53:03.408]   ..$ strategy2     :<environment: R_GlobalEnv> 
  [20:53:03.408]   ..$ bs            :<environment: R_GlobalEnv> 
  [20:53:03.408]  - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list"
  [20:53:03.408]  - attr(*, "resolved")= logi FALSE
  [20:53:03.408]  - attr(*, "total_size")= num 184
  [20:53:03.424]   - R expression:
  [20:53:03.424] {
  [20:53:03.424]     doFuture::registerDoFuture()
  [20:53:03.424]     lapply(seq_along(...future.x_ii), FUN = function(jj) {
  [20:53:03.424]         ...future.x_jj <- ...future.x_ii[[jj]]
  [20:53:03.424]         a <- NULL
  [20:53:03.424]         ...future.env <- environment()
  [20:53:03.424]         local({
  [20:53:03.424]             for (name in names(...future.x_jj)) {
  [20:53:03.424]                 assign(name, ...future.x_jj[[name]], envir = ...future.env, 
  [20:53:03.424]                   inherits = FALSE)
  [20:53:03.424]             }
  [20:53:03.424]         })
  [20:53:03.424]         tryCatch({
  [20:53:03.424]             plan_list <- future::plan()
  [20:53:03.424]             stopifnot(inherits(plan_list, strategy2))
  [20:53:03.424]             plan_a <- future::plan("list")
  [20:53:03.424]             str(plan_a)
  [20:53:03.424]             stopifnot(inherits(plan_a[[1]], strategy2))
  [20:53:03.424]             message("foreach() - level 2 ...")
  [20:53:03.424]             y <- foreach(b = bs, .export = c("a", "plan_a")) %dopar% 
  [20:53:03.424]                 {
  [20:53:03.424]                   plan_list <- future::plan()
  [20:53:03.424]                   message(capture.output(print(plan_list)))
  [20:53:03.424]                   stopifnot(inherits(plan_list, "future"), inherits(plan_list, 
  [20:53:03.424]                     getOption("future.default", "sequential")))
  [20:53:03.424]                   plan_b <- future::plan("list")
  [20:53:03.424]                   str(plan_b)
  [20:53:03.424]                   stopifnot(inherits(plan_b[[1]], "future"), 
  [20:53:03.424]                     inherits(plan_b[[1]], getOption("future.default", 
  [20:53:03.424]                       "sequential")))
  [20:53:03.424]                   list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
  [20:53:03.424]                 }
  [20:53:03.424]             message("foreach() - level 2 ... DONE")
  [20:53:03.424]             y
  [20:53:03.424]         }, error = identity)
  [20:53:03.424]     })
  [20:53:03.424] }
  [20:53:03.426]   - globals: [3] '...future.x_ii', 'strategy2', 'bs'
  [20:53:03.426] List of 3
  [20:53:03.426]  $ ...future.x_ii: NULL
  [20:53:03.426]  $ strategy2     : chr "multisession"
  [20:53:03.426]  $ bs            : int [1:3] 3 2 1
  [20:53:03.426]  - attr(*, "where")=List of 3
  [20:53:03.426]   ..$ ...future.x_ii:<environment: 0x55a47f9c1e08> 
  [20:53:03.426]   ..$ strategy2     :<environment: R_GlobalEnv> 
  [20:53:03.426]   ..$ bs            :<environment: R_GlobalEnv> 
  [20:53:03.426]  - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list"
  [20:53:03.426]  - attr(*, "resolved")= logi FALSE
  [20:53:03.426]  - attr(*, "total_size")= num 184
  [20:53:03.438]   - packages: [3] 'doFuture', 'utils', 'foreach'
  [20:53:03.438] - identifying globals and packages ... DONE
  [20:53:03.440] Number of chunks: 2
  [20:53:03.440] Number of futures (= number of chunks): 2
  [20:53:03.441] Launching 2 futures (chunks) ...
  [20:53:03.441] Chunk #1 of 2 ...
  [20:53:03.441]  - Finding globals in 'args_list' chunk #1 ...
  getGlobalsAndPackages() ...
  Searching for globals...
  
  Searching for globals ... DONE
  - globals: [0] <none>
  getGlobalsAndPackages() ... DONE
  [20:53:03.444] 
  [20:53:03.444] 
  [20:53:03.444]  - Finding globals in 'args_list' for chunk #1 ... DONE
  getGlobalsAndPackages() ...
  - globals passed as-is: [3] '...future.x_ii', 'strategy2', 'bs'
  Resolving globals: FALSE
  The total size of the 3 globals is 240 bytes (240 bytes)
  - globals: [3] '...future.x_ii', 'strategy2', 'bs'
  
  getGlobalsAndPackages() ... DONE
  Packages needed by future strategies (n = 1): 'future'
  Packages needed by the future expression (n = 3): 'doFuture', 'utils', 'foreach'
  {
      {
          ...future.startTime <- Sys.time()
          ...future.oldOptions <- options(future.startup.loadScript = FALSE, 
              future.globals.onMissing = "ignore", future.globals.maxSize = NULL, 
              future.globals.method = NULL, future.globals.onMissing = "ignore", 
              future.globals.onReference = NULL, future.globals.resolve = NULL, 
              future.resolve.recursive = NULL, width = 80L)
          {
              {
                  {
                    {
                      has_future <- requireNamespace("future", 
                        quietly = TRUE)
                      version <- if (has_future) 
                        packageVersion("future")
                      else NULL
                      if (!has_future || version < "1.8.0") {
                        info <- c(r_version = gsub("R version ", 
                          "", R.version$version.string), platform = sprintf("%s (%s-bit)", 
                          R.version$platform, 8 * .Machine$sizeof.pointer), 
                          os = paste(Sys.info()[c("sysname", "release", 
                            "version")], collapse = " "), hostname = Sys.info()[["nodename"]])
                        info <- sprintf("%s: %s", names(info), 
                          info)
                        info <- paste(info, collapse = "; ")
                        if (!has_future) {
                          msg <- sprintf("Package 'future' is not installed on worker (%s)", 
                            info)
                        }
                        else {
                          msg <- sprintf("Package 'future' on worker (%s) must be of version >= 1.8.0: %s", 
                            info, version)
                        }
                        stop(msg)
                      }
                    }
                    ...future.mc.cores.old <- getOption("mc.cores")
                    options(mc.cores = 1L)
                  }
                  local({
                    for (pkg in c("future", "doFuture", "utils", 
                    "foreach")) {
                      loadNamespace(pkg)
                      library(pkg, character.only = TRUE)
                    }
                  })
              }
              future::plan(list(b = function (expr, envir = parent.frame(), 
                  substitute = TRUE, lazy = FALSE, seed = NULL, 
                  globals = TRUE, persistent = FALSE, workers = availableCores(), 
                  gc = FALSE, earlySignal = FALSE, label = NULL, 
                  ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  if (is.function(workers)) 
                    workers <- workers()
                  workers <- as.integer(workers)
                  stop_if_not(length(workers) == 1, is.finite(workers), 
                    workers >= 1)
                  if (workers == 1L) {
                    return(sequential(expr, envir = envir, substitute = FALSE, 
                      lazy = TRUE, seed = seed, globals = globals, 
                      local = TRUE, label = label, ...))
                  }
                  workers <- ClusterRegistry("start", workers = workers)
                  future <- MultisessionFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, persistent = persistent, 
                    workers = workers, gc = gc, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }), .cleanup = FALSE, .init = FALSE)
          }
      }
      if (is.na(TRUE)) {
      }
      else {
          if (TRUE) {
              ...future.stdout <- rawConnection(raw(0L), open = "w")
          }
          else {
              ...future.stdout <- file(switch(.Platform$OS.type, 
                  windows = "NUL", "/dev/null"), open = "w")
          }
          sink(...future.stdout, type = "output", split = FALSE)
          on.exit(if (!is.null(...future.stdout)) {
              sink(type = "output", split = FALSE)
              close(...future.stdout)
          }, add = TRUE)
      }
      ...future.frame <- sys.nframe()
      ...future.conditions <- list()
      ...future.result <- tryCatch({
          withCallingHandlers({
              ...future.value <- local({
                  doFuture::registerDoFuture()
                  lapply(seq_along(...future.x_ii), FUN = function(jj) {
                    ...future.x_jj <- ...future.x_ii[[jj]]
                    a <- NULL
                    ...future.env <- environment()
                    local({
                      for (name in names(...future.x_jj)) {
                        assign(name, ...future.x_jj[[name]], envir = ...future.env, 
                          inherits = FALSE)
                      }
                    })
                    tryCatch({
                      plan_list <- future::plan()
                      stopifnot(inherits(plan_list, strategy2))
                      plan_a <- future::plan("list")
                      str(plan_a)
                      stopifnot(inherits(plan_a[[1]], strategy2))
                      message("foreach() - level 2 ...")
                      y <- foreach(b = bs, .export = c("a", "plan_a")) %dopar% 
                        {
                          plan_list <- future::plan()
                          message(capture.output(print(plan_list)))
                          stopifnot(inherits(plan_list, "future"), 
                            inherits(plan_list, getOption("future.default", 
                              "sequential")))
                          plan_b <- future::plan("list")
                          str(plan_b)
                          stopifnot(inherits(plan_b[[1]], "future"), 
                            inherits(plan_b[[1]], getOption("future.default", 
                              "sequential")))
                          list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
                        }
                      message("foreach() - level 2 ... DONE")
                      y
                    }, error = identity)
                  })
              })
              future::FutureResult(value = ...future.value, started = ...future.startTime, 
                  version = "1.8")
          }, condition = local({
              inherits <- base::inherits
              invokeRestart <- base::invokeRestart
              length <- base::length
              seq.int <- base::seq.int
              sys.calls <- base::sys.calls
              `[[` <- base::`[[`
              `+` <- base::`+`
              `<<-` <- base::`<<-`
              sysCalls <- function(calls = sys.calls(), from = 1L) {
                  calls[seq.int(from = from + 12L, to = length(calls) - 
                    3L)]
              }
              function(cond) {
                  if (inherits(cond, "error")) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond, calls = c(sysCalls(from = ...future.frame), 
                      cond$call), timestamp = base::Sys.time())
                    signalCondition(cond)
                  }
                  else if (inherits(cond, c("message", "warning"
                  ))) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond)
                    if (inherits(cond, "message")) {
                      invokeRestart("muffleMessage")
                    }
                    else if (inherits(cond, "warning")) {
                      invokeRestart("muffleWarning")
                    }
                  }
              }
          }))
      }, error = function(ex) {
          structure(list(value = NULL, conditions = ...future.conditions, 
              condition = ex, calls = sys.calls(), version = "1.8"), 
              class = "FutureResult")
      }, finally = {
          {
              {
                  options(mc.cores = ...future.mc.cores.old)
              }
              future::plan(list(a = function (expr, envir = parent.frame(), 
                  substitute = TRUE, lazy = FALSE, seed = NULL, 
                  globals = TRUE, workers = availableCores(constraints = "multicore"), 
                  earlySignal = FALSE, label = NULL, ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  if (is.function(workers)) 
                    workers <- workers()
                  workers <- as.integer(workers)
                  stop_if_not(is.finite(workers), workers >= 1L)
                  if (workers == 1L || !supportsMulticore()) {
                    return(sequential(expr, envir = envir, substitute = FALSE, 
                      lazy = lazy, seed = seed, globals = globals, 
                      local = TRUE, label = label, ...))
                  }
                  oopts <- options(mc.cores = workers)
                  on.exit(options(oopts))
                  future <- MulticoreFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, workers = workers, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }, b = function (expr, envir = parent.frame(), substitute = TRUE, 
                  lazy = FALSE, seed = NULL, globals = TRUE, persistent = FALSE, 
                  workers = availableCores(), gc = FALSE, earlySignal = FALSE, 
                  label = NULL, ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  if (is.function(workers)) 
                    workers <- workers()
                  workers <- as.integer(workers)
                  stop_if_not(length(workers) == 1, is.finite(workers), 
                    workers >= 1)
                  if (workers == 1L) {
                    return(sequential(expr, envir = envir, substitute = FALSE, 
                      lazy = TRUE, seed = seed, globals = globals, 
                      local = TRUE, label = label, ...))
                  }
                  workers <- ClusterRegistry("start", workers = workers)
                  future <- MultisessionFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, persistent = persistent, 
                    workers = workers, gc = gc, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }), .cleanup = FALSE, .init = FALSE)
          }
          options(...future.oldOptions)
      })
      if (is.na(TRUE)) {
      }
      else {
          sink(type = "output", split = FALSE)
          if (TRUE) {
              ...future.result$stdout <- rawToChar(rawConnectionValue(...future.stdout))
          }
          else {
              ...future.result["stdout"] <- list(NULL)
          }
          close(...future.stdout)
          ...future.stdout <- NULL
      }
      ...future.result$conditions <- ...future.conditions
      ...future.result
  }
  requestCore(): workers = 2
  MulticoreFuture started
  [20:53:03.465] Chunk #1 of 2 ... DONE
  [20:53:03.465] Chunk #2 of 2 ...
  [20:53:03.466]  - Finding globals in 'args_list' chunk #2 ...
  getGlobalsAndPackages() ...
  Searching for globals...
  
  Searching for globals ... DONE
  - globals: [0] <none>
  getGlobalsAndPackages() ... DONE
  [20:53:03.469] 
  [20:53:03.469] 
  [20:53:03.470]  - Finding globals in 'args_list' for chunk #2 ... DONE
  getGlobalsAndPackages() ...
  - globals passed as-is: [3] '...future.x_ii', 'strategy2', 'bs'
  Resolving globals: FALSE
  The total size of the 3 globals is 240 bytes (240 bytes)
  - globals: [3] '...future.x_ii', 'strategy2', 'bs'
  
  getGlobalsAndPackages() ... DONE
  Packages needed by future strategies (n = 1): 'future'
  plan(): Setting new future strategy stack:
  List of future strategies:
  1. multisession:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, persistent = FALSE, workers = availableCores(), gc = FALSE, earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: plan(list(a = strategy1, b = strategy2))
  
  plan(): nbrOfWorkers() = 1
  Packages needed by the future expression (n = 3): 'doFuture', 'utils', 'foreach'
  {
      {
          ...future.startTime <- Sys.time()
          ...future.oldOptions <- options(future.startup.loadScript = FALSE, 
              future.globals.onMissing = "ignore", future.globals.maxSize = NULL, 
              future.globals.method = NULL, future.globals.onMissing = "ignore", 
              future.globals.onReference = NULL, future.globals.resolve = NULL, 
              future.resolve.recursive = NULL, width = 80L)
          {
              {
                  {
                    {
                      has_future <- requireNamespace("future", 
                        quietly = TRUE)
                      version <- if (has_future) 
                        packageVersion("future")
                      else NULL
                      if (!has_future || version < "1.8.0") {
                        info <- c(r_version = gsub("R version ", 
                          "", R.version$version.string), platform = sprintf("%s (%s-bit)", 
                          R.version$platform, 8 * .Machine$sizeof.pointer), 
                          os = paste(Sys.info()[c("sysname", "release", 
                            "version")], collapse = " "), hostname = Sys.info()[["nodename"]])
                        info <- sprintf("%s: %s", names(info), 
                          info)
                        info <- paste(info, collapse = "; ")
                        if (!has_future) {
                          msg <- sprintf("Package 'future' is not installed on worker (%s)", 
                            info)
                        }
                        else {
                          msg <- sprintf("Package 'future' on worker (%s) must be of version >= 1.8.0: %s", 
                            info, version)
                        }
                        stop(msg)
                      }
                    }
                    ...future.mc.cores.old <- getOption("mc.cores")
                    options(mc.cores = 1L)
                  }
                  local({
                    for (pkg in c("future", "doFuture", "utils", 
                    "foreach")) {
                      loadNamespace(pkg)
                      library(pkg, character.only = TRUE)
                    }
                  })
              }
              future::plan(list(b = function (expr, envir = parent.frame(), 
                  substitute = TRUE, lazy = FALSE, seed = NULL, 
                  globals = TRUE, persistent = FALSE, workers = availableCores(), 
                  gc = FALSE, earlySignal = FALSE, label = NULL, 
                  ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  if (is.function(workers)) 
                    workers <- workers()
                  workers <- as.integer(workers)
                  stop_if_not(length(workers) == 1, is.finite(workers), 
                    workers >= 1)
                  if (workers == 1L) {
                    return(sequential(expr, envir = envir, substitute = FALSE, 
                      lazy = TRUE, seed = seed, globals = globals, 
                      local = TRUE, label = label, ...))
                  }
                  workers <- ClusterRegistry("start", workers = workers)
                  future <- MultisessionFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, persistent = persistent, 
                    workers = workers, gc = gc, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }), .cleanup = FALSE, .init = FALSE)
          }
      }
      if (is.na(TRUE)) {
      }
      else {
          if (TRUE) {
              ...future.stdout <- rawConnection(raw(0L), open = "w")
          }
          else {
              ...future.stdout <- file(switch(.Platform$OS.type, 
                  windows = "NUL", "/dev/null"), open = "w")
          }
          sink(...future.stdout, type = "output", split = FALSE)
          on.exit(if (!is.null(...future.stdout)) {
              sink(type = "output", split = FALSE)
              close(...future.stdout)
          }, add = TRUE)
      }
      ...future.frame <- sys.nframe()
      ...future.conditions <- list()
      ...future.result <- tryCatch({
          withCallingHandlers({
              ...future.value <- local({
                  doFuture::registerDoFuture()
                  lapply(seq_along(...future.x_ii), FUN = function(jj) {
                    ...future.x_jj <- ...future.x_ii[[jj]]
                    a <- NULL
                    ...future.env <- environment()
                    local({
                      for (name in names(...future.x_jj)) {
                        assign(name, ...future.x_jj[[name]], envir = ...future.env, 
                          inherits = FALSE)
                      }
                    })
                    tryCatch({
                      plan_list <- future::plan()
                      stopifnot(inherits(plan_list, strategy2))
                      plan_a <- future::plan("list")
                      str(plan_a)
                      stopifnot(inherits(plan_a[[1]], strategy2))
                      message("foreach() - level 2 ...")
                      y <- foreach(b = bs, .export = c("a", "plan_a")) %dopar% 
                        {
                          plan_list <- future::plan()
                          message(capture.output(print(plan_list)))
                          stopifnot(inherits(plan_list, "future"), 
                            inherits(plan_list, getOption("future.default", 
                              "sequential")))
                          plan_b <- future::plan("list")
                          str(plan_b)
                          stopifnot(inherits(plan_b[[1]], "future"), 
                            inherits(plan_b[[1]], getOption("future.default", 
                              "sequential")))
                          list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
                        }
                      message("foreach() - level 2 ... DONE")
                      y
                    }, error = identity)
                  })
              })
              future::FutureResult(value = ...future.value, started = ...future.startTime, 
                  version = "1.8")
          }, condition = local({
              inherits <- base::inherits
              invokeRestart <- base::invokeRestart
              length <- base::length
              seq.int <- base::seq.int
              sys.calls <- base::sys.calls
              `[[` <- base::`[[`
              `+` <- base::`+`
              `<<-` <- base::`<<-`
              sysCalls <- function(calls = sys.calls(), from = 1L) {
                  calls[seq.int(from = from + 12L, to = length(calls) - 
                    3L)]
              }
              function(cond) {
                  if (inherits(cond, "error")) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond, calls = c(sysCalls(from = ...future.frame), 
                      cond$call), timestamp = base::Sys.time())
                    signalCondition(cond)
                  }
                  else if (inherits(cond, c("message", "warning"
                  ))) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond)
                    if (inherits(cond, "message")) {
                      invokeRestart("muffleMessage")
                    }
                    else if (inherits(cond, "warning")) {
                      invokeRestart("muffleWarning")
                    }
                  }
              }
          }))
      }, error = function(ex) {
          structure(list(value = NULL, conditions = ...future.conditions, 
              condition = ex, calls = sys.calls(), version = "1.8"), 
              class = "FutureResult")
      }, finally = {
          {
              {
                  options(mc.cores = ...future.mc.cores.old)
              }
              future::plan(list(a = function (expr, envir = parent.frame(), 
                  substitute = TRUE, lazy = FALSE, seed = NULL, 
                  globals = TRUE, workers = availableCores(constraints = "multicore"), 
                  earlySignal = FALSE, label = NULL, ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  if (is.function(workers)) 
                    workers <- workers()
                  workers <- as.integer(workers)
                  stop_if_not(is.finite(workers), workers >= 1L)
                  if (workers == 1L || !supportsMulticore()) {
                    return(sequential(expr, envir = envir, substitute = FALSE, 
                      lazy = lazy, seed = seed, globals = globals, 
                      local = TRUE, label = label, ...))
                  }
                  oopts <- options(mc.cores = workers)
                  on.exit(options(oopts))
                  future <- MulticoreFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, workers = workers, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }, b = function (expr, envir = parent.frame(), substitute = TRUE, 
                  lazy = FALSE, seed = NULL, globals = TRUE, persistent = FALSE, 
                  workers = availableCores(), gc = FALSE, earlySignal = FALSE, 
                  label = NULL, ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  if (is.function(workers)) 
                    workers <- workers()
                  workers <- as.integer(workers)
                  stop_if_not(length(workers) == 1, is.finite(workers), 
                    workers >= 1)
                  if (workers == 1L) {
                    return(sequential(expr, envir = envir, substitute = FALSE, 
                      lazy = TRUE, seed = seed, globals = globals, 
                      local = TRUE, label = label, ...))
                  }
                  workers <- ClusterRegistry("start", workers = workers)
                  future <- MultisessionFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, persistent = persistent, 
                    workers = workers, gc = gc, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }), .cleanup = FALSE, .init = FALSE)
          }
          options(...future.oldOptions)
      })
      if (is.na(TRUE)) {
      }
      else {
          sink(type = "output", split = FALSE)
          if (TRUE) {
              ...future.result$stdout <- rawToChar(rawConnectionValue(...future.stdout))
          }
          else {
              ...future.result["stdout"] <- list(NULL)
          }
          close(...future.stdout)
          ...future.stdout <- NULL
      }
      ...future.result$conditions <- ...future.conditions
      ...future.result
  }
  requestCore(): workers = 2
  MulticoreFuture started
  [20:53:03.529] Chunk #2 of 2 ... DONE
  [20:53:03.530] Launching 2 futures (chunks) ... DONE
  [20:53:03.531] - resolving futures
  resolve() on list ...
   recursive: 0
   length: 2
  
  plan(): Setting new future strategy stack:
  List of future strategies:
  1. multisession:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, persistent = FALSE, workers = availableCores(), gc = FALSE, earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: plan(list(a = strategy1, b = strategy2))
  
  plan(): nbrOfWorkers() = 1
  plan(): Setting new future strategy stack:
  List of future strategies:
  1. multicore:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, workers = availableCores(constraints = "multicore"), earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: plan(list(a = strategy1, b = strategy2))
  2. multisession:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, persistent = FALSE, workers = availableCores(), gc = FALSE, earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: plan(list(a = strategy1, b = strategy2))
  
  plan(): nbrOfWorkers() = 2
   length: 1 (resolved future 1)
  plan(): Setting new future strategy stack:
  List of future strategies:
  1. multicore:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, workers = availableCores(constraints = "multicore"), earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: plan(list(a = strategy1, b = strategy2))
  2. multisession:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, persistent = FALSE, workers = availableCores(), gc = FALSE, earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: plan(list(a = strategy1, b = strategy2))
  
  plan(): nbrOfWorkers() = 2
   length: 0 (resolved future 2)
  resolve() on list ... DONE
  [20:53:03.705] - relaying conditions of futures
  List of 1
   $ b:function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, persistent = FALSE, workers = availableCores(), 
      gc = FALSE, earlySignal = FALSE, label = NULL, ...)  
    ..- attr(*, "class")= chr [1:5] "multisession" "cluster" "multiprocess" "future" ...
    ..- attr(*, "init")= logi TRUE
    ..- attr(*, "call")= language plan(list(a = strategy1, b = strategy2))
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  List of 1
   $ :function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
      ...)  
    ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  List of 1
   $ :function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
      ...)  
    ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  List of 1
   $ :function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
      ...)  
    ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  Future state: 'finished'
  foreach() - level 2 ...
  [20:53:03.502] doFuture() ...
  [20:53:03.505] - dummy globals (as locals): [1] 'b'
  [20:53:03.506] - R expression:
  [20:53:03.507] {
  [20:53:03.507]     doFuture::registerDoFuture()
  [20:53:03.507]     lapply(seq_along(...future.x_ii), FUN = function(jj) {
  [20:53:03.507]         ...future.x_jj <- ...future.x_ii[[jj]]
  [20:53:03.507]         b <- NULL
  [20:53:03.507]         ...future.env <- environment()
  [20:53:03.507]         local({
  [20:53:03.507]             for (name in names(...future.x_jj)) {
  [20:53:03.507]                 assign(name, ...future.x_jj[[name]], envir = ...future.env, 
  [20:53:03.507]                   inherits = FALSE)
  [20:53:03.507]             }
  [20:53:03.507]         })
  [20:53:03.507]         tryCatch({
  [20:53:03.507]             plan_list <- future::plan()
  [20:53:03.507]             message(capture.output(print(plan_list)))
  [20:53:03.507]             stopifnot(inherits(plan_list, "future"), inherits(plan_list, 
  [20:53:03.507]                 getOption("future.default", "sequential")))
  [20:53:03.507]             plan_b <- future::plan("list")
  [20:53:03.507]             str(plan_b)
  [20:53:03.507]             stopifnot(inherits(plan_b[[1]], "future"), inherits(plan_b[[1]], 
  [20:53:03.507]                 getOption("future.default", "sequential")))
  [20:53:03.507]             list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
  [20:53:03.507]         }, error = identity)
  [20:53:03.507]     })
  [20:53:03.507] }
  [20:53:03.509] - identifying globals and packages ...
  getGlobalsAndPackages() ...
  Searching for globals...
  - globals found: [24] '{', '::', 'lapply', 'seq_along', '...future.x_ii', '<-', '[[', 'environment', 'local', 'for', 'names', 'assign', 'tryCatch', 'message', 'capture.output', 'print', 'stopifnot', 'inherits', 'getOption', 'str', 'list', 'a', 'plan_a', 'identity'
  Searching for globals ... DONE
  Resolving globals: FALSE
  The total size of the 3 globals is 81.59 KiB (83544 bytes)
  - globals: [3] '...future.x_ii', 'a', 'plan_a'
  - packages: [1] 'utils'
  getGlobalsAndPackages() ... DONE
  [20:53:03.574] List of 3
  [20:53:03.574]  $ ...future.x_ii: NULL
  [20:53:03.574]  $ a             : int 1
  [20:53:03.574]  $ plan_a        :List of 1
  [20:53:03.574]   ..$ b:function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
  [20:53:03.574]     seed = NULL, globals = TRUE, persistent = FALSE, workers = availableCores(), 
  [20:53:03.574]     gc = FALSE, earlySignal = FALSE, label = NULL, ...)  
  [20:53:03.574]   .. ..- attr(*, "class")= chr [1:5] "multisession" "cluster" "multiprocess" "future" ...
  [20:53:03.574]   .. ..- attr(*, "init")= logi TRUE
  [20:53:03.574]   .. ..- attr(*, "call")= language plan(list(a = strategy1, b = strategy2))
  [20:53:03.574]   ..- attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  [20:53:03.574]  - attr(*, "where")=List of 3
  [20:53:03.574]   ..$ ...future.x_ii:<environment: 0x55a47fb7e630> 
  [20:53:03.574]   ..$ a             :<environment: 0x55a47f852918> 
  [20:53:03.574]   ..$ plan_a        :<environment: 0x55a47f852918> 
  [20:53:03.574]  - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list"
  [20:53:03.574]  - attr(*, "resolved")= logi FALSE
  [20:53:03.574]  - attr(*, "total_size")= num 83544
  [20:53:03.592]   - R expression:
  [20:53:03.592] {
  [20:53:03.592]     doFuture::registerDoFuture()
  [20:53:03.592]     lapply(seq_along(...future.x_ii), FUN = function(jj) {
  [20:53:03.592]         ...future.x_jj <- ...future.x_ii[[jj]]
  [20:53:03.592]         b <- NULL
  [20:53:03.592]         ...future.env <- environment()
  [20:53:03.592]         local({
  [20:53:03.592]             for (name in names(...future.x_jj)) {
  [20:53:03.592]                 assign(name, ...future.x_jj[[name]], envir = ...future.env, 
  [20:53:03.592]                   inherits = FALSE)
  [20:53:03.592]             }
  [20:53:03.592]         })
  [20:53:03.592]         tryCatch({
  [20:53:03.592]             plan_list <- future::plan()
  [20:53:03.592]             message(capture.output(print(plan_list)))
  [20:53:03.592]             stopifnot(inherits(plan_list, "future"), inherits(plan_list, 
  [20:53:03.592]                 getOption("future.default", "sequential")))
  [20:53:03.592]             plan_b <- future::plan("list")
  [20:53:03.592]             str(plan_b)
  [20:53:03.592]             stopifnot(inherits(plan_b[[1]], "future"), inherits(plan_b[[1]], 
  [20:53:03.592]                 getOption("future.default", "sequential")))
  [20:53:03.592]             list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
  [20:53:03.592]         }, error = identity)
  [20:53:03.592]     })
  [20:53:03.592] }
  [20:53:03.594]   - globals: [3] '...future.x_ii', 'a', 'plan_a'
  [20:53:03.594] List of 3
  [20:53:03.594]  $ ...future.x_ii: NULL
  [20:53:03.594]  $ a             : int 1
  [20:53:03.594]  $ plan_a        :List of 1
  [20:53:03.594]   ..$ b:function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
  [20:53:03.594]     seed = NULL, globals = TRUE, persistent = FALSE, workers = availableCores(), 
  [20:53:03.594]     gc = FALSE, earlySignal = FALSE, label = NULL, ...)  
  [20:53:03.594]   .. ..- attr(*, "class")= chr [1:5] "multisession" "cluster" "multiprocess" "future" ...
  [20:53:03.594]   .. ..- attr(*, "init")= logi TRUE
  [20:53:03.594]   .. ..- attr(*, "call")= language plan(list(a = strategy1, b = strategy2))
  [20:53:03.594]   ..- attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  [20:53:03.594]  - attr(*, "where")=List of 3
  [20:53:03.594]   ..$ ...future.x_ii:<environment: 0x55a47fb7e630> 
  [20:53:03.594]   ..$ a             :<environment: 0x55a47f852918> 
  [20:53:03.594]   ..$ plan_a        :<environment: 0x55a47f852918> 
  [20:53:03.594]  - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list"
  [20:53:03.594]  - attr(*, "resolved")= logi FALSE
  [20:53:03.594]  - attr(*, "total_size")= num 83544
  [20:53:03.620]   - packages: [2] 'doFuture', 'utils'
  [20:53:03.620] - identifying globals and packages ... DONE
  [20:53:03.622] Number of chunks: 1
  [20:53:03.622] Number of futures (= number of chunks): 1
  [20:53:03.623] Launching 1 futures (chunks) ...
  [20:53:03.623] Chunk #1 of 1 ...
  [20:53:03.623]  - Finding globals in 'args_list' chunk #1 ...
  getGlobalsAndPackages() ...
  Searching for globals...
  
  Searching for globals ... DONE
  - globals: [0] <none>
  getGlobalsAndPackages() ... DONE
  [20:53:03.627] 
  [20:53:03.628] 
  [20:53:03.628]  - Finding globals in 'args_list' for chunk #1 ... DONE
  getGlobalsAndPackages() ...
  - globals passed as-is: [3] '...future.x_ii', 'a', 'plan_a'
  Resolving globals: FALSE
  The total size of the 3 globals is 81.75 KiB (83712 bytes)
  - globals: [3] '...future.x_ii', 'a', 'plan_a'
  
  getGlobalsAndPackages() ... DONE
  [20:53:03.635] Chunk #1 of 1 ... DONE
  [20:53:03.635] Launching 1 futures (chunks) ... DONE
  [20:53:03.636] - resolving futures
  resolve() on list ...
   recursive: 0
   length: 1
  
  Packages needed by future strategies (n = 0): <none>
  Packages needed by the future expression (n = 2): 'doFuture', 'utils'
  {
      {
          ...future.startTime <- Sys.time()
          ...future.oldOptions <- options(future.startup.loadScript = FALSE, 
              future.globals.onMissing = "ignore", future.globals.maxSize = NULL, 
              future.globals.method = NULL, future.globals.onMissing = "ignore", 
              future.globals.onReference = NULL, future.globals.resolve = NULL, 
              future.resolve.recursive = NULL, width = 80L)
          {
              {
                  {
                    has_future <- requireNamespace("future", quietly = TRUE)
                    version <- if (has_future) 
                      packageVersion("future")
                    else NULL
                    if (!has_future || version < "1.8.0") {
                      info <- c(r_version = gsub("R version ", 
                        "", R.version$version.string), platform = sprintf("%s (%s-bit)", 
                        R.version$platform, 8 * .Machine$sizeof.pointer), 
                        os = paste(Sys.info()[c("sysname", "release", 
                          "version")], collapse = " "), hostname = Sys.info()[["nodename"]])
                      info <- sprintf("%s: %s", names(info), info)
                      info <- paste(info, collapse = "; ")
                      if (!has_future) {
                        msg <- sprintf("Package 'future' is not installed on worker (%s)", 
                          info)
                      }
                      else {
                        msg <- sprintf("Package 'future' on worker (%s) must be of version >= 1.8.0: %s", 
                          info, version)
                      }
                      stop(msg)
                    }
                  }
                  local({
                    for (pkg in c("doFuture", "utils")) {
                      loadNamespace(pkg)
                      library(pkg, character.only = TRUE)
                    }
                  })
              }
              future::plan("default", .cleanup = FALSE, .init = FALSE)
          }
      }
      if (is.na(TRUE)) {
      }
      else {
          if (TRUE) {
              ...future.stdout <- rawConnection(raw(0L), open = "w")
          }
          else {
              ...future.stdout <- file(switch(.Platform$OS.type, 
                  windows = "NUL", "/dev/null"), open = "w")
          }
          sink(...future.stdout, type = "output", split = FALSE)
          on.exit(if (!is.null(...future.stdout)) {
              sink(type = "output", split = FALSE)
              close(...future.stdout)
          }, add = TRUE)
      }
      ...future.frame <- sys.nframe()
      ...future.conditions <- list()
      ...future.result <- tryCatch({
          withCallingHandlers({
              ...future.value <- local({
                  doFuture::registerDoFuture()
                  lapply(seq_along(...future.x_ii), FUN = function(jj) {
                    ...future.x_jj <- ...future.x_ii[[jj]]
                    b <- NULL
                    ...future.env <- environment()
                    local({
                      for (name in names(...future.x_jj)) {
                        assign(name, ...future.x_jj[[name]], envir = ...future.env, 
                          inherits = FALSE)
                      }
                    })
                    tryCatch({
                      plan_list <- future::plan()
                      message(capture.output(print(plan_list)))
                      stopifnot(inherits(plan_list, "future"), 
                        inherits(plan_list, getOption("future.default", 
                          "sequential")))
                      plan_b <- future::plan("list")
                      str(plan_b)
                      stopifnot(inherits(plan_b[[1]], "future"), 
                        inherits(plan_b[[1]], getOption("future.default", 
                          "sequential")))
                      list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
                    }, error = identity)
                  })
              })
              future::FutureResult(value = ...future.value, started = ...future.startTime, 
                  version = "1.8")
          }, condition = local({
              inherits <- base::inherits
              invokeRestart <- base::invokeRestart
              length <- base::length
              seq.int <- base::seq.int
              sys.calls <- base::sys.calls
              `[[` <- base::`[[`
              `+` <- base::`+`
              `<<-` <- base::`<<-`
              sysCalls <- function(calls = sys.calls(), from = 1L) {
                  calls[seq.int(from = from + 12L, to = length(calls) - 
                    3L)]
              }
              function(cond) {
                  if (inherits(cond, "error")) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond, calls = c(sysCalls(from = ...future.frame), 
                      cond$call), timestamp = base::Sys.time())
                    signalCondition(cond)
                  }
                  else if (inherits(cond, c("message", "warning"
                  ))) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond)
                    if (inherits(cond, "message")) {
                      invokeRestart("muffleMessage")
                    }
                    else if (inherits(cond, "warning")) {
                      invokeRestart("muffleWarning")
                    }
                  }
              }
          }))
      }, error = function(ex) {
          structure(list(value = NULL, conditions = ...future.conditions, 
              condition = ex, calls = sys.calls(), version = "1.8"), 
              class = "FutureResult")
      }, finally = {
          {
              NULL
              future::plan(list(b = function (expr, envir = parent.frame(), 
                  substitute = TRUE, lazy = FALSE, seed = NULL, 
                  globals = TRUE, persistent = FALSE, workers = availableCores(), 
                  gc = FALSE, earlySignal = FALSE, label = NULL, 
                  ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  if (is.function(workers)) 
                    workers <- workers()
                  workers <- as.integer(workers)
                  stop_if_not(length(workers) == 1, is.finite(workers), 
                    workers >= 1)
                  if (workers == 1L) {
                    return(sequential(expr, envir = envir, substitute = FALSE, 
                      lazy = TRUE, seed = seed, globals = globals, 
                      local = TRUE, label = label, ...))
                  }
                  workers <- ClusterRegistry("start", workers = workers)
                  future <- MultisessionFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, persistent = persistent, 
                    workers = workers, gc = gc, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }), .cleanup = FALSE, .init = FALSE)
          }
          options(...future.oldOptions)
      })
      if (is.na(TRUE)) {
      }
      else {
          sink(type = "output", split = FALSE)
          if (TRUE) {
              ...future.result$stdout <- rawToChar(rawConnectionValue(...future.stdout))
          }
          else {
              ...future.result["stdout"] <- list(NULL)
          }
          close(...future.stdout)
          ...future.stdout <- NULL
      }
      ...future.result$conditions <- ...future.conditions
      ...future.result
  }
  plan(): Setting new future strategy stack:
  List of future strategies:
  1. sequential:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: NULL
  
  plan(): nbrOfWorkers() = 1
  plan(): Setting new future strategy stack:
  List of future strategies:
  1. multisession:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, persistent = FALSE, workers = availableCores(), gc = FALSE, earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: plan(list(a = strategy1, b = strategy2))
  
  plan(): nbrOfWorkers() = 1
  SequentialFuture started (and completed)
   length: 0 (resolved future 1)
  resolve() on list ... DONE
  [20:53:03.670] - relaying conditions of futures
  Future state: 'finished'
  sequential:- args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)- tweaked: FALSE- call: NULL
  sequential:- args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)- tweaked: FALSE- call: NULL
  sequential:- args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)- tweaked: FALSE- call: NULL
  [20:53:03.672] - collecting values of futures
  [20:53:03.673] - accumulating results
  [20:53:03.674] - processing errors (handler = 'stop')
  [20:53:03.675] - extracting results
  [20:53:03.675] doFuture() ... DONE
  foreach() - level 2 ... DONE
  List of 1
   $ b:function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, persistent = FALSE, workers = availableCores(), 
      gc = FALSE, earlySignal = FALSE, label = NULL, ...)  
    ..- attr(*, "class")= chr [1:5] "multisession" "cluster" "multiprocess" "future" ...
    ..- attr(*, "init")= logi TRUE
    ..- attr(*, "call")= language plan(list(a = strategy1, b = strategy2))
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  List of 1
   $ :function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
      ...)  
    ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  List of 1
   $ :function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
      ...)  
    ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  List of 1
   $ :function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
      ...)  
    ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  Future state: 'finished'
  foreach() - level 2 ...
  [20:53:03.560] doFuture() ...
  [20:53:03.563] - dummy globals (as locals): [1] 'b'
  [20:53:03.565] - R expression:
  [20:53:03.565] {
  [20:53:03.565]     doFuture::registerDoFuture()
  [20:53:03.565]     lapply(seq_along(...future.x_ii), FUN = function(jj) {
  [20:53:03.565]         ...future.x_jj <- ...future.x_ii[[jj]]
  [20:53:03.565]         b <- NULL
  [20:53:03.565]         ...future.env <- environment()
  [20:53:03.565]         local({
  [20:53:03.565]             for (name in names(...future.x_jj)) {
  [20:53:03.565]                 assign(name, ...future.x_jj[[name]], envir = ...future.env, 
  [20:53:03.565]                   inherits = FALSE)
  [20:53:03.565]             }
  [20:53:03.565]         })
  [20:53:03.565]         tryCatch({
  [20:53:03.565]             plan_list <- future::plan()
  [20:53:03.565]             message(capture.output(print(plan_list)))
  [20:53:03.565]             stopifnot(inherits(plan_list, "future"), inherits(plan_list, 
  [20:53:03.565]                 getOption("future.default", "sequential")))
  [20:53:03.565]             plan_b <- future::plan("list")
  [20:53:03.565]             str(plan_b)
  [20:53:03.565]             stopifnot(inherits(plan_b[[1]], "future"), inherits(plan_b[[1]], 
  [20:53:03.565]                 getOption("future.default", "sequential")))
  [20:53:03.565]             list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
  [20:53:03.565]         }, error = identity)
  [20:53:03.565]     })
  [20:53:03.565] }
  [20:53:03.567] - identifying globals and packages ...
  getGlobalsAndPackages() ...
  Searching for globals...
  - globals found: [24] '{', '::', 'lapply', 'seq_along', '...future.x_ii', '<-', '[[', 'environment', 'local', 'for', 'names', 'assign', 'tryCatch', 'message', 'capture.output', 'print', 'stopifnot', 'inherits', 'getOption', 'str', 'list', 'a', 'plan_a', 'identity'
  Searching for globals ... DONE
  Resolving globals: FALSE
  The total size of the 3 globals is 81.59 KiB (83544 bytes)
  - globals: [3] '...future.x_ii', 'a', 'plan_a'
  - packages: [1] 'utils'
  getGlobalsAndPackages() ... DONE
  [20:53:03.603] List of 3
  [20:53:03.603]  $ ...future.x_ii: NULL
  [20:53:03.603]  $ a             : int 2
  [20:53:03.603]  $ plan_a        :List of 1
  [20:53:03.603]   ..$ b:function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
  [20:53:03.603]     seed = NULL, globals = TRUE, persistent = FALSE, workers = availableCores(), 
  [20:53:03.603]     gc = FALSE, earlySignal = FALSE, label = NULL, ...)  
  [20:53:03.603]   .. ..- attr(*, "class")= chr [1:5] "multisession" "cluster" "multiprocess" "future" ...
  [20:53:03.603]   .. ..- attr(*, "init")= logi TRUE
  [20:53:03.603]   .. ..- attr(*, "call")= language plan(list(a = strategy1, b = strategy2))
  [20:53:03.603]   ..- attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  [20:53:03.603]  - attr(*, "where")=List of 3
  [20:53:03.603]   ..$ ...future.x_ii:<environment: 0x55a47e59c2b0> 
  [20:53:03.603]   ..$ a             :<environment: 0x55a47eaa9f38> 
  [20:53:03.603]   ..$ plan_a        :<environment: 0x55a47eaa9f38> 
  [20:53:03.603]  - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list"
  [20:53:03.603]  - attr(*, "resolved")= logi FALSE
  [20:53:03.603]  - attr(*, "total_size")= num 83544
  [20:53:03.626]   - R expression:
  [20:53:03.627] {
  [20:53:03.627]     doFuture::registerDoFuture()
  [20:53:03.627]     lapply(seq_along(...future.x_ii), FUN = function(jj) {
  [20:53:03.627]         ...future.x_jj <- ...future.x_ii[[jj]]
  [20:53:03.627]         b <- NULL
  [20:53:03.627]         ...future.env <- environment()
  [20:53:03.627]         local({
  [20:53:03.627]             for (name in names(...future.x_jj)) {
  [20:53:03.627]                 assign(name, ...future.x_jj[[name]], envir = ...future.env, 
  [20:53:03.627]                   inherits = FALSE)
  [20:53:03.627]             }
  [20:53:03.627]         })
  [20:53:03.627]         tryCatch({
  [20:53:03.627]             plan_list <- future::plan()
  [20:53:03.627]             message(capture.output(print(plan_list)))
  [20:53:03.627]             stopifnot(inherits(plan_list, "future"), inherits(plan_list, 
  [20:53:03.627]                 getOption("future.default", "sequential")))
  [20:53:03.627]             plan_b <- future::plan("list")
  [20:53:03.627]             str(plan_b)
  [20:53:03.627]             stopifnot(inherits(plan_b[[1]], "future"), inherits(plan_b[[1]], 
  [20:53:03.627]                 getOption("future.default", "sequential")))
  [20:53:03.627]             list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
  [20:53:03.627]         }, error = identity)
  [20:53:03.627]     })
  [20:53:03.627] }
  [20:53:03.628]   - globals: [3] '...future.x_ii', 'a', 'plan_a'
  [20:53:03.628] List of 3
  [20:53:03.628]  $ ...future.x_ii: NULL
  [20:53:03.628]  $ a             : int 2
  [20:53:03.628]  $ plan_a        :List of 1
  [20:53:03.628]   ..$ b:function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
  [20:53:03.628]     seed = NULL, globals = TRUE, persistent = FALSE, workers = availableCores(), 
  [20:53:03.628]     gc = FALSE, earlySignal = FALSE, label = NULL, ...)  
  [20:53:03.628]   .. ..- attr(*, "class")= chr [1:5] "multisession" "cluster" "multiprocess" "future" ...
  [20:53:03.628]   .. ..- attr(*, "init")= logi TRUE
  [20:53:03.628]   .. ..- attr(*, "call")= language plan(list(a = strategy1, b = strategy2))
  [20:53:03.628]   ..- attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  [20:53:03.628]  - attr(*, "where")=List of 3
  [20:53:03.628]   ..$ ...future.x_ii:<environment: 0x55a47e59c2b0> 
  [20:53:03.628]   ..$ a             :<environment: 0x55a47eaa9f38> 
  [20:53:03.628]   ..$ plan_a        :<environment: 0x55a47eaa9f38> 
  [20:53:03.628]  - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list"
  [20:53:03.628]  - attr(*, "resolved")= logi FALSE
  [20:53:03.628]  - attr(*, "total_size")= num 83544
  [20:53:03.642]   - packages: [2] 'doFuture', 'utils'
  [20:53:03.643] - identifying globals and packages ... DONE
  [20:53:03.644] Number of chunks: 1
  [20:53:03.644] Number of futures (= number of chunks): 1
  [20:53:03.645] Launching 1 futures (chunks) ...
  [20:53:03.645] Chunk #1 of 1 ...
  [20:53:03.645]  - Finding globals in 'args_list' chunk #1 ...
  getGlobalsAndPackages() ...
  Searching for globals...
  
  Searching for globals ... DONE
  - globals: [0] <none>
  getGlobalsAndPackages() ... DONE
  [20:53:03.649] 
  [20:53:03.649] 
  [20:53:03.650]  - Finding globals in 'args_list' for chunk #1 ... DONE
  getGlobalsAndPackages() ...
  - globals passed as-is: [3] '...future.x_ii', 'a', 'plan_a'
  Resolving globals: FALSE
  The total size of the 3 globals is 81.75 KiB (83712 bytes)
  - globals: [3] '...future.x_ii', 'a', 'plan_a'
  
  getGlobalsAndPackages() ... DONE
  [20:53:03.656] Chunk #1 of 1 ... DONE
  [20:53:03.656] Launching 1 futures (chunks) ... DONE
  [20:53:03.657] - resolving futures
  resolve() on list ...
   recursive: 0
   length: 1
  
  Packages needed by future strategies (n = 0): <none>
  Packages needed by the future expression (n = 2): 'doFuture', 'utils'
  {
      {
          ...future.startTime <- Sys.time()
          ...future.oldOptions <- options(future.startup.loadScript = FALSE, 
              future.globals.onMissing = "ignore", future.globals.maxSize = NULL, 
              future.globals.method = NULL, future.globals.onMissing = "ignore", 
              future.globals.onReference = NULL, future.globals.resolve = NULL, 
              future.resolve.recursive = NULL, width = 80L)
          {
              {
                  {
                    has_future <- requireNamespace("future", quietly = TRUE)
                    version <- if (has_future) 
                      packageVersion("future")
                    else NULL
                    if (!has_future || version < "1.8.0") {
                      info <- c(r_version = gsub("R version ", 
                        "", R.version$version.string), platform = sprintf("%s (%s-bit)", 
                        R.version$platform, 8 * .Machine$sizeof.pointer), 
                        os = paste(Sys.info()[c("sysname", "release", 
                          "version")], collapse = " "), hostname = Sys.info()[["nodename"]])
                      info <- sprintf("%s: %s", names(info), info)
                      info <- paste(info, collapse = "; ")
                      if (!has_future) {
                        msg <- sprintf("Package 'future' is not installed on worker (%s)", 
                          info)
                      }
                      else {
                        msg <- sprintf("Package 'future' on worker (%s) must be of version >= 1.8.0: %s", 
                          info, version)
                      }
                      stop(msg)
                    }
                  }
                  local({
                    for (pkg in c("doFuture", "utils")) {
                      loadNamespace(pkg)
                      library(pkg, character.only = TRUE)
                    }
                  })
              }
              future::plan("default", .cleanup = FALSE, .init = FALSE)
          }
      }
      if (is.na(TRUE)) {
      }
      else {
          if (TRUE) {
              ...future.stdout <- rawConnection(raw(0L), open = "w")
          }
          else {
              ...future.stdout <- file(switch(.Platform$OS.type, 
                  windows = "NUL", "/dev/null"), open = "w")
          }
          sink(...future.stdout, type = "output", split = FALSE)
          on.exit(if (!is.null(...future.stdout)) {
              sink(type = "output", split = FALSE)
              close(...future.stdout)
          }, add = TRUE)
      }
      ...future.frame <- sys.nframe()
      ...future.conditions <- list()
      ...future.result <- tryCatch({
          withCallingHandlers({
              ...future.value <- local({
                  doFuture::registerDoFuture()
                  lapply(seq_along(...future.x_ii), FUN = function(jj) {
                    ...future.x_jj <- ...future.x_ii[[jj]]
                    b <- NULL
                    ...future.env <- environment()
                    local({
                      for (name in names(...future.x_jj)) {
                        assign(name, ...future.x_jj[[name]], envir = ...future.env, 
                          inherits = FALSE)
                      }
                    })
                    tryCatch({
                      plan_list <- future::plan()
                      message(capture.output(print(plan_list)))
                      stopifnot(inherits(plan_list, "future"), 
                        inherits(plan_list, getOption("future.default", 
                          "sequential")))
                      plan_b <- future::plan("list")
                      str(plan_b)
                      stopifnot(inherits(plan_b[[1]], "future"), 
                        inherits(plan_b[[1]], getOption("future.default", 
                          "sequential")))
                      list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
                    }, error = identity)
                  })
              })
              future::FutureResult(value = ...future.value, started = ...future.startTime, 
                  version = "1.8")
          }, condition = local({
              inherits <- base::inherits
              invokeRestart <- base::invokeRestart
              length <- base::length
              seq.int <- base::seq.int
              sys.calls <- base::sys.calls
              `[[` <- base::`[[`
              `+` <- base::`+`
              `<<-` <- base::`<<-`
              sysCalls <- function(calls = sys.calls(), from = 1L) {
                  calls[seq.int(from = from + 12L, to = length(calls) - 
                    3L)]
              }
              function(cond) {
                  if (inherits(cond, "error")) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond, calls = c(sysCalls(from = ...future.frame), 
                      cond$call), timestamp = base::Sys.time())
                    signalCondition(cond)
                  }
                  else if (inherits(cond, c("message", "warning"
                  ))) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond)
                    if (inherits(cond, "message")) {
                      invokeRestart("muffleMessage")
                    }
                    else if (inherits(cond, "warning")) {
                      invokeRestart("muffleWarning")
                    }
                  }
              }
          }))
      }, error = function(ex) {
          structure(list(value = NULL, conditions = ...future.conditions, 
              condition = ex, calls = sys.calls(), version = "1.8"), 
              class = "FutureResult")
      }, finally = {
          {
              NULL
              future::plan(list(b = function (expr, envir = parent.frame(), 
                  substitute = TRUE, lazy = FALSE, seed = NULL, 
                  globals = TRUE, persistent = FALSE, workers = availableCores(), 
                  gc = FALSE, earlySignal = FALSE, label = NULL, 
                  ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  if (is.function(workers)) 
                    workers <- workers()
                  workers <- as.integer(workers)
                  stop_if_not(length(workers) == 1, is.finite(workers), 
                    workers >= 1)
                  if (workers == 1L) {
                    return(sequential(expr, envir = envir, substitute = FALSE, 
                      lazy = TRUE, seed = seed, globals = globals, 
                      local = TRUE, label = label, ...))
                  }
                  workers <- ClusterRegistry("start", workers = workers)
                  future <- MultisessionFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, persistent = persistent, 
                    workers = workers, gc = gc, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }), .cleanup = FALSE, .init = FALSE)
          }
          options(...future.oldOptions)
      })
      if (is.na(TRUE)) {
      }
      else {
          sink(type = "output", split = FALSE)
          if (TRUE) {
              ...future.result$stdout <- rawToChar(rawConnectionValue(...future.stdout))
          }
          else {
              ...future.result["stdout"] <- list(NULL)
          }
          close(...future.stdout)
          ...future.stdout <- NULL
      }
      ...future.result$conditions <- ...future.conditions
      ...future.result
  }
  plan(): Setting new future strategy stack:
  List of future strategies:
  1. sequential:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: NULL
  
  plan(): nbrOfWorkers() = 1
  plan(): Setting new future strategy stack:
  List of future strategies:
  1. multisession:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, persistent = FALSE, workers = availableCores(), gc = FALSE, earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: plan(list(a = strategy1, b = strategy2))
  
  plan(): nbrOfWorkers() = 1
  SequentialFuture started (and completed)
   length: 0 (resolved future 1)
  resolve() on list ... DONE
  [20:53:03.695] - relaying conditions of futures
  Future state: 'finished'
  sequential:- args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)- tweaked: FALSE- call: NULL
  sequential:- args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)- tweaked: FALSE- call: NULL
  sequential:- args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)- tweaked: FALSE- call: NULL
  [20:53:03.697] - collecting values of futures
  [20:53:03.697] - accumulating results
  [20:53:03.699] - processing errors (handler = 'stop')
  [20:53:03.699] - extracting results
  [20:53:03.700] doFuture() ... DONE
  foreach() - level 2 ... DONE
  [20:53:03.747] - collecting values of futures
  [20:53:03.747] - accumulating results
  [20:53:03.748] - processing errors (handler = 'stop')
  [20:53:03.749] - extracting results
  [20:53:03.749] doFuture() ... DONE
  foreach() - level 1 ... DONE
  - plan(list('multicore', 'multisession')) ... DONE
  - plan(list('multicore', 'cluster')) ...
  plan(): Setting new future strategy stack:
  List of future strategies:
  1. multicore:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, workers = availableCores(constraints = "multicore"), earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: plan(list(a = strategy1, b = strategy2))
  2. cluster:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, persistent = FALSE, workers = availableWorkers(), user = NULL, revtunnel = TRUE, homogeneous = TRUE, gc = FALSE, earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: plan(list(a = strategy1, b = strategy2))
  
  plan(): nbrOfWorkers() = 2
  foreach() - level 1 ...
  [20:53:03.754] doFuture() ...
  [20:53:03.756] - dummy globals (as locals): [1] 'a'
  [20:53:03.759] - R expression:
  [20:53:03.760] {
  [20:53:03.760]     doFuture::registerDoFuture()
  [20:53:03.760]     lapply(seq_along(...future.x_ii), FUN = function(jj) {
  [20:53:03.760]         ...future.x_jj <- ...future.x_ii[[jj]]
  [20:53:03.760]         a <- NULL
  [20:53:03.760]         ...future.env <- environment()
  [20:53:03.760]         local({
  [20:53:03.760]             for (name in names(...future.x_jj)) {
  [20:53:03.760]                 assign(name, ...future.x_jj[[name]], envir = ...future.env, 
  [20:53:03.760]                   inherits = FALSE)
  [20:53:03.760]             }
  [20:53:03.760]         })
  [20:53:03.760]         tryCatch({
  [20:53:03.760]             plan_list <- future::plan()
  [20:53:03.760]             stopifnot(inherits(plan_list, strategy2))
  [20:53:03.760]             plan_a <- future::plan("list")
  [20:53:03.760]             str(plan_a)
  [20:53:03.760]             stopifnot(inherits(plan_a[[1]], strategy2))
  [20:53:03.760]             message("foreach() - level 2 ...")
  [20:53:03.760]             y <- foreach(b = bs, .export = c("a", "plan_a")) %dopar% 
  [20:53:03.760]                 {
  [20:53:03.760]                   plan_list <- future::plan()
  [20:53:03.760]                   message(capture.output(print(plan_list)))
  [20:53:03.760]                   stopifnot(inherits(plan_list, "future"), inherits(plan_list, 
  [20:53:03.760]                     getOption("future.default", "sequential")))
  [20:53:03.760]                   plan_b <- future::plan("list")
  [20:53:03.760]                   str(plan_b)
  [20:53:03.760]                   stopifnot(inherits(plan_b[[1]], "future"), 
  [20:53:03.760]                     inherits(plan_b[[1]], getOption("future.default", 
  [20:53:03.760]                       "sequential")))
  [20:53:03.760]                   list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
  [20:53:03.760]                 }
  [20:53:03.760]             message("foreach() - level 2 ... DONE")
  [20:53:03.760]             y
  [20:53:03.760]         }, error = identity)
  [20:53:03.760]     })
  [20:53:03.760] }
  [20:53:03.762] - identifying globals and packages ...
  getGlobalsAndPackages() ...
  Searching for globals...
  - globals found: [28] '{', '::', 'lapply', 'seq_along', '...future.x_ii', '<-', '[[', 'environment', 'local', 'for', 'names', 'assign', 'tryCatch', 'stopifnot', 'inherits', 'strategy2', 'str', 'message', '%dopar%', 'foreach', 'bs', 'c', 'capture.output', 'print', 'getOption', 'list', 'b', 'identity'
  Searching for globals ... DONE
  Resolving globals: FALSE
  The total size of the 3 globals is 176 bytes (176 bytes)
  - globals: [3] '...future.x_ii', 'strategy2', 'bs'
  - packages: [2] 'utils', 'foreach'
  getGlobalsAndPackages() ... DONE
  [20:53:03.820] List of 3
  [20:53:03.820]  $ ...future.x_ii: NULL
  [20:53:03.820]  $ strategy2     : chr "cluster"
  [20:53:03.820]  $ bs            : int [1:3] 3 2 1
  [20:53:03.820]  - attr(*, "where")=List of 3
  [20:53:03.820]   ..$ ...future.x_ii:<environment: 0x55a47e6c12c0> 
  [20:53:03.820]   ..$ strategy2     :<environment: R_GlobalEnv> 
  [20:53:03.820]   ..$ bs            :<environment: R_GlobalEnv> 
  [20:53:03.820]  - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list"
  [20:53:03.820]  - attr(*, "resolved")= logi FALSE
  [20:53:03.820]  - attr(*, "total_size")= num 176
  [20:53:03.833]   - R expression:
  [20:53:03.833] {
  [20:53:03.833]     doFuture::registerDoFuture()
  [20:53:03.833]     lapply(seq_along(...future.x_ii), FUN = function(jj) {
  [20:53:03.833]         ...future.x_jj <- ...future.x_ii[[jj]]
  [20:53:03.833]         a <- NULL
  [20:53:03.833]         ...future.env <- environment()
  [20:53:03.833]         local({
  [20:53:03.833]             for (name in names(...future.x_jj)) {
  [20:53:03.833]                 assign(name, ...future.x_jj[[name]], envir = ...future.env, 
  [20:53:03.833]                   inherits = FALSE)
  [20:53:03.833]             }
  [20:53:03.833]         })
  [20:53:03.833]         tryCatch({
  [20:53:03.833]             plan_list <- future::plan()
  [20:53:03.833]             stopifnot(inherits(plan_list, strategy2))
  [20:53:03.833]             plan_a <- future::plan("list")
  [20:53:03.833]             str(plan_a)
  [20:53:03.833]             stopifnot(inherits(plan_a[[1]], strategy2))
  [20:53:03.833]             message("foreach() - level 2 ...")
  [20:53:03.833]             y <- foreach(b = bs, .export = c("a", "plan_a")) %dopar% 
  [20:53:03.833]                 {
  [20:53:03.833]                   plan_list <- future::plan()
  [20:53:03.833]                   message(capture.output(print(plan_list)))
  [20:53:03.833]                   stopifnot(inherits(plan_list, "future"), inherits(plan_list, 
  [20:53:03.833]                     getOption("future.default", "sequential")))
  [20:53:03.833]                   plan_b <- future::plan("list")
  [20:53:03.833]                   str(plan_b)
  [20:53:03.833]                   stopifnot(inherits(plan_b[[1]], "future"), 
  [20:53:03.833]                     inherits(plan_b[[1]], getOption("future.default", 
  [20:53:03.833]                       "sequential")))
  [20:53:03.833]                   list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
  [20:53:03.833]                 }
  [20:53:03.833]             message("foreach() - level 2 ... DONE")
  [20:53:03.833]             y
  [20:53:03.833]         }, error = identity)
  [20:53:03.833]     })
  [20:53:03.833] }
  [20:53:03.834]   - globals: [3] '...future.x_ii', 'strategy2', 'bs'
  [20:53:03.835] List of 3
  [20:53:03.835]  $ ...future.x_ii: NULL
  [20:53:03.835]  $ strategy2     : chr "cluster"
  [20:53:03.835]  $ bs            : int [1:3] 3 2 1
  [20:53:03.835]  - attr(*, "where")=List of 3
  [20:53:03.835]   ..$ ...future.x_ii:<environment: 0x55a47e6c12c0> 
  [20:53:03.835]   ..$ strategy2     :<environment: R_GlobalEnv> 
  [20:53:03.835]   ..$ bs            :<environment: R_GlobalEnv> 
  [20:53:03.835]  - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list"
  [20:53:03.835]  - attr(*, "resolved")= logi FALSE
  [20:53:03.835]  - attr(*, "total_size")= num 176
  [20:53:03.846]   - packages: [3] 'doFuture', 'utils', 'foreach'
  [20:53:03.847] - identifying globals and packages ... DONE
  [20:53:03.848] Number of chunks: 2
  [20:53:03.849] Number of futures (= number of chunks): 2
  [20:53:03.849] Launching 2 futures (chunks) ...
  [20:53:03.849] Chunk #1 of 2 ...
  [20:53:03.850]  - Finding globals in 'args_list' chunk #1 ...
  getGlobalsAndPackages() ...
  Searching for globals...
  
  Searching for globals ... DONE
  - globals: [0] <none>
  getGlobalsAndPackages() ... DONE
  [20:53:03.852] 
  [20:53:03.853] 
  [20:53:03.853]  - Finding globals in 'args_list' for chunk #1 ... DONE
  getGlobalsAndPackages() ...
  - globals passed as-is: [3] '...future.x_ii', 'strategy2', 'bs'
  Resolving globals: FALSE
  The total size of the 3 globals is 232 bytes (232 bytes)
  - globals: [3] '...future.x_ii', 'strategy2', 'bs'
  
  getGlobalsAndPackages() ... DONE
  Packages needed by future strategies (n = 1): 'future'
  Packages needed by the future expression (n = 3): 'doFuture', 'utils', 'foreach'
  {
      {
          ...future.startTime <- Sys.time()
          ...future.oldOptions <- options(future.startup.loadScript = FALSE, 
              future.globals.onMissing = "ignore", future.globals.maxSize = NULL, 
              future.globals.method = NULL, future.globals.onMissing = "ignore", 
              future.globals.onReference = NULL, future.globals.resolve = NULL, 
              future.resolve.recursive = NULL, width = 80L)
          {
              {
                  {
                    {
                      has_future <- requireNamespace("future", 
                        quietly = TRUE)
                      version <- if (has_future) 
                        packageVersion("future")
                      else NULL
                      if (!has_future || version < "1.8.0") {
                        info <- c(r_version = gsub("R version ", 
                          "", R.version$version.string), platform = sprintf("%s (%s-bit)", 
                          R.version$platform, 8 * .Machine$sizeof.pointer), 
                          os = paste(Sys.info()[c("sysname", "release", 
                            "version")], collapse = " "), hostname = Sys.info()[["nodename"]])
                        info <- sprintf("%s: %s", names(info), 
                          info)
                        info <- paste(info, collapse = "; ")
                        if (!has_future) {
                          msg <- sprintf("Package 'future' is not installed on worker (%s)", 
                            info)
                        }
                        else {
                          msg <- sprintf("Package 'future' on worker (%s) must be of version >= 1.8.0: %s", 
                            info, version)
                        }
                        stop(msg)
                      }
                    }
                    ...future.mc.cores.old <- getOption("mc.cores")
                    options(mc.cores = 1L)
                  }
                  local({
                    for (pkg in c("future", "doFuture", "utils", 
                    "foreach")) {
                      loadNamespace(pkg)
                      library(pkg, character.only = TRUE)
                    }
                  })
              }
              future::plan(list(b = function (expr, envir = parent.frame(), 
                  substitute = TRUE, lazy = FALSE, seed = NULL, 
                  globals = TRUE, persistent = FALSE, workers = availableWorkers(), 
                  user = NULL, revtunnel = TRUE, homogeneous = TRUE, 
                  gc = FALSE, earlySignal = FALSE, label = NULL, 
                  ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  future <- ClusterFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, persistent = persistent, 
                    workers = workers, user = user, revtunnel = revtunnel, 
                    homogeneous = homogeneous, gc = gc, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }), .cleanup = FALSE, .init = FALSE)
          }
      }
      if (is.na(TRUE)) {
      }
      else {
          if (TRUE) {
              ...future.stdout <- rawConnection(raw(0L), open = "w")
          }
          else {
              ...future.stdout <- file(switch(.Platform$OS.type, 
                  windows = "NUL", "/dev/null"), open = "w")
          }
          sink(...future.stdout, type = "output", split = FALSE)
          on.exit(if (!is.null(...future.stdout)) {
              sink(type = "output", split = FALSE)
              close(...future.stdout)
          }, add = TRUE)
      }
      ...future.frame <- sys.nframe()
      ...future.conditions <- list()
      ...future.result <- tryCatch({
          withCallingHandlers({
              ...future.value <- local({
                  doFuture::registerDoFuture()
                  lapply(seq_along(...future.x_ii), FUN = function(jj) {
                    ...future.x_jj <- ...future.x_ii[[jj]]
                    a <- NULL
                    ...future.env <- environment()
                    local({
                      for (name in names(...future.x_jj)) {
                        assign(name, ...future.x_jj[[name]], envir = ...future.env, 
                          inherits = FALSE)
                      }
                    })
                    tryCatch({
                      plan_list <- future::plan()
                      stopifnot(inherits(plan_list, strategy2))
                      plan_a <- future::plan("list")
                      str(plan_a)
                      stopifnot(inherits(plan_a[[1]], strategy2))
                      message("foreach() - level 2 ...")
                      y <- foreach(b = bs, .export = c("a", "plan_a")) %dopar% 
                        {
                          plan_list <- future::plan()
                          message(capture.output(print(plan_list)))
                          stopifnot(inherits(plan_list, "future"), 
                            inherits(plan_list, getOption("future.default", 
                              "sequential")))
                          plan_b <- future::plan("list")
                          str(plan_b)
                          stopifnot(inherits(plan_b[[1]], "future"), 
                            inherits(plan_b[[1]], getOption("future.default", 
                              "sequential")))
                          list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
                        }
                      message("foreach() - level 2 ... DONE")
                      y
                    }, error = identity)
                  })
              })
              future::FutureResult(value = ...future.value, started = ...future.startTime, 
                  version = "1.8")
          }, condition = local({
              inherits <- base::inherits
              invokeRestart <- base::invokeRestart
              length <- base::length
              seq.int <- base::seq.int
              sys.calls <- base::sys.calls
              `[[` <- base::`[[`
              `+` <- base::`+`
              `<<-` <- base::`<<-`
              sysCalls <- function(calls = sys.calls(), from = 1L) {
                  calls[seq.int(from = from + 12L, to = length(calls) - 
                    3L)]
              }
              function(cond) {
                  if (inherits(cond, "error")) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond, calls = c(sysCalls(from = ...future.frame), 
                      cond$call), timestamp = base::Sys.time())
                    signalCondition(cond)
                  }
                  else if (inherits(cond, c("message", "warning"
                  ))) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond)
                    if (inherits(cond, "message")) {
                      invokeRestart("muffleMessage")
                    }
                    else if (inherits(cond, "warning")) {
                      invokeRestart("muffleWarning")
                    }
                  }
              }
          }))
      }, error = function(ex) {
          structure(list(value = NULL, conditions = ...future.conditions, 
              condition = ex, calls = sys.calls(), version = "1.8"), 
              class = "FutureResult")
      }, finally = {
          {
              {
                  options(mc.cores = ...future.mc.cores.old)
              }
              future::plan(list(a = function (expr, envir = parent.frame(), 
                  substitute = TRUE, lazy = FALSE, seed = NULL, 
                  globals = TRUE, workers = availableCores(constraints = "multicore"), 
                  earlySignal = FALSE, label = NULL, ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  if (is.function(workers)) 
                    workers <- workers()
                  workers <- as.integer(workers)
                  stop_if_not(is.finite(workers), workers >= 1L)
                  if (workers == 1L || !supportsMulticore()) {
                    return(sequential(expr, envir = envir, substitute = FALSE, 
                      lazy = lazy, seed = seed, globals = globals, 
                      local = TRUE, label = label, ...))
                  }
                  oopts <- options(mc.cores = workers)
                  on.exit(options(oopts))
                  future <- MulticoreFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, workers = workers, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }, b = function (expr, envir = parent.frame(), substitute = TRUE, 
                  lazy = FALSE, seed = NULL, globals = TRUE, persistent = FALSE, 
                  workers = availableWorkers(), user = NULL, revtunnel = TRUE, 
                  homogeneous = TRUE, gc = FALSE, earlySignal = FALSE, 
                  label = NULL, ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  future <- ClusterFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, persistent = persistent, 
                    workers = workers, user = user, revtunnel = revtunnel, 
                    homogeneous = homogeneous, gc = gc, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }), .cleanup = FALSE, .init = FALSE)
          }
          options(...future.oldOptions)
      })
      if (is.na(TRUE)) {
      }
      else {
          sink(type = "output", split = FALSE)
          if (TRUE) {
              ...future.result$stdout <- rawToChar(rawConnectionValue(...future.stdout))
          }
          else {
              ...future.result["stdout"] <- list(NULL)
          }
          close(...future.stdout)
          ...future.stdout <- NULL
      }
      ...future.result$conditions <- ...future.conditions
      ...future.result
  }
  requestCore(): workers = 2
  MulticoreFuture started
  [20:53:03.884] Chunk #1 of 2 ... DONE
  [20:53:03.885] Chunk #2 of 2 ...
  [20:53:03.886]  - Finding globals in 'args_list' chunk #2 ...
  getGlobalsAndPackages() ...
  Searching for globals...
  
  Searching for globals ... DONE
  - globals: [0] <none>
  getGlobalsAndPackages() ... DONE
  [20:53:03.893] 
  [20:53:03.894] 
  [20:53:03.895]  - Finding globals in 'args_list' for chunk #2 ... DONE
  getGlobalsAndPackages() ...
  - globals passed as-is: [3] '...future.x_ii', 'strategy2', 'bs'
  Resolving globals: FALSE
  The total size of the 3 globals is 232 bytes (232 bytes)
  - globals: [3] '...future.x_ii', 'strategy2', 'bs'
  
  getGlobalsAndPackages() ... DONE
  Packages needed by future strategies (n = 1): 'future'
  Packages needed by the future expression (n = 3): 'doFuture', 'utils', 'foreach'
  plan(): Setting new future strategy stack:
  List of future strategies:
  1. cluster:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, persistent = FALSE, workers = availableWorkers(), user = NULL, revtunnel = TRUE, homogeneous = TRUE, gc = FALSE, earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: plan(list(a = strategy1, b = strategy2))
  
  plan(): nbrOfWorkers() = 1
  {
      {
          ...future.startTime <- Sys.time()
          ...future.oldOptions <- options(future.startup.loadScript = FALSE, 
              future.globals.onMissing = "ignore", future.globals.maxSize = NULL, 
              future.globals.method = NULL, future.globals.onMissing = "ignore", 
              future.globals.onReference = NULL, future.globals.resolve = NULL, 
              future.resolve.recursive = NULL, width = 80L)
          {
              {
                  {
                    {
                      has_future <- requireNamespace("future", 
                        quietly = TRUE)
                      version <- if (has_future) 
                        packageVersion("future")
                      else NULL
                      if (!has_future || version < "1.8.0") {
                        info <- c(r_version = gsub("R version ", 
                          "", R.version$version.string), platform = sprintf("%s (%s-bit)", 
                          R.version$platform, 8 * .Machine$sizeof.pointer), 
                          os = paste(Sys.info()[c("sysname", "release", 
                            "version")], collapse = " "), hostname = Sys.info()[["nodename"]])
                        info <- sprintf("%s: %s", names(info), 
                          info)
                        info <- paste(info, collapse = "; ")
                        if (!has_future) {
                          msg <- sprintf("Package 'future' is not installed on worker (%s)", 
                            info)
                        }
                        else {
                          msg <- sprintf("Package 'future' on worker (%s) must be of version >= 1.8.0: %s", 
                            info, version)
                        }
                        stop(msg)
                      }
                    }
                    ...future.mc.cores.old <- getOption("mc.cores")
                    options(mc.cores = 1L)
                  }
                  local({
                    for (pkg in c("future", "doFuture", "utils", 
                    "foreach")) {
                      loadNamespace(pkg)
                      library(pkg, character.only = TRUE)
                    }
                  })
              }
              future::plan(list(b = function (expr, envir = parent.frame(), 
                  substitute = TRUE, lazy = FALSE, seed = NULL, 
                  globals = TRUE, persistent = FALSE, workers = availableWorkers(), 
                  user = NULL, revtunnel = TRUE, homogeneous = TRUE, 
                  gc = FALSE, earlySignal = FALSE, label = NULL, 
                  ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  future <- ClusterFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, persistent = persistent, 
                    workers = workers, user = user, revtunnel = revtunnel, 
                    homogeneous = homogeneous, gc = gc, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }), .cleanup = FALSE, .init = FALSE)
          }
      }
      if (is.na(TRUE)) {
      }
      else {
          if (TRUE) {
              ...future.stdout <- rawConnection(raw(0L), open = "w")
          }
          else {
              ...future.stdout <- file(switch(.Platform$OS.type, 
                  windows = "NUL", "/dev/null"), open = "w")
          }
          sink(...future.stdout, type = "output", split = FALSE)
          on.exit(if (!is.null(...future.stdout)) {
              sink(type = "output", split = FALSE)
              close(...future.stdout)
          }, add = TRUE)
      }
      ...future.frame <- sys.nframe()
      ...future.conditions <- list()
      ...future.result <- tryCatch({
          withCallingHandlers({
              ...future.value <- local({
                  doFuture::registerDoFuture()
                  lapply(seq_along(...future.x_ii), FUN = function(jj) {
                    ...future.x_jj <- ...future.x_ii[[jj]]
                    a <- NULL
                    ...future.env <- environment()
                    local({
                      for (name in names(...future.x_jj)) {
                        assign(name, ...future.x_jj[[name]], envir = ...future.env, 
                          inherits = FALSE)
                      }
                    })
                    tryCatch({
                      plan_list <- future::plan()
                      stopifnot(inherits(plan_list, strategy2))
                      plan_a <- future::plan("list")
                      str(plan_a)
                      stopifnot(inherits(plan_a[[1]], strategy2))
                      message("foreach() - level 2 ...")
                      y <- foreach(b = bs, .export = c("a", "plan_a")) %dopar% 
                        {
                          plan_list <- future::plan()
                          message(capture.output(print(plan_list)))
                          stopifnot(inherits(plan_list, "future"), 
                            inherits(plan_list, getOption("future.default", 
                              "sequential")))
                          plan_b <- future::plan("list")
                          str(plan_b)
                          stopifnot(inherits(plan_b[[1]], "future"), 
                            inherits(plan_b[[1]], getOption("future.default", 
                              "sequential")))
                          list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
                        }
                      message("foreach() - level 2 ... DONE")
                      y
                    }, error = identity)
                  })
              })
              future::FutureResult(value = ...future.value, started = ...future.startTime, 
                  version = "1.8")
          }, condition = local({
              inherits <- base::inherits
              invokeRestart <- base::invokeRestart
              length <- base::length
              seq.int <- base::seq.int
              sys.calls <- base::sys.calls
              `[[` <- base::`[[`
              `+` <- base::`+`
              `<<-` <- base::`<<-`
              sysCalls <- function(calls = sys.calls(), from = 1L) {
                  calls[seq.int(from = from + 12L, to = length(calls) - 
                    3L)]
              }
              function(cond) {
                  if (inherits(cond, "error")) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond, calls = c(sysCalls(from = ...future.frame), 
                      cond$call), timestamp = base::Sys.time())
                    signalCondition(cond)
                  }
                  else if (inherits(cond, c("message", "warning"
                  ))) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond)
                    if (inherits(cond, "message")) {
                      invokeRestart("muffleMessage")
                    }
                    else if (inherits(cond, "warning")) {
                      invokeRestart("muffleWarning")
                    }
                  }
              }
          }))
      }, error = function(ex) {
          structure(list(value = NULL, conditions = ...future.conditions, 
              condition = ex, calls = sys.calls(), version = "1.8"), 
              class = "FutureResult")
      }, finally = {
          {
              {
                  options(mc.cores = ...future.mc.cores.old)
              }
              future::plan(list(a = function (expr, envir = parent.frame(), 
                  substitute = TRUE, lazy = FALSE, seed = NULL, 
                  globals = TRUE, workers = availableCores(constraints = "multicore"), 
                  earlySignal = FALSE, label = NULL, ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  if (is.function(workers)) 
                    workers <- workers()
                  workers <- as.integer(workers)
                  stop_if_not(is.finite(workers), workers >= 1L)
                  if (workers == 1L || !supportsMulticore()) {
                    return(sequential(expr, envir = envir, substitute = FALSE, 
                      lazy = lazy, seed = seed, globals = globals, 
                      local = TRUE, label = label, ...))
                  }
                  oopts <- options(mc.cores = workers)
                  on.exit(options(oopts))
                  future <- MulticoreFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, workers = workers, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }, b = function (expr, envir = parent.frame(), substitute = TRUE, 
                  lazy = FALSE, seed = NULL, globals = TRUE, persistent = FALSE, 
                  workers = availableWorkers(), user = NULL, revtunnel = TRUE, 
                  homogeneous = TRUE, gc = FALSE, earlySignal = FALSE, 
                  label = NULL, ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  future <- ClusterFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, persistent = persistent, 
                    workers = workers, user = user, revtunnel = revtunnel, 
                    homogeneous = homogeneous, gc = gc, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }), .cleanup = FALSE, .init = FALSE)
          }
          options(...future.oldOptions)
      })
      if (is.na(TRUE)) {
      }
      else {
          sink(type = "output", split = FALSE)
          if (TRUE) {
              ...future.result$stdout <- rawToChar(rawConnectionValue(...future.stdout))
          }
          else {
              ...future.result["stdout"] <- list(NULL)
          }
          close(...future.stdout)
          ...future.stdout <- NULL
      }
      ...future.result$conditions <- ...future.conditions
      ...future.result
  }
  requestCore(): workers = 2
  MulticoreFuture started
  [20:53:03.925] Chunk #2 of 2 ... DONE
  [20:53:03.925] Launching 2 futures (chunks) ... DONE
  [20:53:03.926] - resolving futures
  resolve() on list ...
   recursive: 0
   length: 2
  
  plan(): Setting new future strategy stack:
  List of future strategies:
  1. cluster:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, persistent = FALSE, workers = availableWorkers(), user = NULL, revtunnel = TRUE, homogeneous = TRUE, gc = FALSE, earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: plan(list(a = strategy1, b = strategy2))
  
  plan(): nbrOfWorkers() = 1
  plan(): Setting new future strategy stack:
  List of future strategies:
  1. multicore:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, workers = availableCores(constraints = "multicore"), earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: plan(list(a = strategy1, b = strategy2))
  2. cluster:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, persistent = FALSE, workers = availableWorkers(), user = NULL, revtunnel = TRUE, homogeneous = TRUE, gc = FALSE, earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: plan(list(a = strategy1, b = strategy2))
  
  plan(): nbrOfWorkers() = 2
  plan(): Setting new future strategy stack:
  List of future strategies:
  1. multicore:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, workers = availableCores(constraints = "multicore"), earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: plan(list(a = strategy1, b = strategy2))
  2. cluster:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, persistent = FALSE, workers = availableWorkers(), user = NULL, revtunnel = TRUE, homogeneous = TRUE, gc = FALSE, earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: plan(list(a = strategy1, b = strategy2))
  
  plan(): nbrOfWorkers() = 2
   length: 1 (resolved future 1)
   length: 0 (resolved future 2)
  resolve() on list ... DONE
  [20:53:12.036] - relaying conditions of futures
  List of 1
   $ b:function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, persistent = FALSE, workers = availableWorkers(), 
      user = NULL, revtunnel = TRUE, homogeneous = TRUE, gc = FALSE, earlySignal = FALSE, 
      label = NULL, ...)  
    ..- attr(*, "class")= chr [1:4] "cluster" "multiprocess" "future" "function"
    ..- attr(*, "init")= logi TRUE
    ..- attr(*, "call")= language plan(list(a = strategy1, b = strategy2))
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  List of 1
   $ :function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
      ...)  
    ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  List of 1
   $ :function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
      ...)  
    ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  List of 1
   $ :function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
      ...)  
    ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  Future state: 'finished'
  foreach() - level 2 ...
  [20:53:03.941] doFuture() ...
  [20:53:03.943] - dummy globals (as locals): [1] 'b'
  [20:53:03.945] - R expression:
  [20:53:03.945] {
  [20:53:03.945]     doFuture::registerDoFuture()
  [20:53:03.945]     lapply(seq_along(...future.x_ii), FUN = function(jj) {
  [20:53:03.945]         ...future.x_jj <- ...future.x_ii[[jj]]
  [20:53:03.945]         b <- NULL
  [20:53:03.945]         ...future.env <- environment()
  [20:53:03.945]         local({
  [20:53:03.945]             for (name in names(...future.x_jj)) {
  [20:53:03.945]                 assign(name, ...future.x_jj[[name]], envir = ...future.env, 
  [20:53:03.945]                   inherits = FALSE)
  [20:53:03.945]             }
  [20:53:03.945]         })
  [20:53:03.945]         tryCatch({
  [20:53:03.945]             plan_list <- future::plan()
  [20:53:03.945]             message(capture.output(print(plan_list)))
  [20:53:03.945]             stopifnot(inherits(plan_list, "future"), inherits(plan_list, 
  [20:53:03.945]                 getOption("future.default", "sequential")))
  [20:53:03.945]             plan_b <- future::plan("list")
  [20:53:03.945]             str(plan_b)
  [20:53:03.945]             stopifnot(inherits(plan_b[[1]], "future"), inherits(plan_b[[1]], 
  [20:53:03.945]                 getOption("future.default", "sequential")))
  [20:53:03.945]             list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
  [20:53:03.945]         }, error = identity)
  [20:53:03.945]     })
  [20:53:03.945] }
  [20:53:03.947] - identifying globals and packages ...
  getGlobalsAndPackages() ...
  Searching for globals...
  - globals found: [24] '{', '::', 'lapply', 'seq_along', '...future.x_ii', '<-', '[[', 'environment', 'local', 'for', 'names', 'assign', 'tryCatch', 'message', 'capture.output', 'print', 'stopifnot', 'inherits', 'getOption', 'str', 'list', 'a', 'plan_a', 'identity'
  Searching for globals ... DONE
  Resolving globals: FALSE
  The total size of the 3 globals is 64.51 KiB (66056 bytes)
  - globals: [3] '...future.x_ii', 'a', 'plan_a'
  - packages: [1] 'utils'
  getGlobalsAndPackages() ... DONE
  [20:53:04.049] List of 3
  [20:53:04.049]  $ ...future.x_ii: NULL
  [20:53:04.049]  $ a             : int 1
  [20:53:04.049]  $ plan_a        :List of 1
  [20:53:04.049]   ..$ b:function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
  [20:53:04.049]     seed = NULL, globals = TRUE, persistent = FALSE, workers = availableWorkers(), 
  [20:53:04.049]     user = NULL, revtunnel = TRUE, homogeneous = TRUE, gc = FALSE, earlySignal = FALSE, 
  [20:53:04.049]     label = NULL, ...)  
  [20:53:04.049]   .. ..- attr(*, "class")= chr [1:4] "cluster" "multiprocess" "future" "function"
  [20:53:04.049]   .. ..- attr(*, "init")= logi TRUE
  [20:53:04.049]   .. ..- attr(*, "call")= language plan(list(a = strategy1, b = strategy2))
  [20:53:04.049]   ..- attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  [20:53:04.049]  - attr(*, "where")=List of 3
  [20:53:04.049]   ..$ ...future.x_ii:<environment: 0x55a47da7e8b0> 
  [20:53:04.049]   ..$ a             :<environment: 0x55a47fa348a8> 
  [20:53:04.049]   ..$ plan_a        :<environment: 0x55a47fa348a8> 
  [20:53:04.049]  - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list"
  [20:53:04.049]  - attr(*, "resolved")= logi FALSE
  [20:53:04.049]  - attr(*, "total_size")= num 66056
  [20:53:04.068]   - R expression:
  [20:53:04.069] {
  [20:53:04.069]     doFuture::registerDoFuture()
  [20:53:04.069]     lapply(seq_along(...future.x_ii), FUN = function(jj) {
  [20:53:04.069]         ...future.x_jj <- ...future.x_ii[[jj]]
  [20:53:04.069]         b <- NULL
  [20:53:04.069]         ...future.env <- environment()
  [20:53:04.069]         local({
  [20:53:04.069]             for (name in names(...future.x_jj)) {
  [20:53:04.069]                 assign(name, ...future.x_jj[[name]], envir = ...future.env, 
  [20:53:04.069]                   inherits = FALSE)
  [20:53:04.069]             }
  [20:53:04.069]         })
  [20:53:04.069]         tryCatch({
  [20:53:04.069]             plan_list <- future::plan()
  [20:53:04.069]             message(capture.output(print(plan_list)))
  [20:53:04.069]             stopifnot(inherits(plan_list, "future"), inherits(plan_list, 
  [20:53:04.069]                 getOption("future.default", "sequential")))
  [20:53:04.069]             plan_b <- future::plan("list")
  [20:53:04.069]             str(plan_b)
  [20:53:04.069]             stopifnot(inherits(plan_b[[1]], "future"), inherits(plan_b[[1]], 
  [20:53:04.069]                 getOption("future.default", "sequential")))
  [20:53:04.069]             list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
  [20:53:04.069]         }, error = identity)
  [20:53:04.069]     })
  [20:53:04.069] }
  [20:53:04.070]   - globals: [3] '...future.x_ii', 'a', 'plan_a'
  [20:53:04.071] List of 3
  [20:53:04.071]  $ ...future.x_ii: NULL
  [20:53:04.071]  $ a             : int 1
  [20:53:04.071]  $ plan_a        :List of 1
  [20:53:04.071]   ..$ b:function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
  [20:53:04.071]     seed = NULL, globals = TRUE, persistent = FALSE, workers = availableWorkers(), 
  [20:53:04.071]     user = NULL, revtunnel = TRUE, homogeneous = TRUE, gc = FALSE, earlySignal = FALSE, 
  [20:53:04.071]     label = NULL, ...)  
  [20:53:04.071]   .. ..- attr(*, "class")= chr [1:4] "cluster" "multiprocess" "future" "function"
  [20:53:04.071]   .. ..- attr(*, "init")= logi TRUE
  [20:53:04.071]   .. ..- attr(*, "call")= language plan(list(a = strategy1, b = strategy2))
  [20:53:04.071]   ..- attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  [20:53:04.071]  - attr(*, "where")=List of 3
  [20:53:04.071]   ..$ ...future.x_ii:<environment: 0x55a47da7e8b0> 
  [20:53:04.071]   ..$ a             :<environment: 0x55a47fa348a8> 
  [20:53:04.071]   ..$ plan_a        :<environment: 0x55a47fa348a8> 
  [20:53:04.071]  - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list"
  [20:53:04.071]  - attr(*, "resolved")= logi FALSE
  [20:53:04.071]  - attr(*, "total_size")= num 66056
  [20:53:04.087]   - packages: [2] 'doFuture', 'utils'
  [20:53:04.088] - identifying globals and packages ... DONE
  [20:53:04.089] Number of chunks: 1
  [20:53:04.090] Number of futures (= number of chunks): 1
  [20:53:04.090] Launching 1 futures (chunks) ...
  [20:53:04.091] Chunk #1 of 1 ...
  [20:53:04.091]  - Finding globals in 'args_list' chunk #1 ...
  getGlobalsAndPackages() ...
  Searching for globals...
  
  Searching for globals ... DONE
  - globals: [0] <none>
  getGlobalsAndPackages() ... DONE
  [20:53:04.095] 
  [20:53:04.095] 
  [20:53:04.096]  - Finding globals in 'args_list' for chunk #1 ... DONE
  [local output] Workers: [n = 1] 'localhost'
  [local output] Base port: 11702
  [local output] Creating node 1 of 1 ...
  [local output] - setting up node
  Testing if worker's PID can be inferred: '/home/hornik/tmp/R.check/r-patched-gcc/Work/build/bin/Rscript -e 'try(cat(Sys.getpid(),file="/tmp/RtmpmhL62P/future.parent=29635.73c3395c2836.pid"), silent = TRUE)' -e "file.exists('/tmp/RtmpmhL62P/future.parent=29635.73c3395c2836.pid')"'
  - Possible to infer worker's PID: TRUE
  [local output] Starting worker #1 on 'localhost': '/home/hornik/tmp/R.check/r-patched-gcc/Work/build/bin/Rscript' --default-packages=datasets,utils,grDevices,graphics,stats,methods -e '#label=foreach,nested_dopar.R:29635:gimli:hornik' -e 'try(cat(Sys.getpid(),file="/tmp/RtmpmhL62P/future.parent=29635.73c3395c2836.pid"), silent = TRUE)' -e 'parallel:::.slaveRSOCK()' MASTER=localhost PORT=11702 OUT=/dev/null TIMEOUT=120 XDR=TRUE
  [local output] - Exit code of system() call: 0
  [local output] Waiting for worker #1 on 'localhost' to connect back
  [local output] Connection with worker #1 on 'localhost' established
  [local output] - collecting session information
  [local output] Creating node 1 of 1 ... done
  getGlobalsAndPackages() ...
  - globals passed as-is: [3] '...future.x_ii', 'a', 'plan_a'
  Resolving globals: FALSE
  The total size of the 3 globals is 64.67 KiB (66224 bytes)
  - globals: [3] '...future.x_ii', 'a', 'plan_a'
  
  getGlobalsAndPackages() ... DONE
  Warning in sample.int(.Machine$integer.max, size = 1L) :
    '.Random.seed' is not an integer vector but of type 'NULL', so ignored
  Packages needed by future strategies (n = 0): <none>
  Packages needed by the future expression (n = 2): 'doFuture', 'utils'
  {
      {
          ...future.startTime <- Sys.time()
          ...future.oldOptions <- options(future.startup.loadScript = FALSE, 
              future.globals.onMissing = "ignore", future.globals.maxSize = NULL, 
              future.globals.method = NULL, future.globals.onMissing = "ignore", 
              future.globals.onReference = NULL, future.globals.resolve = NULL, 
              future.resolve.recursive = NULL, width = 80L)
          {
              {
                  {
                    has_future <- requireNamespace("future", quietly = TRUE)
                    version <- if (has_future) 
                      packageVersion("future")
                    else NULL
                    if (!has_future || version < "1.8.0") {
                      info <- c(r_version = gsub("R version ", 
                        "", R.version$version.string), platform = sprintf("%s (%s-bit)", 
                        R.version$platform, 8 * .Machine$sizeof.pointer), 
                        os = paste(Sys.info()[c("sysname", "release", 
                          "version")], collapse = " "), hostname = Sys.info()[["nodename"]])
                      info <- sprintf("%s: %s", names(info), info)
                      info <- paste(info, collapse = "; ")
                      if (!has_future) {
                        msg <- sprintf("Package 'future' is not installed on worker (%s)", 
                          info)
                      }
                      else {
                        msg <- sprintf("Package 'future' on worker (%s) must be of version >= 1.8.0: %s", 
                          info, version)
                      }
                      stop(msg)
                    }
                  }
                  local({
                    for (pkg in c("doFuture", "utils")) {
                      loadNamespace(pkg)
                      library(pkg, character.only = TRUE)
                    }
                  })
              }
              future::plan("default", .cleanup = FALSE, .init = FALSE)
          }
      }
      if (is.na(TRUE)) {
      }
      else {
          if (TRUE) {
              ...future.stdout <- rawConnection(raw(0L), open = "w")
          }
          else {
              ...future.stdout <- file(switch(.Platform$OS.type, 
                  windows = "NUL", "/dev/null"), open = "w")
          }
          sink(...future.stdout, type = "output", split = FALSE)
          on.exit(if (!is.null(...future.stdout)) {
              sink(type = "output", split = FALSE)
              close(...future.stdout)
          }, add = TRUE)
      }
      ...future.frame <- sys.nframe()
      ...future.conditions <- list()
      ...future.result <- tryCatch({
          withCallingHandlers({
              ...future.value <- local({
                  doFuture::registerDoFuture()
                  lapply(seq_along(...future.x_ii), FUN = function(jj) {
                    ...future.x_jj <- ...future.x_ii[[jj]]
                    b <- NULL
                    ...future.env <- environment()
                    local({
                      for (name in names(...future.x_jj)) {
                        assign(name, ...future.x_jj[[name]], envir = ...future.env, 
                          inherits = FALSE)
                      }
                    })
                    tryCatch({
                      plan_list <- future::plan()
                      message(capture.output(print(plan_list)))
                      stopifnot(inherits(plan_list, "future"), 
                        inherits(plan_list, getOption("future.default", 
                          "sequential")))
                      plan_b <- future::plan("list")
                      str(plan_b)
                      stopifnot(inherits(plan_b[[1]], "future"), 
                        inherits(plan_b[[1]], getOption("future.default", 
                          "sequential")))
                      list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
                    }, error = identity)
                  })
              })
              future::FutureResult(value = ...future.value, started = ...future.startTime, 
                  version = "1.8")
          }, condition = local({
              inherits <- base::inherits
              invokeRestart <- base::invokeRestart
              length <- base::length
              seq.int <- base::seq.int
              sys.calls <- base::sys.calls
              `[[` <- base::`[[`
              `+` <- base::`+`
              `<<-` <- base::`<<-`
              sysCalls <- function(calls = sys.calls(), from = 1L) {
                  calls[seq.int(from = from + 12L, to = length(calls) - 
                    3L)]
              }
              function(cond) {
                  if (inherits(cond, "error")) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond, calls = c(sysCalls(from = ...future.frame), 
                      cond$call), timestamp = base::Sys.time())
                    signalCondition(cond)
                  }
                  else if (inherits(cond, c("message", "warning"
                  ))) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond)
                    if (inherits(cond, "message")) {
                      invokeRestart("muffleMessage")
                    }
                    else if (inherits(cond, "warning")) {
                      invokeRestart("muffleWarning")
                    }
                  }
              }
          }))
      }, error = function(ex) {
          structure(list(value = NULL, conditions = ...future.conditions, 
              condition = ex, calls = sys.calls(), version = "1.8"), 
              class = "FutureResult")
      }, finally = {
          {
              NULL
              future::plan(list(b = function (expr, envir = parent.frame(), 
                  substitute = TRUE, lazy = FALSE, seed = NULL, 
                  globals = TRUE, persistent = FALSE, workers = availableWorkers(), 
                  user = NULL, revtunnel = TRUE, homogeneous = TRUE, 
                  gc = FALSE, earlySignal = FALSE, label = NULL, 
                  ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  future <- ClusterFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, persistent = persistent, 
                    workers = workers, user = user, revtunnel = revtunnel, 
                    homogeneous = homogeneous, gc = gc, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }), .cleanup = FALSE, .init = FALSE)
          }
          options(...future.oldOptions)
      })
      if (is.na(TRUE)) {
      }
      else {
          sink(type = "output", split = FALSE)
          if (TRUE) {
              ...future.result$stdout <- rawToChar(rawConnectionValue(...future.stdout))
          }
          else {
              ...future.result["stdout"] <- list(NULL)
          }
          close(...future.stdout)
          ...future.stdout <- NULL
      }
      ...future.result$conditions <- ...future.conditions
      ...future.result
  }
  Exporting 3 global objects (64.67 KiB) to cluster node #1 ...
  Exporting '...future.x_ii' (168 bytes) to cluster node #1 ...
  Exporting '...future.x_ii' (168 bytes) to cluster node #1 ... DONE
  Exporting 'a' (56 bytes) to cluster node #1 ...
  Exporting 'a' (56 bytes) to cluster node #1 ... DONE
  Exporting 'plan_a' (64.45 KiB) to cluster node #1 ...
  Exporting 'plan_a' (64.45 KiB) to cluster node #1 ... DONE
  Exporting 3 global objects (64.67 KiB) to cluster node #1 ... DONE
  ClusterFuture started
  [20:53:11.657] Chunk #1 of 1 ... DONE
  [20:53:11.658] Launching 1 futures (chunks) ... DONE
  [20:53:11.658] - resolving futures
  resolve() on list ...
   recursive: 0
   length: 1
  
   length: 0 (resolved future 1)
  resolve() on list ... DONE
  [20:53:11.980] - relaying conditions of futures
  result() for ClusterFuture ...
  - Validating connection of ClusterFuture
  - class(result): FutureResult
  Future state: 'finished'
  result() for ClusterFuture ...
  - result already collected: FutureResult
  result() for ClusterFuture ... done
  sequential:- args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)- tweaked: FALSE- call: NULL
  sequential:- args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)- tweaked: FALSE- call: NULL
  sequential:- args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)- tweaked: FALSE- call: NULL
  [20:53:12.026] - collecting values of futures
  result() for ClusterFuture ...
  - result already collected: FutureResult
  result() for ClusterFuture ... done
  [20:53:12.028] - accumulating results
  [20:53:12.029] - processing errors (handler = 'stop')
  [20:53:12.030] - extracting results
  [20:53:12.030] doFuture() ... DONE
  foreach() - level 2 ... DONE
  List of 1
   $ b:function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, persistent = FALSE, workers = availableWorkers(), 
      user = NULL, revtunnel = TRUE, homogeneous = TRUE, gc = FALSE, earlySignal = FALSE, 
      label = NULL, ...)  
    ..- attr(*, "class")= chr [1:4] "cluster" "multiprocess" "future" "function"
    ..- attr(*, "init")= logi TRUE
    ..- attr(*, "call")= language plan(list(a = strategy1, b = strategy2))
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  List of 1
   $ :function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
      ...)  
    ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  List of 1
   $ :function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
      ...)  
    ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  List of 1
   $ :function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
      ...)  
    ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  Future state: 'finished'
  foreach() - level 2 ...
  [20:53:03.951] doFuture() ...
  [20:53:03.953] - dummy globals (as locals): [1] 'b'
  [20:53:03.955] - R expression:
  [20:53:03.955] {
  [20:53:03.955]     doFuture::registerDoFuture()
  [20:53:03.955]     lapply(seq_along(...future.x_ii), FUN = function(jj) {
  [20:53:03.955]         ...future.x_jj <- ...future.x_ii[[jj]]
  [20:53:03.955]         b <- NULL
  [20:53:03.955]         ...future.env <- environment()
  [20:53:03.955]         local({
  [20:53:03.955]             for (name in names(...future.x_jj)) {
  [20:53:03.955]                 assign(name, ...future.x_jj[[name]], envir = ...future.env, 
  [20:53:03.955]                   inherits = FALSE)
  [20:53:03.955]             }
  [20:53:03.955]         })
  [20:53:03.955]         tryCatch({
  [20:53:03.955]             plan_list <- future::plan()
  [20:53:03.955]             message(capture.output(print(plan_list)))
  [20:53:03.955]             stopifnot(inherits(plan_list, "future"), inherits(plan_list, 
  [20:53:03.955]                 getOption("future.default", "sequential")))
  [20:53:03.955]             plan_b <- future::plan("list")
  [20:53:03.955]             str(plan_b)
  [20:53:03.955]             stopifnot(inherits(plan_b[[1]], "future"), inherits(plan_b[[1]], 
  [20:53:03.955]                 getOption("future.default", "sequential")))
  [20:53:03.955]             list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
  [20:53:03.955]         }, error = identity)
  [20:53:03.955]     })
  [20:53:03.955] }
  [20:53:03.957] - identifying globals and packages ...
  getGlobalsAndPackages() ...
  Searching for globals...
  - globals found: [24] '{', '::', 'lapply', 'seq_along', '...future.x_ii', '<-', '[[', 'environment', 'local', 'for', 'names', 'assign', 'tryCatch', 'message', 'capture.output', 'print', 'stopifnot', 'inherits', 'getOption', 'str', 'list', 'a', 'plan_a', 'identity'
  Searching for globals ... DONE
  Resolving globals: FALSE
  The total size of the 3 globals is 64.51 KiB (66056 bytes)
  - globals: [3] '...future.x_ii', 'a', 'plan_a'
  - packages: [1] 'utils'
  getGlobalsAndPackages() ... DONE
  [20:53:04.026] List of 3
  [20:53:04.026]  $ ...future.x_ii: NULL
  [20:53:04.026]  $ a             : int 2
  [20:53:04.026]  $ plan_a        :List of 1
  [20:53:04.026]   ..$ b:function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
  [20:53:04.026]     seed = NULL, globals = TRUE, persistent = FALSE, workers = availableWorkers(), 
  [20:53:04.026]     user = NULL, revtunnel = TRUE, homogeneous = TRUE, gc = FALSE, earlySignal = FALSE, 
  [20:53:04.026]     label = NULL, ...)  
  [20:53:04.026]   .. ..- attr(*, "class")= chr [1:4] "cluster" "multiprocess" "future" "function"
  [20:53:04.026]   .. ..- attr(*, "init")= logi TRUE
  [20:53:04.026]   .. ..- attr(*, "call")= language plan(list(a = strategy1, b = strategy2))
  [20:53:04.026]   ..- attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  [20:53:04.026]  - attr(*, "where")=List of 3
  [20:53:04.026]   ..$ ...future.x_ii:<environment: 0x55a47f776120> 
  [20:53:04.026]   ..$ a             :<environment: 0x55a47e011f48> 
  [20:53:04.026]   ..$ plan_a        :<environment: 0x55a47e011f48> 
  [20:53:04.026]  - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list"
  [20:53:04.026]  - attr(*, "resolved")= logi FALSE
  [20:53:04.026]  - attr(*, "total_size")= num 66056
  [20:53:04.042]   - R expression:
  [20:53:04.043] {
  [20:53:04.043]     doFuture::registerDoFuture()
  [20:53:04.043]     lapply(seq_along(...future.x_ii), FUN = function(jj) {
  [20:53:04.043]         ...future.x_jj <- ...future.x_ii[[jj]]
  [20:53:04.043]         b <- NULL
  [20:53:04.043]         ...future.env <- environment()
  [20:53:04.043]         local({
  [20:53:04.043]             for (name in names(...future.x_jj)) {
  [20:53:04.043]                 assign(name, ...future.x_jj[[name]], envir = ...future.env, 
  [20:53:04.043]                   inherits = FALSE)
  [20:53:04.043]             }
  [20:53:04.043]         })
  [20:53:04.043]         tryCatch({
  [20:53:04.043]             plan_list <- future::plan()
  [20:53:04.043]             message(capture.output(print(plan_list)))
  [20:53:04.043]             stopifnot(inherits(plan_list, "future"), inherits(plan_list, 
  [20:53:04.043]                 getOption("future.default", "sequential")))
  [20:53:04.043]             plan_b <- future::plan("list")
  [20:53:04.043]             str(plan_b)
  [20:53:04.043]             stopifnot(inherits(plan_b[[1]], "future"), inherits(plan_b[[1]], 
  [20:53:04.043]                 getOption("future.default", "sequential")))
  [20:53:04.043]             list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
  [20:53:04.043]         }, error = identity)
  [20:53:04.043]     })
  [20:53:04.043] }
  [20:53:04.044]   - globals: [3] '...future.x_ii', 'a', 'plan_a'
  [20:53:04.045] List of 3
  [20:53:04.045]  $ ...future.x_ii: NULL
  [20:53:04.045]  $ a             : int 2
  [20:53:04.045]  $ plan_a        :List of 1
  [20:53:04.045]   ..$ b:function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
  [20:53:04.045]     seed = NULL, globals = TRUE, persistent = FALSE, workers = availableWorkers(), 
  [20:53:04.045]     user = NULL, revtunnel = TRUE, homogeneous = TRUE, gc = FALSE, earlySignal = FALSE, 
  [20:53:04.045]     label = NULL, ...)  
  [20:53:04.045]   .. ..- attr(*, "class")= chr [1:4] "cluster" "multiprocess" "future" "function"
  [20:53:04.045]   .. ..- attr(*, "init")= logi TRUE
  [20:53:04.045]   .. ..- attr(*, "call")= language plan(list(a = strategy1, b = strategy2))
  [20:53:04.045]   ..- attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  [20:53:04.045]  - attr(*, "where")=List of 3
  [20:53:04.045]   ..$ ...future.x_ii:<environment: 0x55a47f776120> 
  [20:53:04.045]   ..$ a             :<environment: 0x55a47e011f48> 
  [20:53:04.045]   ..$ plan_a        :<environment: 0x55a47e011f48> 
  [20:53:04.045]  - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list"
  [20:53:04.045]  - attr(*, "resolved")= logi FALSE
  [20:53:04.045]  - attr(*, "total_size")= num 66056
  [20:53:04.059]   - packages: [2] 'doFuture', 'utils'
  [20:53:04.060] - identifying globals and packages ... DONE
  [20:53:04.072] Number of chunks: 1
  [20:53:04.078] Number of futures (= number of chunks): 1
  [20:53:04.078] Launching 1 futures (chunks) ...
  [20:53:04.079] Chunk #1 of 1 ...
  [20:53:04.079]  - Finding globals in 'args_list' chunk #1 ...
  getGlobalsAndPackages() ...
  Searching for globals...
  
  Searching for globals ... DONE
  - globals: [0] <none>
  getGlobalsAndPackages() ... DONE
  [20:53:04.083] 
  [20:53:04.083] 
  [20:53:04.084]  - Finding globals in 'args_list' for chunk #1 ... DONE
  [local output] Workers: [n = 1] 'localhost'
  [local output] Base port: 11211
  [local output] Creating node 1 of 1 ...
  [local output] - setting up node
  Testing if worker's PID can be inferred: '/home/hornik/tmp/R.check/r-patched-gcc/Work/build/bin/Rscript -e 'try(cat(Sys.getpid(),file="/tmp/RtmpmhL62P/future.parent=29676.73ec395c2836.pid"), silent = TRUE)' -e "file.exists('/tmp/RtmpmhL62P/future.parent=29676.73ec395c2836.pid')"'
  - Possible to infer worker's PID: TRUE
  [local output] Starting worker #1 on 'localhost': '/home/hornik/tmp/R.check/r-patched-gcc/Work/build/bin/Rscript' --default-packages=datasets,utils,grDevices,graphics,stats,methods -e '#label=foreach,nested_dopar.R:29676:gimli:hornik' -e 'try(cat(Sys.getpid(),file="/tmp/RtmpmhL62P/future.parent=29676.73ec395c2836.pid"), silent = TRUE)' -e 'parallel:::.slaveRSOCK()' MASTER=localhost PORT=11211 OUT=/dev/null TIMEOUT=120 XDR=TRUE
  [local output] - Exit code of system() call: 0
  [local output] Waiting for worker #1 on 'localhost' to connect back
  [local output] Connection with worker #1 on 'localhost' established
  [local output] - collecting session information
  [local output] Creating node 1 of 1 ... done
  getGlobalsAndPackages() ...
  - globals passed as-is: [3] '...future.x_ii', 'a', 'plan_a'
  Resolving globals: FALSE
  The total size of the 3 globals is 64.67 KiB (66224 bytes)
  - globals: [3] '...future.x_ii', 'a', 'plan_a'
  
  getGlobalsAndPackages() ... DONE
  Warning in sample.int(.Machine$integer.max, size = 1L) :
    '.Random.seed' is not an integer vector but of type 'NULL', so ignored
  Packages needed by future strategies (n = 0): <none>
  Packages needed by the future expression (n = 2): 'doFuture', 'utils'
  {
      {
          ...future.startTime <- Sys.time()
          ...future.oldOptions <- options(future.startup.loadScript = FALSE, 
              future.globals.onMissing = "ignore", future.globals.maxSize = NULL, 
              future.globals.method = NULL, future.globals.onMissing = "ignore", 
              future.globals.onReference = NULL, future.globals.resolve = NULL, 
              future.resolve.recursive = NULL, width = 80L)
          {
              {
                  {
                    has_future <- requireNamespace("future", quietly = TRUE)
                    version <- if (has_future) 
                      packageVersion("future")
                    else NULL
                    if (!has_future || version < "1.8.0") {
                      info <- c(r_version = gsub("R version ", 
                        "", R.version$version.string), platform = sprintf("%s (%s-bit)", 
                        R.version$platform, 8 * .Machine$sizeof.pointer), 
                        os = paste(Sys.info()[c("sysname", "release", 
                          "version")], collapse = " "), hostname = Sys.info()[["nodename"]])
                      info <- sprintf("%s: %s", names(info), info)
                      info <- paste(info, collapse = "; ")
                      if (!has_future) {
                        msg <- sprintf("Package 'future' is not installed on worker (%s)", 
                          info)
                      }
                      else {
                        msg <- sprintf("Package 'future' on worker (%s) must be of version >= 1.8.0: %s", 
                          info, version)
                      }
                      stop(msg)
                    }
                  }
                  local({
                    for (pkg in c("doFuture", "utils")) {
                      loadNamespace(pkg)
                      library(pkg, character.only = TRUE)
                    }
                  })
              }
              future::plan("default", .cleanup = FALSE, .init = FALSE)
          }
      }
      if (is.na(TRUE)) {
      }
      else {
          if (TRUE) {
              ...future.stdout <- rawConnection(raw(0L), open = "w")
          }
          else {
              ...future.stdout <- file(switch(.Platform$OS.type, 
                  windows = "NUL", "/dev/null"), open = "w")
          }
          sink(...future.stdout, type = "output", split = FALSE)
          on.exit(if (!is.null(...future.stdout)) {
              sink(type = "output", split = FALSE)
              close(...future.stdout)
          }, add = TRUE)
      }
      ...future.frame <- sys.nframe()
      ...future.conditions <- list()
      ...future.result <- tryCatch({
          withCallingHandlers({
              ...future.value <- local({
                  doFuture::registerDoFuture()
                  lapply(seq_along(...future.x_ii), FUN = function(jj) {
                    ...future.x_jj <- ...future.x_ii[[jj]]
                    b <- NULL
                    ...future.env <- environment()
                    local({
                      for (name in names(...future.x_jj)) {
                        assign(name, ...future.x_jj[[name]], envir = ...future.env, 
                          inherits = FALSE)
                      }
                    })
                    tryCatch({
                      plan_list <- future::plan()
                      message(capture.output(print(plan_list)))
                      stopifnot(inherits(plan_list, "future"), 
                        inherits(plan_list, getOption("future.default", 
                          "sequential")))
                      plan_b <- future::plan("list")
                      str(plan_b)
                      stopifnot(inherits(plan_b[[1]], "future"), 
                        inherits(plan_b[[1]], getOption("future.default", 
                          "sequential")))
                      list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
                    }, error = identity)
                  })
              })
              future::FutureResult(value = ...future.value, started = ...future.startTime, 
                  version = "1.8")
          }, condition = local({
              inherits <- base::inherits
              invokeRestart <- base::invokeRestart
              length <- base::length
              seq.int <- base::seq.int
              sys.calls <- base::sys.calls
              `[[` <- base::`[[`
              `+` <- base::`+`
              `<<-` <- base::`<<-`
              sysCalls <- function(calls = sys.calls(), from = 1L) {
                  calls[seq.int(from = from + 12L, to = length(calls) - 
                    3L)]
              }
              function(cond) {
                  if (inherits(cond, "error")) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond, calls = c(sysCalls(from = ...future.frame), 
                      cond$call), timestamp = base::Sys.time())
                    signalCondition(cond)
                  }
                  else if (inherits(cond, c("message", "warning"
                  ))) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond)
                    if (inherits(cond, "message")) {
                      invokeRestart("muffleMessage")
                    }
                    else if (inherits(cond, "warning")) {
                      invokeRestart("muffleWarning")
                    }
                  }
              }
          }))
      }, error = function(ex) {
          structure(list(value = NULL, conditions = ...future.conditions, 
              condition = ex, calls = sys.calls(), version = "1.8"), 
              class = "FutureResult")
      }, finally = {
          {
              NULL
              future::plan(list(b = function (expr, envir = parent.frame(), 
                  substitute = TRUE, lazy = FALSE, seed = NULL, 
                  globals = TRUE, persistent = FALSE, workers = availableWorkers(), 
                  user = NULL, revtunnel = TRUE, homogeneous = TRUE, 
                  gc = FALSE, earlySignal = FALSE, label = NULL, 
                  ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  future <- ClusterFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, persistent = persistent, 
                    workers = workers, user = user, revtunnel = revtunnel, 
                    homogeneous = homogeneous, gc = gc, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }), .cleanup = FALSE, .init = FALSE)
          }
          options(...future.oldOptions)
      })
      if (is.na(TRUE)) {
      }
      else {
          sink(type = "output", split = FALSE)
          if (TRUE) {
              ...future.result$stdout <- rawToChar(rawConnectionValue(...future.stdout))
          }
          else {
              ...future.result["stdout"] <- list(NULL)
          }
          close(...future.stdout)
          ...future.stdout <- NULL
      }
      ...future.result$conditions <- ...future.conditions
      ...future.result
  }
  Exporting 3 global objects (64.67 KiB) to cluster node #1 ...
  Exporting '...future.x_ii' (168 bytes) to cluster node #1 ...
  Exporting '...future.x_ii' (168 bytes) to cluster node #1 ... DONE
  Exporting 'a' (56 bytes) to cluster node #1 ...
  Exporting 'a' (56 bytes) to cluster node #1 ... DONE
  Exporting 'plan_a' (64.45 KiB) to cluster node #1 ...
  Exporting 'plan_a' (64.45 KiB) to cluster node #1 ... DONE
  Exporting 3 global objects (64.67 KiB) to cluster node #1 ... DONE
  ClusterFuture started
  [20:53:11.505] Chunk #1 of 1 ... DONE
  [20:53:11.506] Launching 1 futures (chunks) ... DONE
  [20:53:11.506] - resolving futures
  resolve() on list ...
   recursive: 0
   length: 1
  
   length: 0 (resolved future 1)
  resolve() on list ... DONE
  [20:53:11.947] - relaying conditions of futures
  result() for ClusterFuture ...
  - Validating connection of ClusterFuture
  - class(result): FutureResult
  Future state: 'finished'
  result() for ClusterFuture ...
  - result already collected: FutureResult
  result() for ClusterFuture ... done
  sequential:- args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)- tweaked: FALSE- call: NULL
  sequential:- args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)- tweaked: FALSE- call: NULL
  sequential:- args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)- tweaked: FALSE- call: NULL
  [20:53:11.990] - collecting values of futures
  result() for ClusterFuture ...
  - result already collected: FutureResult
  result() for ClusterFuture ... done
  [20:53:11.992] - accumulating results
  [20:53:11.994] - processing errors (handler = 'stop')
  [20:53:11.994] - extracting results
  [20:53:11.995] doFuture() ... DONE
  foreach() - level 2 ... DONE
  [20:53:12.102] - collecting values of futures
  [20:53:12.103] - accumulating results
  [20:53:12.104] - processing errors (handler = 'stop')
  [20:53:12.105] - extracting results
  [20:53:12.105] doFuture() ... DONE
  foreach() - level 1 ... DONE
  - plan(list('multicore', 'cluster')) ... DONE
  - plan(list('multisession', 'sequential')) ...
  plan(): Setting new future strategy stack:
  List of future strategies:
  1. multisession:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, persistent = FALSE, workers = availableCores(), gc = FALSE, earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: plan(list(a = strategy1, b = strategy2))
  2. sequential:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: plan(list(a = strategy1, b = strategy2))
  
  plan(): plan_init() of 'multisession', 'cluster', 'multiprocess', 'future', 'function' ...
  multisession:
  - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, persistent = FALSE, workers = availableCores(), gc = FALSE, earlySignal = FALSE, label = NULL, ...)
  - tweaked: FALSE
  - call: plan(list(a = strategy1, b = strategy2))
  [local output] Workers: [n = 2] 'localhost', 'localhost'
  [local output] Base port: 11544
  [local output] Creating node 1 of 2 ...
  [local output] - setting up node
  Testing if worker's PID can be inferred: '/home/hornik/tmp/R.check/r-patched-gcc/Work/build/bin/Rscript -e 'try(cat(Sys.getpid(),file="/tmp/RtmpmhL62P/future.parent=10097.2771395c2836.pid"), silent = TRUE)' -e "file.exists('/tmp/RtmpmhL62P/future.parent=10097.2771395c2836.pid')"'
  - Possible to infer worker's PID: TRUE
  [local output] Starting worker #1 on 'localhost': '/home/hornik/tmp/R.check/r-patched-gcc/Work/build/bin/Rscript' --default-packages=datasets,utils,grDevices,graphics,stats,methods -e '#label=foreach,nested_dopar.R:10097:gimli:hornik' -e 'try(cat(Sys.getpid(),file="/tmp/RtmpmhL62P/future.parent=10097.2771395c2836.pid"), silent = TRUE)' -e 'parallel:::.slaveRSOCK()' MASTER=localhost PORT=11544 OUT=/dev/null TIMEOUT=120 XDR=TRUE
  [local output] - Exit code of system() call: 0
  [local output] Waiting for worker #1 on 'localhost' to connect back
  [local output] Connection with worker #1 on 'localhost' established
  [local output] - collecting session information
  [local output] Creating node 1 of 2 ... done
  [local output] Creating node 2 of 2 ...
  [local output] - setting up node
  Testing if worker's PID can be inferred: '/home/hornik/tmp/R.check/r-patched-gcc/Work/build/bin/Rscript -e 'try(cat(Sys.getpid(),file="/tmp/RtmpmhL62P/future.parent=10097.277144d24d66.pid"), silent = TRUE)' -e "file.exists('/tmp/RtmpmhL62P/future.parent=10097.277144d24d66.pid')"'
  - Possible to infer worker's PID: TRUE
  [local output] Starting worker #2 on 'localhost': '/home/hornik/tmp/R.check/r-patched-gcc/Work/build/bin/Rscript' --default-packages=datasets,utils,grDevices,graphics,stats,methods -e '#label=foreach,nested_dopar.R:10097:gimli:hornik' -e 'try(cat(Sys.getpid(),file="/tmp/RtmpmhL62P/future.parent=10097.277144d24d66.pid"), silent = TRUE)' -e 'parallel:::.slaveRSOCK()' MASTER=localhost PORT=11544 OUT=/dev/null TIMEOUT=120 XDR=TRUE
  [local output] - Exit code of system() call: 0
  [local output] Waiting for worker #2 on 'localhost' to connect back
  [local output] Connection with worker #2 on 'localhost' established
  [local output] - collecting session information
  [local output] Creating node 2 of 2 ... done
  getGlobalsAndPackages() ...
  Not searching for globals
  - globals: [0] <none>
  getGlobalsAndPackages() ... DONE
  Packages needed by future strategies (n = 1): 'future'
  Packages needed by the future expression (n = 0): <none>
  {
      {
          ...future.startTime <- Sys.time()
          ...future.oldOptions <- options(future.startup.loadScript = FALSE, 
              future.globals.onMissing = "ignore", future.globals.maxSize = NULL, 
              future.globals.method = NULL, future.globals.onMissing = "ignore", 
              future.globals.onReference = NULL, future.globals.resolve = NULL, 
              future.resolve.recursive = NULL, width = 80L)
          {
              {
                  {
                    {
                      has_future <- requireNamespace("future", 
                        quietly = TRUE)
                      version <- if (has_future) 
                        packageVersion("future")
                      else NULL
                      if (!has_future || version < "1.8.0") {
                        info <- c(r_version = gsub("R version ", 
                          "", R.version$version.string), platform = sprintf("%s (%s-bit)", 
                          R.version$platform, 8 * .Machine$sizeof.pointer), 
                          os = paste(Sys.info()[c("sysname", "release", 
                            "version")], collapse = " "), hostname = Sys.info()[["nodename"]])
                        info <- sprintf("%s: %s", names(info), 
                          info)
                        info <- paste(info, collapse = "; ")
                        if (!has_future) {
                          msg <- sprintf("Package 'future' is not installed on worker (%s)", 
                            info)
                        }
                        else {
                          msg <- sprintf("Package 'future' on worker (%s) must be of version >= 1.8.0: %s", 
                            info, version)
                        }
                        stop(msg)
                      }
                    }
                    ...future.mc.cores.old <- getOption("mc.cores")
                    options(mc.cores = 1L)
                  }
                  local({
                    for (pkg in "future") {
                      loadNamespace(pkg)
                      library(pkg, character.only = TRUE)
                    }
                  })
              }
              future::plan(list(b = function (expr, envir = parent.frame(), 
                  substitute = TRUE, lazy = FALSE, seed = NULL, 
                  globals = TRUE, local = TRUE, earlySignal = FALSE, 
                  label = NULL, ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  local <- as.logical(local)
                  future <- SequentialFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, local = local, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }), .cleanup = FALSE, .init = FALSE)
          }
      }
      if (is.na(TRUE)) {
      }
      else {
          if (TRUE) {
              ...future.stdout <- rawConnection(raw(0L), open = "w")
          }
          else {
              ...future.stdout <- file(switch(.Platform$OS.type, 
                  windows = "NUL", "/dev/null"), open = "w")
          }
          sink(...future.stdout, type = "output", split = FALSE)
          on.exit(if (!is.null(...future.stdout)) {
              sink(type = "output", split = FALSE)
              close(...future.stdout)
          }, add = TRUE)
      }
      ...future.frame <- sys.nframe()
      ...future.conditions <- list()
      ...future.result <- tryCatch({
          withCallingHandlers({
              ...future.value <- local(NA)
              future::FutureResult(value = ...future.value, started = ...future.startTime, 
                  version = "1.8")
          }, condition = local({
              inherits <- base::inherits
              invokeRestart <- base::invokeRestart
              length <- base::length
              seq.int <- base::seq.int
              sys.calls <- base::sys.calls
              `[[` <- base::`[[`
              `+` <- base::`+`
              `<<-` <- base::`<<-`
              sysCalls <- function(calls = sys.calls(), from = 1L) {
                  calls[seq.int(from = from + 12L, to = length(calls) - 
                    3L)]
              }
              function(cond) {
                  if (inherits(cond, "error")) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond, calls = c(sysCalls(from = ...future.frame), 
                      cond$call), timestamp = base::Sys.time())
                    signalCondition(cond)
                  }
                  else if (inherits(cond, c("message", "warning"
                  ))) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond)
                    if (inherits(cond, "message")) {
                      invokeRestart("muffleMessage")
                    }
                    else if (inherits(cond, "warning")) {
                      invokeRestart("muffleWarning")
                    }
                  }
              }
          }))
      }, error = function(ex) {
          structure(list(value = NULL, conditions = ...future.conditions, 
              condition = ex, calls = sys.calls(), version = "1.8"), 
              class = "FutureResult")
      }, finally = {
          {
              {
                  options(mc.cores = ...future.mc.cores.old)
              }
              future::plan(list(a = function (expr, envir = parent.frame(), 
                  substitute = TRUE, lazy = FALSE, seed = NULL, 
                  globals = TRUE, persistent = FALSE, workers = availableCores(), 
                  gc = FALSE, earlySignal = FALSE, label = NULL, 
                  ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  if (is.function(workers)) 
                    workers <- workers()
                  workers <- as.integer(workers)
                  stop_if_not(length(workers) == 1, is.finite(workers), 
                    workers >= 1)
                  if (workers == 1L) {
                    return(sequential(expr, envir = envir, substitute = FALSE, 
                      lazy = TRUE, seed = seed, globals = globals, 
                      local = TRUE, label = label, ...))
                  }
                  workers <- ClusterRegistry("start", workers = workers)
                  future <- MultisessionFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, persistent = persistent, 
                    workers = workers, gc = gc, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }, b = function (expr, envir = parent.frame(), substitute = TRUE, 
                  lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, 
                  earlySignal = FALSE, label = NULL, ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  local <- as.logical(local)
                  future <- SequentialFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, local = local, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }), .cleanup = FALSE, .init = FALSE)
          }
          options(...future.oldOptions)
      })
      if (is.na(TRUE)) {
      }
      else {
          sink(type = "output", split = FALSE)
          if (TRUE) {
              ...future.result$stdout <- rawToChar(rawConnectionValue(...future.stdout))
          }
          else {
              ...future.result["stdout"] <- list(NULL)
          }
          close(...future.stdout)
          ...future.stdout <- NULL
      }
      ...future.result$conditions <- ...future.conditions
      ...future.result
  }
  MultisessionFuture started
  result() for ClusterFuture ...
  - Validating connection of MultisessionFuture
  - class(result): FutureResult
  plan(): plan_init() of 'multisession', 'cluster', 'multiprocess', 'future', 'function' ... DONE
  plan(): nbrOfWorkers() = 2
  foreach() - level 1 ...
  [20:53:27.238] doFuture() ...
  [20:53:27.240] - dummy globals (as locals): [1] 'a'
  [20:53:27.241] - R expression:
  [20:53:27.241] {
  [20:53:27.241]     doFuture::registerDoFuture()
  [20:53:27.241]     lapply(seq_along(...future.x_ii), FUN = function(jj) {
  [20:53:27.241]         ...future.x_jj <- ...future.x_ii[[jj]]
  [20:53:27.241]         a <- NULL
  [20:53:27.241]         ...future.env <- environment()
  [20:53:27.241]         local({
  [20:53:27.241]             for (name in names(...future.x_jj)) {
  [20:53:27.241]                 assign(name, ...future.x_jj[[name]], envir = ...future.env, 
  [20:53:27.241]                   inherits = FALSE)
  [20:53:27.241]             }
  [20:53:27.241]         })
  [20:53:27.241]         tryCatch({
  [20:53:27.241]             plan_list <- future::plan()
  [20:53:27.241]             stopifnot(inherits(plan_list, strategy2))
  [20:53:27.241]             plan_a <- future::plan("list")
  [20:53:27.241]             str(plan_a)
  [20:53:27.241]             stopifnot(inherits(plan_a[[1]], strategy2))
  [20:53:27.241]             message("foreach() - level 2 ...")
  [20:53:27.241]             y <- foreach(b = bs, .export = c("a", "plan_a")) %dopar% 
  [20:53:27.241]                 {
  [20:53:27.241]                   plan_list <- future::plan()
  [20:53:27.241]                   message(capture.output(print(plan_list)))
  [20:53:27.241]                   stopifnot(inherits(plan_list, "future"), inherits(plan_list, 
  [20:53:27.241]                     getOption("future.default", "sequential")))
  [20:53:27.241]                   plan_b <- future::plan("list")
  [20:53:27.241]                   str(plan_b)
  [20:53:27.241]                   stopifnot(inherits(plan_b[[1]], "future"), 
  [20:53:27.241]                     inherits(plan_b[[1]], getOption("future.default", 
  [20:53:27.241]                       "sequential")))
  [20:53:27.241]                   list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
  [20:53:27.241]                 }
  [20:53:27.241]             message("foreach() - level 2 ... DONE")
  [20:53:27.241]             y
  [20:53:27.241]         }, error = identity)
  [20:53:27.241]     })
  [20:53:27.241] }
  [20:53:27.243] - identifying globals and packages ...
  getGlobalsAndPackages() ...
  Searching for globals...
  - globals found: [28] '{', '::', 'lapply', 'seq_along', '...future.x_ii', '<-', '[[', 'environment', 'local', 'for', 'names', 'assign', 'tryCatch', 'stopifnot', 'inherits', 'strategy2', 'str', 'message', '%dopar%', 'foreach', 'bs', 'c', 'capture.output', 'print', 'getOption', 'list', 'b', 'identity'
  Searching for globals ... DONE
  Resolving globals: FALSE
  The total size of the 3 globals is 184 bytes (184 bytes)
  - globals: [3] '...future.x_ii', 'strategy2', 'bs'
  - packages: [2] 'utils', 'foreach'
  getGlobalsAndPackages() ... DONE
  [20:53:27.325] List of 3
  [20:53:27.325]  $ ...future.x_ii: NULL
  [20:53:27.325]  $ strategy2     : chr "sequential"
  [20:53:27.325]  $ bs            : int [1:3] 3 2 1
  [20:53:27.325]  - attr(*, "where")=List of 3
  [20:53:27.325]   ..$ ...future.x_ii:<environment: 0x55a47ddfd568> 
  [20:53:27.325]   ..$ strategy2     :<environment: R_GlobalEnv> 
  [20:53:27.325]   ..$ bs            :<environment: R_GlobalEnv> 
  [20:53:27.325]  - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list"
  [20:53:27.325]  - attr(*, "resolved")= logi FALSE
  [20:53:27.325]  - attr(*, "total_size")= num 184
  [20:53:27.338]   - R expression:
  [20:53:27.338] {
  [20:53:27.338]     doFuture::registerDoFuture()
  [20:53:27.338]     lapply(seq_along(...future.x_ii), FUN = function(jj) {
  [20:53:27.338]         ...future.x_jj <- ...future.x_ii[[jj]]
  [20:53:27.338]         a <- NULL
  [20:53:27.338]         ...future.env <- environment()
  [20:53:27.338]         local({
  [20:53:27.338]             for (name in names(...future.x_jj)) {
  [20:53:27.338]                 assign(name, ...future.x_jj[[name]], envir = ...future.env, 
  [20:53:27.338]                   inherits = FALSE)
  [20:53:27.338]             }
  [20:53:27.338]         })
  [20:53:27.338]         tryCatch({
  [20:53:27.338]             plan_list <- future::plan()
  [20:53:27.338]             stopifnot(inherits(plan_list, strategy2))
  [20:53:27.338]             plan_a <- future::plan("list")
  [20:53:27.338]             str(plan_a)
  [20:53:27.338]             stopifnot(inherits(plan_a[[1]], strategy2))
  [20:53:27.338]             message("foreach() - level 2 ...")
  [20:53:27.338]             y <- foreach(b = bs, .export = c("a", "plan_a")) %dopar% 
  [20:53:27.338]                 {
  [20:53:27.338]                   plan_list <- future::plan()
  [20:53:27.338]                   message(capture.output(print(plan_list)))
  [20:53:27.338]                   stopifnot(inherits(plan_list, "future"), inherits(plan_list, 
  [20:53:27.338]                     getOption("future.default", "sequential")))
  [20:53:27.338]                   plan_b <- future::plan("list")
  [20:53:27.338]                   str(plan_b)
  [20:53:27.338]                   stopifnot(inherits(plan_b[[1]], "future"), 
  [20:53:27.338]                     inherits(plan_b[[1]], getOption("future.default", 
  [20:53:27.338]                       "sequential")))
  [20:53:27.338]                   list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
  [20:53:27.338]                 }
  [20:53:27.338]             message("foreach() - level 2 ... DONE")
  [20:53:27.338]             y
  [20:53:27.338]         }, error = identity)
  [20:53:27.338]     })
  [20:53:27.338] }
  [20:53:27.339]   - globals: [3] '...future.x_ii', 'strategy2', 'bs'
  [20:53:27.340] List of 3
  [20:53:27.340]  $ ...future.x_ii: NULL
  [20:53:27.340]  $ strategy2     : chr "sequential"
  [20:53:27.340]  $ bs            : int [1:3] 3 2 1
  [20:53:27.340]  - attr(*, "where")=List of 3
  [20:53:27.340]   ..$ ...future.x_ii:<environment: 0x55a47ddfd568> 
  [20:53:27.340]   ..$ strategy2     :<environment: R_GlobalEnv> 
  [20:53:27.340]   ..$ bs            :<environment: R_GlobalEnv> 
  [20:53:27.340]  - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list"
  [20:53:27.340]  - attr(*, "resolved")= logi FALSE
  [20:53:27.340]  - attr(*, "total_size")= num 184
  [20:53:27.350]   - packages: [3] 'doFuture', 'utils', 'foreach'
  [20:53:27.350] - identifying globals and packages ... DONE
  [20:53:27.351] Number of chunks: 2
  [20:53:27.352] Number of futures (= number of chunks): 2
  [20:53:27.352] Launching 2 futures (chunks) ...
  [20:53:27.352] Chunk #1 of 2 ...
  [20:53:27.353]  - Finding globals in 'args_list' chunk #1 ...
  getGlobalsAndPackages() ...
  Searching for globals...
  
  Searching for globals ... DONE
  - globals: [0] <none>
  getGlobalsAndPackages() ... DONE
  [20:53:27.355] 
  [20:53:27.361] 
  [20:53:27.361]  - Finding globals in 'args_list' for chunk #1 ... DONE
  getGlobalsAndPackages() ...
  - globals passed as-is: [3] '...future.x_ii', 'strategy2', 'bs'
  Resolving globals: FALSE
  The total size of the 3 globals is 240 bytes (240 bytes)
  - globals: [3] '...future.x_ii', 'strategy2', 'bs'
  
  getGlobalsAndPackages() ... DONE
  Packages needed by future strategies (n = 1): 'future'
  Packages needed by the future expression (n = 3): 'doFuture', 'utils', 'foreach'
  {
      {
          ...future.startTime <- Sys.time()
          ...future.oldOptions <- options(future.startup.loadScript = FALSE, 
              future.globals.onMissing = "ignore", future.globals.maxSize = NULL, 
              future.globals.method = NULL, future.globals.onMissing = "ignore", 
              future.globals.onReference = NULL, future.globals.resolve = NULL, 
              future.resolve.recursive = NULL, width = 80L)
          {
              {
                  {
                    {
                      has_future <- requireNamespace("future", 
                        quietly = TRUE)
                      version <- if (has_future) 
                        packageVersion("future")
                      else NULL
                      if (!has_future || version < "1.8.0") {
                        info <- c(r_version = gsub("R version ", 
                          "", R.version$version.string), platform = sprintf("%s (%s-bit)", 
                          R.version$platform, 8 * .Machine$sizeof.pointer), 
                          os = paste(Sys.info()[c("sysname", "release", 
                            "version")], collapse = " "), hostname = Sys.info()[["nodename"]])
                        info <- sprintf("%s: %s", names(info), 
                          info)
                        info <- paste(info, collapse = "; ")
                        if (!has_future) {
                          msg <- sprintf("Package 'future' is not installed on worker (%s)", 
                            info)
                        }
                        else {
                          msg <- sprintf("Package 'future' on worker (%s) must be of version >= 1.8.0: %s", 
                            info, version)
                        }
                        stop(msg)
                      }
                    }
                    ...future.mc.cores.old <- getOption("mc.cores")
                    options(mc.cores = 1L)
                  }
                  local({
                    for (pkg in c("future", "doFuture", "utils", 
                    "foreach")) {
                      loadNamespace(pkg)
                      library(pkg, character.only = TRUE)
                    }
                  })
              }
              future::plan(list(b = function (expr, envir = parent.frame(), 
                  substitute = TRUE, lazy = FALSE, seed = NULL, 
                  globals = TRUE, local = TRUE, earlySignal = FALSE, 
                  label = NULL, ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  local <- as.logical(local)
                  future <- SequentialFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, local = local, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }), .cleanup = FALSE, .init = FALSE)
          }
      }
      if (is.na(TRUE)) {
      }
      else {
          if (TRUE) {
              ...future.stdout <- rawConnection(raw(0L), open = "w")
          }
          else {
              ...future.stdout <- file(switch(.Platform$OS.type, 
                  windows = "NUL", "/dev/null"), open = "w")
          }
          sink(...future.stdout, type = "output", split = FALSE)
          on.exit(if (!is.null(...future.stdout)) {
              sink(type = "output", split = FALSE)
              close(...future.stdout)
          }, add = TRUE)
      }
      ...future.frame <- sys.nframe()
      ...future.conditions <- list()
      ...future.result <- tryCatch({
          withCallingHandlers({
              ...future.value <- local({
                  doFuture::registerDoFuture()
                  lapply(seq_along(...future.x_ii), FUN = function(jj) {
                    ...future.x_jj <- ...future.x_ii[[jj]]
                    a <- NULL
                    ...future.env <- environment()
                    local({
                      for (name in names(...future.x_jj)) {
                        assign(name, ...future.x_jj[[name]], envir = ...future.env, 
                          inherits = FALSE)
                      }
                    })
                    tryCatch({
                      plan_list <- future::plan()
                      stopifnot(inherits(plan_list, strategy2))
                      plan_a <- future::plan("list")
                      str(plan_a)
                      stopifnot(inherits(plan_a[[1]], strategy2))
                      message("foreach() - level 2 ...")
                      y <- foreach(b = bs, .export = c("a", "plan_a")) %dopar% 
                        {
                          plan_list <- future::plan()
                          message(capture.output(print(plan_list)))
                          stopifnot(inherits(plan_list, "future"), 
                            inherits(plan_list, getOption("future.default", 
                              "sequential")))
                          plan_b <- future::plan("list")
                          str(plan_b)
                          stopifnot(inherits(plan_b[[1]], "future"), 
                            inherits(plan_b[[1]], getOption("future.default", 
                              "sequential")))
                          list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
                        }
                      message("foreach() - level 2 ... DONE")
                      y
                    }, error = identity)
                  })
              })
              future::FutureResult(value = ...future.value, started = ...future.startTime, 
                  version = "1.8")
          }, condition = local({
              inherits <- base::inherits
              invokeRestart <- base::invokeRestart
              length <- base::length
              seq.int <- base::seq.int
              sys.calls <- base::sys.calls
              `[[` <- base::`[[`
              `+` <- base::`+`
              `<<-` <- base::`<<-`
              sysCalls <- function(calls = sys.calls(), from = 1L) {
                  calls[seq.int(from = from + 12L, to = length(calls) - 
                    3L)]
              }
              function(cond) {
                  if (inherits(cond, "error")) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond, calls = c(sysCalls(from = ...future.frame), 
                      cond$call), timestamp = base::Sys.time())
                    signalCondition(cond)
                  }
                  else if (inherits(cond, c("message", "warning"
                  ))) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond)
                    if (inherits(cond, "message")) {
                      invokeRestart("muffleMessage")
                    }
                    else if (inherits(cond, "warning")) {
                      invokeRestart("muffleWarning")
                    }
                  }
              }
          }))
      }, error = function(ex) {
          structure(list(value = NULL, conditions = ...future.conditions, 
              condition = ex, calls = sys.calls(), version = "1.8"), 
              class = "FutureResult")
      }, finally = {
          {
              {
                  options(mc.cores = ...future.mc.cores.old)
              }
              future::plan(list(a = function (expr, envir = parent.frame(), 
                  substitute = TRUE, lazy = FALSE, seed = NULL, 
                  globals = TRUE, persistent = FALSE, workers = availableCores(), 
                  gc = FALSE, earlySignal = FALSE, label = NULL, 
                  ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  if (is.function(workers)) 
                    workers <- workers()
                  workers <- as.integer(workers)
                  stop_if_not(length(workers) == 1, is.finite(workers), 
                    workers >= 1)
                  if (workers == 1L) {
                    return(sequential(expr, envir = envir, substitute = FALSE, 
                      lazy = TRUE, seed = seed, globals = globals, 
                      local = TRUE, label = label, ...))
                  }
                  workers <- ClusterRegistry("start", workers = workers)
                  future <- MultisessionFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, persistent = persistent, 
                    workers = workers, gc = gc, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }, b = function (expr, envir = parent.frame(), substitute = TRUE, 
                  lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, 
                  earlySignal = FALSE, label = NULL, ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  local <- as.logical(local)
                  future <- SequentialFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, local = local, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }), .cleanup = FALSE, .init = FALSE)
          }
          options(...future.oldOptions)
      })
      if (is.na(TRUE)) {
      }
      else {
          sink(type = "output", split = FALSE)
          if (TRUE) {
              ...future.result$stdout <- rawToChar(rawConnectionValue(...future.stdout))
          }
          else {
              ...future.result["stdout"] <- list(NULL)
          }
          close(...future.stdout)
          ...future.stdout <- NULL
      }
      ...future.result$conditions <- ...future.conditions
      ...future.result
  }
  Exporting 3 global objects (240 bytes) to cluster node #1 ...
  Exporting '...future.x_ii' (56 bytes) to cluster node #1 ...
  Exporting '...future.x_ii' (56 bytes) to cluster node #1 ... DONE
  Exporting 'strategy2' (120 bytes) to cluster node #1 ...
  Exporting 'strategy2' (120 bytes) to cluster node #1 ... DONE
  Exporting 'bs' (64 bytes) to cluster node #1 ...
  Exporting 'bs' (64 bytes) to cluster node #1 ... DONE
  Exporting 3 global objects (240 bytes) to cluster node #1 ... DONE
  MultisessionFuture started
  [20:53:27.396] Chunk #1 of 2 ... DONE
  [20:53:27.397] Chunk #2 of 2 ...
  [20:53:27.397]  - Finding globals in 'args_list' chunk #2 ...
  getGlobalsAndPackages() ...
  Searching for globals...
  
  Searching for globals ... DONE
  - globals: [0] <none>
  getGlobalsAndPackages() ... DONE
  [20:53:27.399] 
  [20:53:27.399] 
  [20:53:27.400]  - Finding globals in 'args_list' for chunk #2 ... DONE
  getGlobalsAndPackages() ...
  - globals passed as-is: [3] '...future.x_ii', 'strategy2', 'bs'
  Resolving globals: FALSE
  The total size of the 3 globals is 240 bytes (240 bytes)
  - globals: [3] '...future.x_ii', 'strategy2', 'bs'
  
  getGlobalsAndPackages() ... DONE
  Packages needed by future strategies (n = 1): 'future'
  Packages needed by the future expression (n = 3): 'doFuture', 'utils', 'foreach'
  {
      {
          ...future.startTime <- Sys.time()
          ...future.oldOptions <- options(future.startup.loadScript = FALSE, 
              future.globals.onMissing = "ignore", future.globals.maxSize = NULL, 
              future.globals.method = NULL, future.globals.onMissing = "ignore", 
              future.globals.onReference = NULL, future.globals.resolve = NULL, 
              future.resolve.recursive = NULL, width = 80L)
          {
              {
                  {
                    {
                      has_future <- requireNamespace("future", 
                        quietly = TRUE)
                      version <- if (has_future) 
                        packageVersion("future")
                      else NULL
                      if (!has_future || version < "1.8.0") {
                        info <- c(r_version = gsub("R version ", 
                          "", R.version$version.string), platform = sprintf("%s (%s-bit)", 
                          R.version$platform, 8 * .Machine$sizeof.pointer), 
                          os = paste(Sys.info()[c("sysname", "release", 
                            "version")], collapse = " "), hostname = Sys.info()[["nodename"]])
                        info <- sprintf("%s: %s", names(info), 
                          info)
                        info <- paste(info, collapse = "; ")
                        if (!has_future) {
                          msg <- sprintf("Package 'future' is not installed on worker (%s)", 
                            info)
                        }
                        else {
                          msg <- sprintf("Package 'future' on worker (%s) must be of version >= 1.8.0: %s", 
                            info, version)
                        }
                        stop(msg)
                      }
                    }
                    ...future.mc.cores.old <- getOption("mc.cores")
                    options(mc.cores = 1L)
                  }
                  local({
                    for (pkg in c("future", "doFuture", "utils", 
                    "foreach")) {
                      loadNamespace(pkg)
                      library(pkg, character.only = TRUE)
                    }
                  })
              }
              future::plan(list(b = function (expr, envir = parent.frame(), 
                  substitute = TRUE, lazy = FALSE, seed = NULL, 
                  globals = TRUE, local = TRUE, earlySignal = FALSE, 
                  label = NULL, ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  local <- as.logical(local)
                  future <- SequentialFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, local = local, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }), .cleanup = FALSE, .init = FALSE)
          }
      }
      if (is.na(TRUE)) {
      }
      else {
          if (TRUE) {
              ...future.stdout <- rawConnection(raw(0L), open = "w")
          }
          else {
              ...future.stdout <- file(switch(.Platform$OS.type, 
                  windows = "NUL", "/dev/null"), open = "w")
          }
          sink(...future.stdout, type = "output", split = FALSE)
          on.exit(if (!is.null(...future.stdout)) {
              sink(type = "output", split = FALSE)
              close(...future.stdout)
          }, add = TRUE)
      }
      ...future.frame <- sys.nframe()
      ...future.conditions <- list()
      ...future.result <- tryCatch({
          withCallingHandlers({
              ...future.value <- local({
                  doFuture::registerDoFuture()
                  lapply(seq_along(...future.x_ii), FUN = function(jj) {
                    ...future.x_jj <- ...future.x_ii[[jj]]
                    a <- NULL
                    ...future.env <- environment()
                    local({
                      for (name in names(...future.x_jj)) {
                        assign(name, ...future.x_jj[[name]], envir = ...future.env, 
                          inherits = FALSE)
                      }
                    })
                    tryCatch({
                      plan_list <- future::plan()
                      stopifnot(inherits(plan_list, strategy2))
                      plan_a <- future::plan("list")
                      str(plan_a)
                      stopifnot(inherits(plan_a[[1]], strategy2))
                      message("foreach() - level 2 ...")
                      y <- foreach(b = bs, .export = c("a", "plan_a")) %dopar% 
                        {
                          plan_list <- future::plan()
                          message(capture.output(print(plan_list)))
                          stopifnot(inherits(plan_list, "future"), 
                            inherits(plan_list, getOption("future.default", 
                              "sequential")))
                          plan_b <- future::plan("list")
                          str(plan_b)
                          stopifnot(inherits(plan_b[[1]], "future"), 
                            inherits(plan_b[[1]], getOption("future.default", 
                              "sequential")))
                          list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
                        }
                      message("foreach() - level 2 ... DONE")
                      y
                    }, error = identity)
                  })
              })
              future::FutureResult(value = ...future.value, started = ...future.startTime, 
                  version = "1.8")
          }, condition = local({
              inherits <- base::inherits
              invokeRestart <- base::invokeRestart
              length <- base::length
              seq.int <- base::seq.int
              sys.calls <- base::sys.calls
              `[[` <- base::`[[`
              `+` <- base::`+`
              `<<-` <- base::`<<-`
              sysCalls <- function(calls = sys.calls(), from = 1L) {
                  calls[seq.int(from = from + 12L, to = length(calls) - 
                    3L)]
              }
              function(cond) {
                  if (inherits(cond, "error")) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond, calls = c(sysCalls(from = ...future.frame), 
                      cond$call), timestamp = base::Sys.time())
                    signalCondition(cond)
                  }
                  else if (inherits(cond, c("message", "warning"
                  ))) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond)
                    if (inherits(cond, "message")) {
                      invokeRestart("muffleMessage")
                    }
                    else if (inherits(cond, "warning")) {
                      invokeRestart("muffleWarning")
                    }
                  }
              }
          }))
      }, error = function(ex) {
          structure(list(value = NULL, conditions = ...future.conditions, 
              condition = ex, calls = sys.calls(), version = "1.8"), 
              class = "FutureResult")
      }, finally = {
          {
              {
                  options(mc.cores = ...future.mc.cores.old)
              }
              future::plan(list(a = function (expr, envir = parent.frame(), 
                  substitute = TRUE, lazy = FALSE, seed = NULL, 
                  globals = TRUE, persistent = FALSE, workers = availableCores(), 
                  gc = FALSE, earlySignal = FALSE, label = NULL, 
                  ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  if (is.function(workers)) 
                    workers <- workers()
                  workers <- as.integer(workers)
                  stop_if_not(length(workers) == 1, is.finite(workers), 
                    workers >= 1)
                  if (workers == 1L) {
                    return(sequential(expr, envir = envir, substitute = FALSE, 
                      lazy = TRUE, seed = seed, globals = globals, 
                      local = TRUE, label = label, ...))
                  }
                  workers <- ClusterRegistry("start", workers = workers)
                  future <- MultisessionFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, persistent = persistent, 
                    workers = workers, gc = gc, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }, b = function (expr, envir = parent.frame(), substitute = TRUE, 
                  lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, 
                  earlySignal = FALSE, label = NULL, ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  local <- as.logical(local)
                  future <- SequentialFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, local = local, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }), .cleanup = FALSE, .init = FALSE)
          }
          options(...future.oldOptions)
      })
      if (is.na(TRUE)) {
      }
      else {
          sink(type = "output", split = FALSE)
          if (TRUE) {
              ...future.result$stdout <- rawToChar(rawConnectionValue(...future.stdout))
          }
          else {
              ...future.result["stdout"] <- list(NULL)
          }
          close(...future.stdout)
          ...future.stdout <- NULL
      }
      ...future.result$conditions <- ...future.conditions
      ...future.result
  }
  Exporting 3 global objects (240 bytes) to cluster node #2 ...
  Exporting '...future.x_ii' (56 bytes) to cluster node #2 ...
  Exporting '...future.x_ii' (56 bytes) to cluster node #2 ... DONE
  Exporting 'strategy2' (120 bytes) to cluster node #2 ...
  Exporting 'strategy2' (120 bytes) to cluster node #2 ... DONE
  Exporting 'bs' (64 bytes) to cluster node #2 ...
  Exporting 'bs' (64 bytes) to cluster node #2 ... DONE
  Exporting 3 global objects (240 bytes) to cluster node #2 ... DONE
  MultisessionFuture started
  [20:53:27.430] Chunk #2 of 2 ... DONE
  [20:53:27.431] Launching 2 futures (chunks) ... DONE
  [20:53:27.431] - resolving futures
  resolve() on list ...
   recursive: 0
   length: 2
  
   length: 1 (resolved future 1)
   length: 0 (resolved future 2)
  resolve() on list ... DONE
  [20:53:27.991] - relaying conditions of futures
  result() for ClusterFuture ...
  - Validating connection of MultisessionFuture
  - class(result): FutureResult
  List of 1
   $ b:function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
      ...)  
    ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
    ..- attr(*, "call")= language plan(list(a = strategy1, b = strategy2))
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  List of 1
   $ :function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
      ...)  
    ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  List of 1
   $ :function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
      ...)  
    ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  List of 1
   $ :function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
      ...)  
    ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  Future state: 'finished'
  result() for ClusterFuture ...
  - result already collected: FutureResult
  result() for ClusterFuture ... done
  foreach() - level 2 ...
  sequential:- args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)- tweaked: FALSE- call: NULL
  sequential:- args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)- tweaked: FALSE- call: NULL
  sequential:- args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)- tweaked: FALSE- call: NULL
  foreach() - level 2 ... DONE
  result() for ClusterFuture ...
  - Validating connection of MultisessionFuture
  - class(result): FutureResult
  List of 1
   $ b:function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
      ...)  
    ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
    ..- attr(*, "call")= language plan(list(a = strategy1, b = strategy2))
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  List of 1
   $ :function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
      ...)  
    ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  List of 1
   $ :function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
      ...)  
    ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  List of 1
   $ :function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
      ...)  
    ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  Future state: 'finished'
  result() for ClusterFuture ...
  - result already collected: FutureResult
  result() for ClusterFuture ... done
  foreach() - level 2 ...
  sequential:- args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)- tweaked: FALSE- call: NULL
  sequential:- args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)- tweaked: FALSE- call: NULL
  sequential:- args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)- tweaked: FALSE- call: NULL
  foreach() - level 2 ... DONE
  [20:53:28.038] - collecting values of futures
  result() for ClusterFuture ...
  - result already collected: FutureResult
  result() for ClusterFuture ... done
  result() for ClusterFuture ...
  - result already collected: FutureResult
  result() for ClusterFuture ... done
  [20:53:28.040] - accumulating results
  [20:53:28.041] - processing errors (handler = 'stop')
  [20:53:28.041] - extracting results
  [20:53:28.042] doFuture() ... DONE
  foreach() - level 1 ... DONE
  - plan(list('multisession', 'sequential')) ... DONE
  - plan(list('multisession', 'multicore')) ...
  plan(): Setting new future strategy stack:
  List of future strategies:
  1. multisession:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, persistent = FALSE, workers = availableCores(), gc = FALSE, earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: plan(list(a = strategy1, b = strategy2))
  2. multicore:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, workers = availableCores(constraints = "multicore"), earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: plan(list(a = strategy1, b = strategy2))
  
  plan(): plan_init() of 'multisession', 'cluster', 'multiprocess', 'future', 'function' ...
  multisession:
  - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, persistent = FALSE, workers = availableCores(), gc = FALSE, earlySignal = FALSE, label = NULL, ...)
  - tweaked: FALSE
  - call: plan(list(a = strategy1, b = strategy2))
  [local output] Workers: [n = 2] 'localhost', 'localhost'
  [local output] Base port: 11544
  [local output] Creating node 1 of 2 ...
  [local output] - setting up node
  Testing if worker's PID can be inferred: '/home/hornik/tmp/R.check/r-patched-gcc/Work/build/bin/Rscript -e 'try(cat(Sys.getpid(),file="/tmp/RtmpmhL62P/future.parent=10097.2771267597fb.pid"), silent = TRUE)' -e "file.exists('/tmp/RtmpmhL62P/future.parent=10097.2771267597fb.pid')"'
  - Possible to infer worker's PID: TRUE
  [local output] Starting worker #1 on 'localhost': '/home/hornik/tmp/R.check/r-patched-gcc/Work/build/bin/Rscript' --default-packages=datasets,utils,grDevices,graphics,stats,methods -e '#label=foreach,nested_dopar.R:10097:gimli:hornik' -e 'try(cat(Sys.getpid(),file="/tmp/RtmpmhL62P/future.parent=10097.2771267597fb.pid"), silent = TRUE)' -e 'parallel:::.slaveRSOCK()' MASTER=localhost PORT=11544 OUT=/dev/null TIMEOUT=120 XDR=TRUE
  [local output] - Exit code of system() call: 0
  [local output] Waiting for worker #1 on 'localhost' to connect back
  [local output] Connection with worker #1 on 'localhost' established
  [local output] - collecting session information
  [local output] Creating node 1 of 2 ... done
  [local output] Creating node 2 of 2 ...
  [local output] - setting up node
  Testing if worker's PID can be inferred: '/home/hornik/tmp/R.check/r-patched-gcc/Work/build/bin/Rscript -e 'try(cat(Sys.getpid(),file="/tmp/RtmpmhL62P/future.parent=10097.2771555c3123.pid"), silent = TRUE)' -e "file.exists('/tmp/RtmpmhL62P/future.parent=10097.2771555c3123.pid')"'
  - Possible to infer worker's PID: TRUE
  [local output] Starting worker #2 on 'localhost': '/home/hornik/tmp/R.check/r-patched-gcc/Work/build/bin/Rscript' --default-packages=datasets,utils,grDevices,graphics,stats,methods -e '#label=foreach,nested_dopar.R:10097:gimli:hornik' -e 'try(cat(Sys.getpid(),file="/tmp/RtmpmhL62P/future.parent=10097.2771555c3123.pid"), silent = TRUE)' -e 'parallel:::.slaveRSOCK()' MASTER=localhost PORT=11544 OUT=/dev/null TIMEOUT=120 XDR=TRUE
  [local output] - Exit code of system() call: 0
  [local output] Waiting for worker #2 on 'localhost' to connect back
  [local output] Connection with worker #2 on 'localhost' established
  [local output] - collecting session information
  [local output] Creating node 2 of 2 ... done
  getGlobalsAndPackages() ...
  Not searching for globals
  - globals: [0] <none>
  getGlobalsAndPackages() ... DONE
  Packages needed by future strategies (n = 1): 'future'
  Packages needed by the future expression (n = 0): <none>
  {
      {
          ...future.startTime <- Sys.time()
          ...future.oldOptions <- options(future.startup.loadScript = FALSE, 
              future.globals.onMissing = "ignore", future.globals.maxSize = NULL, 
              future.globals.method = NULL, future.globals.onMissing = "ignore", 
              future.globals.onReference = NULL, future.globals.resolve = NULL, 
              future.resolve.recursive = NULL, width = 80L)
          {
              {
                  {
                    {
                      has_future <- requireNamespace("future", 
                        quietly = TRUE)
                      version <- if (has_future) 
                        packageVersion("future")
                      else NULL
                      if (!has_future || version < "1.8.0") {
                        info <- c(r_version = gsub("R version ", 
                          "", R.version$version.string), platform = sprintf("%s (%s-bit)", 
                          R.version$platform, 8 * .Machine$sizeof.pointer), 
                          os = paste(Sys.info()[c("sysname", "release", 
                            "version")], collapse = " "), hostname = Sys.info()[["nodename"]])
                        info <- sprintf("%s: %s", names(info), 
                          info)
                        info <- paste(info, collapse = "; ")
                        if (!has_future) {
                          msg <- sprintf("Package 'future' is not installed on worker (%s)", 
                            info)
                        }
                        else {
                          msg <- sprintf("Package 'future' on worker (%s) must be of version >= 1.8.0: %s", 
                            info, version)
                        }
                        stop(msg)
                      }
                    }
                    ...future.mc.cores.old <- getOption("mc.cores")
                    options(mc.cores = 1L)
                  }
                  local({
                    for (pkg in "future") {
                      loadNamespace(pkg)
                      library(pkg, character.only = TRUE)
                    }
                  })
              }
              future::plan(list(b = function (expr, envir = parent.frame(), 
                  substitute = TRUE, lazy = FALSE, seed = NULL, 
                  globals = TRUE, workers = availableCores(constraints = "multicore"), 
                  earlySignal = FALSE, label = NULL, ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  if (is.function(workers)) 
                    workers <- workers()
                  workers <- as.integer(workers)
                  stop_if_not(is.finite(workers), workers >= 1L)
                  if (workers == 1L || !supportsMulticore()) {
                    return(sequential(expr, envir = envir, substitute = FALSE, 
                      lazy = lazy, seed = seed, globals = globals, 
                      local = TRUE, label = label, ...))
                  }
                  oopts <- options(mc.cores = workers)
                  on.exit(options(oopts))
                  future <- MulticoreFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, workers = workers, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }), .cleanup = FALSE, .init = FALSE)
          }
      }
      if (is.na(TRUE)) {
      }
      else {
          if (TRUE) {
              ...future.stdout <- rawConnection(raw(0L), open = "w")
          }
          else {
              ...future.stdout <- file(switch(.Platform$OS.type, 
                  windows = "NUL", "/dev/null"), open = "w")
          }
          sink(...future.stdout, type = "output", split = FALSE)
          on.exit(if (!is.null(...future.stdout)) {
              sink(type = "output", split = FALSE)
              close(...future.stdout)
          }, add = TRUE)
      }
      ...future.frame <- sys.nframe()
      ...future.conditions <- list()
      ...future.result <- tryCatch({
          withCallingHandlers({
              ...future.value <- local(NA)
              future::FutureResult(value = ...future.value, started = ...future.startTime, 
                  version = "1.8")
          }, condition = local({
              inherits <- base::inherits
              invokeRestart <- base::invokeRestart
              length <- base::length
              seq.int <- base::seq.int
              sys.calls <- base::sys.calls
              `[[` <- base::`[[`
              `+` <- base::`+`
              `<<-` <- base::`<<-`
              sysCalls <- function(calls = sys.calls(), from = 1L) {
                  calls[seq.int(from = from + 12L, to = length(calls) - 
                    3L)]
              }
              function(cond) {
                  if (inherits(cond, "error")) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond, calls = c(sysCalls(from = ...future.frame), 
                      cond$call), timestamp = base::Sys.time())
                    signalCondition(cond)
                  }
                  else if (inherits(cond, c("message", "warning"
                  ))) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond)
                    if (inherits(cond, "message")) {
                      invokeRestart("muffleMessage")
                    }
                    else if (inherits(cond, "warning")) {
                      invokeRestart("muffleWarning")
                    }
                  }
              }
          }))
      }, error = function(ex) {
          structure(list(value = NULL, conditions = ...future.conditions, 
              condition = ex, calls = sys.calls(), version = "1.8"), 
              class = "FutureResult")
      }, finally = {
          {
              {
                  options(mc.cores = ...future.mc.cores.old)
              }
              future::plan(list(a = function (expr, envir = parent.frame(), 
                  substitute = TRUE, lazy = FALSE, seed = NULL, 
                  globals = TRUE, persistent = FALSE, workers = availableCores(), 
                  gc = FALSE, earlySignal = FALSE, label = NULL, 
                  ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  if (is.function(workers)) 
                    workers <- workers()
                  workers <- as.integer(workers)
                  stop_if_not(length(workers) == 1, is.finite(workers), 
                    workers >= 1)
                  if (workers == 1L) {
                    return(sequential(expr, envir = envir, substitute = FALSE, 
                      lazy = TRUE, seed = seed, globals = globals, 
                      local = TRUE, label = label, ...))
                  }
                  workers <- ClusterRegistry("start", workers = workers)
                  future <- MultisessionFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, persistent = persistent, 
                    workers = workers, gc = gc, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }, b = function (expr, envir = parent.frame(), substitute = TRUE, 
                  lazy = FALSE, seed = NULL, globals = TRUE, workers = availableCores(constraints = "multicore"), 
                  earlySignal = FALSE, label = NULL, ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  if (is.function(workers)) 
                    workers <- workers()
                  workers <- as.integer(workers)
                  stop_if_not(is.finite(workers), workers >= 1L)
                  if (workers == 1L || !supportsMulticore()) {
                    return(sequential(expr, envir = envir, substitute = FALSE, 
                      lazy = lazy, seed = seed, globals = globals, 
                      local = TRUE, label = label, ...))
                  }
                  oopts <- options(mc.cores = workers)
                  on.exit(options(oopts))
                  future <- MulticoreFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, workers = workers, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }), .cleanup = FALSE, .init = FALSE)
          }
          options(...future.oldOptions)
      })
      if (is.na(TRUE)) {
      }
      else {
          sink(type = "output", split = FALSE)
          if (TRUE) {
              ...future.result$stdout <- rawToChar(rawConnectionValue(...future.stdout))
          }
          else {
              ...future.result["stdout"] <- list(NULL)
          }
          close(...future.stdout)
          ...future.stdout <- NULL
      }
      ...future.result$conditions <- ...future.conditions
      ...future.result
  }
  MultisessionFuture started
  result() for ClusterFuture ...
  - Validating connection of MultisessionFuture
  - class(result): FutureResult
  plan(): plan_init() of 'multisession', 'cluster', 'multiprocess', 'future', 'function' ... DONE
  plan(): nbrOfWorkers() = 2
  foreach() - level 1 ...
  [20:53:43.277] doFuture() ...
  [20:53:43.279] - dummy globals (as locals): [1] 'a'
  [20:53:43.280] - R expression:
  [20:53:43.281] {
  [20:53:43.281]     doFuture::registerDoFuture()
  [20:53:43.281]     lapply(seq_along(...future.x_ii), FUN = function(jj) {
  [20:53:43.281]         ...future.x_jj <- ...future.x_ii[[jj]]
  [20:53:43.281]         a <- NULL
  [20:53:43.281]         ...future.env <- environment()
  [20:53:43.281]         local({
  [20:53:43.281]             for (name in names(...future.x_jj)) {
  [20:53:43.281]                 assign(name, ...future.x_jj[[name]], envir = ...future.env, 
  [20:53:43.281]                   inherits = FALSE)
  [20:53:43.281]             }
  [20:53:43.281]         })
  [20:53:43.281]         tryCatch({
  [20:53:43.281]             plan_list <- future::plan()
  [20:53:43.281]             stopifnot(inherits(plan_list, strategy2))
  [20:53:43.281]             plan_a <- future::plan("list")
  [20:53:43.281]             str(plan_a)
  [20:53:43.281]             stopifnot(inherits(plan_a[[1]], strategy2))
  [20:53:43.281]             message("foreach() - level 2 ...")
  [20:53:43.281]             y <- foreach(b = bs, .export = c("a", "plan_a")) %dopar% 
  [20:53:43.281]                 {
  [20:53:43.281]                   plan_list <- future::plan()
  [20:53:43.281]                   message(capture.output(print(plan_list)))
  [20:53:43.281]                   stopifnot(inherits(plan_list, "future"), inherits(plan_list, 
  [20:53:43.281]                     getOption("future.default", "sequential")))
  [20:53:43.281]                   plan_b <- future::plan("list")
  [20:53:43.281]                   str(plan_b)
  [20:53:43.281]                   stopifnot(inherits(plan_b[[1]], "future"), 
  [20:53:43.281]                     inherits(plan_b[[1]], getOption("future.default", 
  [20:53:43.281]                       "sequential")))
  [20:53:43.281]                   list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
  [20:53:43.281]                 }
  [20:53:43.281]             message("foreach() - level 2 ... DONE")
  [20:53:43.281]             y
  [20:53:43.281]         }, error = identity)
  [20:53:43.281]     })
  [20:53:43.281] }
  [20:53:43.282] - identifying globals and packages ...
  getGlobalsAndPackages() ...
  Searching for globals...
  - globals found: [28] '{', '::', 'lapply', 'seq_along', '...future.x_ii', '<-', '[[', 'environment', 'local', 'for', 'names', 'assign', 'tryCatch', 'stopifnot', 'inherits', 'strategy2', 'str', 'message', '%dopar%', 'foreach', 'bs', 'c', 'capture.output', 'print', 'getOption', 'list', 'b', 'identity'
  Searching for globals ... DONE
  Resolving globals: FALSE
  The total size of the 3 globals is 184 bytes (184 bytes)
  - globals: [3] '...future.x_ii', 'strategy2', 'bs'
  - packages: [2] 'utils', 'foreach'
  getGlobalsAndPackages() ... DONE
  [20:53:43.360] List of 3
  [20:53:43.360]  $ ...future.x_ii: NULL
  [20:53:43.360]  $ strategy2     : chr "multicore"
  [20:53:43.360]  $ bs            : int [1:3] 3 2 1
  [20:53:43.360]  - attr(*, "where")=List of 3
  [20:53:43.360]   ..$ ...future.x_ii:<environment: 0x55a47ddd3f40> 
  [20:53:43.360]   ..$ strategy2     :<environment: R_GlobalEnv> 
  [20:53:43.360]   ..$ bs            :<environment: R_GlobalEnv> 
  [20:53:43.360]  - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list"
  [20:53:43.360]  - attr(*, "resolved")= logi FALSE
  [20:53:43.360]  - attr(*, "total_size")= num 184
  [20:53:43.386]   - R expression:
  [20:53:43.387] {
  [20:53:43.387]     doFuture::registerDoFuture()
  [20:53:43.387]     lapply(seq_along(...future.x_ii), FUN = function(jj) {
  [20:53:43.387]         ...future.x_jj <- ...future.x_ii[[jj]]
  [20:53:43.387]         a <- NULL
  [20:53:43.387]         ...future.env <- environment()
  [20:53:43.387]         local({
  [20:53:43.387]             for (name in names(...future.x_jj)) {
  [20:53:43.387]                 assign(name, ...future.x_jj[[name]], envir = ...future.env, 
  [20:53:43.387]                   inherits = FALSE)
  [20:53:43.387]             }
  [20:53:43.387]         })
  [20:53:43.387]         tryCatch({
  [20:53:43.387]             plan_list <- future::plan()
  [20:53:43.387]             stopifnot(inherits(plan_list, strategy2))
  [20:53:43.387]             plan_a <- future::plan("list")
  [20:53:43.387]             str(plan_a)
  [20:53:43.387]             stopifnot(inherits(plan_a[[1]], strategy2))
  [20:53:43.387]             message("foreach() - level 2 ...")
  [20:53:43.387]             y <- foreach(b = bs, .export = c("a", "plan_a")) %dopar% 
  [20:53:43.387]                 {
  [20:53:43.387]                   plan_list <- future::plan()
  [20:53:43.387]                   message(capture.output(print(plan_list)))
  [20:53:43.387]                   stopifnot(inherits(plan_list, "future"), inherits(plan_list, 
  [20:53:43.387]                     getOption("future.default", "sequential")))
  [20:53:43.387]                   plan_b <- future::plan("list")
  [20:53:43.387]                   str(plan_b)
  [20:53:43.387]                   stopifnot(inherits(plan_b[[1]], "future"), 
  [20:53:43.387]                     inherits(plan_b[[1]], getOption("future.default", 
  [20:53:43.387]                       "sequential")))
  [20:53:43.387]                   list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
  [20:53:43.387]                 }
  [20:53:43.387]             message("foreach() - level 2 ... DONE")
  [20:53:43.387]             y
  [20:53:43.387]         }, error = identity)
  [20:53:43.387]     })
  [20:53:43.387] }
  [20:53:43.388]   - globals: [3] '...future.x_ii', 'strategy2', 'bs'
  [20:53:43.388] List of 3
  [20:53:43.388]  $ ...future.x_ii: NULL
  [20:53:43.388]  $ strategy2     : chr "multicore"
  [20:53:43.388]  $ bs            : int [1:3] 3 2 1
  [20:53:43.388]  - attr(*, "where")=List of 3
  [20:53:43.388]   ..$ ...future.x_ii:<environment: 0x55a47ddd3f40> 
  [20:53:43.388]   ..$ strategy2     :<environment: R_GlobalEnv> 
  [20:53:43.388]   ..$ bs            :<environment: R_GlobalEnv> 
  [20:53:43.388]  - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list"
  [20:53:43.388]  - attr(*, "resolved")= logi FALSE
  [20:53:43.388]  - attr(*, "total_size")= num 184
  [20:53:43.398]   - packages: [3] 'doFuture', 'utils', 'foreach'
  [20:53:43.398] - identifying globals and packages ... DONE
  [20:53:43.400] Number of chunks: 2
  [20:53:43.400] Number of futures (= number of chunks): 2
  [20:53:43.400] Launching 2 futures (chunks) ...
  [20:53:43.401] Chunk #1 of 2 ...
  [20:53:43.401]  - Finding globals in 'args_list' chunk #1 ...
  getGlobalsAndPackages() ...
  Searching for globals...
  
  Searching for globals ... DONE
  - globals: [0] <none>
  getGlobalsAndPackages() ... DONE
  [20:53:43.403] 
  [20:53:43.404] 
  [20:53:43.404]  - Finding globals in 'args_list' for chunk #1 ... DONE
  getGlobalsAndPackages() ...
  - globals passed as-is: [3] '...future.x_ii', 'strategy2', 'bs'
  Resolving globals: FALSE
  The total size of the 3 globals is 240 bytes (240 bytes)
  - globals: [3] '...future.x_ii', 'strategy2', 'bs'
  
  getGlobalsAndPackages() ... DONE
  Packages needed by future strategies (n = 1): 'future'
  Packages needed by the future expression (n = 3): 'doFuture', 'utils', 'foreach'
  {
      {
          ...future.startTime <- Sys.time()
          ...future.oldOptions <- options(future.startup.loadScript = FALSE, 
              future.globals.onMissing = "ignore", future.globals.maxSize = NULL, 
              future.globals.method = NULL, future.globals.onMissing = "ignore", 
              future.globals.onReference = NULL, future.globals.resolve = NULL, 
              future.resolve.recursive = NULL, width = 80L)
          {
              {
                  {
                    {
                      has_future <- requireNamespace("future", 
                        quietly = TRUE)
                      version <- if (has_future) 
                        packageVersion("future")
                      else NULL
                      if (!has_future || version < "1.8.0") {
                        info <- c(r_version = gsub("R version ", 
                          "", R.version$version.string), platform = sprintf("%s (%s-bit)", 
                          R.version$platform, 8 * .Machine$sizeof.pointer), 
                          os = paste(Sys.info()[c("sysname", "release", 
                            "version")], collapse = " "), hostname = Sys.info()[["nodename"]])
                        info <- sprintf("%s: %s", names(info), 
                          info)
                        info <- paste(info, collapse = "; ")
                        if (!has_future) {
                          msg <- sprintf("Package 'future' is not installed on worker (%s)", 
                            info)
                        }
                        else {
                          msg <- sprintf("Package 'future' on worker (%s) must be of version >= 1.8.0: %s", 
                            info, version)
                        }
                        stop(msg)
                      }
                    }
                    ...future.mc.cores.old <- getOption("mc.cores")
                    options(mc.cores = 1L)
                  }
                  local({
                    for (pkg in c("future", "doFuture", "utils", 
                    "foreach")) {
                      loadNamespace(pkg)
                      library(pkg, character.only = TRUE)
                    }
                  })
              }
              future::plan(list(b = function (expr, envir = parent.frame(), 
                  substitute = TRUE, lazy = FALSE, seed = NULL, 
                  globals = TRUE, workers = availableCores(constraints = "multicore"), 
                  earlySignal = FALSE, label = NULL, ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  if (is.function(workers)) 
                    workers <- workers()
                  workers <- as.integer(workers)
                  stop_if_not(is.finite(workers), workers >= 1L)
                  if (workers == 1L || !supportsMulticore()) {
                    return(sequential(expr, envir = envir, substitute = FALSE, 
                      lazy = lazy, seed = seed, globals = globals, 
                      local = TRUE, label = label, ...))
                  }
                  oopts <- options(mc.cores = workers)
                  on.exit(options(oopts))
                  future <- MulticoreFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, workers = workers, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }), .cleanup = FALSE, .init = FALSE)
          }
      }
      if (is.na(TRUE)) {
      }
      else {
          if (TRUE) {
              ...future.stdout <- rawConnection(raw(0L), open = "w")
          }
          else {
              ...future.stdout <- file(switch(.Platform$OS.type, 
                  windows = "NUL", "/dev/null"), open = "w")
          }
          sink(...future.stdout, type = "output", split = FALSE)
          on.exit(if (!is.null(...future.stdout)) {
              sink(type = "output", split = FALSE)
              close(...future.stdout)
          }, add = TRUE)
      }
      ...future.frame <- sys.nframe()
      ...future.conditions <- list()
      ...future.result <- tryCatch({
          withCallingHandlers({
              ...future.value <- local({
                  doFuture::registerDoFuture()
                  lapply(seq_along(...future.x_ii), FUN = function(jj) {
                    ...future.x_jj <- ...future.x_ii[[jj]]
                    a <- NULL
                    ...future.env <- environment()
                    local({
                      for (name in names(...future.x_jj)) {
                        assign(name, ...future.x_jj[[name]], envir = ...future.env, 
                          inherits = FALSE)
                      }
                    })
                    tryCatch({
                      plan_list <- future::plan()
                      stopifnot(inherits(plan_list, strategy2))
                      plan_a <- future::plan("list")
                      str(plan_a)
                      stopifnot(inherits(plan_a[[1]], strategy2))
                      message("foreach() - level 2 ...")
                      y <- foreach(b = bs, .export = c("a", "plan_a")) %dopar% 
                        {
                          plan_list <- future::plan()
                          message(capture.output(print(plan_list)))
                          stopifnot(inherits(plan_list, "future"), 
                            inherits(plan_list, getOption("future.default", 
                              "sequential")))
                          plan_b <- future::plan("list")
                          str(plan_b)
                          stopifnot(inherits(plan_b[[1]], "future"), 
                            inherits(plan_b[[1]], getOption("future.default", 
                              "sequential")))
                          list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
                        }
                      message("foreach() - level 2 ... DONE")
                      y
                    }, error = identity)
                  })
              })
              future::FutureResult(value = ...future.value, started = ...future.startTime, 
                  version = "1.8")
          }, condition = local({
              inherits <- base::inherits
              invokeRestart <- base::invokeRestart
              length <- base::length
              seq.int <- base::seq.int
              sys.calls <- base::sys.calls
              `[[` <- base::`[[`
              `+` <- base::`+`
              `<<-` <- base::`<<-`
              sysCalls <- function(calls = sys.calls(), from = 1L) {
                  calls[seq.int(from = from + 12L, to = length(calls) - 
                    3L)]
              }
              function(cond) {
                  if (inherits(cond, "error")) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond, calls = c(sysCalls(from = ...future.frame), 
                      cond$call), timestamp = base::Sys.time())
                    signalCondition(cond)
                  }
                  else if (inherits(cond, c("message", "warning"
                  ))) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond)
                    if (inherits(cond, "message")) {
                      invokeRestart("muffleMessage")
                    }
                    else if (inherits(cond, "warning")) {
                      invokeRestart("muffleWarning")
                    }
                  }
              }
          }))
      }, error = function(ex) {
          structure(list(value = NULL, conditions = ...future.conditions, 
              condition = ex, calls = sys.calls(), version = "1.8"), 
              class = "FutureResult")
      }, finally = {
          {
              {
                  options(mc.cores = ...future.mc.cores.old)
              }
              future::plan(list(a = function (expr, envir = parent.frame(), 
                  substitute = TRUE, lazy = FALSE, seed = NULL, 
                  globals = TRUE, persistent = FALSE, workers = availableCores(), 
                  gc = FALSE, earlySignal = FALSE, label = NULL, 
                  ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  if (is.function(workers)) 
                    workers <- workers()
                  workers <- as.integer(workers)
                  stop_if_not(length(workers) == 1, is.finite(workers), 
                    workers >= 1)
                  if (workers == 1L) {
                    return(sequential(expr, envir = envir, substitute = FALSE, 
                      lazy = TRUE, seed = seed, globals = globals, 
                      local = TRUE, label = label, ...))
                  }
                  workers <- ClusterRegistry("start", workers = workers)
                  future <- MultisessionFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, persistent = persistent, 
                    workers = workers, gc = gc, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }, b = function (expr, envir = parent.frame(), substitute = TRUE, 
                  lazy = FALSE, seed = NULL, globals = TRUE, workers = availableCores(constraints = "multicore"), 
                  earlySignal = FALSE, label = NULL, ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  if (is.function(workers)) 
                    workers <- workers()
                  workers <- as.integer(workers)
                  stop_if_not(is.finite(workers), workers >= 1L)
                  if (workers == 1L || !supportsMulticore()) {
                    return(sequential(expr, envir = envir, substitute = FALSE, 
                      lazy = lazy, seed = seed, globals = globals, 
                      local = TRUE, label = label, ...))
                  }
                  oopts <- options(mc.cores = workers)
                  on.exit(options(oopts))
                  future <- MulticoreFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, workers = workers, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }), .cleanup = FALSE, .init = FALSE)
          }
          options(...future.oldOptions)
      })
      if (is.na(TRUE)) {
      }
      else {
          sink(type = "output", split = FALSE)
          if (TRUE) {
              ...future.result$stdout <- rawToChar(rawConnectionValue(...future.stdout))
          }
          else {
              ...future.result["stdout"] <- list(NULL)
          }
          close(...future.stdout)
          ...future.stdout <- NULL
      }
      ...future.result$conditions <- ...future.conditions
      ...future.result
  }
  Exporting 3 global objects (240 bytes) to cluster node #1 ...
  Exporting '...future.x_ii' (56 bytes) to cluster node #1 ...
  Exporting '...future.x_ii' (56 bytes) to cluster node #1 ... DONE
  Exporting 'strategy2' (120 bytes) to cluster node #1 ...
  Exporting 'strategy2' (120 bytes) to cluster node #1 ... DONE
  Exporting 'bs' (64 bytes) to cluster node #1 ...
  Exporting 'bs' (64 bytes) to cluster node #1 ... DONE
  Exporting 3 global objects (240 bytes) to cluster node #1 ... DONE
  MultisessionFuture started
  [20:53:43.443] Chunk #1 of 2 ... DONE
  [20:53:43.443] Chunk #2 of 2 ...
  [20:53:43.443]  - Finding globals in 'args_list' chunk #2 ...
  getGlobalsAndPackages() ...
  Searching for globals...
  
  Searching for globals ... DONE
  - globals: [0] <none>
  getGlobalsAndPackages() ... DONE
  [20:53:43.445] 
  [20:53:43.446] 
  [20:53:43.446]  - Finding globals in 'args_list' for chunk #2 ... DONE
  getGlobalsAndPackages() ...
  - globals passed as-is: [3] '...future.x_ii', 'strategy2', 'bs'
  Resolving globals: FALSE
  The total size of the 3 globals is 240 bytes (240 bytes)
  - globals: [3] '...future.x_ii', 'strategy2', 'bs'
  
  getGlobalsAndPackages() ... DONE
  Packages needed by future strategies (n = 1): 'future'
  Packages needed by the future expression (n = 3): 'doFuture', 'utils', 'foreach'
  {
      {
          ...future.startTime <- Sys.time()
          ...future.oldOptions <- options(future.startup.loadScript = FALSE, 
              future.globals.onMissing = "ignore", future.globals.maxSize = NULL, 
              future.globals.method = NULL, future.globals.onMissing = "ignore", 
              future.globals.onReference = NULL, future.globals.resolve = NULL, 
              future.resolve.recursive = NULL, width = 80L)
          {
              {
                  {
                    {
                      has_future <- requireNamespace("future", 
                        quietly = TRUE)
                      version <- if (has_future) 
                        packageVersion("future")
                      else NULL
                      if (!has_future || version < "1.8.0") {
                        info <- c(r_version = gsub("R version ", 
                          "", R.version$version.string), platform = sprintf("%s (%s-bit)", 
                          R.version$platform, 8 * .Machine$sizeof.pointer), 
                          os = paste(Sys.info()[c("sysname", "release", 
                            "version")], collapse = " "), hostname = Sys.info()[["nodename"]])
                        info <- sprintf("%s: %s", names(info), 
                          info)
                        info <- paste(info, collapse = "; ")
                        if (!has_future) {
                          msg <- sprintf("Package 'future' is not installed on worker (%s)", 
                            info)
                        }
                        else {
                          msg <- sprintf("Package 'future' on worker (%s) must be of version >= 1.8.0: %s", 
                            info, version)
                        }
                        stop(msg)
                      }
                    }
                    ...future.mc.cores.old <- getOption("mc.cores")
                    options(mc.cores = 1L)
                  }
                  local({
                    for (pkg in c("future", "doFuture", "utils", 
                    "foreach")) {
                      loadNamespace(pkg)
                      library(pkg, character.only = TRUE)
                    }
                  })
              }
              future::plan(list(b = function (expr, envir = parent.frame(), 
                  substitute = TRUE, lazy = FALSE, seed = NULL, 
                  globals = TRUE, workers = availableCores(constraints = "multicore"), 
                  earlySignal = FALSE, label = NULL, ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  if (is.function(workers)) 
                    workers <- workers()
                  workers <- as.integer(workers)
                  stop_if_not(is.finite(workers), workers >= 1L)
                  if (workers == 1L || !supportsMulticore()) {
                    return(sequential(expr, envir = envir, substitute = FALSE, 
                      lazy = lazy, seed = seed, globals = globals, 
                      local = TRUE, label = label, ...))
                  }
                  oopts <- options(mc.cores = workers)
                  on.exit(options(oopts))
                  future <- MulticoreFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, workers = workers, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }), .cleanup = FALSE, .init = FALSE)
          }
      }
      if (is.na(TRUE)) {
      }
      else {
          if (TRUE) {
              ...future.stdout <- rawConnection(raw(0L), open = "w")
          }
          else {
              ...future.stdout <- file(switch(.Platform$OS.type, 
                  windows = "NUL", "/dev/null"), open = "w")
          }
          sink(...future.stdout, type = "output", split = FALSE)
          on.exit(if (!is.null(...future.stdout)) {
              sink(type = "output", split = FALSE)
              close(...future.stdout)
          }, add = TRUE)
      }
      ...future.frame <- sys.nframe()
      ...future.conditions <- list()
      ...future.result <- tryCatch({
          withCallingHandlers({
              ...future.value <- local({
                  doFuture::registerDoFuture()
                  lapply(seq_along(...future.x_ii), FUN = function(jj) {
                    ...future.x_jj <- ...future.x_ii[[jj]]
                    a <- NULL
                    ...future.env <- environment()
                    local({
                      for (name in names(...future.x_jj)) {
                        assign(name, ...future.x_jj[[name]], envir = ...future.env, 
                          inherits = FALSE)
                      }
                    })
                    tryCatch({
                      plan_list <- future::plan()
                      stopifnot(inherits(plan_list, strategy2))
                      plan_a <- future::plan("list")
                      str(plan_a)
                      stopifnot(inherits(plan_a[[1]], strategy2))
                      message("foreach() - level 2 ...")
                      y <- foreach(b = bs, .export = c("a", "plan_a")) %dopar% 
                        {
                          plan_list <- future::plan()
                          message(capture.output(print(plan_list)))
                          stopifnot(inherits(plan_list, "future"), 
                            inherits(plan_list, getOption("future.default", 
                              "sequential")))
                          plan_b <- future::plan("list")
                          str(plan_b)
                          stopifnot(inherits(plan_b[[1]], "future"), 
                            inherits(plan_b[[1]], getOption("future.default", 
                              "sequential")))
                          list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
                        }
                      message("foreach() - level 2 ... DONE")
                      y
                    }, error = identity)
                  })
              })
              future::FutureResult(value = ...future.value, started = ...future.startTime, 
                  version = "1.8")
          }, condition = local({
              inherits <- base::inherits
              invokeRestart <- base::invokeRestart
              length <- base::length
              seq.int <- base::seq.int
              sys.calls <- base::sys.calls
              `[[` <- base::`[[`
              `+` <- base::`+`
              `<<-` <- base::`<<-`
              sysCalls <- function(calls = sys.calls(), from = 1L) {
                  calls[seq.int(from = from + 12L, to = length(calls) - 
                    3L)]
              }
              function(cond) {
                  if (inherits(cond, "error")) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond, calls = c(sysCalls(from = ...future.frame), 
                      cond$call), timestamp = base::Sys.time())
                    signalCondition(cond)
                  }
                  else if (inherits(cond, c("message", "warning"
                  ))) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond)
                    if (inherits(cond, "message")) {
                      invokeRestart("muffleMessage")
                    }
                    else if (inherits(cond, "warning")) {
                      invokeRestart("muffleWarning")
                    }
                  }
              }
          }))
      }, error = function(ex) {
          structure(list(value = NULL, conditions = ...future.conditions, 
              condition = ex, calls = sys.calls(), version = "1.8"), 
              class = "FutureResult")
      }, finally = {
          {
              {
                  options(mc.cores = ...future.mc.cores.old)
              }
              future::plan(list(a = function (expr, envir = parent.frame(), 
                  substitute = TRUE, lazy = FALSE, seed = NULL, 
                  globals = TRUE, persistent = FALSE, workers = availableCores(), 
                  gc = FALSE, earlySignal = FALSE, label = NULL, 
                  ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  if (is.function(workers)) 
                    workers <- workers()
                  workers <- as.integer(workers)
                  stop_if_not(length(workers) == 1, is.finite(workers), 
                    workers >= 1)
                  if (workers == 1L) {
                    return(sequential(expr, envir = envir, substitute = FALSE, 
                      lazy = TRUE, seed = seed, globals = globals, 
                      local = TRUE, label = label, ...))
                  }
                  workers <- ClusterRegistry("start", workers = workers)
                  future <- MultisessionFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, persistent = persistent, 
                    workers = workers, gc = gc, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }, b = function (expr, envir = parent.frame(), substitute = TRUE, 
                  lazy = FALSE, seed = NULL, globals = TRUE, workers = availableCores(constraints = "multicore"), 
                  earlySignal = FALSE, label = NULL, ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  if (is.function(workers)) 
                    workers <- workers()
                  workers <- as.integer(workers)
                  stop_if_not(is.finite(workers), workers >= 1L)
                  if (workers == 1L || !supportsMulticore()) {
                    return(sequential(expr, envir = envir, substitute = FALSE, 
                      lazy = lazy, seed = seed, globals = globals, 
                      local = TRUE, label = label, ...))
                  }
                  oopts <- options(mc.cores = workers)
                  on.exit(options(oopts))
                  future <- MulticoreFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, workers = workers, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }), .cleanup = FALSE, .init = FALSE)
          }
          options(...future.oldOptions)
      })
      if (is.na(TRUE)) {
      }
      else {
          sink(type = "output", split = FALSE)
          if (TRUE) {
              ...future.result$stdout <- rawToChar(rawConnectionValue(...future.stdout))
          }
          else {
              ...future.result["stdout"] <- list(NULL)
          }
          close(...future.stdout)
          ...future.stdout <- NULL
      }
      ...future.result$conditions <- ...future.conditions
      ...future.result
  }
  Exporting 3 global objects (240 bytes) to cluster node #2 ...
  Exporting '...future.x_ii' (56 bytes) to cluster node #2 ...
  Exporting '...future.x_ii' (56 bytes) to cluster node #2 ... DONE
  Exporting 'strategy2' (120 bytes) to cluster node #2 ...
  Exporting 'strategy2' (120 bytes) to cluster node #2 ... DONE
  Exporting 'bs' (64 bytes) to cluster node #2 ...
  Exporting 'bs' (64 bytes) to cluster node #2 ... DONE
  Exporting 3 global objects (240 bytes) to cluster node #2 ... DONE
  MultisessionFuture started
  [20:53:43.474] Chunk #2 of 2 ... DONE
  [20:53:43.475] Launching 2 futures (chunks) ... DONE
  [20:53:43.475] - resolving futures
  resolve() on list ...
   recursive: 0
   length: 2
  
   length: 1 (resolved future 1)
   length: 0 (resolved future 2)
  resolve() on list ... DONE
  [20:53:44.084] - relaying conditions of futures
  result() for ClusterFuture ...
  - Validating connection of MultisessionFuture
  - class(result): FutureResult
  List of 1
   $ b:function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, workers = availableCores(constraints = "multicore"), 
      earlySignal = FALSE, label = NULL, ...)  
    ..- attr(*, "class")= chr [1:4] "multicore" "multiprocess" "future" "function"
    ..- attr(*, "call")= language plan(list(a = strategy1, b = strategy2))
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  List of 1
   $ :function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
      ...)  
    ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  List of 1
   $ :function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
      ...)  
    ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  List of 1
   $ :function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
      ...)  
    ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  Future state: 'finished'
  result() for ClusterFuture ...
  - result already collected: FutureResult
  result() for ClusterFuture ... done
  foreach() - level 2 ...
  sequential:- args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)- tweaked: FALSE- call: NULL
  sequential:- args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)- tweaked: FALSE- call: NULL
  sequential:- args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)- tweaked: FALSE- call: NULL
  foreach() - level 2 ... DONE
  result() for ClusterFuture ...
  - Validating connection of MultisessionFuture
  - class(result): FutureResult
  List of 1
   $ b:function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, workers = availableCores(constraints = "multicore"), 
      earlySignal = FALSE, label = NULL, ...)  
    ..- attr(*, "class")= chr [1:4] "multicore" "multiprocess" "future" "function"
    ..- attr(*, "call")= language plan(list(a = strategy1, b = strategy2))
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  List of 1
   $ :function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
      ...)  
    ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  List of 1
   $ :function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
      ...)  
    ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  List of 1
   $ :function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
      ...)  
    ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  Future state: 'finished'
  result() for ClusterFuture ...
  - result already collected: FutureResult
  result() for ClusterFuture ... done
  foreach() - level 2 ...
  sequential:- args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)- tweaked: FALSE- call: NULL
  sequential:- args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)- tweaked: FALSE- call: NULL
  sequential:- args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)- tweaked: FALSE- call: NULL
  foreach() - level 2 ... DONE
  [20:53:44.130] - collecting values of futures
  result() for ClusterFuture ...
  - result already collected: FutureResult
  result() for ClusterFuture ... done
  result() for ClusterFuture ...
  - result already collected: FutureResult
  result() for ClusterFuture ... done
  [20:53:44.132] - accumulating results
  [20:53:44.133] - processing errors (handler = 'stop')
  [20:53:44.133] - extracting results
  [20:53:44.133] doFuture() ... DONE
  foreach() - level 1 ... DONE
  - plan(list('multisession', 'multicore')) ... DONE
  - plan(list('multisession', 'multisession')) ...
  plan(): Setting new future strategy stack:
  List of future strategies:
  1. multisession:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, persistent = FALSE, workers = availableCores(), gc = FALSE, earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: plan(list(a = strategy1, b = strategy2))
  2. multisession:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, persistent = FALSE, workers = availableCores(), gc = FALSE, earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: plan(list(a = strategy1, b = strategy2))
  
  plan(): plan_init() of 'multisession', 'cluster', 'multiprocess', 'future', 'function' ...
  multisession:
  - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, persistent = FALSE, workers = availableCores(), gc = FALSE, earlySignal = FALSE, label = NULL, ...)
  - tweaked: FALSE
  - call: plan(list(a = strategy1, b = strategy2))
  [local output] Workers: [n = 2] 'localhost', 'localhost'
  [local output] Base port: 11544
  [local output] Creating node 1 of 2 ...
  [local output] - setting up node
  Testing if worker's PID can be inferred: '/home/hornik/tmp/R.check/r-patched-gcc/Work/build/bin/Rscript -e 'try(cat(Sys.getpid(),file="/tmp/RtmpmhL62P/future.parent=10097.2771265b48af.pid"), silent = TRUE)' -e "file.exists('/tmp/RtmpmhL62P/future.parent=10097.2771265b48af.pid')"'
  - Possible to infer worker's PID: TRUE
  [local output] Starting worker #1 on 'localhost': '/home/hornik/tmp/R.check/r-patched-gcc/Work/build/bin/Rscript' --default-packages=datasets,utils,grDevices,graphics,stats,methods -e '#label=foreach,nested_dopar.R:10097:gimli:hornik' -e 'try(cat(Sys.getpid(),file="/tmp/RtmpmhL62P/future.parent=10097.2771265b48af.pid"), silent = TRUE)' -e 'parallel:::.slaveRSOCK()' MASTER=localhost PORT=11544 OUT=/dev/null TIMEOUT=120 XDR=TRUE
  [local output] - Exit code of system() call: 0
  [local output] Waiting for worker #1 on 'localhost' to connect back
  [local output] Connection with worker #1 on 'localhost' established
  [local output] - collecting session information
  [local output] Creating node 1 of 2 ... done
  [local output] Creating node 2 of 2 ...
  [local output] - setting up node
  Testing if worker's PID can be inferred: '/home/hornik/tmp/R.check/r-patched-gcc/Work/build/bin/Rscript -e 'try(cat(Sys.getpid(),file="/tmp/RtmpmhL62P/future.parent=10097.277179309dc7.pid"), silent = TRUE)' -e "file.exists('/tmp/RtmpmhL62P/future.parent=10097.277179309dc7.pid')"'
  - Possible to infer worker's PID: TRUE
  [local output] Starting worker #2 on 'localhost': '/home/hornik/tmp/R.check/r-patched-gcc/Work/build/bin/Rscript' --default-packages=datasets,utils,grDevices,graphics,stats,methods -e '#label=foreach,nested_dopar.R:10097:gimli:hornik' -e 'try(cat(Sys.getpid(),file="/tmp/RtmpmhL62P/future.parent=10097.277179309dc7.pid"), silent = TRUE)' -e 'parallel:::.slaveRSOCK()' MASTER=localhost PORT=11544 OUT=/dev/null TIMEOUT=120 XDR=TRUE
  [local output] - Exit code of system() call: 0
  [local output] Waiting for worker #2 on 'localhost' to connect back
  [local output] Connection with worker #2 on 'localhost' established
  [local output] - collecting session information
  [local output] Creating node 2 of 2 ... done
  getGlobalsAndPackages() ...
  Not searching for globals
  - globals: [0] <none>
  getGlobalsAndPackages() ... DONE
  Packages needed by future strategies (n = 1): 'future'
  Packages needed by the future expression (n = 0): <none>
  {
      {
          ...future.startTime <- Sys.time()
          ...future.oldOptions <- options(future.startup.loadScript = FALSE, 
              future.globals.onMissing = "ignore", future.globals.maxSize = NULL, 
              future.globals.method = NULL, future.globals.onMissing = "ignore", 
              future.globals.onReference = NULL, future.globals.resolve = NULL, 
              future.resolve.recursive = NULL, width = 80L)
          {
              {
                  {
                    {
                      has_future <- requireNamespace("future", 
                        quietly = TRUE)
                      version <- if (has_future) 
                        packageVersion("future")
                      else NULL
                      if (!has_future || version < "1.8.0") {
                        info <- c(r_version = gsub("R version ", 
                          "", R.version$version.string), platform = sprintf("%s (%s-bit)", 
                          R.version$platform, 8 * .Machine$sizeof.pointer), 
                          os = paste(Sys.info()[c("sysname", "release", 
                            "version")], collapse = " "), hostname = Sys.info()[["nodename"]])
                        info <- sprintf("%s: %s", names(info), 
                          info)
                        info <- paste(info, collapse = "; ")
                        if (!has_future) {
                          msg <- sprintf("Package 'future' is not installed on worker (%s)", 
                            info)
                        }
                        else {
                          msg <- sprintf("Package 'future' on worker (%s) must be of version >= 1.8.0: %s", 
                            info, version)
                        }
                        stop(msg)
                      }
                    }
                    ...future.mc.cores.old <- getOption("mc.cores")
                    options(mc.cores = 1L)
                  }
                  local({
                    for (pkg in "future") {
                      loadNamespace(pkg)
                      library(pkg, character.only = TRUE)
                    }
                  })
              }
              future::plan(list(b = function (expr, envir = parent.frame(), 
                  substitute = TRUE, lazy = FALSE, seed = NULL, 
                  globals = TRUE, persistent = FALSE, workers = availableCores(), 
                  gc = FALSE, earlySignal = FALSE, label = NULL, 
                  ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  if (is.function(workers)) 
                    workers <- workers()
                  workers <- as.integer(workers)
                  stop_if_not(length(workers) == 1, is.finite(workers), 
                    workers >= 1)
                  if (workers == 1L) {
                    return(sequential(expr, envir = envir, substitute = FALSE, 
                      lazy = TRUE, seed = seed, globals = globals, 
                      local = TRUE, label = label, ...))
                  }
                  workers <- ClusterRegistry("start", workers = workers)
                  future <- MultisessionFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, persistent = persistent, 
                    workers = workers, gc = gc, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }), .cleanup = FALSE, .init = FALSE)
          }
      }
      if (is.na(TRUE)) {
      }
      else {
          if (TRUE) {
              ...future.stdout <- rawConnection(raw(0L), open = "w")
          }
          else {
              ...future.stdout <- file(switch(.Platform$OS.type, 
                  windows = "NUL", "/dev/null"), open = "w")
          }
          sink(...future.stdout, type = "output", split = FALSE)
          on.exit(if (!is.null(...future.stdout)) {
              sink(type = "output", split = FALSE)
              close(...future.stdout)
          }, add = TRUE)
      }
      ...future.frame <- sys.nframe()
      ...future.conditions <- list()
      ...future.result <- tryCatch({
          withCallingHandlers({
              ...future.value <- local(NA)
              future::FutureResult(value = ...future.value, started = ...future.startTime, 
                  version = "1.8")
          }, condition = local({
              inherits <- base::inherits
              invokeRestart <- base::invokeRestart
              length <- base::length
              seq.int <- base::seq.int
              sys.calls <- base::sys.calls
              `[[` <- base::`[[`
              `+` <- base::`+`
              `<<-` <- base::`<<-`
              sysCalls <- function(calls = sys.calls(), from = 1L) {
                  calls[seq.int(from = from + 12L, to = length(calls) - 
                    3L)]
              }
              function(cond) {
                  if (inherits(cond, "error")) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond, calls = c(sysCalls(from = ...future.frame), 
                      cond$call), timestamp = base::Sys.time())
                    signalCondition(cond)
                  }
                  else if (inherits(cond, c("message", "warning"
                  ))) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond)
                    if (inherits(cond, "message")) {
                      invokeRestart("muffleMessage")
                    }
                    else if (inherits(cond, "warning")) {
                      invokeRestart("muffleWarning")
                    }
                  }
              }
          }))
      }, error = function(ex) {
          structure(list(value = NULL, conditions = ...future.conditions, 
              condition = ex, calls = sys.calls(), version = "1.8"), 
              class = "FutureResult")
      }, finally = {
          {
              {
                  options(mc.cores = ...future.mc.cores.old)
              }
              future::plan(list(a = function (expr, envir = parent.frame(), 
                  substitute = TRUE, lazy = FALSE, seed = NULL, 
                  globals = TRUE, persistent = FALSE, workers = availableCores(), 
                  gc = FALSE, earlySignal = FALSE, label = NULL, 
                  ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  if (is.function(workers)) 
                    workers <- workers()
                  workers <- as.integer(workers)
                  stop_if_not(length(workers) == 1, is.finite(workers), 
                    workers >= 1)
                  if (workers == 1L) {
                    return(sequential(expr, envir = envir, substitute = FALSE, 
                      lazy = TRUE, seed = seed, globals = globals, 
                      local = TRUE, label = label, ...))
                  }
                  workers <- ClusterRegistry("start", workers = workers)
                  future <- MultisessionFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, persistent = persistent, 
                    workers = workers, gc = gc, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }, b = function (expr, envir = parent.frame(), substitute = TRUE, 
                  lazy = FALSE, seed = NULL, globals = TRUE, persistent = FALSE, 
                  workers = availableCores(), gc = FALSE, earlySignal = FALSE, 
                  label = NULL, ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  if (is.function(workers)) 
                    workers <- workers()
                  workers <- as.integer(workers)
                  stop_if_not(length(workers) == 1, is.finite(workers), 
                    workers >= 1)
                  if (workers == 1L) {
                    return(sequential(expr, envir = envir, substitute = FALSE, 
                      lazy = TRUE, seed = seed, globals = globals, 
                      local = TRUE, label = label, ...))
                  }
                  workers <- ClusterRegistry("start", workers = workers)
                  future <- MultisessionFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, persistent = persistent, 
                    workers = workers, gc = gc, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }), .cleanup = FALSE, .init = FALSE)
          }
          options(...future.oldOptions)
      })
      if (is.na(TRUE)) {
      }
      else {
          sink(type = "output", split = FALSE)
          if (TRUE) {
              ...future.result$stdout <- rawToChar(rawConnectionValue(...future.stdout))
          }
          else {
              ...future.result["stdout"] <- list(NULL)
          }
          close(...future.stdout)
          ...future.stdout <- NULL
      }
      ...future.result$conditions <- ...future.conditions
      ...future.result
  }
  MultisessionFuture started
  result() for ClusterFuture ...
  - Validating connection of MultisessionFuture
  - class(result): FutureResult
  plan(): plan_init() of 'multisession', 'cluster', 'multiprocess', 'future', 'function' ... DONE
  plan(): nbrOfWorkers() = 2
  foreach() - level 1 ...
  [20:53:59.252] doFuture() ...
  [20:53:59.254] - dummy globals (as locals): [1] 'a'
  [20:53:59.255] - R expression:
  [20:53:59.256] {
  [20:53:59.256]     doFuture::registerDoFuture()
  [20:53:59.256]     lapply(seq_along(...future.x_ii), FUN = function(jj) {
  [20:53:59.256]         ...future.x_jj <- ...future.x_ii[[jj]]
  [20:53:59.256]         a <- NULL
  [20:53:59.256]         ...future.env <- environment()
  [20:53:59.256]         local({
  [20:53:59.256]             for (name in names(...future.x_jj)) {
  [20:53:59.256]                 assign(name, ...future.x_jj[[name]], envir = ...future.env, 
  [20:53:59.256]                   inherits = FALSE)
  [20:53:59.256]             }
  [20:53:59.256]         })
  [20:53:59.256]         tryCatch({
  [20:53:59.256]             plan_list <- future::plan()
  [20:53:59.256]             stopifnot(inherits(plan_list, strategy2))
  [20:53:59.256]             plan_a <- future::plan("list")
  [20:53:59.256]             str(plan_a)
  [20:53:59.256]             stopifnot(inherits(plan_a[[1]], strategy2))
  [20:53:59.256]             message("foreach() - level 2 ...")
  [20:53:59.256]             y <- foreach(b = bs, .export = c("a", "plan_a")) %dopar% 
  [20:53:59.256]                 {
  [20:53:59.256]                   plan_list <- future::plan()
  [20:53:59.256]                   message(capture.output(print(plan_list)))
  [20:53:59.256]                   stopifnot(inherits(plan_list, "future"), inherits(plan_list, 
  [20:53:59.256]                     getOption("future.default", "sequential")))
  [20:53:59.256]                   plan_b <- future::plan("list")
  [20:53:59.256]                   str(plan_b)
  [20:53:59.256]                   stopifnot(inherits(plan_b[[1]], "future"), 
  [20:53:59.256]                     inherits(plan_b[[1]], getOption("future.default", 
  [20:53:59.256]                       "sequential")))
  [20:53:59.256]                   list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
  [20:53:59.256]                 }
  [20:53:59.256]             message("foreach() - level 2 ... DONE")
  [20:53:59.256]             y
  [20:53:59.256]         }, error = identity)
  [20:53:59.256]     })
  [20:53:59.256] }
  [20:53:59.257] - identifying globals and packages ...
  getGlobalsAndPackages() ...
  Searching for globals...
  - globals found: [28] '{', '::', 'lapply', 'seq_along', '...future.x_ii', '<-', '[[', 'environment', 'local', 'for', 'names', 'assign', 'tryCatch', 'stopifnot', 'inherits', 'strategy2', 'str', 'message', '%dopar%', 'foreach', 'bs', 'c', 'capture.output', 'print', 'getOption', 'list', 'b', 'identity'
  Searching for globals ... DONE
  Resolving globals: FALSE
  The total size of the 3 globals is 184 bytes (184 bytes)
  - globals: [3] '...future.x_ii', 'strategy2', 'bs'
  - packages: [2] 'utils', 'foreach'
  getGlobalsAndPackages() ... DONE
  [20:53:59.339] List of 3
  [20:53:59.339]  $ ...future.x_ii: NULL
  [20:53:59.339]  $ strategy2     : chr "multisession"
  [20:53:59.339]  $ bs            : int [1:3] 3 2 1
  [20:53:59.339]  - attr(*, "where")=List of 3
  [20:53:59.339]   ..$ ...future.x_ii:<environment: 0x55a47e30dfb8> 
  [20:53:59.339]   ..$ strategy2     :<environment: R_GlobalEnv> 
  [20:53:59.339]   ..$ bs            :<environment: R_GlobalEnv> 
  [20:53:59.339]  - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list"
  [20:53:59.339]  - attr(*, "resolved")= logi FALSE
  [20:53:59.339]  - attr(*, "total_size")= num 184
  [20:53:59.365]   - R expression:
  [20:53:59.366] {
  [20:53:59.366]     doFuture::registerDoFuture()
  [20:53:59.366]     lapply(seq_along(...future.x_ii), FUN = function(jj) {
  [20:53:59.366]         ...future.x_jj <- ...future.x_ii[[jj]]
  [20:53:59.366]         a <- NULL
  [20:53:59.366]         ...future.env <- environment()
  [20:53:59.366]         local({
  [20:53:59.366]             for (name in names(...future.x_jj)) {
  [20:53:59.366]                 assign(name, ...future.x_jj[[name]], envir = ...future.env, 
  [20:53:59.366]                   inherits = FALSE)
  [20:53:59.366]             }
  [20:53:59.366]         })
  [20:53:59.366]         tryCatch({
  [20:53:59.366]             plan_list <- future::plan()
  [20:53:59.366]             stopifnot(inherits(plan_list, strategy2))
  [20:53:59.366]             plan_a <- future::plan("list")
  [20:53:59.366]             str(plan_a)
  [20:53:59.366]             stopifnot(inherits(plan_a[[1]], strategy2))
  [20:53:59.366]             message("foreach() - level 2 ...")
  [20:53:59.366]             y <- foreach(b = bs, .export = c("a", "plan_a")) %dopar% 
  [20:53:59.366]                 {
  [20:53:59.366]                   plan_list <- future::plan()
  [20:53:59.366]                   message(capture.output(print(plan_list)))
  [20:53:59.366]                   stopifnot(inherits(plan_list, "future"), inherits(plan_list, 
  [20:53:59.366]                     getOption("future.default", "sequential")))
  [20:53:59.366]                   plan_b <- future::plan("list")
  [20:53:59.366]                   str(plan_b)
  [20:53:59.366]                   stopifnot(inherits(plan_b[[1]], "future"), 
  [20:53:59.366]                     inherits(plan_b[[1]], getOption("future.default", 
  [20:53:59.366]                       "sequential")))
  [20:53:59.366]                   list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
  [20:53:59.366]                 }
  [20:53:59.366]             message("foreach() - level 2 ... DONE")
  [20:53:59.366]             y
  [20:53:59.366]         }, error = identity)
  [20:53:59.366]     })
  [20:53:59.366] }
  [20:53:59.367]   - globals: [3] '...future.x_ii', 'strategy2', 'bs'
  [20:53:59.367] List of 3
  [20:53:59.367]  $ ...future.x_ii: NULL
  [20:53:59.367]  $ strategy2     : chr "multisession"
  [20:53:59.367]  $ bs            : int [1:3] 3 2 1
  [20:53:59.367]  - attr(*, "where")=List of 3
  [20:53:59.367]   ..$ ...future.x_ii:<environment: 0x55a47e30dfb8> 
  [20:53:59.367]   ..$ strategy2     :<environment: R_GlobalEnv> 
  [20:53:59.367]   ..$ bs            :<environment: R_GlobalEnv> 
  [20:53:59.367]  - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list"
  [20:53:59.367]  - attr(*, "resolved")= logi FALSE
  [20:53:59.367]  - attr(*, "total_size")= num 184
  [20:53:59.380]   - packages: [3] 'doFuture', 'utils', 'foreach'
  [20:53:59.380] - identifying globals and packages ... DONE
  [20:53:59.382] Number of chunks: 2
  [20:53:59.382] Number of futures (= number of chunks): 2
  [20:53:59.382] Launching 2 futures (chunks) ...
  [20:53:59.383] Chunk #1 of 2 ...
  [20:53:59.383]  - Finding globals in 'args_list' chunk #1 ...
  getGlobalsAndPackages() ...
  Searching for globals...
  
  Searching for globals ... DONE
  - globals: [0] <none>
  getGlobalsAndPackages() ... DONE
  [20:53:59.386] 
  [20:53:59.387] 
  [20:53:59.393]  - Finding globals in 'args_list' for chunk #1 ... DONE
  getGlobalsAndPackages() ...
  - globals passed as-is: [3] '...future.x_ii', 'strategy2', 'bs'
  Resolving globals: FALSE
  The total size of the 3 globals is 240 bytes (240 bytes)
  - globals: [3] '...future.x_ii', 'strategy2', 'bs'
  
  getGlobalsAndPackages() ... DONE
  Packages needed by future strategies (n = 1): 'future'
  Packages needed by the future expression (n = 3): 'doFuture', 'utils', 'foreach'
  {
      {
          ...future.startTime <- Sys.time()
          ...future.oldOptions <- options(future.startup.loadScript = FALSE, 
              future.globals.onMissing = "ignore", future.globals.maxSize = NULL, 
              future.globals.method = NULL, future.globals.onMissing = "ignore", 
              future.globals.onReference = NULL, future.globals.resolve = NULL, 
              future.resolve.recursive = NULL, width = 80L)
          {
              {
                  {
                    {
                      has_future <- requireNamespace("future", 
                        quietly = TRUE)
                      version <- if (has_future) 
                        packageVersion("future")
                      else NULL
                      if (!has_future || version < "1.8.0") {
                        info <- c(r_version = gsub("R version ", 
                          "", R.version$version.string), platform = sprintf("%s (%s-bit)", 
                          R.version$platform, 8 * .Machine$sizeof.pointer), 
                          os = paste(Sys.info()[c("sysname", "release", 
                            "version")], collapse = " "), hostname = Sys.info()[["nodename"]])
                        info <- sprintf("%s: %s", names(info), 
                          info)
                        info <- paste(info, collapse = "; ")
                        if (!has_future) {
                          msg <- sprintf("Package 'future' is not installed on worker (%s)", 
                            info)
                        }
                        else {
                          msg <- sprintf("Package 'future' on worker (%s) must be of version >= 1.8.0: %s", 
                            info, version)
                        }
                        stop(msg)
                      }
                    }
                    ...future.mc.cores.old <- getOption("mc.cores")
                    options(mc.cores = 1L)
                  }
                  local({
                    for (pkg in c("future", "doFuture", "utils", 
                    "foreach")) {
                      loadNamespace(pkg)
                      library(pkg, character.only = TRUE)
                    }
                  })
              }
              future::plan(list(b = function (expr, envir = parent.frame(), 
                  substitute = TRUE, lazy = FALSE, seed = NULL, 
                  globals = TRUE, persistent = FALSE, workers = availableCores(), 
                  gc = FALSE, earlySignal = FALSE, label = NULL, 
                  ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  if (is.function(workers)) 
                    workers <- workers()
                  workers <- as.integer(workers)
                  stop_if_not(length(workers) == 1, is.finite(workers), 
                    workers >= 1)
                  if (workers == 1L) {
                    return(sequential(expr, envir = envir, substitute = FALSE, 
                      lazy = TRUE, seed = seed, globals = globals, 
                      local = TRUE, label = label, ...))
                  }
                  workers <- ClusterRegistry("start", workers = workers)
                  future <- MultisessionFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, persistent = persistent, 
                    workers = workers, gc = gc, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }), .cleanup = FALSE, .init = FALSE)
          }
      }
      if (is.na(TRUE)) {
      }
      else {
          if (TRUE) {
              ...future.stdout <- rawConnection(raw(0L), open = "w")
          }
          else {
              ...future.stdout <- file(switch(.Platform$OS.type, 
                  windows = "NUL", "/dev/null"), open = "w")
          }
          sink(...future.stdout, type = "output", split = FALSE)
          on.exit(if (!is.null(...future.stdout)) {
              sink(type = "output", split = FALSE)
              close(...future.stdout)
          }, add = TRUE)
      }
      ...future.frame <- sys.nframe()
      ...future.conditions <- list()
      ...future.result <- tryCatch({
          withCallingHandlers({
              ...future.value <- local({
                  doFuture::registerDoFuture()
                  lapply(seq_along(...future.x_ii), FUN = function(jj) {
                    ...future.x_jj <- ...future.x_ii[[jj]]
                    a <- NULL
                    ...future.env <- environment()
                    local({
                      for (name in names(...future.x_jj)) {
                        assign(name, ...future.x_jj[[name]], envir = ...future.env, 
                          inherits = FALSE)
                      }
                    })
                    tryCatch({
                      plan_list <- future::plan()
                      stopifnot(inherits(plan_list, strategy2))
                      plan_a <- future::plan("list")
                      str(plan_a)
                      stopifnot(inherits(plan_a[[1]], strategy2))
                      message("foreach() - level 2 ...")
                      y <- foreach(b = bs, .export = c("a", "plan_a")) %dopar% 
                        {
                          plan_list <- future::plan()
                          message(capture.output(print(plan_list)))
                          stopifnot(inherits(plan_list, "future"), 
                            inherits(plan_list, getOption("future.default", 
                              "sequential")))
                          plan_b <- future::plan("list")
                          str(plan_b)
                          stopifnot(inherits(plan_b[[1]], "future"), 
                            inherits(plan_b[[1]], getOption("future.default", 
                              "sequential")))
                          list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
                        }
                      message("foreach() - level 2 ... DONE")
                      y
                    }, error = identity)
                  })
              })
              future::FutureResult(value = ...future.value, started = ...future.startTime, 
                  version = "1.8")
          }, condition = local({
              inherits <- base::inherits
              invokeRestart <- base::invokeRestart
              length <- base::length
              seq.int <- base::seq.int
              sys.calls <- base::sys.calls
              `[[` <- base::`[[`
              `+` <- base::`+`
              `<<-` <- base::`<<-`
              sysCalls <- function(calls = sys.calls(), from = 1L) {
                  calls[seq.int(from = from + 12L, to = length(calls) - 
                    3L)]
              }
              function(cond) {
                  if (inherits(cond, "error")) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond, calls = c(sysCalls(from = ...future.frame), 
                      cond$call), timestamp = base::Sys.time())
                    signalCondition(cond)
                  }
                  else if (inherits(cond, c("message", "warning"
                  ))) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond)
                    if (inherits(cond, "message")) {
                      invokeRestart("muffleMessage")
                    }
                    else if (inherits(cond, "warning")) {
                      invokeRestart("muffleWarning")
                    }
                  }
              }
          }))
      }, error = function(ex) {
          structure(list(value = NULL, conditions = ...future.conditions, 
              condition = ex, calls = sys.calls(), version = "1.8"), 
              class = "FutureResult")
      }, finally = {
          {
              {
                  options(mc.cores = ...future.mc.cores.old)
              }
              future::plan(list(a = function (expr, envir = parent.frame(), 
                  substitute = TRUE, lazy = FALSE, seed = NULL, 
                  globals = TRUE, persistent = FALSE, workers = availableCores(), 
                  gc = FALSE, earlySignal = FALSE, label = NULL, 
                  ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  if (is.function(workers)) 
                    workers <- workers()
                  workers <- as.integer(workers)
                  stop_if_not(length(workers) == 1, is.finite(workers), 
                    workers >= 1)
                  if (workers == 1L) {
                    return(sequential(expr, envir = envir, substitute = FALSE, 
                      lazy = TRUE, seed = seed, globals = globals, 
                      local = TRUE, label = label, ...))
                  }
                  workers <- ClusterRegistry("start", workers = workers)
                  future <- MultisessionFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, persistent = persistent, 
                    workers = workers, gc = gc, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }, b = function (expr, envir = parent.frame(), substitute = TRUE, 
                  lazy = FALSE, seed = NULL, globals = TRUE, persistent = FALSE, 
                  workers = availableCores(), gc = FALSE, earlySignal = FALSE, 
                  label = NULL, ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  if (is.function(workers)) 
                    workers <- workers()
                  workers <- as.integer(workers)
                  stop_if_not(length(workers) == 1, is.finite(workers), 
                    workers >= 1)
                  if (workers == 1L) {
                    return(sequential(expr, envir = envir, substitute = FALSE, 
                      lazy = TRUE, seed = seed, globals = globals, 
                      local = TRUE, label = label, ...))
                  }
                  workers <- ClusterRegistry("start", workers = workers)
                  future <- MultisessionFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, persistent = persistent, 
                    workers = workers, gc = gc, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }), .cleanup = FALSE, .init = FALSE)
          }
          options(...future.oldOptions)
      })
      if (is.na(TRUE)) {
      }
      else {
          sink(type = "output", split = FALSE)
          if (TRUE) {
              ...future.result$stdout <- rawToChar(rawConnectionValue(...future.stdout))
          }
          else {
              ...future.result["stdout"] <- list(NULL)
          }
          close(...future.stdout)
          ...future.stdout <- NULL
      }
      ...future.result$conditions <- ...future.conditions
      ...future.result
  }
  Exporting 3 global objects (240 bytes) to cluster node #1 ...
  Exporting '...future.x_ii' (56 bytes) to cluster node #1 ...
  Exporting '...future.x_ii' (56 bytes) to cluster node #1 ... DONE
  Exporting 'strategy2' (120 bytes) to cluster node #1 ...
  Exporting 'strategy2' (120 bytes) to cluster node #1 ... DONE
  Exporting 'bs' (64 bytes) to cluster node #1 ...
  Exporting 'bs' (64 bytes) to cluster node #1 ... DONE
  Exporting 3 global objects (240 bytes) to cluster node #1 ... DONE
  MultisessionFuture started
  [20:53:59.434] Chunk #1 of 2 ... DONE
  [20:53:59.435] Chunk #2 of 2 ...
  [20:53:59.435]  - Finding globals in 'args_list' chunk #2 ...
  getGlobalsAndPackages() ...
  Searching for globals...
  
  Searching for globals ... DONE
  - globals: [0] <none>
  getGlobalsAndPackages() ... DONE
  [20:53:59.437] 
  [20:53:59.437] 
  [20:53:59.438]  - Finding globals in 'args_list' for chunk #2 ... DONE
  getGlobalsAndPackages() ...
  - globals passed as-is: [3] '...future.x_ii', 'strategy2', 'bs'
  Resolving globals: FALSE
  The total size of the 3 globals is 240 bytes (240 bytes)
  - globals: [3] '...future.x_ii', 'strategy2', 'bs'
  
  getGlobalsAndPackages() ... DONE
  Packages needed by future strategies (n = 1): 'future'
  Packages needed by the future expression (n = 3): 'doFuture', 'utils', 'foreach'
  {
      {
          ...future.startTime <- Sys.time()
          ...future.oldOptions <- options(future.startup.loadScript = FALSE, 
              future.globals.onMissing = "ignore", future.globals.maxSize = NULL, 
              future.globals.method = NULL, future.globals.onMissing = "ignore", 
              future.globals.onReference = NULL, future.globals.resolve = NULL, 
              future.resolve.recursive = NULL, width = 80L)
          {
              {
                  {
                    {
                      has_future <- requireNamespace("future", 
                        quietly = TRUE)
                      version <- if (has_future) 
                        packageVersion("future")
                      else NULL
                      if (!has_future || version < "1.8.0") {
                        info <- c(r_version = gsub("R version ", 
                          "", R.version$version.string), platform = sprintf("%s (%s-bit)", 
                          R.version$platform, 8 * .Machine$sizeof.pointer), 
                          os = paste(Sys.info()[c("sysname", "release", 
                            "version")], collapse = " "), hostname = Sys.info()[["nodename"]])
                        info <- sprintf("%s: %s", names(info), 
                          info)
                        info <- paste(info, collapse = "; ")
                        if (!has_future) {
                          msg <- sprintf("Package 'future' is not installed on worker (%s)", 
                            info)
                        }
                        else {
                          msg <- sprintf("Package 'future' on worker (%s) must be of version >= 1.8.0: %s", 
                            info, version)
                        }
                        stop(msg)
                      }
                    }
                    ...future.mc.cores.old <- getOption("mc.cores")
                    options(mc.cores = 1L)
                  }
                  local({
                    for (pkg in c("future", "doFuture", "utils", 
                    "foreach")) {
                      loadNamespace(pkg)
                      library(pkg, character.only = TRUE)
                    }
                  })
              }
              future::plan(list(b = function (expr, envir = parent.frame(), 
                  substitute = TRUE, lazy = FALSE, seed = NULL, 
                  globals = TRUE, persistent = FALSE, workers = availableCores(), 
                  gc = FALSE, earlySignal = FALSE, label = NULL, 
                  ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  if (is.function(workers)) 
                    workers <- workers()
                  workers <- as.integer(workers)
                  stop_if_not(length(workers) == 1, is.finite(workers), 
                    workers >= 1)
                  if (workers == 1L) {
                    return(sequential(expr, envir = envir, substitute = FALSE, 
                      lazy = TRUE, seed = seed, globals = globals, 
                      local = TRUE, label = label, ...))
                  }
                  workers <- ClusterRegistry("start", workers = workers)
                  future <- MultisessionFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, persistent = persistent, 
                    workers = workers, gc = gc, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }), .cleanup = FALSE, .init = FALSE)
          }
      }
      if (is.na(TRUE)) {
      }
      else {
          if (TRUE) {
              ...future.stdout <- rawConnection(raw(0L), open = "w")
          }
          else {
              ...future.stdout <- file(switch(.Platform$OS.type, 
                  windows = "NUL", "/dev/null"), open = "w")
          }
          sink(...future.stdout, type = "output", split = FALSE)
          on.exit(if (!is.null(...future.stdout)) {
              sink(type = "output", split = FALSE)
              close(...future.stdout)
          }, add = TRUE)
      }
      ...future.frame <- sys.nframe()
      ...future.conditions <- list()
      ...future.result <- tryCatch({
          withCallingHandlers({
              ...future.value <- local({
                  doFuture::registerDoFuture()
                  lapply(seq_along(...future.x_ii), FUN = function(jj) {
                    ...future.x_jj <- ...future.x_ii[[jj]]
                    a <- NULL
                    ...future.env <- environment()
                    local({
                      for (name in names(...future.x_jj)) {
                        assign(name, ...future.x_jj[[name]], envir = ...future.env, 
                          inherits = FALSE)
                      }
                    })
                    tryCatch({
                      plan_list <- future::plan()
                      stopifnot(inherits(plan_list, strategy2))
                      plan_a <- future::plan("list")
                      str(plan_a)
                      stopifnot(inherits(plan_a[[1]], strategy2))
                      message("foreach() - level 2 ...")
                      y <- foreach(b = bs, .export = c("a", "plan_a")) %dopar% 
                        {
                          plan_list <- future::plan()
                          message(capture.output(print(plan_list)))
                          stopifnot(inherits(plan_list, "future"), 
                            inherits(plan_list, getOption("future.default", 
                              "sequential")))
                          plan_b <- future::plan("list")
                          str(plan_b)
                          stopifnot(inherits(plan_b[[1]], "future"), 
                            inherits(plan_b[[1]], getOption("future.default", 
                              "sequential")))
                          list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
                        }
                      message("foreach() - level 2 ... DONE")
                      y
                    }, error = identity)
                  })
              })
              future::FutureResult(value = ...future.value, started = ...future.startTime, 
                  version = "1.8")
          }, condition = local({
              inherits <- base::inherits
              invokeRestart <- base::invokeRestart
              length <- base::length
              seq.int <- base::seq.int
              sys.calls <- base::sys.calls
              `[[` <- base::`[[`
              `+` <- base::`+`
              `<<-` <- base::`<<-`
              sysCalls <- function(calls = sys.calls(), from = 1L) {
                  calls[seq.int(from = from + 12L, to = length(calls) - 
                    3L)]
              }
              function(cond) {
                  if (inherits(cond, "error")) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond, calls = c(sysCalls(from = ...future.frame), 
                      cond$call), timestamp = base::Sys.time())
                    signalCondition(cond)
                  }
                  else if (inherits(cond, c("message", "warning"
                  ))) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond)
                    if (inherits(cond, "message")) {
                      invokeRestart("muffleMessage")
                    }
                    else if (inherits(cond, "warning")) {
                      invokeRestart("muffleWarning")
                    }
                  }
              }
          }))
      }, error = function(ex) {
          structure(list(value = NULL, conditions = ...future.conditions, 
              condition = ex, calls = sys.calls(), version = "1.8"), 
              class = "FutureResult")
      }, finally = {
          {
              {
                  options(mc.cores = ...future.mc.cores.old)
              }
              future::plan(list(a = function (expr, envir = parent.frame(), 
                  substitute = TRUE, lazy = FALSE, seed = NULL, 
                  globals = TRUE, persistent = FALSE, workers = availableCores(), 
                  gc = FALSE, earlySignal = FALSE, label = NULL, 
                  ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  if (is.function(workers)) 
                    workers <- workers()
                  workers <- as.integer(workers)
                  stop_if_not(length(workers) == 1, is.finite(workers), 
                    workers >= 1)
                  if (workers == 1L) {
                    return(sequential(expr, envir = envir, substitute = FALSE, 
                      lazy = TRUE, seed = seed, globals = globals, 
                      local = TRUE, label = label, ...))
                  }
                  workers <- ClusterRegistry("start", workers = workers)
                  future <- MultisessionFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, persistent = persistent, 
                    workers = workers, gc = gc, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }, b = function (expr, envir = parent.frame(), substitute = TRUE, 
                  lazy = FALSE, seed = NULL, globals = TRUE, persistent = FALSE, 
                  workers = availableCores(), gc = FALSE, earlySignal = FALSE, 
                  label = NULL, ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  if (is.function(workers)) 
                    workers <- workers()
                  workers <- as.integer(workers)
                  stop_if_not(length(workers) == 1, is.finite(workers), 
                    workers >= 1)
                  if (workers == 1L) {
                    return(sequential(expr, envir = envir, substitute = FALSE, 
                      lazy = TRUE, seed = seed, globals = globals, 
                      local = TRUE, label = label, ...))
                  }
                  workers <- ClusterRegistry("start", workers = workers)
                  future <- MultisessionFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, persistent = persistent, 
                    workers = workers, gc = gc, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }), .cleanup = FALSE, .init = FALSE)
          }
          options(...future.oldOptions)
      })
      if (is.na(TRUE)) {
      }
      else {
          sink(type = "output", split = FALSE)
          if (TRUE) {
              ...future.result$stdout <- rawToChar(rawConnectionValue(...future.stdout))
          }
          else {
              ...future.result["stdout"] <- list(NULL)
          }
          close(...future.stdout)
          ...future.stdout <- NULL
      }
      ...future.result$conditions <- ...future.conditions
      ...future.result
  }
  Exporting 3 global objects (240 bytes) to cluster node #2 ...
  Exporting '...future.x_ii' (56 bytes) to cluster node #2 ...
  Exporting '...future.x_ii' (56 bytes) to cluster node #2 ... DONE
  Exporting 'strategy2' (120 bytes) to cluster node #2 ...
  Exporting 'strategy2' (120 bytes) to cluster node #2 ... DONE
  Exporting 'bs' (64 bytes) to cluster node #2 ...
  Exporting 'bs' (64 bytes) to cluster node #2 ... DONE
  Exporting 3 global objects (240 bytes) to cluster node #2 ... DONE
  MultisessionFuture started
  [20:53:59.470] Chunk #2 of 2 ... DONE
  [20:53:59.470] Launching 2 futures (chunks) ... DONE
  [20:53:59.470] - resolving futures
  resolve() on list ...
   recursive: 0
   length: 2
  
   length: 1 (resolved future 1)
   length: 0 (resolved future 2)
  resolve() on list ... DONE
  [20:54:00.052] - relaying conditions of futures
  result() for ClusterFuture ...
  - Validating connection of MultisessionFuture
  - class(result): FutureResult
  List of 1
   $ b:function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, persistent = FALSE, workers = availableCores(), 
      gc = FALSE, earlySignal = FALSE, label = NULL, ...)  
    ..- attr(*, "class")= chr [1:5] "multisession" "cluster" "multiprocess" "future" ...
    ..- attr(*, "init")= logi TRUE
    ..- attr(*, "call")= language plan(list(a = strategy1, b = strategy2))
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  List of 1
   $ :function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
      ...)  
    ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  List of 1
   $ :function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
      ...)  
    ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  List of 1
   $ :function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
      ...)  
    ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  Future state: 'finished'
  result() for ClusterFuture ...
  - result already collected: FutureResult
  result() for ClusterFuture ... done
  foreach() - level 2 ...
  sequential:- args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)- tweaked: FALSE- call: NULL
  sequential:- args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)- tweaked: FALSE- call: NULL
  sequential:- args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)- tweaked: FALSE- call: NULL
  foreach() - level 2 ... DONE
  result() for ClusterFuture ...
  - Validating connection of MultisessionFuture
  - class(result): FutureResult
  List of 1
   $ b:function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, persistent = FALSE, workers = availableCores(), 
      gc = FALSE, earlySignal = FALSE, label = NULL, ...)  
    ..- attr(*, "class")= chr [1:5] "multisession" "cluster" "multiprocess" "future" ...
    ..- attr(*, "init")= logi TRUE
    ..- attr(*, "call")= language plan(list(a = strategy1, b = strategy2))
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  List of 1
   $ :function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
      ...)  
    ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  List of 1
   $ :function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
      ...)  
    ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  List of 1
   $ :function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
      ...)  
    ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  Future state: 'finished'
  result() for ClusterFuture ...
  - result already collected: FutureResult
  result() for ClusterFuture ... done
  foreach() - level 2 ...
  sequential:- args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)- tweaked: FALSE- call: NULL
  sequential:- args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)- tweaked: FALSE- call: NULL
  sequential:- args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)- tweaked: FALSE- call: NULL
  foreach() - level 2 ... DONE
  [20:54:00.098] - collecting values of futures
  result() for ClusterFuture ...
  - result already collected: FutureResult
  result() for ClusterFuture ... done
  result() for ClusterFuture ...
  - result already collected: FutureResult
  result() for ClusterFuture ... done
  [20:54:00.107] - accumulating results
  [20:54:00.108] - processing errors (handler = 'stop')
  [20:54:00.109] - extracting results
  [20:54:00.109] doFuture() ... DONE
  foreach() - level 1 ... DONE
  - plan(list('multisession', 'multisession')) ... DONE
  - plan(list('multisession', 'cluster')) ...
  plan(): Setting new future strategy stack:
  List of future strategies:
  1. multisession:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, persistent = FALSE, workers = availableCores(), gc = FALSE, earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: plan(list(a = strategy1, b = strategy2))
  2. cluster:
     - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, persistent = FALSE, workers = availableWorkers(), user = NULL, revtunnel = TRUE, homogeneous = TRUE, gc = FALSE, earlySignal = FALSE, label = NULL, ...)
     - tweaked: FALSE
     - call: plan(list(a = strategy1, b = strategy2))
  
  plan(): plan_init() of 'multisession', 'cluster', 'multiprocess', 'future', 'function' ...
  multisession:
  - args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, persistent = FALSE, workers = availableCores(), gc = FALSE, earlySignal = FALSE, label = NULL, ...)
  - tweaked: FALSE
  - call: plan(list(a = strategy1, b = strategy2))
  [local output] Workers: [n = 2] 'localhost', 'localhost'
  [local output] Base port: 11544
  [local output] Creating node 1 of 2 ...
  [local output] - setting up node
  Testing if worker's PID can be inferred: '/home/hornik/tmp/R.check/r-patched-gcc/Work/build/bin/Rscript -e 'try(cat(Sys.getpid(),file="/tmp/RtmpmhL62P/future.parent=10097.2771364a0560.pid"), silent = TRUE)' -e "file.exists('/tmp/RtmpmhL62P/future.parent=10097.2771364a0560.pid')"'
  - Possible to infer worker's PID: TRUE
  [local output] Starting worker #1 on 'localhost': '/home/hornik/tmp/R.check/r-patched-gcc/Work/build/bin/Rscript' --default-packages=datasets,utils,grDevices,graphics,stats,methods -e '#label=foreach,nested_dopar.R:10097:gimli:hornik' -e 'try(cat(Sys.getpid(),file="/tmp/RtmpmhL62P/future.parent=10097.2771364a0560.pid"), silent = TRUE)' -e 'parallel:::.slaveRSOCK()' MASTER=localhost PORT=11544 OUT=/dev/null TIMEOUT=120 XDR=TRUE
  [local output] - Exit code of system() call: 0
  [local output] Waiting for worker #1 on 'localhost' to connect back
  [local output] Connection with worker #1 on 'localhost' established
  [local output] - collecting session information
  [local output] Creating node 1 of 2 ... done
  [local output] Creating node 2 of 2 ...
  [local output] - setting up node
  Testing if worker's PID can be inferred: '/home/hornik/tmp/R.check/r-patched-gcc/Work/build/bin/Rscript -e 'try(cat(Sys.getpid(),file="/tmp/RtmpmhL62P/future.parent=10097.2771288b0e05.pid"), silent = TRUE)' -e "file.exists('/tmp/RtmpmhL62P/future.parent=10097.2771288b0e05.pid')"'
  - Possible to infer worker's PID: TRUE
  [local output] Starting worker #2 on 'localhost': '/home/hornik/tmp/R.check/r-patched-gcc/Work/build/bin/Rscript' --default-packages=datasets,utils,grDevices,graphics,stats,methods -e '#label=foreach,nested_dopar.R:10097:gimli:hornik' -e 'try(cat(Sys.getpid(),file="/tmp/RtmpmhL62P/future.parent=10097.2771288b0e05.pid"), silent = TRUE)' -e 'parallel:::.slaveRSOCK()' MASTER=localhost PORT=11544 OUT=/dev/null TIMEOUT=120 XDR=TRUE
  [local output] - Exit code of system() call: 0
  [local output] Waiting for worker #2 on 'localhost' to connect back
  [local output] Connection with worker #2 on 'localhost' established
  [local output] - collecting session information
  [local output] Creating node 2 of 2 ... done
  getGlobalsAndPackages() ...
  Not searching for globals
  - globals: [0] <none>
  getGlobalsAndPackages() ... DONE
  Packages needed by future strategies (n = 1): 'future'
  Packages needed by the future expression (n = 0): <none>
  {
      {
          ...future.startTime <- Sys.time()
          ...future.oldOptions <- options(future.startup.loadScript = FALSE, 
              future.globals.onMissing = "ignore", future.globals.maxSize = NULL, 
              future.globals.method = NULL, future.globals.onMissing = "ignore", 
              future.globals.onReference = NULL, future.globals.resolve = NULL, 
              future.resolve.recursive = NULL, width = 80L)
          {
              {
                  {
                    {
                      has_future <- requireNamespace("future", 
                        quietly = TRUE)
                      version <- if (has_future) 
                        packageVersion("future")
                      else NULL
                      if (!has_future || version < "1.8.0") {
                        info <- c(r_version = gsub("R version ", 
                          "", R.version$version.string), platform = sprintf("%s (%s-bit)", 
                          R.version$platform, 8 * .Machine$sizeof.pointer), 
                          os = paste(Sys.info()[c("sysname", "release", 
                            "version")], collapse = " "), hostname = Sys.info()[["nodename"]])
                        info <- sprintf("%s: %s", names(info), 
                          info)
                        info <- paste(info, collapse = "; ")
                        if (!has_future) {
                          msg <- sprintf("Package 'future' is not installed on worker (%s)", 
                            info)
                        }
                        else {
                          msg <- sprintf("Package 'future' on worker (%s) must be of version >= 1.8.0: %s", 
                            info, version)
                        }
                        stop(msg)
                      }
                    }
                    ...future.mc.cores.old <- getOption("mc.cores")
                    options(mc.cores = 1L)
                  }
                  local({
                    for (pkg in "future") {
                      loadNamespace(pkg)
                      library(pkg, character.only = TRUE)
                    }
                  })
              }
              future::plan(list(b = function (expr, envir = parent.frame(), 
                  substitute = TRUE, lazy = FALSE, seed = NULL, 
                  globals = TRUE, persistent = FALSE, workers = availableWorkers(), 
                  user = NULL, revtunnel = TRUE, homogeneous = TRUE, 
                  gc = FALSE, earlySignal = FALSE, label = NULL, 
                  ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  future <- ClusterFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, persistent = persistent, 
                    workers = workers, user = user, revtunnel = revtunnel, 
                    homogeneous = homogeneous, gc = gc, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }), .cleanup = FALSE, .init = FALSE)
          }
      }
      if (is.na(TRUE)) {
      }
      else {
          if (TRUE) {
              ...future.stdout <- rawConnection(raw(0L), open = "w")
          }
          else {
              ...future.stdout <- file(switch(.Platform$OS.type, 
                  windows = "NUL", "/dev/null"), open = "w")
          }
          sink(...future.stdout, type = "output", split = FALSE)
          on.exit(if (!is.null(...future.stdout)) {
              sink(type = "output", split = FALSE)
              close(...future.stdout)
          }, add = TRUE)
      }
      ...future.frame <- sys.nframe()
      ...future.conditions <- list()
      ...future.result <- tryCatch({
          withCallingHandlers({
              ...future.value <- local(NA)
              future::FutureResult(value = ...future.value, started = ...future.startTime, 
                  version = "1.8")
          }, condition = local({
              inherits <- base::inherits
              invokeRestart <- base::invokeRestart
              length <- base::length
              seq.int <- base::seq.int
              sys.calls <- base::sys.calls
              `[[` <- base::`[[`
              `+` <- base::`+`
              `<<-` <- base::`<<-`
              sysCalls <- function(calls = sys.calls(), from = 1L) {
                  calls[seq.int(from = from + 12L, to = length(calls) - 
                    3L)]
              }
              function(cond) {
                  if (inherits(cond, "error")) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond, calls = c(sysCalls(from = ...future.frame), 
                      cond$call), timestamp = base::Sys.time())
                    signalCondition(cond)
                  }
                  else if (inherits(cond, c("message", "warning"
                  ))) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond)
                    if (inherits(cond, "message")) {
                      invokeRestart("muffleMessage")
                    }
                    else if (inherits(cond, "warning")) {
                      invokeRestart("muffleWarning")
                    }
                  }
              }
          }))
      }, error = function(ex) {
          structure(list(value = NULL, conditions = ...future.conditions, 
              condition = ex, calls = sys.calls(), version = "1.8"), 
              class = "FutureResult")
      }, finally = {
          {
              {
                  options(mc.cores = ...future.mc.cores.old)
              }
              future::plan(list(a = function (expr, envir = parent.frame(), 
                  substitute = TRUE, lazy = FALSE, seed = NULL, 
                  globals = TRUE, persistent = FALSE, workers = availableCores(), 
                  gc = FALSE, earlySignal = FALSE, label = NULL, 
                  ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  if (is.function(workers)) 
                    workers <- workers()
                  workers <- as.integer(workers)
                  stop_if_not(length(workers) == 1, is.finite(workers), 
                    workers >= 1)
                  if (workers == 1L) {
                    return(sequential(expr, envir = envir, substitute = FALSE, 
                      lazy = TRUE, seed = seed, globals = globals, 
                      local = TRUE, label = label, ...))
                  }
                  workers <- ClusterRegistry("start", workers = workers)
                  future <- MultisessionFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, persistent = persistent, 
                    workers = workers, gc = gc, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }, b = function (expr, envir = parent.frame(), substitute = TRUE, 
                  lazy = FALSE, seed = NULL, globals = TRUE, persistent = FALSE, 
                  workers = availableWorkers(), user = NULL, revtunnel = TRUE, 
                  homogeneous = TRUE, gc = FALSE, earlySignal = FALSE, 
                  label = NULL, ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  future <- ClusterFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, persistent = persistent, 
                    workers = workers, user = user, revtunnel = revtunnel, 
                    homogeneous = homogeneous, gc = gc, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }), .cleanup = FALSE, .init = FALSE)
          }
          options(...future.oldOptions)
      })
      if (is.na(TRUE)) {
      }
      else {
          sink(type = "output", split = FALSE)
          if (TRUE) {
              ...future.result$stdout <- rawToChar(rawConnectionValue(...future.stdout))
          }
          else {
              ...future.result["stdout"] <- list(NULL)
          }
          close(...future.stdout)
          ...future.stdout <- NULL
      }
      ...future.result$conditions <- ...future.conditions
      ...future.result
  }
  MultisessionFuture started
  result() for ClusterFuture ...
  - Validating connection of MultisessionFuture
  - class(result): FutureResult
  plan(): plan_init() of 'multisession', 'cluster', 'multiprocess', 'future', 'function' ... DONE
  plan(): nbrOfWorkers() = 2
  foreach() - level 1 ...
  [20:54:15.171] doFuture() ...
  [20:54:15.172] - dummy globals (as locals): [1] 'a'
  [20:54:15.173] - R expression:
  [20:54:15.174] {
  [20:54:15.174]     doFuture::registerDoFuture()
  [20:54:15.174]     lapply(seq_along(...future.x_ii), FUN = function(jj) {
  [20:54:15.174]         ...future.x_jj <- ...future.x_ii[[jj]]
  [20:54:15.174]         a <- NULL
  [20:54:15.174]         ...future.env <- environment()
  [20:54:15.174]         local({
  [20:54:15.174]             for (name in names(...future.x_jj)) {
  [20:54:15.174]                 assign(name, ...future.x_jj[[name]], envir = ...future.env, 
  [20:54:15.174]                   inherits = FALSE)
  [20:54:15.174]             }
  [20:54:15.174]         })
  [20:54:15.174]         tryCatch({
  [20:54:15.174]             plan_list <- future::plan()
  [20:54:15.174]             stopifnot(inherits(plan_list, strategy2))
  [20:54:15.174]             plan_a <- future::plan("list")
  [20:54:15.174]             str(plan_a)
  [20:54:15.174]             stopifnot(inherits(plan_a[[1]], strategy2))
  [20:54:15.174]             message("foreach() - level 2 ...")
  [20:54:15.174]             y <- foreach(b = bs, .export = c("a", "plan_a")) %dopar% 
  [20:54:15.174]                 {
  [20:54:15.174]                   plan_list <- future::plan()
  [20:54:15.174]                   message(capture.output(print(plan_list)))
  [20:54:15.174]                   stopifnot(inherits(plan_list, "future"), inherits(plan_list, 
  [20:54:15.174]                     getOption("future.default", "sequential")))
  [20:54:15.174]                   plan_b <- future::plan("list")
  [20:54:15.174]                   str(plan_b)
  [20:54:15.174]                   stopifnot(inherits(plan_b[[1]], "future"), 
  [20:54:15.174]                     inherits(plan_b[[1]], getOption("future.default", 
  [20:54:15.174]                       "sequential")))
  [20:54:15.174]                   list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
  [20:54:15.174]                 }
  [20:54:15.174]             message("foreach() - level 2 ... DONE")
  [20:54:15.174]             y
  [20:54:15.174]         }, error = identity)
  [20:54:15.174]     })
  [20:54:15.174] }
  [20:54:15.175] - identifying globals and packages ...
  getGlobalsAndPackages() ...
  Searching for globals...
  - globals found: [28] '{', '::', 'lapply', 'seq_along', '...future.x_ii', '<-', '[[', 'environment', 'local', 'for', 'names', 'assign', 'tryCatch', 'stopifnot', 'inherits', 'strategy2', 'str', 'message', '%dopar%', 'foreach', 'bs', 'c', 'capture.output', 'print', 'getOption', 'list', 'b', 'identity'
  Searching for globals ... DONE
  Resolving globals: FALSE
  The total size of the 3 globals is 176 bytes (176 bytes)
  - globals: [3] '...future.x_ii', 'strategy2', 'bs'
  - packages: [2] 'utils', 'foreach'
  getGlobalsAndPackages() ... DONE
  [20:54:15.280] List of 3
  [20:54:15.280]  $ ...future.x_ii: NULL
  [20:54:15.280]  $ strategy2     : chr "cluster"
  [20:54:15.280]  $ bs            : int [1:3] 3 2 1
  [20:54:15.280]  - attr(*, "where")=List of 3
  [20:54:15.280]   ..$ ...future.x_ii:<environment: 0x55a47ebfd0d0> 
  [20:54:15.280]   ..$ strategy2     :<environment: R_GlobalEnv> 
  [20:54:15.280]   ..$ bs            :<environment: R_GlobalEnv> 
  [20:54:15.280]  - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list"
  [20:54:15.280]  - attr(*, "resolved")= logi FALSE
  [20:54:15.280]  - attr(*, "total_size")= num 176
  [20:54:15.308]   - R expression:
  [20:54:15.308] {
  [20:54:15.308]     doFuture::registerDoFuture()
  [20:54:15.308]     lapply(seq_along(...future.x_ii), FUN = function(jj) {
  [20:54:15.308]         ...future.x_jj <- ...future.x_ii[[jj]]
  [20:54:15.308]         a <- NULL
  [20:54:15.308]         ...future.env <- environment()
  [20:54:15.308]         local({
  [20:54:15.308]             for (name in names(...future.x_jj)) {
  [20:54:15.308]                 assign(name, ...future.x_jj[[name]], envir = ...future.env, 
  [20:54:15.308]                   inherits = FALSE)
  [20:54:15.308]             }
  [20:54:15.308]         })
  [20:54:15.308]         tryCatch({
  [20:54:15.308]             plan_list <- future::plan()
  [20:54:15.308]             stopifnot(inherits(plan_list, strategy2))
  [20:54:15.308]             plan_a <- future::plan("list")
  [20:54:15.308]             str(plan_a)
  [20:54:15.308]             stopifnot(inherits(plan_a[[1]], strategy2))
  [20:54:15.308]             message("foreach() - level 2 ...")
  [20:54:15.308]             y <- foreach(b = bs, .export = c("a", "plan_a")) %dopar% 
  [20:54:15.308]                 {
  [20:54:15.308]                   plan_list <- future::plan()
  [20:54:15.308]                   message(capture.output(print(plan_list)))
  [20:54:15.308]                   stopifnot(inherits(plan_list, "future"), inherits(plan_list, 
  [20:54:15.308]                     getOption("future.default", "sequential")))
  [20:54:15.308]                   plan_b <- future::plan("list")
  [20:54:15.308]                   str(plan_b)
  [20:54:15.308]                   stopifnot(inherits(plan_b[[1]], "future"), 
  [20:54:15.308]                     inherits(plan_b[[1]], getOption("future.default", 
  [20:54:15.308]                       "sequential")))
  [20:54:15.308]                   list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
  [20:54:15.308]                 }
  [20:54:15.308]             message("foreach() - level 2 ... DONE")
  [20:54:15.308]             y
  [20:54:15.308]         }, error = identity)
  [20:54:15.308]     })
  [20:54:15.308] }
  [20:54:15.309]   - globals: [3] '...future.x_ii', 'strategy2', 'bs'
  [20:54:15.310] List of 3
  [20:54:15.310]  $ ...future.x_ii: NULL
  [20:54:15.310]  $ strategy2     : chr "cluster"
  [20:54:15.310]  $ bs            : int [1:3] 3 2 1
  [20:54:15.310]  - attr(*, "where")=List of 3
  [20:54:15.310]   ..$ ...future.x_ii:<environment: 0x55a47ebfd0d0> 
  [20:54:15.310]   ..$ strategy2     :<environment: R_GlobalEnv> 
  [20:54:15.310]   ..$ bs            :<environment: R_GlobalEnv> 
  [20:54:15.310]  - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list"
  [20:54:15.310]  - attr(*, "resolved")= logi FALSE
  [20:54:15.310]  - attr(*, "total_size")= num 176
  [20:54:15.344]   - packages: [3] 'doFuture', 'utils', 'foreach'
  [20:54:15.345] - identifying globals and packages ... DONE
  [20:54:15.346] Number of chunks: 2
  [20:54:15.363] Number of futures (= number of chunks): 2
  [20:54:15.363] Launching 2 futures (chunks) ...
  [20:54:15.364] Chunk #1 of 2 ...
  [20:54:15.364]  - Finding globals in 'args_list' chunk #1 ...
  getGlobalsAndPackages() ...
  Searching for globals...
  
  Searching for globals ... DONE
  - globals: [0] <none>
  getGlobalsAndPackages() ... DONE
  [20:54:15.367] 
  [20:54:15.367] 
  [20:54:15.368]  - Finding globals in 'args_list' for chunk #1 ... DONE
  getGlobalsAndPackages() ...
  - globals passed as-is: [3] '...future.x_ii', 'strategy2', 'bs'
  Resolving globals: FALSE
  The total size of the 3 globals is 232 bytes (232 bytes)
  - globals: [3] '...future.x_ii', 'strategy2', 'bs'
  
  getGlobalsAndPackages() ... DONE
  Packages needed by future strategies (n = 1): 'future'
  Packages needed by the future expression (n = 3): 'doFuture', 'utils', 'foreach'
  {
      {
          ...future.startTime <- Sys.time()
          ...future.oldOptions <- options(future.startup.loadScript = FALSE, 
              future.globals.onMissing = "ignore", future.globals.maxSize = NULL, 
              future.globals.method = NULL, future.globals.onMissing = "ignore", 
              future.globals.onReference = NULL, future.globals.resolve = NULL, 
              future.resolve.recursive = NULL, width = 80L)
          {
              {
                  {
                    {
                      has_future <- requireNamespace("future", 
                        quietly = TRUE)
                      version <- if (has_future) 
                        packageVersion("future")
                      else NULL
                      if (!has_future || version < "1.8.0") {
                        info <- c(r_version = gsub("R version ", 
                          "", R.version$version.string), platform = sprintf("%s (%s-bit)", 
                          R.version$platform, 8 * .Machine$sizeof.pointer), 
                          os = paste(Sys.info()[c("sysname", "release", 
                            "version")], collapse = " "), hostname = Sys.info()[["nodename"]])
                        info <- sprintf("%s: %s", names(info), 
                          info)
                        info <- paste(info, collapse = "; ")
                        if (!has_future) {
                          msg <- sprintf("Package 'future' is not installed on worker (%s)", 
                            info)
                        }
                        else {
                          msg <- sprintf("Package 'future' on worker (%s) must be of version >= 1.8.0: %s", 
                            info, version)
                        }
                        stop(msg)
                      }
                    }
                    ...future.mc.cores.old <- getOption("mc.cores")
                    options(mc.cores = 1L)
                  }
                  local({
                    for (pkg in c("future", "doFuture", "utils", 
                    "foreach")) {
                      loadNamespace(pkg)
                      library(pkg, character.only = TRUE)
                    }
                  })
              }
              future::plan(list(b = function (expr, envir = parent.frame(), 
                  substitute = TRUE, lazy = FALSE, seed = NULL, 
                  globals = TRUE, persistent = FALSE, workers = availableWorkers(), 
                  user = NULL, revtunnel = TRUE, homogeneous = TRUE, 
                  gc = FALSE, earlySignal = FALSE, label = NULL, 
                  ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  future <- ClusterFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, persistent = persistent, 
                    workers = workers, user = user, revtunnel = revtunnel, 
                    homogeneous = homogeneous, gc = gc, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }), .cleanup = FALSE, .init = FALSE)
          }
      }
      if (is.na(TRUE)) {
      }
      else {
          if (TRUE) {
              ...future.stdout <- rawConnection(raw(0L), open = "w")
          }
          else {
              ...future.stdout <- file(switch(.Platform$OS.type, 
                  windows = "NUL", "/dev/null"), open = "w")
          }
          sink(...future.stdout, type = "output", split = FALSE)
          on.exit(if (!is.null(...future.stdout)) {
              sink(type = "output", split = FALSE)
              close(...future.stdout)
          }, add = TRUE)
      }
      ...future.frame <- sys.nframe()
      ...future.conditions <- list()
      ...future.result <- tryCatch({
          withCallingHandlers({
              ...future.value <- local({
                  doFuture::registerDoFuture()
                  lapply(seq_along(...future.x_ii), FUN = function(jj) {
                    ...future.x_jj <- ...future.x_ii[[jj]]
                    a <- NULL
                    ...future.env <- environment()
                    local({
                      for (name in names(...future.x_jj)) {
                        assign(name, ...future.x_jj[[name]], envir = ...future.env, 
                          inherits = FALSE)
                      }
                    })
                    tryCatch({
                      plan_list <- future::plan()
                      stopifnot(inherits(plan_list, strategy2))
                      plan_a <- future::plan("list")
                      str(plan_a)
                      stopifnot(inherits(plan_a[[1]], strategy2))
                      message("foreach() - level 2 ...")
                      y <- foreach(b = bs, .export = c("a", "plan_a")) %dopar% 
                        {
                          plan_list <- future::plan()
                          message(capture.output(print(plan_list)))
                          stopifnot(inherits(plan_list, "future"), 
                            inherits(plan_list, getOption("future.default", 
                              "sequential")))
                          plan_b <- future::plan("list")
                          str(plan_b)
                          stopifnot(inherits(plan_b[[1]], "future"), 
                            inherits(plan_b[[1]], getOption("future.default", 
                              "sequential")))
                          list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
                        }
                      message("foreach() - level 2 ... DONE")
                      y
                    }, error = identity)
                  })
              })
              future::FutureResult(value = ...future.value, started = ...future.startTime, 
                  version = "1.8")
          }, condition = local({
              inherits <- base::inherits
              invokeRestart <- base::invokeRestart
              length <- base::length
              seq.int <- base::seq.int
              sys.calls <- base::sys.calls
              `[[` <- base::`[[`
              `+` <- base::`+`
              `<<-` <- base::`<<-`
              sysCalls <- function(calls = sys.calls(), from = 1L) {
                  calls[seq.int(from = from + 12L, to = length(calls) - 
                    3L)]
              }
              function(cond) {
                  if (inherits(cond, "error")) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond, calls = c(sysCalls(from = ...future.frame), 
                      cond$call), timestamp = base::Sys.time())
                    signalCondition(cond)
                  }
                  else if (inherits(cond, c("message", "warning"
                  ))) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond)
                    if (inherits(cond, "message")) {
                      invokeRestart("muffleMessage")
                    }
                    else if (inherits(cond, "warning")) {
                      invokeRestart("muffleWarning")
                    }
                  }
              }
          }))
      }, error = function(ex) {
          structure(list(value = NULL, conditions = ...future.conditions, 
              condition = ex, calls = sys.calls(), version = "1.8"), 
              class = "FutureResult")
      }, finally = {
          {
              {
                  options(mc.cores = ...future.mc.cores.old)
              }
              future::plan(list(a = function (expr, envir = parent.frame(), 
                  substitute = TRUE, lazy = FALSE, seed = NULL, 
                  globals = TRUE, persistent = FALSE, workers = availableCores(), 
                  gc = FALSE, earlySignal = FALSE, label = NULL, 
                  ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  if (is.function(workers)) 
                    workers <- workers()
                  workers <- as.integer(workers)
                  stop_if_not(length(workers) == 1, is.finite(workers), 
                    workers >= 1)
                  if (workers == 1L) {
                    return(sequential(expr, envir = envir, substitute = FALSE, 
                      lazy = TRUE, seed = seed, globals = globals, 
                      local = TRUE, label = label, ...))
                  }
                  workers <- ClusterRegistry("start", workers = workers)
                  future <- MultisessionFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, persistent = persistent, 
                    workers = workers, gc = gc, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }, b = function (expr, envir = parent.frame(), substitute = TRUE, 
                  lazy = FALSE, seed = NULL, globals = TRUE, persistent = FALSE, 
                  workers = availableWorkers(), user = NULL, revtunnel = TRUE, 
                  homogeneous = TRUE, gc = FALSE, earlySignal = FALSE, 
                  label = NULL, ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  future <- ClusterFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, persistent = persistent, 
                    workers = workers, user = user, revtunnel = revtunnel, 
                    homogeneous = homogeneous, gc = gc, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }), .cleanup = FALSE, .init = FALSE)
          }
          options(...future.oldOptions)
      })
      if (is.na(TRUE)) {
      }
      else {
          sink(type = "output", split = FALSE)
          if (TRUE) {
              ...future.result$stdout <- rawToChar(rawConnectionValue(...future.stdout))
          }
          else {
              ...future.result["stdout"] <- list(NULL)
          }
          close(...future.stdout)
          ...future.stdout <- NULL
      }
      ...future.result$conditions <- ...future.conditions
      ...future.result
  }
  Exporting 3 global objects (232 bytes) to cluster node #1 ...
  Exporting '...future.x_ii' (56 bytes) to cluster node #1 ...
  Exporting '...future.x_ii' (56 bytes) to cluster node #1 ... DONE
  Exporting 'strategy2' (112 bytes) to cluster node #1 ...
  Exporting 'strategy2' (112 bytes) to cluster node #1 ... DONE
  Exporting 'bs' (64 bytes) to cluster node #1 ...
  Exporting 'bs' (64 bytes) to cluster node #1 ... DONE
  Exporting 3 global objects (232 bytes) to cluster node #1 ... DONE
  MultisessionFuture started
  [20:54:15.446] Chunk #1 of 2 ... DONE
  [20:54:15.446] Chunk #2 of 2 ...
  [20:54:15.446]  - Finding globals in 'args_list' chunk #2 ...
  getGlobalsAndPackages() ...
  Searching for globals...
  
  Searching for globals ... DONE
  - globals: [0] <none>
  getGlobalsAndPackages() ... DONE
  [20:54:15.449] 
  [20:54:15.449] 
  [20:54:15.450]  - Finding globals in 'args_list' for chunk #2 ... DONE
  getGlobalsAndPackages() ...
  - globals passed as-is: [3] '...future.x_ii', 'strategy2', 'bs'
  Resolving globals: FALSE
  The total size of the 3 globals is 232 bytes (232 bytes)
  - globals: [3] '...future.x_ii', 'strategy2', 'bs'
  
  getGlobalsAndPackages() ... DONE
  Packages needed by future strategies (n = 1): 'future'
  Packages needed by the future expression (n = 3): 'doFuture', 'utils', 'foreach'
  {
      {
          ...future.startTime <- Sys.time()
          ...future.oldOptions <- options(future.startup.loadScript = FALSE, 
              future.globals.onMissing = "ignore", future.globals.maxSize = NULL, 
              future.globals.method = NULL, future.globals.onMissing = "ignore", 
              future.globals.onReference = NULL, future.globals.resolve = NULL, 
              future.resolve.recursive = NULL, width = 80L)
          {
              {
                  {
                    {
                      has_future <- requireNamespace("future", 
                        quietly = TRUE)
                      version <- if (has_future) 
                        packageVersion("future")
                      else NULL
                      if (!has_future || version < "1.8.0") {
                        info <- c(r_version = gsub("R version ", 
                          "", R.version$version.string), platform = sprintf("%s (%s-bit)", 
                          R.version$platform, 8 * .Machine$sizeof.pointer), 
                          os = paste(Sys.info()[c("sysname", "release", 
                            "version")], collapse = " "), hostname = Sys.info()[["nodename"]])
                        info <- sprintf("%s: %s", names(info), 
                          info)
                        info <- paste(info, collapse = "; ")
                        if (!has_future) {
                          msg <- sprintf("Package 'future' is not installed on worker (%s)", 
                            info)
                        }
                        else {
                          msg <- sprintf("Package 'future' on worker (%s) must be of version >= 1.8.0: %s", 
                            info, version)
                        }
                        stop(msg)
                      }
                    }
                    ...future.mc.cores.old <- getOption("mc.cores")
                    options(mc.cores = 1L)
                  }
                  local({
                    for (pkg in c("future", "doFuture", "utils", 
                    "foreach")) {
                      loadNamespace(pkg)
                      library(pkg, character.only = TRUE)
                    }
                  })
              }
              future::plan(list(b = function (expr, envir = parent.frame(), 
                  substitute = TRUE, lazy = FALSE, seed = NULL, 
                  globals = TRUE, persistent = FALSE, workers = availableWorkers(), 
                  user = NULL, revtunnel = TRUE, homogeneous = TRUE, 
                  gc = FALSE, earlySignal = FALSE, label = NULL, 
                  ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  future <- ClusterFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, persistent = persistent, 
                    workers = workers, user = user, revtunnel = revtunnel, 
                    homogeneous = homogeneous, gc = gc, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }), .cleanup = FALSE, .init = FALSE)
          }
      }
      if (is.na(TRUE)) {
      }
      else {
          if (TRUE) {
              ...future.stdout <- rawConnection(raw(0L), open = "w")
          }
          else {
              ...future.stdout <- file(switch(.Platform$OS.type, 
                  windows = "NUL", "/dev/null"), open = "w")
          }
          sink(...future.stdout, type = "output", split = FALSE)
          on.exit(if (!is.null(...future.stdout)) {
              sink(type = "output", split = FALSE)
              close(...future.stdout)
          }, add = TRUE)
      }
      ...future.frame <- sys.nframe()
      ...future.conditions <- list()
      ...future.result <- tryCatch({
          withCallingHandlers({
              ...future.value <- local({
                  doFuture::registerDoFuture()
                  lapply(seq_along(...future.x_ii), FUN = function(jj) {
                    ...future.x_jj <- ...future.x_ii[[jj]]
                    a <- NULL
                    ...future.env <- environment()
                    local({
                      for (name in names(...future.x_jj)) {
                        assign(name, ...future.x_jj[[name]], envir = ...future.env, 
                          inherits = FALSE)
                      }
                    })
                    tryCatch({
                      plan_list <- future::plan()
                      stopifnot(inherits(plan_list, strategy2))
                      plan_a <- future::plan("list")
                      str(plan_a)
                      stopifnot(inherits(plan_a[[1]], strategy2))
                      message("foreach() - level 2 ...")
                      y <- foreach(b = bs, .export = c("a", "plan_a")) %dopar% 
                        {
                          plan_list <- future::plan()
                          message(capture.output(print(plan_list)))
                          stopifnot(inherits(plan_list, "future"), 
                            inherits(plan_list, getOption("future.default", 
                              "sequential")))
                          plan_b <- future::plan("list")
                          str(plan_b)
                          stopifnot(inherits(plan_b[[1]], "future"), 
                            inherits(plan_b[[1]], getOption("future.default", 
                              "sequential")))
                          list(a = a, plan_a = plan_a, b = b, plan_b = plan_b)
                        }
                      message("foreach() - level 2 ... DONE")
                      y
                    }, error = identity)
                  })
              })
              future::FutureResult(value = ...future.value, started = ...future.startTime, 
                  version = "1.8")
          }, condition = local({
              inherits <- base::inherits
              invokeRestart <- base::invokeRestart
              length <- base::length
              seq.int <- base::seq.int
              sys.calls <- base::sys.calls
              `[[` <- base::`[[`
              `+` <- base::`+`
              `<<-` <- base::`<<-`
              sysCalls <- function(calls = sys.calls(), from = 1L) {
                  calls[seq.int(from = from + 12L, to = length(calls) - 
                    3L)]
              }
              function(cond) {
                  if (inherits(cond, "error")) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond, calls = c(sysCalls(from = ...future.frame), 
                      cond$call), timestamp = base::Sys.time())
                    signalCondition(cond)
                  }
                  else if (inherits(cond, c("message", "warning"
                  ))) {
                    ...future.conditions[[length(...future.conditions) + 
                      1L]] <<- list(condition = cond)
                    if (inherits(cond, "message")) {
                      invokeRestart("muffleMessage")
                    }
                    else if (inherits(cond, "warning")) {
                      invokeRestart("muffleWarning")
                    }
                  }
              }
          }))
      }, error = function(ex) {
          structure(list(value = NULL, conditions = ...future.conditions, 
              condition = ex, calls = sys.calls(), version = "1.8"), 
              class = "FutureResult")
      }, finally = {
          {
              {
                  options(mc.cores = ...future.mc.cores.old)
              }
              future::plan(list(a = function (expr, envir = parent.frame(), 
                  substitute = TRUE, lazy = FALSE, seed = NULL, 
                  globals = TRUE, persistent = FALSE, workers = availableCores(), 
                  gc = FALSE, earlySignal = FALSE, label = NULL, 
                  ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  if (is.function(workers)) 
                    workers <- workers()
                  workers <- as.integer(workers)
                  stop_if_not(length(workers) == 1, is.finite(workers), 
                    workers >= 1)
                  if (workers == 1L) {
                    return(sequential(expr, envir = envir, substitute = FALSE, 
                      lazy = TRUE, seed = seed, globals = globals, 
                      local = TRUE, label = label, ...))
                  }
                  workers <- ClusterRegistry("start", workers = workers)
                  future <- MultisessionFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, persistent = persistent, 
                    workers = workers, gc = gc, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }, b = function (expr, envir = parent.frame(), substitute = TRUE, 
                  lazy = FALSE, seed = NULL, globals = TRUE, persistent = FALSE, 
                  workers = availableWorkers(), user = NULL, revtunnel = TRUE, 
                  homogeneous = TRUE, gc = FALSE, earlySignal = FALSE, 
                  label = NULL, ...) 
              {
                  if (substitute) 
                    expr <- substitute(expr)
                  future <- ClusterFuture(expr = expr, envir = envir, 
                    substitute = FALSE, lazy = lazy, seed = seed, 
                    globals = globals, persistent = persistent, 
                    workers = workers, user = user, revtunnel = revtunnel, 
                    homogeneous = homogeneous, gc = gc, earlySignal = earlySignal, 
                    label = label, ...)
                  if (!future$lazy) 
                    future <- run(future)
                  invisible(future)
              }), .cleanup = FALSE, .init = FALSE)
          }
          options(...future.oldOptions)
      })
      if (is.na(TRUE)) {
      }
      else {
          sink(type = "output", split = FALSE)
          if (TRUE) {
              ...future.result$stdout <- rawToChar(rawConnectionValue(...future.stdout))
          }
          else {
              ...future.result["stdout"] <- list(NULL)
          }
          close(...future.stdout)
          ...future.stdout <- NULL
      }
      ...future.result$conditions <- ...future.conditions
      ...future.result
  }
  Exporting 3 global objects (232 bytes) to cluster node #2 ...
  Exporting '...future.x_ii' (56 bytes) to cluster node #2 ...
  Exporting '...future.x_ii' (56 bytes) to cluster node #2 ... DONE
  Exporting 'strategy2' (112 bytes) to cluster node #2 ...
  Exporting 'strategy2' (112 bytes) to cluster node #2 ... DONE
  Exporting 'bs' (64 bytes) to cluster node #2 ...
  Exporting 'bs' (64 bytes) to cluster node #2 ... DONE
  Exporting 3 global objects (232 bytes) to cluster node #2 ... DONE
  MultisessionFuture started
  [20:54:15.525] Chunk #2 of 2 ... DONE
  [20:54:15.526] Launching 2 futures (chunks) ... DONE
  [20:54:15.526] - resolving futures
  resolve() on list ...
   recursive: 0
   length: 2
  
   length: 1 (resolved future 2)
   length: 0 (resolved future 1)
  resolve() on list ... DONE
  [20:54:23.669] - relaying conditions of futures
  result() for ClusterFuture ...
  - Validating connection of MultisessionFuture
  - class(result): FutureResult
  List of 1
   $ b:function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, persistent = FALSE, workers = availableWorkers(), 
      user = NULL, revtunnel = TRUE, homogeneous = TRUE, gc = FALSE, earlySignal = FALSE, 
      label = NULL, ...)  
    ..- attr(*, "class")= chr [1:4] "cluster" "multiprocess" "future" "function"
    ..- attr(*, "init")= logi TRUE
    ..- attr(*, "call")= language plan(list(a = strategy1, b = strategy2))
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  List of 1
   $ :function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
      ...)  
    ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  List of 1
   $ :function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
      ...)  
    ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  List of 1
   $ :function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, 
      ...)  
    ..- attr(*, "class")= chr [1:4] "sequential" "uniprocess" "future" "function"
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  Future state: 'finished'
  result() for ClusterFuture ...
  - result already collected: FutureResult
  result() for ClusterFuture ... done
  foreach() - level 2 ...
  sequential:- args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)- tweaked: FALSE- call: NULL
  sequential:- args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)- tweaked: FALSE- call: NULL
  sequential:- args: function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = NULL, globals = TRUE, local = TRUE, earlySignal = FALSE, label = NULL, ...)- tweaked: FALSE- call: NULL
  foreach() - level 2 ... DONE
  result() for ClusterFuture ...
  - Validating connection of MultisessionFuture
  - class(result): FutureResult
  List of 1
   $ b:function (expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, 
      seed = NULL, globals = TRUE, persistent = FALSE, workers = availableWorkers(), 
      user = NULL, revtunnel = TRUE, homogeneous = TRUE, gc = FALSE, earlySignal = FALSE, 
      label = NULL, ...)  
    ..- attr(*, "class")= chr [1:4] "cluster" "multiprocess" "future" "function"
    ..- attr(*, "init")= logi TRUE
    ..- attr(*, "call")= language plan(list(a = strategy1, b = strategy2))
   - attr(*, "class")= chr [1:2] "FutureStrategyList" "list"
  Future state: 'finished'
  result() for ClusterFuture ...
  - result already collected: FutureResult
  result() for ClusterFuture ... done
  foreach() - level 2 ...
  Warning in socketConnection("localhost", port = port, server = TRUE, blocking = TRUE,  :
    port 11395 cannot be opened
  [20:54:23.716] - collecting values of futures
  result() for ClusterFuture ...
  - result already collected: FutureResult
  result() for ClusterFuture ... done
  result() for ClusterFuture ...
  - result already collected: FutureResult
  result() for ClusterFuture ... done
  [20:54:23.719] - accumulating results
  [20:54:23.720] - processing errors (handler = 'stop')
  Error in { : 
    task 2 failed - "Failed to launch and connect to R worker on local machine 'localhost' from local machine 'gimli'.
   * The error produced by socketConnection() was: 'cannot open the connection'
   * In addition, socketConnection() produced 1 warning(s):
     - Warning #1: 'port 11395 cannot be opened' (which suggests that this port is either already occupied by another process or blocked by the firewall on your local machine)
   * The localhost socket connection that failed to connect to the R worker used port 11395 using a communication timeout of 120 seconds and a connection timeout of 120 seconds.
   * Worker launch call: '/home/hornik/tmp/R.check/r-patched-gcc/Work/build/bin/Rscript' --default-packages=datasets,utils,grDevices,graphics,stats,methods -e '#label=UNKNOWN:28824:gimli:hornik' -e 'try(cat(Sys.getpid(),file="/tmp/RtmpjHdIg3/future.parent=28824.70987a103f93.pid"), silent = TRUE)' -e 'parallel:::.slaveRSOCK()' MASTER=localhost PORT=11395 OUT=/dev/null TIMEOUT=120 XDR=TRUE.
  Calls: %dopar% -> <Anonymous>
  Execution halted