similar to: Using 'foreach' for parallel computing

Displaying 20 results from an estimated 20000 matches similar to: "Using 'foreach' for parallel computing"

2011 Jun 28
1
parallel computing with 'foreach'
Hi all, I would like to parallelize some R code and would like to use the 'foreach' package with a foreach loop. However, whenever I call a function from an enabled package outside of MASS, I get an error message that a number of the functions aren't recognized (even though the functions should be defined). For example: library(foreach) library(doSMP) library(survival) # Create the
2010 Jun 16
2
Parallel computing on Windows (foreach) (Sergey Goriatchev)
foreach (or virtually anything you might use for concurrent programming) only really makes sense if the work the "clients" are doing is substantial enough to overwhelm the communication overhead. And there are many ways to accomplish the same task more or less efficiently (for example, doing blocks of tasks in chunks rather than passing each one as an individual job). But more to the
2017 Dec 07
0
parallel computing with foreach()
Your code generates an error that has nothing to do with dopar. I have no idea what your function stack is supposed to do; you may be inadvertently calling utils::stack which would produce this kind of error: > stack(1:25, RAT = FALSE) Error in data.frame(values = unlist(unname(x)), ind, stringsAsFactors = FALSE) : arguments imply differing number of rows: 25, 0 HTH, Peter On Wed, Dec 6,
2017 Dec 07
2
parallel computing with foreach()
I have used foreach() for parallel computing but in the current problem, it is not working. Given the volume and type of the data involved in the analysis, I will try to give below the complete code without reproducible example. In short, each R environment will draw a set of separate files, perform the analysis and dump in separate folders. splist <- c("juoc", "juos",
2012 Jul 24
1
untaring files in parallel with foreach and doSNOW?
Hello, I'm running some code that requires untaring many files in the first step. This takes a lot of time and I'd like to do this in parallel, if possible. If it's the disk reading speed that is the bottleneck I guess I should not expect an improvement, but perhaps it's the processor. So I want to try this out. I'm working on windows 7 with R 2.15.1 and the latest foreach
2011 Feb 27
0
foreach() package for parallel computing
dear R experts---I have been experimenting with the foreach package (with doMC) for a while. my first impression is that it is a very easy way to acquire parallel processing capabilities. (thanks, revolution R.) the only two gotchas were about installation (it required an exit and restart), and the precedence order of the foreach (higher than '+', I think), but once I understood this,
2012 Oct 25
1
parallel processing with foreach
Hi, I am trying to parallel computing with foreach function, but not able to get the result. I know that in parallel processing, all result is collected in list format, but I am not able to get input there. Any help is really appreciated. esf.m <-foreach (i = 1:n.s, .combine=rbind) %dopar% { EV <- as.data.frame(eig$vectors[,1:n.candid[i]]) colnames(EV) <- paste("EV",
2012 Aug 08
1
random number generator with SNOW/ Parallel/ foreach
Dear All, I have three classes of questions about generating random numbers with different packages (windows xp 32bit R). . 1. Suppose I would like to use package *foreach*, can I use current Sys.time as a seed? Although I can get the time up to1e-6 second precesion, the code below dose not work well on a local machine with two cores. ################# library(foreach) library(snow)
2010 Dec 02
1
using foreach (parallel processing)
Hello group, I am experimenting with parallel processing on my quad core Win 7 32 bit machine. Using these packages for the first time. I can see all my processor running at full performance when I use a smaller dataset require(snow) require(doSNOW) require(foreach) #change the 8 to however many cores\phys processors you have on your machine cl.tmp = makeCluster(rep("localhost",4),
2013 Jan 21
2
foreach takes foreever?
I started to look at ways to improve times of certain very parallel tasks and thought that foreach should be a valid candidate to do the job. So, i opened foreach tutorial by Steve Weston and started timing examples from it. First example from tutorial is  >system.time(for(i in 1:100000) sqrt(i))    user  system elapsed     0.06    0.00    0.06  > system.time(foreach(i=1:100000) %do%
2011 May 11
1
foreach(): how to do calculations "between" two foreach loops?
Dear expeRts, is it possible to carry out calculations between different foreach() calls? As for nested loops, you want to carry out calcuations not depending on the inner loop only once and not for each iteration of the innermost loop. Cheers, Marius library(foreach) foreach(i=1:3) %:% foreach(j=1:2) %do% { i <- i+1 print(paste(i,j)) } foreach(i=1:3) %:% i
2011 Feb 25
1
Question about foreach (with doSNOW), is that a bug?
Hi all, Within a foreach loop with doSNOW, we cant call functions which come from the non-default package. We need to load(require/library) the package once more within the foreach loop. Anyone knows why would happen like this? Is it caused by the snow package and something happened when "snow" parallelize the job? Other than load the package once more with in the foreach loop, is
2011 Jul 12
2
foreach not recognizing functions in memory
All, I am not understanding the scoping used in foreach when it is used inside a function. I keep getting "could not find function" errors for functions that are in memory when I try to use foreach within a function call. I have a simple example below. "testFun" is in memory and works when called by foreach directly, but when I place foreach in a function called
2009 Sep 02
1
foreach + snowfall for multicore situations
Hello dear R community. I just started playing with the snowfall package (a wrapper for the snow package), and found it very convenient. (See also this great website: http://www.imbi.uni-freiburg.de/parallel/ ) I was wondering if it is possible to connect snowfall with the foreach package (since it has some connection to snow). My final goal is to do some simple parallel simulations on my two
2012 May 08
1
revolution foreach oddity
I know this is not a revolution support forum, but as anyone noticed the following? I have a foreach loop to generate random samples. If I run the exact code below in normal r (2.14.1) it works as expected, but if I run it from revolution 4.2.0 each loop returns the same numbers. The only way I can get revolution to give different numbers is using 1 instead of 8 in registerDoSNOW(makeCluster(8,
2013 Feb 18
3
foreach loop, stata equivalent
Hi! I'm a recent convert from Stata, so forgive my ignorance. In Stata, I can write foreach loops (example below) foreach var of varlist p1-p14 { foreach y of varlist p15-p269 { reg `var' `y' } } It's looping p1-p15, p1-p16...., p1-p269, p2-p15, p2-p16,... p2-p269,... variable pairs. How can I write something similar in R? I 'tried' understanding the
2009 Jul 01
0
Parallel programming packages iterators, foreach and doMC released
REvolution Computing has just released three new packages for R to CRAN (under the open-source Apache 2.0 license): foreach, iterators, and doMC. Together, they provide a simple, scalable parallel computing framework for R that lets you take advantage of your multicore or multiprocessor workstation to program loops that run faster than traditional loops in R. The three packages build on each
2009 Jul 01
0
Parallel programming packages iterators, foreach and doMC released
REvolution Computing has just released three new packages for R to CRAN (under the open-source Apache 2.0 license): foreach, iterators, and doMC. Together, they provide a simple, scalable parallel computing framework for R that lets you take advantage of your multicore or multiprocessor workstation to program loops that run faster than traditional loops in R. The three packages build on each
2009 Jul 18
1
Building a big.matrix using foreach
Hi there! I have become a big fan of the 'foreach' package allowing me to do a lot of stuff in parallel. For example, evaluating the function f on all elements in a vector x is easily accomplished: foreach(i=1:length(x),.combine=c) %dopar% f(x[i]) Here the .combine=c option tells foreach to combine output using the c()-function. That is, to return it as a vector. Today I discovered the
2013 Apr 24
0
help with execution of 'embarrassingly parallel' problem using foreach, doParallel on a windows system
Dear R helpers, I have what another member on this forum described as an embarrassingly parallel problem. I am trying to fit models on subsets of some data based on unique combinations of two id factors in the dataset. Total number of combinations is 30^5, and this takes a long time. So, I would like fit models for each of the datasets produced by subsetting on the unique combinations, splitting