similar to: MC-Simulation with foreach: Some cores finish early

Displaying 20 results from an estimated 400 matches similar to: "MC-Simulation with foreach: Some cores finish early"

2006 Sep 20
4
Calculating mean together with split
Hi I have a table called npl containing results of simulations. It contains about 19000 entries and the structure looks like this: NoPlants sim run year DensPlants 1 6 lng_cs99_renosterbos 1 4 0.00192 . . . it has 43 different entries for sim and year goes from 1 to 100, and run from 1 to 5. I would like to calculate the mean of DensPlants for each
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
2007 Oct 27
0
Who wants to take a stab at IO.foreach?
Hi all, Anyone want to help with a native IO.foreach? I''m missing some of the critical logic here. This currently just does a straight BYTE_MAX data read, instead of a line by line data read, and doesn''t deal with lines split between multiple reads. I checked strtok into CVS (for windows-pr) if anyone wants to use that instead of String#split. It''s in
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 =
2010 Nov 11
0
logging interim results using foreach/doMC
Dear all, I am converting a large process to a parallel backhend using doMC and foreach. Basically, I havea long list of input graph files and each of them calls soem basic igraph package functions. I am parallelizing the run, in order to save time. All works fine, and each %dopar% call ends with a vector of results that at the end got fed into a data frame and saved as a csv table. When I
2011 May 27
0
saving multiple arrays from a foreach loop
Dear R-List member, I have a problem when I'm trying to save two arrays from a foreach-loop. I'm also not sure whether this is possible or just my inexperience. However, this works perferctly fine with a for-loop. Here is an example code - any help is much appreciated!!: ############ n.vpn = 2 n.run= 3 # create to empty matrices sme = matrix(NA,4,n.vpn) test = matrix(NA,4,n.vpn) #
2011 Jun 23
1
Using 'foreach' for parallel computing
Hi all, I'm currently working on updating an R package to run for loops in parallel to speed up computation time. I'm using the 'foreach' package with a foreach loop. When I run my code inside the loop, I get an error message that a number of the functions aren't recognized (even though the functions have been defined); if I call my R package inside the loop, everything runs
2011 May 03
0
How do I break a foreach loop?
Hi, I've noticed that the usual "break", "next" commands do not work in a foreach loop, is there a nice way to do that? A little more detail: I am using foreach to conduct a very time consuming (may take several days if done sequentially) simulation study. The number of simulations is set to 1000. So the command I am using looks like this simplified version: grandsum
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
2016 Apr 13
0
could not find function in mempry inside foreach loop
I'm trying to use foreach function to do multicore computing in R. Error in FUN(train_adjmt, iter = missedmat[i, 1], iter2 = missedmat[i, : task 1 failed - "?????'predictMatrix'" then I call function A in the console. The problem is I'm calling a function Posdef inside B that is defined in another script file which I source. I had to put predictMatrix in the list
2016 Apr 13
0
could not find function in mempry inside foreach loop
I'm trying to use foreach function to do multicore computing in R. A <-function(....) { foreach(i=1:10) %dopar% { B() }} then I call function A in the console. The problem is I'm calling a function ipredictMatrix inside B that is defined in another script file which I source.However I get the following error: Error in FUN(train_adjmt, iter = missedmat[i, 1], iter2 =
2016 Apr 27
0
using foreach function with gtrendsR
I have this code which is working library("checkpoint") library("gtrendsR") library("doParallel") cl<-makeCluster(4) registerDoParallel(cl) gconnect(usr = "email at gmail.com", psw = "password", verbose = FALSE) names <- c("apple","shit", "android", "rocks") formula <- function(x){ x0 <-
2016 Apr 27
0
Using Foreach for downloading data
Hi! I have this code which is working formula <- function(x){ return(x) } For( x in names) { x5 <- rbind(x5,formula(x)) } Now, I want to convert this code to parallel processing, so i am using foreach function foreach(x=names, .packages="checkpoint" ,.combine='rbind') %dopar% { x5 <- rbind(x5,formula(x))
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]]
2018 Mar 10
0
. Package gamlss used inside foreach() and %dopar% fails to find an object (Nik Tuzov)
Dear Nik Try the following code loo_predict.mu <- function(model.obj, input.data) { yhat <- foreach(i = 1 : nrow(input.data), .packages="gamlss", .combine = rbind) %dopar% { updated.model.obj <- update(model.obj, data = input.data[-i, ]) predict(updated.model.obj, what = "mu", data = input.data[-i, ], newdata = input.data[i,], type =
2013 Jun 07
1
[LLVMdev] tablegen foreach question
What's the best (most concise) way to create the following four defs? D0 = (0, "A") D1 = (1, "B") D2 = (2, "C") D3 = (3, "D") I tried to use list of strings and the foreach construct, but apparently tablegen doesn't allow using identifiers to access array elements. $ cat tbl3.td def StrList { list<string> ls = ["A",
2011 Aug 17
1
R cmd check and multicore foreach loop
Hi, in R 2.12.1, R CMD check hangs when building a vignette that uses a foreach loop with the doMC parallel backend. This does not happen in R 2.13.1, nor if I use doSEQ instead of doMC. All versions of multicore, doMC and foreach are the same on both my R installations. Has anybody encountered a similar issue? Thank you. Renaud ### UNIVERSITY OF CAPE TOWN This e-mail is subject to the
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
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