Questions tagged [rparallel]

This tag refers to the `parallel` package, R core team. It provides support for parallel computation in R.

72 questions
1
vote
1 answer

Getting an error in using foreach in R - no applicable method for 'filter' applied to an object of class "list"

I am getting in using foreach. Can someone please explain the reason. Error in UseMethod("filter") : no applicable method for 'filter' applied to an object of class "list" library(dplyr) library(doFuture) library(foreach) # PARALLEL…
SiH
  • 1,378
  • 4
  • 18
1
vote
0 answers

Assign variables to the global environment in a parallel loop

I am doing some heavy computations which I would like to speed up by performing it in a parallel loop. Moreover, I want the result of each calculation to be assigned to the global environment based on the name of the data currently processed: fun <-…
koenniem
  • 506
  • 2
  • 10
1
vote
0 answers

Calling mclapply from Rscript

When calling a function which uses mclapply() with Rscript myFuction.R --json=config.json the mclapply functions fails with message all scheduled cores encountered errors in user code However when I run the code within RStudio it runs fine. I'm…
JoeMG
  • 11
  • 2
1
vote
1 answer

Does parApply() divide the matrix and then process each?

Suppose I have a parApply() call as follows: cl <- makeCluster("FORK", 5) parApply(cl = cl, X = my.mat, MARGIN = 1, FUN = myFun) Where nrow(my.mat) is very big but myFun() is computed very fast. Note that the number of cores of cl is 5. I wonder…
D1X
  • 5,025
  • 5
  • 21
  • 36
1
vote
0 answers

R non-standard evaluation : get promise value while leaving it unevaluated [or: keep external pointer valid...]

This a follow-up to Parallelize function taking external pointers (XPtr) I won't reproduce the Cpp code here to make things shorter. The problem was to that once a parameter of a function is evaluated, it is defined in the function's environment…
Elvis
  • 548
  • 2
  • 14
1
vote
0 answers

R Google Compute Engine create cluster error

I'm trying to create an R cluster comprised on VMs on GCE. I've followed the example from googleComputeEngineR. I've pasted the code below. ###### vm_names <- paste0("cpu",1:2) ## specify the cheapest VMs that may get turned off preemptible =…
1
vote
1 answer

How can I make R using more than 1 core (8 available) on a Ubuntu Rstudio server?

I want to run the glmer procedure in lme4 package on a large dataset (250,000 observations). The model takes more than 15 min to run on a laptop. We are using a Rstudio server based on Ubuntu. The problem is that 8 cores are available on this server…
1
vote
1 answer

Difference between 'foreach' and 'parallel' in R?

As the title suggest, I am confused about what is the difference between both package as they are both used in parallel computing in R.
Lewis Wong
  • 93
  • 10
1
vote
2 answers

Package that suggests `parallel` fails compile in windows

I am developing a package that suggests R's parallel package (So my DESCRIPTION has a Suggests: parallel (>= 1.13.1) statement. It compiles fine under OSX and Linux but fails when building on windows (using win-builder). Here is the end of the…
dudu
  • 675
  • 6
  • 15
1
vote
1 answer

Using mclapply in a function in custom R package

I used R Studio to create a package using these two sites as guides: https://support.rstudio.com/hc/en-us/articles/200486488-Developing-Packages-with-RStudio https://www.r-bloggers.com/building-a-package-in-rstudio-is-actually-very-easy/ The only…
Scott White
  • 190
  • 2
  • 14
1
vote
1 answer

Parallelization using shared memory [bigmemory]

I'm experiencing some difficulties when trying to make it work a parallel scenario [doSNOW], with involves the use of shared memory [bigmemory]. The summary is that I get the following error "Error in { : task 1 failed - "cannot open the…
zek
  • 73
  • 5
1
vote
0 answers

R parallel package parSapply(): cannot print message

I've been exploring the parSapply() function in parallel package. In the sapply() function we can do this: result = sapply(1:10, function(x){print('haha'); return(x)}) This prints "haha" in each iteration and stores 1:10 in "result". When I try to…
snowneji
  • 1,086
  • 1
  • 11
  • 25
1
vote
0 answers

Cluster memory usage when calling parLapply multiple times

If calling parLapply multiple times, is it fine to call makeCluster and stopCluster only once, or should they be called before and after each parLapply call? How does this affect memory usage? Here's a toy example: library(parallel) my_g1 <-…
Adrian
  • 3,138
  • 2
  • 28
  • 39
1
vote
1 answer

addressing a big.matrix from cluster workers

I am trying to access a big.matrix (not file backed) from a parLapply function on a windows machine. However, R crashes when calling the big.matrix - "R for Windows front-end stopped working". Do I need to attach the big.matrix first? How do I do…
JuliettVictor
  • 614
  • 5
  • 14
1
vote
0 answers

R in parallel, parLapply() not returning the same as lapply()

I've been tasked with making some code run quicker at work and I have run into a roadblock with parallel computing. I have an original for loop which I would like to run in parallel. It seemed easiest to reproduce the code without the for loop and…
nickb
  • 11
  • 2