similar to: How do I break a foreach loop?

Displaying 20 results from an estimated 10000 matches similar to: "How do I break a foreach loop?"

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
2015 May 11
1
Foreach %dopar% operator incorrectly load balancing
Dear R-SIG-Debian, I am using R version 3.1.2 with rstudio-server 0.98.113 on debian build 3.2.0-4-amd64 #1 SMP Debian 3.2.68-1+deb7u1 x86_64 GNU/Linux. I often use the %dopar% operator in from the foreach package to run code in parallel. However, the only other use on the box seemingly installed a few items and suddenly %dopar% will use far more than the number of cores I am specifying and
2010 May 12
1
snow makeCluster (makeSOCKcluster) not working in R-2.11
Hello, I was using snow to parallel-process some code in R-2.10 (32-bit windows. ). The code is as follows: require(foreach) require(doSNOW) cl <- makeCluster(6, type='SOCK') registerDoSNOW(cl) bl2 <- foreach(i=icount(length(unqmrno))) %dopar% { (some code here) } stopCluster(cl) When I run the same code in Windows R-2.11 (either 32-bit or 64-bit), R hangs at
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,
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
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
2018 Mar 12
0
Package gamlss used inside foreach() and %dopar% fails to find an object
Hello Mikis: Thanks a lot, it worked. Could you tell me what the problem was? Regards, Nik ----- Original Message ----- From: r-help-request at r-project.org To: "r-help" Sent: Sunday, March 11, 2018 6:00:02 AM Subject: R-help Digest, Vol 181, Issue 11 Send R-help mailing list submissions to r-help at r-project.org To subscribe or unsubscribe via the World Wide Web, visit
2011 May 27
0
object not found with %dopar% when using foreach
Dear R-List member, tried implement the foreach loop. It works fine, when I'm using %do%, but not when I'm using %dopar%. I always receive one of the following error messages: error in { : task 1 failed - "Objekt 'S3' not found" - could the .export be an solution for this?? Any help is much appreciated! The Code hast the following structure: ########## dft3 =
2015 May 25
0
foreach hangs when using doMPI on Windows with Microsoft MPI
??I installed Microsoft MPI. Then installed the foreach and Rmpi packages. Then built doMPI from source. mpi.remote.exec works. foreach hangs with the main process and all worker processes idle. I launch my script with mpiexec: "C:\Program Files\Microsoft MPI\Bin\mpiexec" -n 3 "C:\Program Files\R\R-3.2.0\bin\x64\Rterm.exe" --no-save -q -f "MPI Test.r" 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,
2011 Jan 14
0
Fwd: Re: [R-sig-hpc] Working doSNOW foreach openMPI example
Whas missing the R in the command line: "mpirun -n --hostfile /home/hostfile R --no-save -f rtest.R" Hope this helps mario On 13-Jan-11 22:08, Justin Moriarty wrote: > Hi, > Just wanted to share a working example of doSNOW and foreach for an openMPI cluster. The function eddcmp() is just an example and returns some inocuous warnings. The
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",
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
2017 Jun 13
1
fedback from foreach
Hi useRs, I am running a foreach loop and hoped to get a small message when it hits a multiple of 1000, but it does not work. p <- foreach(i=1:10000, .combine='c') %dopar% { if(i%%1000==0) print(i) sqrt(i) } What is the proper way to do it. Thanks everybody. Stephen B [[alternative HTML version deleted]]
2010 Dec 08
2
Parallel Scan of Large File
Is it possible to parallel scan a large file into a character vector in 1M chunks using scan() with the "doMC" package? Furthermore, can I specify the tasks for each child? i.e. I'm working on a Linux box with 8 cores and would like to scan in 8M records at time (all 8 cores scan 1M records at a time) from a file with 40M records total. file <-
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 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
2012 Feb 23
1
segfault when using data.table package in conjunction with foreach
Hi all, I'm trying to use the package read.table within a foreach loop. I'm grabbing 500M rows of data at a time from two different files and then doing an aggregate/tapply like function in read.table after that. I had planned on doing a foreach loop 39 times at once for the 39 files I have, but obviously that won't work until I figure out why the segfault is occurring. The
2012 Aug 01
1
Foreach help!
Hi, just during these vacation days, I'm trying to approach with multicore package and I have some troubles with foreach. ex. foreach(.combine=c, ii=1:200, jj=1:500) %dopar% makefunction[ii,jj] Command seem to work but if I see ii and jj value at the and of cycle, they are both 200 instead than ii=200 and jj=500. Why?? Can someone help me? Thank you in advance. Max -- View this
2011 Feb 11
1
foreach with registerDoMC on R 2.12.0 OSX 10.6 --- errors and warnings
some hints for the search engines. I just did install.packages("foreach") install.packages("doMC") library(doMC) registerDoMC() library(foreach) > foreach(i = 1:3) %dopar% sqrt(i) The process has forked and you cannot use this CoreFoundation functionality safely. You MUST exec(). Break on