Running ‘debug.R’
  Running ‘demo.R’ [3s/124s]
  Running ‘exceptions.R’
  Running ‘handler_make_progression.R’
  Running ‘handler_pbmcapply.R’
  Running ‘handler_progress.R’
  Running ‘handler_shiny.R’
  Running ‘handler_tkprogressbar.R’
  Running ‘handler_txtprogressbar.R’
  Running ‘handlers.R’
  Running ‘progress_aggregator.R’
  Running ‘progression.R’
  Running ‘progressor.R’
  Running ‘utils.R’
  Running ‘with_progress,delay.R’
  Running ‘with_progress,stdout.R’
  Running ‘with_progress.R’ [8s/10s]
  Running ‘without_progress.R’
  Running ‘zzz,doFuture.R’
  Running ‘zzz,foreach_do.R’
  Running ‘zzz,furrr.R’
  Running ‘zzz,future.apply.R’
  Running ‘zzz,plyr.R’
  Running ‘zzz,purrr.R’
  Running ‘zzz,shiny.R’
Running the tests in ‘tests/demo.R’ failed.
Complete output:
  > source("incl/start.R")
  > 
  > library(future)
  > supportedStrategies <- function(...) future:::supportedStrategies()
  > 
  > isWin32 <- FALSE
  > availCores <- 2L
  > 
  > message("*** Demos ...")
  *** Demos ...
  > 
  > message("*** Mandelbrot demo ...")
  *** Mandelbrot demo ...
  > 
  > if (getRversion() >= "3.2.0" && !isWin32) {
  +   options(future.demo.mandelbrot.nrow = 2L)
  +   options(future.demo.mandelbrot.resolution = 50L)
  +   options(future.demo.mandelbrot.delay = FALSE)
  +   
  +   for (cores in 1:availCores) {
  +     message(sprintf("Testing with %d cores ...", cores))
  +     options(mc.cores = cores)
  +   
  +     for (strategy in supportedStrategies(cores)) {
  +       message(sprintf("- plan('%s') ...", strategy))
  +       plan(strategy)
  +       demo("mandelbrot", package = "progressr", ask = FALSE)
  +       message(sprintf("- plan('%s') ... DONE", strategy))
  +     }
  +   
  +     message(sprintf("Testing with %d cores ... DONE", cores))
  +   } ## for (cores ...)
  + } else {
  +   message(" - This demo requires R (>= 3.2.0). Skipping test. (Skipping also on Win32 i386 for speed)")
  + }
  Testing with 1 cores ...
  - plan('sequential') ...
  
  
  	demo(mandelbrot)
  	---- ~~~~~~~~~~
  
  > library(progressr)
  
  > library(future)
  
  > library(graphics)
  
  > p <- function(...) NULL
  
  > plot_what_is_done <- function(counts) {
  +   done <- 0L
  +   
  +   for (kk in seq_along(counts)) {
  +     f <- counts[[kk]]
  + 
  +     ## Already plotted?
  +     if (!inherits(f, "Future")) {
  +       done <- done + 1L
  +       next
  +     }
  + 
  +     ## Not resolved?
  +     ## NOTE: This will block, if all workers are busy!
  +     if (runif(1) < 0.8*(1-(done/length(counts))) || !resolved(f)) next
  + 
  +     message(sprintf("Plotting tile #%d of %d ...", kk, n))
  +     counts[[kk]] <- value(f)
  +     screen(kk)
  +     plot(counts[[kk]])
  + 
  +     done <- done + 1L
  +   }
  +   
  +   counts
  + }
  
  > ## Options
  > region <- getOption("future.demo.mandelbrot.region", 1L)
  
  > if (!is.list(region)) {
  +   if (region == 1L) {
  +     region <- list(xmid = -0.75, ymid = 0.0, side = 3.0)
  +   } else if (region == 2L) {
  +     region <- list(xmid = 0.283, ymid = -0.0095, side = 0.00026)
  +   } else if (region == 3L) {
  +     region <- list(xmid = 0.282989, ymid = -0.01, side = 3e-8)
  +   }
  + }
  
  > nrow <- getOption("future.demo.mandelbrot.nrow", 5L)
  
  > resolution <- getOption("future.demo.mandelbrot.resolution", 1024L)
  
  > delay <- getOption("future.demo.mandelbrot.delay", interactive())
  
  > if (isTRUE(delay)) {
  +   delay <- function(counts) Sys.sleep(runif(1L, min=0.5, max=5))
  + } else if (!is.function(delay)) {
  +   delay <- function(counts) {}
  + }
  
  > ## Generate Mandelbrot tiles to be computed
  > Cs <- mandelbrot_tiles(xmid = region$xmid, ymid = region$ymid,
  +                        side = region$side, nrow = nrow,
  +                        resolution = resolution)
  
  > message("Tiles: ", paste(dim(Cs), collapse = " by "))		       
  Tiles: 2 by 2
  
  > if (interactive()) {
  +   dev.new()
  +   plot.new()
  +   split.screen(dim(Cs))
  +   for (ii in seq_along(Cs)) {
  +     screen(ii)
  +     par(mar = c(0, 0, 0, 0))
  +     text(x = 1 / 2, y = 1 / 2, sprintf("Future #%d\nunresolved", ii), cex = 2)
  +   }
  + } else {
  +   split.screen(dim(Cs))
  + }
  [1] 1 2 3 4
  
  > ## Create all Mandelbrot tiles via lazy futures
  > n <- length(Cs)
  
  > message(sprintf("* Creating %d Mandelbrot tiles", n))
  * Creating 4 Mandelbrot tiles
  
  > with_progress({
  +   p <- progressor(along = Cs)
  +   counts <- lapply(seq_along(Cs), FUN=function(ii) {
  +     C <- Cs[[ii]]
  +     future({
  +       message(sprintf("Calculating tile #%d of %d ...", ii, n), appendLF = FALSE)
  +       fit <- mandelbrot(C)
  +   
  +       ## Emulate slowness
  +       delay(fit)
  +   
  +       p(sprintf("Tile #%d by %d", ii, Sys.getpid()))
  +       
  +       message(" done")
  +       fit
  +     }, lazy = TRUE)
  +   })
  +   str(counts)
  + 
  +   pp <- 0L
  +   while (any(sapply(counts, FUN = inherits, "Future"))) {
  +     counts <- plot_what_is_done(counts)
  +   }
  + })
  
    |                                                                            
    |                                                                      |   0%
                                                                                 
  
    |                                                                            
    |                                                                      |   0%
                                                                                 
  Plotting tile #3 of 4 ...
  Calculating tile #3 of 4 ... done
  
    |                                                                            
    |                                                                      |   0%
                                                                                 
  Plotting tile #1 of 4 ...
  Calculating tile #1 of 4 ... done
  
    |                                                                            
    |                                                                      |   0%
                                                                                 
  Plotting tile #4 of 4 ...
  Calculating tile #4 of 4 ... done
  
    |                                                                            
    |                                                                      |   0%
                                                                                 
  Plotting tile #2 of 4 ...
  Calculating tile #2 of 4 ... done
  
  > close.screen()
  [1] 1 2 3 4
  
  > message("SUGGESTION: Try to rerun this demo after changing strategy for how futures are resolved, e.g. plan(multiprocess).\n")
  SUGGESTION: Try to rerun this demo after changing strategy for how futures are resolved, e.g. plan(multiprocess).
  
  - plan('sequential') ... DONE
  - plan('multicore') ...
  
  
  	demo(mandelbrot)
  	---- ~~~~~~~~~~
  
  > library(progressr)
  
  > library(future)
  
  > library(graphics)
  
  > p <- function(...) NULL
  
  > plot_what_is_done <- function(counts) {
  +   done <- 0L
  +   
  +   for (kk in seq_along(counts)) {
  +     f <- counts[[kk]]
  + 
  +     ## Already plotted?
  +     if (!inherits(f, "Future")) {
  +       done <- done + 1L
  +       next
  +     }
  + 
  +     ## Not resolved?
  +     ## NOTE: This will block, if all workers are busy!
  +     if (runif(1) < 0.8*(1-(done/length(counts))) || !resolved(f)) next
  + 
  +     message(sprintf("Plotting tile #%d of %d ...", kk, n))
  +     counts[[kk]] <- value(f)
  +     screen(kk)
  +     plot(counts[[kk]])
  + 
  +     done <- done + 1L
  +   }
  +   
  +   counts
  + }
  
  > ## Options
  > region <- getOption("future.demo.mandelbrot.region", 1L)
  
  > if (!is.list(region)) {
  +   if (region == 1L) {
  +     region <- list(xmid = -0.75, ymid = 0.0, side = 3.0)
  +   } else if (region == 2L) {
  +     region <- list(xmid = 0.283, ymid = -0.0095, side = 0.00026)
  +   } else if (region == 3L) {
  +     region <- list(xmid = 0.282989, ymid = -0.01, side = 3e-8)
  +   }
  + }
  
  > nrow <- getOption("future.demo.mandelbrot.nrow", 5L)
  
  > resolution <- getOption("future.demo.mandelbrot.resolution", 1024L)
  
  > delay <- getOption("future.demo.mandelbrot.delay", interactive())
  
  > if (isTRUE(delay)) {
  +   delay <- function(counts) Sys.sleep(runif(1L, min=0.5, max=5))
  + } else if (!is.function(delay)) {
  +   delay <- function(counts) {}
  + }
  
  > ## Generate Mandelbrot tiles to be computed
  > Cs <- mandelbrot_tiles(xmid = region$xmid, ymid = region$ymid,
  +                        side = region$side, nrow = nrow,
  +                        resolution = resolution)
  
  > message("Tiles: ", paste(dim(Cs), collapse = " by "))		       
  Tiles: 2 by 2
  
  > if (interactive()) {
  +   dev.new()
  +   plot.new()
  +   split.screen(dim(Cs))
  +   for (ii in seq_along(Cs)) {
  +     screen(ii)
  +     par(mar = c(0, 0, 0, 0))
  +     text(x = 1 / 2, y = 1 / 2, sprintf("Future #%d\nunresolved", ii), cex = 2)
  +   }
  + } else {
  +   split.screen(dim(Cs))
  + }
  [1] 5 6 7 8
  
  > ## Create all Mandelbrot tiles via lazy futures
  > n <- length(Cs)
  
  > message(sprintf("* Creating %d Mandelbrot tiles", n))
  * Creating 4 Mandelbrot tiles
  
  > with_progress({
  +   p <- progressor(along = Cs)
  +   counts <- lapply(seq_along(Cs), FUN=function(ii) {
  +     C <- Cs[[ii]]
  +     future({
  +       message(sprintf("Calculating tile #%d of %d ...", ii, n), appendLF = FALSE)
  +       fit <- mandelbrot(C)
  +   
  +       ## Emulate slowness
  +       delay(fit)
  +   
  +       p(sprintf("Tile #%d by %d", ii, Sys.getpid()))
  +       
  +       message(" done")
  +       fit
  +     }, lazy = TRUE)
  +   })
  +   str(counts)
  + 
  +   pp <- 0L
  +   while (any(sapply(counts, FUN = inherits, "Future"))) {
  +     counts <- plot_what_is_done(counts)
  +   }
  + })
  
    |                                                                            
    |                                                                      |   0%
                                                                                 
  
    |                                                                            
    |                                                                      |   0%
                                                                                 
  Plotting tile #2 of 4 ...
  Calculating tile #2 of 4 ... done
  
    |                                                                            
    |                                                                      |   0%
                                                                                 
  Plotting tile #4 of 4 ...
  Calculating tile #4 of 4 ... done
  
    |                                                                            
    |                                                                      |   0%
                                                                                 
  Plotting tile #1 of 4 ...
  Calculating tile #1 of 4 ... done
  
    |                                                                            
    |                                                                      |   0%
                                                                                 
  Plotting tile #3 of 4 ...
  Calculating tile #3 of 4 ... done
  
  > close.screen()
  [1] 1 2 3 4 5 6 7 8
  
  > message("SUGGESTION: Try to rerun this demo after changing strategy for how futures are resolved, e.g. plan(multiprocess).\n")
  SUGGESTION: Try to rerun this demo after changing strategy for how futures are resolved, e.g. plan(multiprocess).
  
  - plan('multicore') ... DONE
  - plan('multisession') ...
  
  
  	demo(mandelbrot)
  	---- ~~~~~~~~~~
  
  > library(progressr)
  
  > library(future)
  
  > library(graphics)
  
  > p <- function(...) NULL
  
  > plot_what_is_done <- function(counts) {
  +   done <- 0L
  +   
  +   for (kk in seq_along(counts)) {
  +     f <- counts[[kk]]
  + 
  +     ## Already plotted?
  +     if (!inherits(f, "Future")) {
  +       done <- done + 1L
  +       next
  +     }
  + 
  +     ## Not resolved?
  +     ## NOTE: This will block, if all workers are busy!
  +     if (runif(1) < 0.8*(1-(done/length(counts))) || !resolved(f)) next
  + 
  +     message(sprintf("Plotting tile #%d of %d ...", kk, n))
  +     counts[[kk]] <- value(f)
  +     screen(kk)
  +     plot(counts[[kk]])
  + 
  +     done <- done + 1L
  +   }
  +   
  +   counts
  + }
  
  > ## Options
  > region <- getOption("future.demo.mandelbrot.region", 1L)
  
  > if (!is.list(region)) {
  +   if (region == 1L) {
  +     region <- list(xmid = -0.75, ymid = 0.0, side = 3.0)
  +   } else if (region == 2L) {
  +     region <- list(xmid = 0.283, ymid = -0.0095, side = 0.00026)
  +   } else if (region == 3L) {
  +     region <- list(xmid = 0.282989, ymid = -0.01, side = 3e-8)
  +   }
  + }
  
  > nrow <- getOption("future.demo.mandelbrot.nrow", 5L)
  
  > resolution <- getOption("future.demo.mandelbrot.resolution", 1024L)
  
  > delay <- getOption("future.demo.mandelbrot.delay", interactive())
  
  > if (isTRUE(delay)) {
  +   delay <- function(counts) Sys.sleep(runif(1L, min=0.5, max=5))
  + } else if (!is.function(delay)) {
  +   delay <- function(counts) {}
  + }
  
  > ## Generate Mandelbrot tiles to be computed
  > Cs <- mandelbrot_tiles(xmid = region$xmid, ymid = region$ymid,
  +                        side = region$side, nrow = nrow,
  +                        resolution = resolution)
  
  > message("Tiles: ", paste(dim(Cs), collapse = " by "))		       
  Tiles: 2 by 2
  
  > if (interactive()) {
  +   dev.new()
  +   plot.new()
  +   split.screen(dim(Cs))
  +   for (ii in seq_along(Cs)) {
  +     screen(ii)
  +     par(mar = c(0, 0, 0, 0))
  +     text(x = 1 / 2, y = 1 / 2, sprintf("Future #%d\nunresolved", ii), cex = 2)
  +   }
  + } else {
  +   split.screen(dim(Cs))
  + }
  [1]  9 10 11 12
  
  > ## Create all Mandelbrot tiles via lazy futures
  > n <- length(Cs)
  
  > message(sprintf("* Creating %d Mandelbrot tiles", n))
  * Creating 4 Mandelbrot tiles
  
  > with_progress({
  +   p <- progressor(along = Cs)
  +   counts <- lapply(seq_along(Cs), FUN=function(ii) {
  +     C <- Cs[[ii]]
  +     future({
  +       message(sprintf("Calculating tile #%d of %d ...", ii, n), appendLF = FALSE)
  +       fit <- mandelbrot(C)
  +   
  +       ## Emulate slowness
  +       delay(fit)
  +   
  +       p(sprintf("Tile #%d by %d", ii, Sys.getpid()))
  +       
  +       message(" done")
  +       fit
  +     }, lazy = TRUE)
  +   })
  +   str(counts)
  + 
  +   pp <- 0L
  +   while (any(sapply(counts, FUN = inherits, "Future"))) {
  +     counts <- plot_what_is_done(counts)
  +   }
  + })
  
    |                                                                            
    |                                                                      |   0%
                                                                                 
  
    |                                                                            
    |                                                                      |   0%
                                                                                 
  Plotting tile #3 of 4 ...
  Calculating tile #3 of 4 ... done
  
    |                                                                            
    |                                                                      |   0%
                                                                                 
  Plotting tile #4 of 4 ...
  Calculating tile #4 of 4 ... done
  
    |                                                                            
    |                                                                      |   0%
                                                                                 
  Plotting tile #2 of 4 ...
  Calculating tile #2 of 4 ... done
  
    |                                                                            
    |                                                                      |   0%
                                                                                 
  Plotting tile #1 of 4 ...
  Calculating tile #1 of 4 ... done
  
  > close.screen()
   [1]  1  2  3  4  5  6  7  8  9 10 11 12
  
  > message("SUGGESTION: Try to rerun this demo after changing strategy for how futures are resolved, e.g. plan(multiprocess).\n")
  SUGGESTION: Try to rerun this demo after changing strategy for how futures are resolved, e.g. plan(multiprocess).
  
  - plan('multisession') ... DONE
  - plan('multiprocess') ...
  
  
  	demo(mandelbrot)
  	---- ~~~~~~~~~~
  
  > library(progressr)
  
  > library(future)
  
  > library(graphics)
  
  > p <- function(...) NULL
  
  > plot_what_is_done <- function(counts) {
  +   done <- 0L
  +   
  +   for (kk in seq_along(counts)) {
  +     f <- counts[[kk]]
  + 
  +     ## Already plotted?
  +     if (!inherits(f, "Future")) {
  +       done <- done + 1L
  +       next
  +     }
  + 
  +     ## Not resolved?
  +     ## NOTE: This will block, if all workers are busy!
  +     if (runif(1) < 0.8*(1-(done/length(counts))) || !resolved(f)) next
  + 
  +     message(sprintf("Plotting tile #%d of %d ...", kk, n))
  +     counts[[kk]] <- value(f)
  +     screen(kk)
  +     plot(counts[[kk]])
  + 
  +     done <- done + 1L
  +   }
  +   
  +   counts
  + }
  
  > ## Options
  > region <- getOption("future.demo.mandelbrot.region", 1L)
  
  > if (!is.list(region)) {
  +   if (region == 1L) {
  +     region <- list(xmid = -0.75, ymid = 0.0, side = 3.0)
  +   } else if (region == 2L) {
  +     region <- list(xmid = 0.283, ymid = -0.0095, side = 0.00026)
  +   } else if (region == 3L) {
  +     region <- list(xmid = 0.282989, ymid = -0.01, side = 3e-8)
  +   }
  + }
  
  > nrow <- getOption("future.demo.mandelbrot.nrow", 5L)
  
  > resolution <- getOption("future.demo.mandelbrot.resolution", 1024L)
  
  > delay <- getOption("future.demo.mandelbrot.delay", interactive())
  
  > if (isTRUE(delay)) {
  +   delay <- function(counts) Sys.sleep(runif(1L, min=0.5, max=5))
  + } else if (!is.function(delay)) {
  +   delay <- function(counts) {}
  + }
  
  > ## Generate Mandelbrot tiles to be computed
  > Cs <- mandelbrot_tiles(xmid = region$xmid, ymid = region$ymid,
  +                        side = region$side, nrow = nrow,
  +                        resolution = resolution)
  
  > message("Tiles: ", paste(dim(Cs), collapse = " by "))		       
  Tiles: 2 by 2
  
  > if (interactive()) {
  +   dev.new()
  +   plot.new()
  +   split.screen(dim(Cs))
  +   for (ii in seq_along(Cs)) {
  +     screen(ii)
  +     par(mar = c(0, 0, 0, 0))
  +     text(x = 1 / 2, y = 1 / 2, sprintf("Future #%d\nunresolved", ii), cex = 2)
  +   }
  + } else {
  +   split.screen(dim(Cs))
  + }
  [1] 13 14 15 16
  
  > ## Create all Mandelbrot tiles via lazy futures
  > n <- length(Cs)
  
  > message(sprintf("* Creating %d Mandelbrot tiles", n))
  * Creating 4 Mandelbrot tiles
  
  > with_progress({
  +   p <- progressor(along = Cs)
  +   counts <- lapply(seq_along(Cs), FUN=function(ii) {
  +     C <- Cs[[ii]]
  +     future({
  +       message(sprintf("Calculating tile #%d of %d ...", ii, n), appendLF = FALSE)
  +       fit <- mandelbrot(C)
  +   
  +       ## Emulate slowness
  +       delay(fit)
  +   
  +       p(sprintf("Tile #%d by %d", ii, Sys.getpid()))
  +       
  +       message(" done")
  +       fit
  +     }, lazy = TRUE)
  +   })
  +   str(counts)
  + 
  +   pp <- 0L
  +   while (any(sapply(counts, FUN = inherits, "Future"))) {
  +     counts <- plot_what_is_done(counts)
  +   }
  + })
  
    |                                                                            
    |                                                                      |   0%
                                                                                 
  
    |                                                                            
    |                                                                      |   0%
                                                                                 
  Plotting tile #4 of 4 ...
  Calculating tile #4 of 4 ... done
  
    |                                                                            
    |                                                                      |   0%
                                                                                 
  Plotting tile #1 of 4 ...
  Calculating tile #1 of 4 ... done
  
    |                                                                            
    |                                                                      |   0%
                                                                                 
  Plotting tile #2 of 4 ...
  Calculating tile #2 of 4 ... done
  
    |                                                                            
    |                                                                      |   0%
                                                                                 
  Plotting tile #3 of 4 ...
  Calculating tile #3 of 4 ... done
  
  > close.screen()
   [1]  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16
  
  > message("SUGGESTION: Try to rerun this demo after changing strategy for how futures are resolved, e.g. plan(multiprocess).\n")
  SUGGESTION: Try to rerun this demo after changing strategy for how futures are resolved, e.g. plan(multiprocess).
  
  - plan('multiprocess') ... DONE
  - plan('cluster') ...
  Error in get(name, envir = asNamespace(pkg), inherits = FALSE) : 
    object '.slaveRSOCK' not found
  Calls: ::: -> get
  Execution halted
  Error in makeRestartList(...) : 
    Failed to launch and connect to R worker on local machine 'localhost' from local machine 'gannet.stats.ox.ac.uk'.
   * The error produced by socketConnection() was: 'reached elapsed time limit' (which suggests that the connection timeout of 120 seconds (argument 'connectTimeout') kicked in)
   * The localhost socket connection that failed to connect to the R worker used port 31436 using a communication timeout of 120 seconds and a connection timeout of 120 seconds.
   * Worker launch call: '/data/gannet/ripley/R/R-clang/bin/Rscript' --default-packages=datasets,utils,grDevices,graphics,stats,methods -e '#label=demo.R:1136324:gannet.stats.ox.ac.uk:ripley' -e 'try(suppressWarnings(cat(Sys.getpid(),file="/tmp/RtmpUsLu4g/working_dir/RtmpdpRDkH/future.parent=1136324.1156c433ae5b88.pid")), silent = TRUE)' -e 'parallel:::.slaveRSOCK()' MASTER=localhost PORT=31436 OUT=/dev/null TIMEOUT=120 XDR=TRUE.
   * Worker (PID 1136606) was successfully killed: TRUE
   * Troubleshooting suggestions:
     - Suggestion #1: Set 'verbose=TRUE' to see more details.
     - Suggestion #2: Set 'outfile=NULL' to see output from worker.
  Calls: plan ... tryCatchList -> tryCatchOne -> <Anonymous> -> <Anonymous>
  In addition: Warning messages:
  1: In sink(type = "output", split = FALSE) : no sink to remove
  2: In sink(type = "output", split = FALSE) : no sink to remove
  3: In sink(type = "output", split = FALSE) : no sink to remove
  4: In sink(type = "output", split = FALSE) : no sink to remove
  Execution halted