Questions tagged [doparallel]

R package that is a “parallel backend” for the foreach package. It provides a mechanism needed to execute foreach loops in parallel.

453 questions
1
vote
1 answer

Parallelization in R

I am new to parallelization and I want to improve the current version of parallelization of my code to see if I can improve the time. I have 4 rasters and one shapefile with 9000 features. I want for each raster to perform the mean in each of the…
Sss
  • 427
  • 2
  • 8
1
vote
0 answers

Parallelise a simulation using 'foreach' and 'doParallel'; "error in evaluating the argument 'x' in selecting a method for function 't'"

I want to parallelise a simulation. I used this example of a simple parallelization, which works just fine. #install.packages("foreach") #install.packages("doParallel") library(doParallel) library(foreach) # replication setup for…
Linus
  • 41
  • 5
1
vote
1 answer

How do I loop through a list of formulas in GEE model in R?

I am trying to run a set of GEE models. However, each model takes about an hour to an hour and a half to run. This wouldnt normally be an issue, but given the amount of models i am trying to run, I am currently trying to implement parallel…
1
vote
1 answer

Writing to database in parallel in R

I try to write a table which is a processed subset of a global data variable, in a normal for loop this piece of code works fine but when I try to do it in parallel it raises an error. Here is my piece of…
Samet Sökel
  • 2,515
  • 6
  • 21
1
vote
2 answers

How to get simple dopar in R example working

I'm trying to get a simple dopar example working so I can parallelize some very expensive cross validation calculations. When I run the following code, my result array r is filled with…
Michael Szczepaniak
  • 1,970
  • 26
  • 35
1
vote
1 answer

Problem with parallel computing over an index using foreach and %dopar% in R

I am trying to efficiently code the computation of the KDN complexity measure, which involves a loop over all of the rows of a distance matrix and making some computations out of it. I am trying to parallel this code with foreach and %dopar%…
1
vote
0 answers

foreach not scaling in bootstrapping when number of selected observations is large

I have an interesting problem with bootstrapping in R using the foreach package. I have an algorithm that works as follows Given R, the number of repetitions in the bootstrap and N_B, the number of observations to use in the bootstrap, and the data…
genauguy
  • 195
  • 1
  • 11
1
vote
1 answer

How to optimize simple parallel processing with tasks taking different amounts of time to complete?

I have some R code using the foreach and doParallel to parallelize (?) an lapply() call, aka parLapply(). It is 100 tasks and I'm splitting across my laptop's 4 cores. The function automatically partitions the tasks in sets of 25 with 1:25, 26:50,…
daileyco
  • 743
  • 5
  • 13
1
vote
0 answers

How can i reduce the running time when compute variogram for large SaptialPointsDataframe in R

I am a beginner in R and geostatistics. I have a large SpatialPointsDataframe (307,907 elements, 27.2MB). When I want to use this data to build a variogram, it needs a lot of time (R runs for a day without any results). I think this is probably…
Hongyi Lyu
  • 11
  • 1
1
vote
1 answer

How R's parallel package would handle 12th Gen Efficiency Cores?

I was planning to do a desktop build with an i7-12700, I mostly need it for high CPU usage R tasks and most of the time parallel processing comes into play. But I wonder how the new Efficiency Cores in 12th Gen Intel processors handle this task. I…
anonR
  • 849
  • 7
  • 26
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
0 answers

Nested parallelism using foreach and cv.glmnet

I'm trying to apply Elastic Net to a training dataset with approx. 29000 samples and 10000 features (approx 2.4gb) to create a binary logistic regression model. Using cv.glmnet, I originally wanted to cycle through alpha values to find the best…
ShakySion
  • 11
  • 1
1
vote
0 answers

R foreach: modify .combine to create equivalent of dplyr::bind_rows and include progress bar

Take the following MWE: df <- data.frame(id =seq(1,100,1),random = seq(2,200,2)) cl <- parallel::makeForkCluster(5) # do not change doParallel::registerDoParallel(cl) # do not change results <- foreach::foreach(i=unique(df$id),.combine…
thmschk
  • 614
  • 3
  • 16
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