Questions tagged [r-future]

Use this tag for questions specific to the future ecosystem in R - typically used for parallel and asynchronous processing. At the core of this ecosystem is Future API and the future package, which a larger set of packages then build upon.

94 questions
2
votes
2 answers

R parallel makeCluster() hangs infinitely on Mac

I came across some problem when I was trying to use parallel package in R on my Mac. Here is how the parallel package works normally. cl = makeCluster(2) # Using 2-core parallel as an example # Your parallel code stopCluster(cl) When I ran this…
2
votes
1 answer

future waits for previous future to conclude when sending to remote

I do the following to send a bunch of models to a compute server. future waits for the first call to wrap, before the next is sent. How do I tell future that it can send multiple jobs to the remote at the same time? This is clearly possible as I…
Ruben
  • 3,452
  • 31
  • 47
1
vote
1 answer

Parallel processes in Shiny R (future, promises)

I have problem with understanding how parallel processes in Shiny works. I created simple Shiny app with 2 processes: first is waiting 10s (Sys.sleep(20)) second generate random heatmap both are triggered by actionButtons. The idea of the…
tomsu
  • 371
  • 2
  • 16
1
vote
1 answer

How do I parallelize this lapply() function in R?

I am trying to perform a grid search to find coefficients that maximize the correlation between a linear combination of x's and y. My function takes a data.frame where each column is the thetas to test for that iteration. corr_grid_search <-…
Jage
  • 453
  • 2
  • 9
1
vote
0 answers

How to display the progress bar for parallel processes using rstudioapi::jobRunScript?

I have a R script called parallel_progress_reprex.R that executes code in parallel and tracks the progress using progressr: library(progressr) ## use progressr for procession updates library(doFuture) ## attaches also foreach and…
Doctor G
  • 163
  • 9
1
vote
1 answer

Error receiving results from R future running on RStudio server on Slurm

I've been struggling to find relevant answers that might help solve the problem, but after hundreds of googling I felt I was out of luck. I'm wondering if someone could point out where might the problem is. I'm running parallel with future +…
Matthew Son
  • 1,109
  • 8
  • 27
1
vote
1 answer

Demo use of future_promise and zeallot not working

I am experimenting with Shiny and async programming in the hopes of using it in a larger, more complex, public application. In this example, I thought that unlist() would wait until the value of v1 is returned because of the use of future_promise…
ixodid
  • 2,180
  • 1
  • 19
  • 46
1
vote
1 answer

Is it possible to use R's zeallot library with the future library?

This works fine: library(zeallot) c(v1, v2, v3) %<-% list(10, 20, 30) This does not: library(zeallot) library(future) c(v1, v2, v3) %<-% list(10, 20, 30) because future overrides zeallot's parallel assignment operator. The following objects are…
ixodid
  • 2,180
  • 1
  • 19
  • 46
1
vote
1 answer

How to solve R future error "error in future$uuid : object of type closure is not subsettable"

When trying to register a future with a parallel backend in R, I receive the following error message: Error in future$uuid : object of type 'closure' is not subsettable Previously using future has always been fine. My code: # Previously installed…
Oragonof
  • 11
  • 2
1
vote
0 answers

print debug info in R future calls

I want to print debug info in an R future call to display information about how long some process (e.g. copying a file) takes. future::plan(future::multisession) copyInBackground <- function(from, to, overwrite = FALSE) { future::future( { …
mzuba
  • 1,226
  • 1
  • 16
  • 33
1
vote
0 answers

How to combine future_promise with memoise in R plumber

I am making an API with R package plumber. Some endpoints in this API would benefit from memoization, so I also use the memoise package. Combining both is pretty straight-forward, as demonstrated in this blog post. I'll build up on this post's…
Vongo
  • 1,325
  • 1
  • 17
  • 27
1
vote
1 answer

What is causing the `external pointer is not valid` error in `parallel::parSapply`?

I am trying to pass an object (i.e., of R6 class; this particular one) to a number of workers created using parallel::makePSOCKcluster() and I get: Error in checkForRemoteErrors(val) : one node produced an error: external pointer is not…
Mihai
  • 2,807
  • 4
  • 28
  • 53
1
vote
2 answers

Can I set different degrees of parallelism for different targets with the R {targets} package?

I'm testing out the targets package and am running into a problem with customizing parallelization. My workflow has two steps, and I'd like to parallelize the first step over 4 workers and the second step over 16 workers. I want to know if I can…
adviksh
  • 123
  • 6
1
vote
0 answers

Waiting for a future to complete in Shiny in combination with progressbar

I have a very long task in R that does a lot of computations and writes out several files. This function is called from within a Shiny-reactive. Since it takes so much time I wanted to parallelize it on several processes but at the same time I…
shghm
  • 239
  • 2
  • 8
1
vote
1 answer

Handling exceptions using tryCatch inside future.apply::future_lapply

I want to reattempt failing readLines fetches using tryCatch. This works as expected, as long as I don't wrap it inside a future.apply::future_lapply call for processing a list or vector. The problem can be reproduced using this…
ternary
  • 123
  • 5